[Opentnl-cvs] tnl/zap HTFGame.cpp,1.1,1.2 UIInstructions.cpp,1.7,1.8 ftol.h,1.1,1.2 lpc10dec.c,1.5,1
Brought to you by:
mark_frohnmayer,
s_alanet
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14491/zap Modified Files: HTFGame.cpp UIInstructions.cpp ftol.h lpc10dec.c lpc10enc.c private.h projectile.cpp projectile.h quickChat.cpp Log Message: Integrated Norbert's patch for Win32 CodeWarrior support Changed instructions screen to display help for current controls configuration Index: ftol.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ftol.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ftol.h 7 May 2004 02:21:46 -0000 1.1 --- ftol.h 28 Sep 2004 18:45:25 -0000 1.2 *************** *** 18,21 **** --- 18,22 ---- #include <math.h> #else + #if !defined(__MWERKS__) #define FP_BITS(fp) (*(int *)&(fp)) *************** *** 28,31 **** --- 29,34 ---- return res>>10; } + + #endif // __MWERKS__ #endif #endif Index: HTFGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/HTFGame.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** HTFGame.cpp 17 Sep 2004 00:14:34 -0000 1.1 --- HTFGame.cpp 28 Sep 2004 18:45:25 -0000 1.2 *************** *** 158,162 **** if(mountedFlag) { ! static StringTableEntry capString("%e0 retrieved %e1 flag!"); Vector<StringTableEntry> e; --- 158,162 ---- if(mountedFlag) { ! static StringTableEntry capString("%e0 retrieved %e1 flag. Team %e2 holds %e1 flag!"); Vector<StringTableEntry> e; *************** *** 166,169 **** --- 166,170 ---- else e.push_back(aString); + e.push_back(mTeams[cl->teamId].name); for(S32 i = 0; i < mClientList.size(); i++) Index: projectile.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/projectile.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** projectile.cpp 20 Aug 2004 18:26:58 -0000 1.44 --- projectile.cpp 28 Sep 2004 18:45:25 -0000 1.45 *************** *** 314,323 **** } ! void Mine::handleCollision(GameObject *theObject, Point colPoint) { ! explode(colPoint); ! ! // No velocity for us. ! mMoveState[0].vel.set(0,0); } --- 314,322 ---- } ! bool Mine::collide(GameObject *otherObj) { ! if(otherObj->getObjectTypeMask() & (ProjectileType)) ! explode(getActualPos()); ! return false; } Index: lpc10enc.c =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/lpc10enc.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** lpc10enc.c 20 May 2004 06:11:39 -0000 1.3 --- lpc10enc.c 28 Sep 2004 18:45:25 -0000 1.4 *************** *** 29,33 **** --- 29,37 ---- #endif #include <stdlib.h> + #ifdef __MWERKS__ + #include <string.h> + #else #include <memory.h> + #endif #ifdef _MSC_VER Index: projectile.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/projectile.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** projectile.h 20 Aug 2004 18:26:58 -0000 1.16 --- projectile.h 28 Sep 2004 18:45:25 -0000 1.17 *************** *** 117,125 **** Timer mScanTimer; SafePtr<GameConnection> mOwnerConnection; ! ! bool collide(GameObject *otherObj) { return (otherObj->getObjectTypeMask() & (ProjectileType)); }; ! void idle(IdleCallPath path); ! void handleCollision(GameObject *theObject, Point colPoint); void damageObject(DamageInfo *damageInfo); void renderItem(Point p); --- 117,123 ---- Timer mScanTimer; SafePtr<GameConnection> mOwnerConnection; ! bool collide(GameObject *otherObj); void idle(IdleCallPath path); ! void damageObject(DamageInfo *damageInfo); void renderItem(Point p); Index: UIInstructions.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIInstructions.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** UIInstructions.cpp 28 Jul 2004 16:05:27 -0000 1.7 --- UIInstructions.cpp 28 Sep 2004 18:45:25 -0000 1.8 *************** *** 34,37 **** --- 34,38 ---- #include "teleporter.h" #include "engineeredObjects.h" + #include "input.h" namespace Zap *************** *** 110,114 **** }; ! static ControlString gControls[] = { { "Move ship up (forward)", "W" }, { "Move ship down (backward)", "S" }, --- 111,115 ---- }; ! static ControlString gControlsKeyboard[] = { { "Move ship up (forward)", "W" }, { "Move ship down (backward)", "S" }, *************** *** 130,133 **** --- 131,151 ---- }; + static ControlString gControlsGamepad[] = { + { "Move Ship", "Left Stick" }, + { "Aim Ship/Fire Weapon", "Right Stick" }, + { "Activate primary module", "Left Trigger" }, + { "Activate secondary module", "Right Trigger" }, + { "Cycle current weapon", "" }, + { "Toggle map view", "" }, + { "Open QuickChat menu", "" }, + { "Open loadout selection menu", "" }, + { "Show scoreboard", "" }, + { "Record voice chat", "" }, + { "Chat to team", "Keyboard T" }, + { "Chat to everyone", "Keyboard G" }, + { NULL, NULL }, + }; + + extern void renderControllerButton(F32 x, F32 y, U32 buttonIndex, U32 keyIndex); void InstructionsUserInterface::renderPage1() *************** *** 141,152 **** glEnd(); glColor3f(1,1,1); drawString(col1, y, 20, "Action"); drawString(col2, y, 20, "Control"); y += 28; ! for(S32 i = 0; gControls[i].controlString; i++) { ! drawString(col1, y, 20, gControls[i].controlString); ! drawString(col2, y, 20, gControls[i].primaryControl); y += 26; } --- 159,186 ---- glEnd(); glColor3f(1,1,1); + ControlString *controls; + bool gamepad = false; + + if(OptionsMenuUserInterface::joystickType == -1) + controls = gControlsKeyboard; + else + { + gamepad = true; + controls = gControlsGamepad; + } drawString(col1, y, 20, "Action"); drawString(col2, y, 20, "Control"); y += 28; ! for(S32 i = 0; controls[i].controlString; i++) { ! glColor3f(1,1,1); ! drawString(col1, y, 20, controls[i].controlString); ! if(OptionsMenuUserInterface::joystickType == PS2DualShock && (i == 2 || i == 3)) ! renderControllerButton(col2, y + 4, i + 4, i + 4); ! else if(gamepad && !controls[i].primaryControl[0]) ! renderControllerButton(col2, y + 4, i - 4, i - 4); ! else ! drawString(col2, y, 20, controls[i].primaryControl); y += 26; } *************** *** 383,391 **** { case GLUT_KEY_LEFT: - case GLUT_KEY_UP: prevPage(); break; case GLUT_KEY_RIGHT: - case GLUT_KEY_DOWN: nextPage(); break; --- 417,423 ---- Index: quickChat.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/quickChat.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** quickChat.cpp 25 Sep 2004 01:26:37 -0000 1.16 --- quickChat.cpp 28 Sep 2004 18:45:25 -0000 1.17 *************** *** 175,180 **** glVertex(center + Point(10, -8)); glEnd(); ! ! UserInterface::drawString(x + 2, y + 2, 11, buttonIndex == 4 ? "L2" : "R2"); } } --- 175,182 ---- glVertex(center + Point(10, -8)); glEnd(); ! static const char *buttonIndexString[4] = { ! "L2", "R2", "L1", "R1" ! }; ! UserInterface::drawString(x + 2, y + 2, 11, buttonIndexString[buttonIndex - 4]); } } Index: private.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/private.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** private.h 9 May 2004 20:44:07 -0000 1.1 --- private.h 28 Sep 2004 18:45:25 -0000 1.2 *************** *** 34,37 **** --- 34,39 ---- #ifdef __GNUC__ #define INLINE extern __inline__ + #elif defined(__MWERKS__) + #define INLINE __inline #else #ifdef _MSC_VER *************** *** 44,48 **** #endif ! #include <memory.h> #include "gsm.h" #define GSM_MAGIC 0xD /* 13 kbit/s RPE-LTP */ --- 46,54 ---- #endif ! #if defined(__MWERKS__) ! #include <string.h> ! #else ! #include <memory.h> ! #endif #include "gsm.h" #define GSM_MAGIC 0xD /* 13 kbit/s RPE-LTP */ Index: lpc10dec.c =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/lpc10dec.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** lpc10dec.c 20 May 2004 20:16:08 -0000 1.5 --- lpc10dec.c 28 Sep 2004 18:45:25 -0000 1.6 *************** *** 29,33 **** --- 29,37 ---- #endif #include <stdlib.h> + #ifdef __MWERKS__ + #include <string.h> + #else #include <memory.h> + #endif #ifdef _MSC_VER #pragma warning (disable:4711) /* to disable automatic inline warning */ |