opentnl-cvs Mailing List for Torque Network Library (Page 6)
Brought to you by:
mark_frohnmayer,
s_alanet
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(141) |
May
(232) |
Jun
(103) |
Jul
(36) |
Aug
(35) |
Sep
(19) |
Oct
(20) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
|
Feb
(26) |
Mar
(2) |
Apr
(84) |
May
(5) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Mark F. <mar...@us...> - 2004-10-15 18:01:41
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21764/zap Modified Files: barrier.cpp barrier.h gameType.cpp gameType.h Log Message: Added facility for variable width barriers Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** gameType.cpp 8 Oct 2004 00:17:47 -0000 1.63 --- gameType.cpp 15 Oct 2004 18:01:15 -0000 1.64 *************** *** 49,52 **** --- 49,53 ---- mGameOver = false; mTeamScoreLimit = DefaultTeamScoreLimit; + mBarrierWidth = Barrier::BarrierWidth; } *************** *** 411,415 **** } ! extern void constructBarriers(Game *theGame, const Vector<F32> &barrier); bool GameType::processLevelItem(S32 argc, const char **argv) --- 412,416 ---- } ! extern void constructBarriers(Game *theGame, const Vector<F32> &barrier, F32 width); bool GameType::processLevelItem(S32 argc, const char **argv) *************** *** 439,451 **** else if(!stricmp(argv[0], "BarrierMaker")) { ! Vector<F32> barrier; for(S32 i = 1; i < argc; i++) ! barrier.push_back(atof(argv[i]) * getGame()->getGridSize()); ! if(barrier.size() > 3) { mBarriers.push_back(barrier); ! constructBarriers(getGame(), barrier); } } else if(!stricmp(argv[0], "LevelName") && argc > 1) mLevelName.set(argv[1]); --- 440,455 ---- else if(!stricmp(argv[0], "BarrierMaker")) { ! BarrierRec barrier; for(S32 i = 1; i < argc; i++) ! barrier.verts.push_back(atof(argv[i]) * getGame()->getGridSize()); ! if(barrier.verts.size() > 3) { + barrier.width = mBarrierWidth; mBarriers.push_back(barrier); ! constructBarriers(getGame(), barrier.verts, mBarrierWidth); } } + else if(!stricmp(argv[0], "BarrierWidth")) + mBarrierWidth = atof(argv[1]); else if(!stricmp(argv[0], "LevelName") && argc > 1) mLevelName.set(argv[1]); *************** *** 889,897 **** // an empty list clears the barriers Vector<F32> v; ! s2cAddBarriers(v); for(S32 i = 0; i < mBarriers.size(); i++) { ! s2cAddBarriers(mBarriers[i]); } s2cSetTimeRemaining(mGameTimer.getCurrent()); --- 893,901 ---- // an empty list clears the barriers Vector<F32> v; ! s2cAddBarriers(v, 0); for(S32 i = 0; i < mBarriers.size(); i++) { ! s2cAddBarriers(mBarriers[i].verts, mBarriers[i].width); } s2cSetTimeRemaining(mGameTimer.getCurrent()); *************** *** 916,925 **** } ! GAMETYPE_RPC_S2C(GameType, s2cAddBarriers, (const Vector<F32> &barrier)) { if(!barrier.size()) getGame()->deleteObjects(BarrierType); else ! constructBarriers(getGame(), barrier); } --- 920,929 ---- } ! GAMETYPE_RPC_S2C(GameType, s2cAddBarriers, (const Vector<F32> &barrier, F32 width)) { if(!barrier.size()) getGame()->deleteObjects(BarrierType); else ! constructBarriers(getGame(), barrier, width); } Index: barrier.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/barrier.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** barrier.h 20 Aug 2004 18:26:58 -0000 1.5 --- barrier.h 15 Oct 2004 18:01:15 -0000 1.6 *************** *** 42,45 **** --- 42,46 ---- Point start; ///< The start point of the barrier Point end; ///< The end point of the barrier + F32 mWidth; enum { *************** *** 53,68 **** /// Barrier constructor. ! Barrier(Point st = Point(), Point e = Point()); /// Adds the server object to the net interface's scope always list void onAddedToGame(Game *theGame); - /// writes the Barrier state into the packet. Since Barrier objects never change - /// network state, this will only be called for the initial update of a barrier. - U32 packUpdate(GhostConnection *connection, U32 updateMask, BitStream *stream); - - /// reads the Barrier state from a packet. - void unpackUpdate(GhostConnection *connection, BitStream *stream); - /// renders this barrier by drawing the render line segments, void render(U32 layer); --- 54,62 ---- /// Barrier constructor. ! Barrier(Point st = Point(), Point e = Point(), F32 width = BarrierWidth); /// Adds the server object to the net interface's scope always list void onAddedToGame(Game *theGame); /// renders this barrier by drawing the render line segments, void render(U32 layer); Index: gameType.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.h,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** gameType.h 8 Oct 2004 00:17:47 -0000 1.37 --- gameType.h 15 Oct 2004 18:01:15 -0000 1.38 *************** *** 77,81 **** }; ! Vector<Vector<F32> > mBarriers; Vector<RefPtr<ClientRef> > mClientList; --- 77,88 ---- }; ! F32 mBarrierWidth; ! struct BarrierRec ! { ! Vector<F32> verts; ! F32 width; ! }; ! ! Vector<BarrierRec> mBarriers; Vector<RefPtr<ClientRef> > mClientList; *************** *** 182,186 **** void onGhostAvailable(GhostConnection *theConnection); TNL_DECLARE_RPC(s2cSetLevelInfo, (StringTableEntryRef levelName, StringTableEntryRef levelDesc)); ! TNL_DECLARE_RPC(s2cAddBarriers, (const Vector<F32> &barrier)); TNL_DECLARE_RPC(s2cAddTeam, (StringTableEntryRef teamName, F32 r, F32 g, F32 b)); TNL_DECLARE_RPC(s2cAddClient, (StringTableEntryRef clientName, bool isMyClient)); --- 189,193 ---- void onGhostAvailable(GhostConnection *theConnection); TNL_DECLARE_RPC(s2cSetLevelInfo, (StringTableEntryRef levelName, StringTableEntryRef levelDesc)); ! TNL_DECLARE_RPC(s2cAddBarriers, (const Vector<F32> &barrier, F32 width)); TNL_DECLARE_RPC(s2cAddTeam, (StringTableEntryRef teamName, F32 r, F32 g, F32 b)); TNL_DECLARE_RPC(s2cAddClient, (StringTableEntryRef clientName, bool isMyClient)); Index: barrier.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/barrier.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** barrier.cpp 28 Jul 2004 16:05:27 -0000 1.15 --- barrier.cpp 15 Oct 2004 18:01:15 -0000 1.16 *************** *** 41,45 **** U32 Barrier::mBarrierChangeIndex = 1; ! void constructBarriers(Game *theGame, const Vector<F32> &barrier) { Vector<Point> vec; --- 41,45 ---- U32 Barrier::mBarrierChangeIndex = 1; ! void constructBarriers(Game *theGame, const Vector<F32> &barrier, F32 width) { Vector<Point> vec; *************** *** 74,78 **** if(cosTheta >= 0) { ! F32 extendAmt = Barrier::BarrierWidth * 0.5 * tan( acos(cosTheta) / 2 ); if(extendAmt > 0.01) extendAmt -= 0.01; --- 74,78 ---- if(cosTheta >= 0) { ! F32 extendAmt = width * 0.5 * tan( acos(cosTheta) / 2 ); if(extendAmt > 0.01) extendAmt -= 0.01; *************** *** 97,106 **** Point start = vec[i] - edgeVector[i] * extendBack; Point end = vec[i+1] + edgeVector[i] * extendForward; ! Barrier *b = new Barrier(start, end); b->addToGame(theGame); } } ! Barrier::Barrier(Point st, Point e) { mObjectTypeMask = BarrierType | CommandMapVisType; --- 97,106 ---- Point start = vec[i] - edgeVector[i] * extendBack; Point end = vec[i+1] + edgeVector[i] * extendForward; ! Barrier *b = new Barrier(start, end, width); b->addToGame(theGame); } } ! Barrier::Barrier(Point st, Point e, F32 width) { mObjectTypeMask = BarrierType | CommandMapVisType; *************** *** 108,112 **** end = e; Rect r(start, end); ! r.expand(Point(BarrierWidth, BarrierWidth)); setExtent(r); mLastBarrierChangeIndex = 0; --- 108,113 ---- end = e; Rect r(start, end); ! mWidth = width; ! r.expand(Point(width, width)); setExtent(r); mLastBarrierChangeIndex = 0; *************** *** 117,147 **** } - U32 Barrier::packUpdate(GhostConnection *connection, U32 updateMask, BitStream *stream) - { - stream->write(start.x); - stream->write(start.y); - stream->write(end.x); - stream->write(end.y); - return 0; - } - - void Barrier::unpackUpdate(GhostConnection *connection, BitStream *stream) - { - stream->read(&start.x); - stream->read(&start.y); - stream->read(&end.x); - stream->read(&end.y); - - Rect r(start, end); - r.expand(Point(BarrierWidth, BarrierWidth)); - setExtent(r); - mBarrierChangeIndex++; - } - bool Barrier::getCollisionPoly(Vector<Point> &polyPoints) { Point vec = end - start; Point crossVec(vec.y, -vec.x); ! crossVec.normalize(BarrierWidth * 0.5); polyPoints.push_back(Point(start.x + crossVec.x, start.y + crossVec.y)); --- 118,126 ---- } bool Barrier::getCollisionPoly(Vector<Point> &polyPoints) { Point vec = end - start; Point crossVec(vec.y, -vec.x); ! crossVec.normalize(mWidth * 0.5); polyPoints.push_back(Point(start.x + crossVec.x, start.y + crossVec.y)); *************** *** 248,252 **** Rect bounds(start, end); ! bounds.expand(Point(BarrierWidth, BarrierWidth)); findObjects(BarrierType, fillObjects, bounds); --- 227,231 ---- Rect bounds(start, end); ! bounds.expand(Point(mWidth, mWidth)); findObjects(BarrierType, fillObjects, bounds); |
From: Mark F. <mar...@us...> - 2004-10-08 21:26:52
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12843/zap Modified Files: main.cpp osxInput.cpp Log Message: Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** main.cpp 5 Oct 2004 23:41:59 -0000 1.72 --- main.cpp 8 Oct 2004 21:26:41 -0000 1.73 *************** *** 47,50 **** --- 47,54 ---- #include "input.h" + #ifdef TNL_OS_MAC_OSX + #include <unistd.h> + #endif + namespace Zap { *************** *** 648,651 **** --- 652,664 ---- #endif { + #ifdef TNL_OS_MAC_OSX + char path[1024]; + strcpy(path, argv[0]); + char *pos = strrchr(path, '/'); + *pos = 0; + logprintf("Path = %s", path); + chdir(path); + #endif + //TNLLogEnable(LogConnectionProtocol, true); //TNLLogEnable(LogNetConnection, true); Index: osxInput.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/osxInput.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** osxInput.cpp 29 Sep 2004 20:40:18 -0000 1.6 --- osxInput.cpp 8 Oct 2004 21:26:41 -0000 1.7 *************** *** 309,313 **** } ! bool ReadJoystick(F32 axes[MaxJoystickAxes], U32 &buttonMask) { if(!gJoystickInit) --- 309,313 ---- } ! bool ReadJoystick(F32 axes[MaxJoystickAxes], U32 &buttonMask, U32 &hatMask) { if(!gJoystickInit) *************** *** 346,348 **** } ! }; \ No newline at end of file --- 346,348 ---- } ! }; |
From: Mark F. <mar...@us...> - 2004-10-08 21:19:52
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11419/zap Modified Files: game.h item.cpp Log Message: Fixed respawning item bug Updated game version Index: item.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/item.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** item.cpp 5 Oct 2004 00:16:34 -0000 1.21 --- item.cpp 8 Oct 2004 21:19:29 -0000 1.22 *************** *** 267,271 **** --- 267,274 ---- { if(mRepopTimer.update(mCurrentMove.time)) + { + setMaskBits(PickupMask); mIsVisible = true; + } } updateExtent(); Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** game.h 8 Oct 2004 00:17:47 -0000 1.69 --- game.h 8 Oct 2004 21:19:28 -0000 1.70 *************** *** 236,240 **** extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.7" }; --- 236,240 ---- extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.8" }; |
From: Mark F. <mar...@us...> - 2004-10-08 18:34:17
|
Update of /cvsroot/opentnl/tnl/exe/levels In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7909/exe/levels Added Files: hunters2.txt Log Message: added new hunters level --- NEW FILE: hunters2.txt --- HuntersGameType 10 1 15 5000 Team Hunters 1 1 0 LevelName Colosseum GridSize 300 HuntersNexusObject 0 0 60 60 Spawn 0 0 -7 Spawn 0 1 7 Spawn 0 9.90927e-007 7 Spawn 0 -1 7 BarrierMaker -0.3 0.7 -0.2 0.6 0.2 0.6 0.3 0.7 BarrierMaker -0.7 -0.299999 -0.6 -0.2 -0.6 0.200001 -0.7 0.3 BarrierMaker -0.3 -0.7 -0.2 -0.6 0.2 -0.6 0.3 -0.7 BarrierMaker 0.700001 -0.299999 0.600001 -0.2 0.600001 0.200001 0.700001 0.3 BarrierMaker 1.8 -6.3 1.8 -5.5 Teleporter 0.3 -5.2 0.3 3.4 Teleporter -0.3 5.2 -0.3 -3.4 BarrierMaker 0 -4.9 0 -5.4 0.1 -5.5 0.5 -5.5 0.6 -5.4 0.6 -4.4 0.5 -4.3 -1.1 -4.3 BarrierMaker -2.4 -4.3 -1.9 -4.3 -1.8 -4.4 -1.8 -4.8 -1.7 -4.9 -0.599999 -4.9 BarrierMaker -2.4 -3.7 -1.9 -3.7 -1.8 -3.6 -1.8 -2.6 -1.9 -2.5 -2.4 -2.5 BarrierMaker -1.2 -2.5 -1.2 -3.6 -1.1 -3.7 -0.0999994 -3.7 0 -3.6 0 -3.2 -0.0999994 -3.1 -0.599999 -3.1 BarrierMaker 0.6 -3.7 0.6 -3.2 0.7 -3.1 1.1 -3.1 1.2 -3 1.2 -2.5 BarrierMaker 1.2 -3.7 1.7 -3.7 1.8 -3.6 1.8 -2.6 1.9 -2.5 2.4 -2.5 BarrierMaker 2.4 -3.7 2.4 -4.2 2.3 -4.3 1.2 -4.3 BarrierMaker 1.8 -4.9 1.3 -4.9 1.2 -5 1.2 -6.2 1.1 -6.3 0.6 -6.3 BarrierMaker -0.599999 -6.3 -0.599999 -5.6 -0.7 -5.5 -1.7 -5.5 -1.8 -5.6 -1.8 -6.3 BarrierMaker -1.8 6.3 -1.8 5.5 BarrierMaker 0 4.9 0 5.4 -0.1 5.5 -0.5 5.5 -0.6 5.4 -0.6 4.4 -0.5 4.3 1.1 4.3 BarrierMaker 2.4 4.3 1.9 4.3 1.8 4.4 1.8 4.8 1.7 4.9 0.6 4.9 BarrierMaker 2.4 3.7 1.9 3.7 1.8 3.6 1.8 2.6 1.9 2.5 2.4 2.5 BarrierMaker 1.2 2.5 1.2 3.6 1.1 3.7 0.1 3.7 0 3.6 0 3.2 0.1 3.1 0.6 3.1 BarrierMaker -0.6 3.7 -0.6 3.2 -0.699999 3.1 -1.1 3.1 -1.2 3 -1.2 2.5 BarrierMaker -1.2 3.7 -1.7 3.7 -1.8 3.6 -1.8 2.6 -1.9 2.5 -2.4 2.5 BarrierMaker -2.4 3.7 -2.4 4.2 -2.3 4.3 -1.2 4.3 BarrierMaker -1.8 4.9 -1.3 4.9 -1.2 5 -1.2 6.2 -1.1 6.3 -0.6 6.3 BarrierMaker 0.6 6.3 0.6 5.6 0.700001 5.5 1.7 5.5 1.8 5.6 1.8 6.3 ForceFieldProjector 0 0.3 0.6 ForceFieldProjector 0 -0.299999 -0.6 ForceFieldProjector 0 -0.299999 0.6 ForceFieldProjector 0 0.3 -0.6 BarrierMaker 2.4 3.1 2.9 3.1 3 3 3 -3 2.9 -3.1 2.4 -3.1 BarrierMaker -2.4 3.1 -2.9 3.1 -3 3 -3 -3.1 -2.9 -3.2 -2.4 -3.2 BarrierMaker -5 -8 5 -8 7 -6 7 6 5 8 -5 8 -7 6 -7 -6 -5 -8 Spawn 0 -3.5 4.5 Spawn 0 3.5 4.5 Spawn 0 3.5 -4.5 Spawn 0 -3.5 -4.5 BarrierMaker -5 -4.5 -5 -5 -4 -6 -3.5 -6 BarrierMaker -4 -3 -4 -0.5 BarrierMaker -4 0 -4 1 BarrierMaker -4 1.5 -4 3 BarrierMaker -5 4 -5 0.5 BarrierMaker -5 0 -5 -1 BarrierMaker -5 -1.5 -5 -4 BarrierMaker -6 -5 -6 -3 BarrierMaker -6 -2.5 -6 1.5 BarrierMaker -6 2 -6 5 BarrierMaker 5 -4.5 5 -5 4 -6 3.5 -6 BarrierMaker 5 4.5 5 5 4 6 3.5 6 BarrierMaker -5 4.5 -5 5 -4 6 -3.5 6 BarrierMaker 4 3 4 0.5 BarrierMaker 4 0 4 -1 BarrierMaker 4 -1.5 4 -3 BarrierMaker 5 -4 5 -0.5 BarrierMaker 5 0 5 1 BarrierMaker 5 1.5 5 4 BarrierMaker 6 5 6 3 BarrierMaker 6 2.5 6 -1.5 BarrierMaker 6 -2 6 -5 BarrierMaker -4 7 -2.5 7 BarrierMaker 4 7 2.5 7 BarrierMaker 4 -7 2.5 -7 BarrierMaker -4 -7 -2.5 -7 Teleporter 6.5 0.5 1.2 6 Teleporter -6.5 0.5 -1.2 -6 Spawn 0 -1 -7 Spawn 0 1 -7 RepairItem 5.5 -6.5 RepairItem -5.5 -6.5 RepairItem 5.5 6.5 RepairItem -5.5 6.5 |
From: Mark F. <mar...@us...> - 2004-10-08 02:30:56
|
Update of /cvsroot/opentnl/tnl/exe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4234/exe Modified Files: README.txt Log Message: Updated README file Index: README.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/README.txt,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** README.txt 25 Sep 2004 01:26:36 -0000 1.33 --- README.txt 8 Oct 2004 02:30:30 -0000 1.34 *************** *** 1,3 **** ! ZAP 1.4.1 Introduction --- 1,3 ---- ! ZAP 1.4.7 Introduction *************** *** 48,51 **** --- 48,54 ---- zap as many other players as you can! + Pay special attention to the triangular arrows that move in an ellipse around + the screen -- these indicate the direction to specific game objectives, including + flags to retrieve, zones to capture and friendly or enemy players carrying flags. Ship configuration: *************** *** 96,102 **** Right stick - aim and fire - right trigger - activate primary module (default = boost) - left trigger - activate secondary module (default = shield) - Buttons (Logitech Wingman Cordless) A - cycle to next weapon --- 99,102 ---- *************** *** 106,109 **** --- 106,121 ---- Y - show scores Z - record voice + right trigger - activate primary module (default = boost) + left trigger - activate secondary module (default = shield) + + Logitech Dual Action + 1 - cycle to next weapon + 2 - toggle commander map + 3 - open quick chat menu + 4 - select weapon and module loadout + 5 - activate primary module (default = boost) + 6 - activate secondary module (default = shield) + 7 - show scores + 8 - record voice Saitek P880 Dual Analog *************** *** 114,117 **** --- 126,131 ---- 5 - show scores 6 - record voice + right trigger - activate primary module (default = boost) + left trigger - activate secondary module (default = shield) PS 2 Dual Shock w/USB *************** *** 120,123 **** --- 134,139 ---- square - open quick chat menu triangle - select weapon and module loadout + R1 - activate primary module (default = boost) + L1 - activate secondary module (default = shield) L2 - show scores R2 - record voice *************** *** 130,133 **** --- 146,151 ---- white - show scores black - record voice + right trigger - activate primary module (default = boost) + left trigger - activate secondary module (default = shield) In the game you can press ESC to go to the game options screen. *************** *** 166,172 **** Known controllers: Logitech Wingman cordless - joystick 0 ! Saitek P880 Dual Analog - joystick 1 ! PS 2 Dual Shock w/USB - joystick 2 ! XBox controller - joystick 3 -jsave [journalName] saves the log of the play session to the specified --- 184,191 ---- Known controllers: Logitech Wingman cordless - joystick 0 ! Logitech Dual Action - joystick 1 ! Saitek P880 Dual Analog - joystick 2 ! PS 2 Dual Shock w/USB - joystick 3 ! XBox controller - joystick 4 -jsave [journalName] saves the log of the play session to the specified |
From: Mark F. <mar...@us...> - 2004-10-08 00:18:09
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11621/zap Modified Files: UIInstructions.cpp UIMenus.cpp game.h gameType.cpp gameType.h huntersGame.cpp huntersGame.h input.cpp input.h quickChat.cpp winJoystick.cpp Log Message: Added objective rendering to Hunters game type Added support for Logitech's Dual Action controller Incremented game version Index: input.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/input.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** input.h 28 Sep 2004 17:34:13 -0000 1.3 --- input.h 8 Oct 2004 00:17:47 -0000 1.4 *************** *** 33,43 **** { ! enum JoystickType { LogitechWingman, SaitekDualAnalog, PS2DualShock, XBoxController, XBoxControllerOnXBox, }; --- 33,45 ---- { ! enum ControllerTypeType { LogitechWingman, + LogitechDualAction, SaitekDualAnalog, PS2DualShock, XBoxController, XBoxControllerOnXBox, + ControllerTypeCount, }; *************** *** 54,63 **** ControllerButtonRightTrigger = 1 << 7, ControllerGameButtonCount = 8, ! ControllerButtonStart = 1 << 16, ! ControllerButtonBack = 1 << 17, ! ControllerButtonDPadUp = 1 << 18, ! ControllerButtonDPadDown = 1 << 19, ! ControllerButtonDPadLeft = 1 << 20, ! ControllerButtonDPadRight = 1 << 21, }; --- 56,65 ---- ControllerButtonRightTrigger = 1 << 7, ControllerGameButtonCount = 8, ! ControllerButtonStart = 1 << 8, ! ControllerButtonBack = 1 << 9, ! ControllerButtonDPadUp = 1 << 10, ! ControllerButtonDPadDown = 1 << 11, ! ControllerButtonDPadLeft = 1 << 12, ! ControllerButtonDPadRight = 1 << 13, }; *************** *** 71,75 **** S32 autodetectJoystickType(); void ShutdownJoystick(); ! bool ReadJoystick(F32 axes[MaxJoystickAxes], U32 &buttonMask); }; --- 73,77 ---- S32 autodetectJoystickType(); void ShutdownJoystick(); ! bool ReadJoystick(F32 axes[MaxJoystickAxes], U32 &buttonMask, U32 &hatMask); }; Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** gameType.cpp 5 Oct 2004 23:41:59 -0000 1.62 --- gameType.cpp 8 Oct 2004 00:17:47 -0000 1.63 *************** *** 241,264 **** nearestPoint.y = r.min.y; ! Point rp = gClientGame->worldToScreenPoint(nearestPoint); ! Point center(400, 300); ! Point arrowDir = rp - center; ! /* ! if(rp.x > UserInterface::horizMargin && ! rp.x < UserInterface::canvasWidth - UserInterface::horizMargin && ! rp.y > UserInterface::vertMargin && ! rp.y < UserInterface::canvasHeight - UserInterface::vertMargin) return; ! if(rp.x < UserInterface::horizMargin) ! rp.x = UserInterface::horizMargin; ! if(rp.x > UserInterface::canvasWidth - UserInterface::horizMargin) ! rp.x = UserInterface::canvasWidth - UserInterface::horizMargin; ! if(rp.y < UserInterface::vertMargin) ! rp.y = UserInterface::vertMargin; ! if(rp.y > UserInterface::canvasHeight - UserInterface::vertMargin) ! rp.y = UserInterface::canvasHeight - UserInterface::vertMargin; ! */ F32 er = arrowDir.x * arrowDir.x / (350 * 350) + arrowDir.y * arrowDir.y / (250 * 250); --- 241,259 ---- nearestPoint.y = r.min.y; ! renderObjectiveArrow(nearestPoint, c, alphaMod); ! } ! void GameType::renderObjectiveArrow(Point nearestPoint, Color c, F32 alphaMod) ! { ! GameConnection *gc = gClientGame->getConnectionToServer(); ! GameObject *co = NULL; ! if(gc) ! co = gc->getControlObject(); ! if(!co) return; ! Point rp = gClientGame->worldToScreenPoint(nearestPoint); ! Point center(400, 300); ! Point arrowDir = rp - center; F32 er = arrowDir.x * arrowDir.x / (350 * 350) + arrowDir.y * arrowDir.y / (250 * 250); Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** game.h 5 Oct 2004 23:41:59 -0000 1.68 --- game.h 8 Oct 2004 00:17:47 -0000 1.69 *************** *** 236,240 **** extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.6" }; --- 236,240 ---- extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.7" }; Index: quickChat.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/quickChat.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** quickChat.cpp 28 Sep 2004 18:45:25 -0000 1.17 --- quickChat.cpp 8 Oct 2004 00:17:47 -0000 1.18 *************** *** 35,38 **** --- 35,39 ---- namespace Zap { + void renderControllerButton(F32 x, F32 y, U32 buttonIndex, U32 keyIndex); VChatHelper::VChatNode VChatHelper::mChatTree[] = *************** *** 100,204 **** }; - extern void drawCircle(Point pos, F32 radius); - void renderControllerButton(F32 x, F32 y, U32 buttonIndex, U32 keyIndex) - { - S32 joy = OptionsMenuUserInterface::joystickType; - - if(joy == -1) - UserInterface::drawStringf(x, y, 15, "%c", keyIndex); - else if(joy == LogitechWingman) - { - glColor3f(1,1,1); - const char buttons[] = "ABCXYZ"; - drawCircle(Point(x + 8, y + 8), 8); - UserInterface::drawStringf(x + 4, y + 2, 12, "%c", buttons[buttonIndex]); - } - else if(joy == SaitekDualAnalog) - { - glColor3f(1,1,1); - const char buttons[] = "123456"; - drawCircle(Point(x + 8, y + 8), 8); - UserInterface::drawStringf(x + 4, y + 2, 12, "%c", buttons[buttonIndex]); - } - else if(joy == PS2DualShock) - { - static F32 color[6][3] = { { 0.5, 0.5, 1 }, - { 1, 0.5, 0.5 }, - { 1, 0.5, 1 }, - { 0.5, 1, 0.5 }, - { 0.7, 0.7, 0.7 }, - { 0.7, 0.7, 0.7 } - }; - Color c(color[buttonIndex][0], color[buttonIndex][1], color[buttonIndex][2]); - glColor3f(1.0, 1.0, 1.0); - Point center(x + 8, y + 8); - if(buttonIndex < 4) - { - drawCircle(center, 8); - glColor(c); - switch(buttonIndex) - { - case 0: - glBegin(GL_LINES); - glVertex(center + Point(-5, -5)); - glVertex(center + Point(5, 5)); - glVertex(center + Point(-5, 5)); - glVertex(center + Point(5, -5)); - glEnd(); - break; - case 1: - drawCircle(center, 5); - break; - case 2: - glBegin(GL_LINE_LOOP); - glVertex(center + Point(-5, -5)); - glVertex(center + Point(-5, 5)); - glVertex(center + Point(5, 5)); - glVertex(center + Point(5, -5)); - glEnd(); - break; - case 3: - glBegin(GL_LINE_LOOP); - glVertex(center + Point(0, -5)); - glVertex(center + Point(5, 3)); - glVertex(center + Point(-5, 3)); - glEnd(); - break; - } - } - else - { - glBegin(GL_LINE_LOOP); - glVertex(center + Point(-8, -8)); - glVertex(center + Point(-8, 8)); - glVertex(center + Point(10, 8)); - 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]); - } - } - else if(joy == XBoxController || joy == XBoxControllerOnXBox) - { - static F32 color[6][3] = { { 0, 1, 0 }, - { 1, 0, 0 }, - { 0, 0, 1 }, - { 1, 1, 0 }, - { 1, 1, 1 }, - { 0, 0, 0} }; - Color c(color[buttonIndex][0], color[buttonIndex][1], color[buttonIndex][2]); - - glColor(c * 0.8f); - fillCircle(Point(x + 8, y + 8), 8); - const char buttons[] = "ABXY "; - glColor3f(1,1,1); - drawCircle(Point(x + 8, y + 8), 8); - glColor(c); - UserInterface::drawStringf(x + 4, y + 2, 12, "%c", buttons[buttonIndex]); - } - } - VChatHelper::VChatHelper() { --- 101,104 ---- Index: huntersGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/huntersGame.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** huntersGame.h 24 Jun 2004 22:50:19 -0000 1.5 --- huntersGame.h 8 Oct 2004 00:17:47 -0000 1.6 *************** *** 47,50 **** --- 47,57 ---- Timer mNexusCapTimer; + struct YardSaleWaypoint + { + Timer timeLeft; + Point pos; + }; + Vector<YardSaleWaypoint> mYardSaleWaypoints; + SafePtr<HuntersNexusObject> mNexus; public: bool mCanNexusCap; *************** *** 53,56 **** --- 60,64 ---- void processArguments(S32 argc, const char **argv); + void addNexus(HuntersNexusObject *theObject); void shipTouchNexus(Ship *theShip, HuntersNexusObject *theNexus); void onGhostAvailable(GhostConnection *theConnection); *************** *** 64,67 **** --- 72,81 ---- enum { + DefaultNexusReturnDelay = 60000, + DefaultNexusCapDelay = 15000, + YardSaleWaypointTime = 5000, + YardSaleCount = 8, + }; + enum { HuntersMsgScore, HuntersMsgYardSale, *************** *** 70,73 **** --- 84,88 ---- }; + TNL_DECLARE_RPC(s2cAddYardSaleWaypoint, (F32 x, F32 y)); TNL_DECLARE_RPC(s2cSetNexusTimer, (U32 nexusTime, bool canCap)); TNL_DECLARE_RPC(s2cHuntersMessage, (U32 msgIndex, StringTableEntryRef clientName, U32 flagCount)); Index: winJoystick.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/winJoystick.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** winJoystick.cpp 29 Sep 2004 23:53:21 -0000 1.21 --- winJoystick.cpp 8 Oct 2004 00:17:47 -0000 1.22 *************** *** 124,132 **** return DIENUM_CONTINUE; strcpy(gJoystickName, pdidInstance->tszProductName); return DIENUM_STOP; } ! bool ReadJoystick(F32 axes[MaxJoystickAxes], U32 &buttonMask) { // mark: it's ok --- 124,133 ---- return DIENUM_CONTINUE; strcpy(gJoystickName, pdidInstance->tszProductName); + logprintf("Joystick found: %s", gJoystickName); return DIENUM_STOP; } ! bool ReadJoystick(F32 axes[MaxJoystickAxes], U32 &buttonMask, U32 &hatMask) { // mark: it's ok *************** *** 178,203 **** { case 0: ! buttonMask |= ControllerButtonDPadUp; break; case 4500: ! buttonMask |= ControllerButtonDPadUp | ControllerButtonDPadRight; break; case 9000: ! buttonMask |= ControllerButtonDPadRight; ! break; case 13500: ! buttonMask |= ControllerButtonDPadRight | ControllerButtonDPadDown; break; case 18000: ! buttonMask |= ControllerButtonDPadDown; break; case 22500: ! buttonMask |= ControllerButtonDPadDown | ControllerButtonDPadLeft; break; case 27000: ! buttonMask |= ControllerButtonDPadLeft; break; case 31500: ! buttonMask |= ControllerButtonDPadLeft | ControllerButtonDPadUp; break; } --- 179,204 ---- { case 0: ! hatMask |= ControllerButtonDPadUp; break; case 4500: ! hatMask |= ControllerButtonDPadUp | ControllerButtonDPadRight; break; case 9000: ! hatMask |= ControllerButtonDPadRight; ! break; case 13500: ! hatMask |= ControllerButtonDPadRight | ControllerButtonDPadDown; break; case 18000: ! hatMask |= ControllerButtonDPadDown; break; case 22500: ! hatMask |= ControllerButtonDPadDown | ControllerButtonDPadLeft; break; case 27000: ! hatMask |= ControllerButtonDPadLeft; break; case 31500: ! hatMask |= ControllerButtonDPadLeft | ControllerButtonDPadUp; break; } Index: UIMenus.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** UIMenus.cpp 5 Oct 2004 23:41:59 -0000 1.26 --- UIMenus.cpp 8 Oct 2004 00:17:47 -0000 1.27 *************** *** 34,37 **** --- 34,38 ---- #include "UIEditor.h" #include "UIInstructions.h" + #include "input.h" #include "glutInclude.h" *************** *** 285,301 **** menuItems.push_back(MenuItem("INPUT: KEYBOARD + MOUSE",2)); break; ! case 0: menuItems.push_back(MenuItem("INPUT: LOGITECH WINGMAN DUAL-ANALOG",2)); break; ! case 1: menuItems.push_back(MenuItem("INPUT: SAITEK P-880 DUAL-ANALOG",2)); break; ! case 2: menuItems.push_back(MenuItem("INPUT: PS2 DUALSHOCK USB",2)); break; ! case 3: menuItems.push_back(MenuItem("INPUT: XBOX CONTROLLER USB",2)); break; ! case 4: menuItems.push_back(MenuItem("INPUT: XBOX CONTROLLER",2)); break; --- 286,305 ---- menuItems.push_back(MenuItem("INPUT: KEYBOARD + MOUSE",2)); break; ! case LogitechWingman: menuItems.push_back(MenuItem("INPUT: LOGITECH WINGMAN DUAL-ANALOG",2)); break; ! case LogitechDualAction: ! menuItems.push_back(MenuItem("INPUT: LOGITECH DUAL ACTION",2)); ! break; ! case SaitekDualAnalog: menuItems.push_back(MenuItem("INPUT: SAITEK P-880 DUAL-ANALOG",2)); break; ! case PS2DualShock: menuItems.push_back(MenuItem("INPUT: PS2 DUALSHOCK USB",2)); break; ! case XBoxController: menuItems.push_back(MenuItem("INPUT: XBOX CONTROLLER USB",2)); break; ! case XBoxControllerOnXBox: menuItems.push_back(MenuItem("INPUT: XBOX CONTROLLER",2)); break; *************** *** 334,338 **** case 2: joystickType++; ! if(joystickType > 3) joystickType = -1; break; --- 338,342 ---- case 2: joystickType++; ! if(joystickType > XBoxController) joystickType = -1; break; Index: huntersGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/huntersGame.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** huntersGame.cpp 25 Sep 2004 01:26:37 -0000 1.11 --- huntersGame.cpp 8 Oct 2004 00:17:47 -0000 1.12 *************** *** 39,42 **** --- 39,43 ---- TNL_IMPLEMENT_NETOBJECT(HuntersGameType); + TNL_IMPLEMENT_NETOBJECT_RPC(HuntersGameType, s2cSetNexusTimer, (U32 nexusTime, bool canCap), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhost, 0) *************** *** 46,49 **** --- 47,58 ---- } + GAMETYPE_RPC_S2C(HuntersGameType, s2cAddYardSaleWaypoint, (F32 x, F32 y)) + { + YardSaleWaypoint w; + w.timeLeft.reset(YardSaleWaypointTime); + w.pos.set(x,y); + mYardSaleWaypoints.push_back(w); + } + TNL_IMPLEMENT_NETOBJECT_RPC(HuntersGameType, s2cHuntersMessage, (U32 msgIndex, StringTableEntryRef clientName, U32 flagCount), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhost, 0) *************** *** 88,91 **** --- 97,105 ---- } + void HuntersGameType::addNexus(HuntersNexusObject *nexus) + { + mNexus = nexus; + } + void HuntersGameType::processArguments(S32 argc, const char **argv) { *************** *** 150,153 **** --- 164,174 ---- { mNexusReturnTimer.update(deltaT); + for(S32 i = 0; i < mYardSaleWaypoints.size();) + { + if(mYardSaleWaypoints[i].timeLeft.update(deltaT)) + mYardSaleWaypoints.erase_fast(i); + else + i++; + } return; } *************** *** 158,161 **** --- 179,186 ---- mCanNexusCap = true; s2cSetNexusTimer(mNexusCapTimer.getCurrent(), mCanNexusCap); + static StringTableEntry msg("The Nexus is now OPEN!"); + for(S32 i = 0; i < mClientList.size(); i++) + mClientList[i]->clientConnection->s2cDisplayMessage( + GameConnection::ColorNuclearGreen, SFXFlagSnatch, msg); } else if(mNexusCapTimer.update(deltaT)) *************** *** 164,167 **** --- 189,196 ---- mCanNexusCap = false; s2cSetNexusTimer(mNexusReturnTimer.getCurrent(), mCanNexusCap); + static StringTableEntry msg("The Nexus is now CLOSED."); + for(S32 i = 0; i < mClientList.size(); i++) + mClientList[i]->clientConnection->s2cDisplayMessage( + GameConnection::ColorNuclearGreen, SFXFlagDrop, msg); } } *************** *** 177,180 **** --- 206,212 ---- UserInterface::drawStringf(UserInterface::canvasWidth - UserInterface::horizMargin - 65, UserInterface::canvasHeight - UserInterface::vertMargin - 45, 20, "%02d:%02d", minsRemaining, secsRemaining); + for(S32 i = 0; i < mYardSaleWaypoints.size(); i++) + renderObjectiveArrow(mYardSaleWaypoints[i].pos, Color(1,1,1)); + renderObjectiveArrow(mNexus, mCanNexusCap ? Color(0,1,0) : Color(0.5, 0, 0)); } *************** *** 194,199 **** if(theFlag) { ! if(theFlag->getFlagCount() > 2) s2cHuntersMessage(HuntersMsgYardSale, theShip->mPlayerName.getString(), 0); return; --- 226,235 ---- if(theFlag) { ! if(theFlag->getFlagCount() >= YardSaleCount) ! { ! Point pos = theFlag->getActualPos(); ! s2cAddYardSaleWaypoint(pos.x, pos.y); s2cHuntersMessage(HuntersMsgYardSale, theShip->mPlayerName.getString(), 0); + } return; *************** *** 375,390 **** if(!isGhost()) setScopeAlways(); } void HuntersNexusObject::render() { ! F32 alpha = 0.2; HuntersGameType *theGameType = dynamic_cast<HuntersGameType *>(getGame()->getGameType()); if(theGameType && theGameType->mCanNexusCap) ! alpha = 0.5; ! Color theColor = getGame()->getGameType()->mTeams[0].color; ! glColor(theColor * alpha); glBegin(GL_POLYGON); glVertex2f(nexusBounds.min.x, nexusBounds.min.y); glVertex2f(nexusBounds.min.x, nexusBounds.max.y); --- 411,435 ---- if(!isGhost()) setScopeAlways(); + ((HuntersGameType *) theGame->getGameType())->addNexus(this); } void HuntersNexusObject::render() { ! Color c; HuntersGameType *theGameType = dynamic_cast<HuntersGameType *>(getGame()->getGameType()); if(theGameType && theGameType->mCanNexusCap) ! c.set(0,1,0); ! else ! c.set(0.5, 0, 0); ! glColor(c * 0.5); glBegin(GL_POLYGON); + glVertex2f(nexusBounds.min.x, nexusBounds.min.y); + glVertex2f(nexusBounds.min.x, nexusBounds.max.y); + glVertex2f(nexusBounds.max.x, nexusBounds.max.y); + glVertex2f(nexusBounds.max.x, nexusBounds.min.y); + glEnd(); + glColor(c); + glBegin(GL_LINE_LOOP); glVertex2f(nexusBounds.min.x, nexusBounds.min.y); glVertex2f(nexusBounds.min.x, nexusBounds.max.y); *************** *** 397,401 **** --- 442,448 ---- { polyPoints.push_back(nexusBounds.min); + polyPoints.push_back(Point(nexusBounds.max.x, nexusBounds.min.y)); polyPoints.push_back(nexusBounds.max); + polyPoints.push_back(Point(nexusBounds.min.x, nexusBounds.max.y)); return true; } Index: gameType.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.h,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** gameType.h 5 Oct 2004 23:41:59 -0000 1.36 --- gameType.h 8 Oct 2004 00:17:47 -0000 1.37 *************** *** 156,159 **** --- 156,160 ---- virtual void renderInterfaceOverlay(bool scoreboardVisible); void renderObjectiveArrow(GameObject *target, Color c, F32 alphaMod = 1.0f); + void renderObjectiveArrow(Point p, Color c, F32 alphaMod = 1.0f); void renderTimeLeft(); Index: UIInstructions.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIInstructions.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** UIInstructions.cpp 5 Oct 2004 23:41:59 -0000 1.9 --- UIInstructions.cpp 8 Oct 2004 00:17:47 -0000 1.10 *************** *** 177,181 **** 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]) --- 177,181 ---- glColor3f(1,1,1); drawString(col1, y, 20, controls[i].controlString); ! if((OptionsMenuUserInterface::joystickType == LogitechDualAction || OptionsMenuUserInterface::joystickType == PS2DualShock) && (i == 2 || i == 3)) renderControllerButton(col2, y + 4, i + 4, i + 4); else if(gamepad && !controls[i].primaryControl[0]) Index: input.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/input.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** input.cpp 1 Oct 2004 00:21:40 -0000 1.5 --- input.cpp 8 Oct 2004 00:17:47 -0000 1.6 *************** *** 32,39 **** --- 32,253 ---- #include <math.h> #include "glutInclude.h" + #include "gameObjectRender.h" namespace Zap { + extern void drawCircle(Point pos, F32 radius); + void renderControllerButton(F32 x, F32 y, U32 buttonIndex, U32 keyIndex) + { + S32 joy = OptionsMenuUserInterface::joystickType; + + if(joy == -1) + UserInterface::drawStringf(x, y, 15, "%c", keyIndex); + else if(joy == LogitechWingman) + { + glColor3f(1,1,1); + const char buttons[] = "ABCXYZ"; + drawCircle(Point(x + 8, y + 8), 8); + UserInterface::drawStringf(x + 4, y + 2, 12, "%c", buttons[buttonIndex]); + } + else if(joy == LogitechDualAction) + { + glColor3f(1,1,1); + const char buttons[] = "12347856"; + drawCircle(Point(x + 8, y + 8), 8); + UserInterface::drawStringf(x + 4, y + 2, 12, "%c", buttons[buttonIndex]); + } + else if(joy == SaitekDualAnalog) + { + glColor3f(1,1,1); + const char buttons[] = "123456"; + drawCircle(Point(x + 8, y + 8), 8); + UserInterface::drawStringf(x + 4, y + 2, 12, "%c", buttons[buttonIndex]); + } + else if(joy == PS2DualShock) + { + static F32 color[6][3] = { { 0.5, 0.5, 1 }, + { 1, 0.5, 0.5 }, + { 1, 0.5, 1 }, + { 0.5, 1, 0.5 }, + { 0.7, 0.7, 0.7 }, + { 0.7, 0.7, 0.7 } + }; + Color c(color[buttonIndex][0], color[buttonIndex][1], color[buttonIndex][2]); + glColor3f(1.0, 1.0, 1.0); + Point center(x + 8, y + 8); + if(buttonIndex < 4) + { + drawCircle(center, 8); + glColor(c); + switch(buttonIndex) + { + case 0: + glBegin(GL_LINES); + glVertex(center + Point(-5, -5)); + glVertex(center + Point(5, 5)); + glVertex(center + Point(-5, 5)); + glVertex(center + Point(5, -5)); + glEnd(); + break; + case 1: + drawCircle(center, 5); + break; + case 2: + glBegin(GL_LINE_LOOP); + glVertex(center + Point(-5, -5)); + glVertex(center + Point(-5, 5)); + glVertex(center + Point(5, 5)); + glVertex(center + Point(5, -5)); + glEnd(); + break; + case 3: + glBegin(GL_LINE_LOOP); + glVertex(center + Point(0, -5)); + glVertex(center + Point(5, 3)); + glVertex(center + Point(-5, 3)); + glEnd(); + break; + } + } + else + { + glBegin(GL_LINE_LOOP); + glVertex(center + Point(-8, -8)); + glVertex(center + Point(-8, 8)); + glVertex(center + Point(10, 8)); + 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]); + } + } + else if(joy == XBoxController || joy == XBoxControllerOnXBox) + { + static F32 color[6][3] = { { 0, 1, 0 }, + { 1, 0, 0 }, + { 0, 0, 1 }, + { 1, 1, 0 }, + { 1, 1, 1 }, + { 0, 0, 0} }; + Color c(color[buttonIndex][0], color[buttonIndex][1], color[buttonIndex][2]); + + glColor(c * 0.8f); + fillCircle(Point(x + 8, y + 8), 8); + const char buttons[] = "ABXY "; + glColor3f(1,1,1); + drawCircle(Point(x + 8, y + 8), 8); + glColor(c); + UserInterface::drawStringf(x + 4, y + 2, 12, "%c", buttons[buttonIndex]); + } + } + + static U32 gShootAxisRemaps[ControllerTypeCount][2] = + { + { 5, 6 }, { 2, 5 }, { 5, 2 }, { 2, 5 }, { 3, 4 }, { 3, 4 }, + }; + + static U32 gControllerButtonRemaps[ControllerTypeCount][MaxJoystickButtons] = + { + { // LogitechWingman + ControllerButton1, + ControllerButton2, + ControllerButton3, + ControllerButton4, + ControllerButton5, + ControllerButton6, + ControllerButtonLeftTrigger, + ControllerButtonRightTrigger, + ControllerButtonBack, + 0, + 0, + 0, + 0, + 0, + }, + { // LogitechDualAction + ControllerButton1, + ControllerButton2, + ControllerButton3, + ControllerButton4, + ControllerButtonLeftTrigger, + ControllerButtonRightTrigger, + ControllerButton5, + ControllerButton6, + ControllerButtonBack, + ControllerButtonStart, + 0, + 0, + 0, + 0, + }, + { // SaitekDualAnalog + ControllerButton1, + ControllerButton2, + ControllerButton3, + ControllerButton4, + ControllerButton5, + ControllerButton6, + ControllerButtonLeftTrigger, + ControllerButtonRightTrigger, + 0, + 0, + ControllerButtonBack, + 0, + 0, + 0, + }, + { // PS2DualShock + ControllerButton4, + ControllerButton2, + ControllerButton1, + ControllerButton3, + ControllerButton5, + ControllerButton6, + ControllerButtonLeftTrigger, + ControllerButtonRightTrigger, + ControllerButtonBack, + 0, + 0, + ControllerButtonStart, + 0, + 0, + }, + { // XBoxController + ControllerButton1, + ControllerButton2, + ControllerButton3, + ControllerButton4, + ControllerButton6, + ControllerButton5, + ControllerButtonStart, + ControllerButtonBack, + 0, + 0, + ControllerButtonLeftTrigger, + ControllerButtonRightTrigger, + 0, + 0, + }, + { // XBoxControllerOnXBox + 1 << 0, + 1 << 1, + 1 << 2, + 1 << 3, + 1 << 4, + 1 << 5, + 1 << 6, + 1 << 7, + 1 << 8, + 1 << 9, + 1 << 10, + 1 << 11, + 1 << 12, + 1 << 13, + } + }; + static bool updateMoveInternal( Move *theMove, U32 &buttonMask ) { *************** *** 41,46 **** static F32 minValues[2] = { - 0.5, -0.5 }; static F32 maxValues[2] = { 0.5, 0.5 }; ! ! if(!ReadJoystick(axes, buttonMask)) return false; --- 255,260 ---- static F32 minValues[2] = { - 0.5, -0.5 }; static F32 maxValues[2] = { 0.5, 0.5 }; ! U32 hatMask = 0; ! if(!ReadJoystick(axes, buttonMask, hatMask)) return false; *************** *** 93,116 **** controls[1] = dir.y; } ! switch(OptionsMenuUserInterface::joystickType) ! { ! case LogitechWingman: ! controls[2] = axes[5]; ! controls[3] = axes[6]; ! break; ! case SaitekDualAnalog: ! controls[2] = axes[5]; ! controls[3] = axes[2]; ! break; ! case PS2DualShock: ! controls[2] = axes[2]; ! controls[3] = axes[5]; ! break; ! case XBoxController: ! case XBoxControllerOnXBox: ! controls[2] = axes[3]; ! controls[3] = axes[4]; ! break; ! } for(U32 i = 0; i < 4; i++) --- 307,312 ---- controls[1] = dir.y; } ! controls[2] = axes[gShootAxisRemaps[OptionsMenuUserInterface::joystickType][0]]; ! controls[3] = axes[gShootAxisRemaps[OptionsMenuUserInterface::joystickType][1]]; for(U32 i = 0; i < 4; i++) *************** *** 156,235 **** theMove->fire = false; ! ! // Remap crazy xbox inputs... ! if(OptionsMenuUserInterface::joystickType == LogitechWingman) ! { ! if(buttonMask & (1 << 8)) ! { ! buttonMask |= ControllerButtonBack; ! buttonMask &= ~(1 << 8); ! } ! } ! else if(OptionsMenuUserInterface::joystickType == SaitekDualAnalog) ! { ! static U32 retMasks[12] = { ! ControllerButton1, ! ControllerButton2, ! ControllerButton3, ! ControllerButton4, ! ControllerButton5, ! ControllerButton6, ! ControllerButtonLeftTrigger, ! ControllerButtonRightTrigger, ! 0, ! 0, ! ControllerButtonBack, ! 0, ! }; ! U32 retMask = 0; ! for(S32 i = 0; i < 12; i++) ! if(buttonMask & (1 << i)) ! retMask |= retMasks[i]; ! buttonMask = retMask; ! } ! else if(OptionsMenuUserInterface::joystickType == PS2DualShock) ! { ! static U32 retMasks[12] = { ! ControllerButton4, ! ControllerButton2, ! ControllerButton1, ! ControllerButton3, ! ControllerButton5, ! ControllerButton6, ! ControllerButtonLeftTrigger, ! ControllerButtonRightTrigger, ! ControllerButtonBack, ! 0, ! 0, ! ControllerButtonStart, ! }; ! U32 retMask = 0; ! for(S32 i = 0; i < 12; i++) ! if(buttonMask & (1 << i)) ! retMask |= retMasks[i]; ! buttonMask = retMask; ! } ! else if(OptionsMenuUserInterface::joystickType == XBoxController) ! { ! static U32 retMasks[12] = { ! ControllerButton1, ! ControllerButton2, ! ControllerButton3, ! ControllerButton4, ! ControllerButton6, ! ControllerButton5, ! ControllerButtonStart, ! ControllerButtonBack, ! 0, ! 0, ! ControllerButtonLeftTrigger, ! ControllerButtonRightTrigger, ! }; ! U32 retMask = 0; ! for(S32 i = 0; i < 12; i++) ! if(buttonMask & (1 << i)) ! retMask |= retMasks[i]; ! buttonMask = retMask; ! } return true; } --- 352,361 ---- theMove->fire = false; ! // remap button inputs ! U32 retMask = 0; ! for(S32 i = 0; i < MaxJoystickButtons; i++) ! if(buttonMask & (1 << i)) ! retMask |= gControllerButtonRemaps[OptionsMenuUserInterface::joystickType][i]; ! buttonMask = retMask | hatMask; return true; } *************** *** 253,256 **** --- 379,384 ---- else if(strstr(joystickName, "P880")) ret = SaitekDualAnalog; + else if(strstr(joystickName, "Logitech Dual Action")) + ret = LogitechDualAction; TNL_JOURNAL_WRITE_BLOCK(JoystickAutodetect, TNL_JOURNAL_WRITE((ret)); |
From: Mark F. <mar...@us...> - 2004-10-08 00:18:04
|
Update of /cvsroot/opentnl/tnl/exe/levels In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11621/exe/levels Modified Files: hunters1.txt Log Message: Added objective rendering to Hunters game type Added support for Logitech's Dual Action controller Incremented game version Index: hunters1.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/levels/hunters1.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** hunters1.txt 17 Sep 2004 00:14:34 -0000 1.3 --- hunters1.txt 8 Oct 2004 00:17:47 -0000 1.4 *************** *** 1,5 **** HuntersGameType 10 1 15 5000 LevelName "Tin Man's Reprise" ! Team Orange 1 0.5 0 GridSize 380 HuntersNexusObject 4.4 2.5 50 50 --- 1,5 ---- HuntersGameType 10 1 15 5000 LevelName "Tin Man's Reprise" ! Team Hunters 1 1 0 GridSize 380 HuntersNexusObject 4.4 2.5 50 50 |
From: Mark F. <mar...@us...> - 2004-10-05 23:42:16
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18710/zap Modified Files: HTFGame.cpp UIGame.cpp UIGame.h UIInstructions.cpp UIInstructions.h UIMenus.cpp UIMenus.h footballGame.cpp game.h gameType.cpp gameType.h main.cpp retrieveGame.cpp Log Message: More fixes for game type objective arrows Removed HTF level Added new retrieve level changed zone-control 5 to be 3 team instead of 4 Added ALT-ENTER for video mode change Added F1 in game for help Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** main.cpp 29 Sep 2004 23:53:21 -0000 1.71 --- main.cpp 5 Oct 2004 23:41:59 -0000 1.72 *************** *** 70,74 **** const char *gLevelList = "retrieve1.txt " "retrieve2.txt " ! "htf1.txt " "football1.txt " "football2.txt " --- 70,74 ---- const char *gLevelList = "retrieve1.txt " "retrieve2.txt " ! "retrieve3.txt " "football1.txt " "football2.txt " *************** *** 78,82 **** "rabbit1.txt " "soccer1.txt " - "soccer2.txt " "ctf1.txt " "ctf2.txt " --- 78,81 ---- *************** *** 154,158 **** TNL_IMPLEMENT_JOURNAL_ENTRYPOINT(ZapJournal, key, (U8 key)) { ! if(UserInterface::current) UserInterface::current->onKeyDown(key); } --- 153,160 ---- TNL_IMPLEMENT_JOURNAL_ENTRYPOINT(ZapJournal, key, (U8 key)) { ! // check for ALT-ENTER ! if(key == '\r' && (glutGetModifiers() & GLUT_ACTIVE_ALT)) ! gOptionsMenuUserInterface.toggleFullscreen(); ! else if(UserInterface::current) UserInterface::current->onKeyDown(key); } Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** gameType.cpp 5 Oct 2004 00:16:34 -0000 1.61 --- gameType.cpp 5 Oct 2004 23:41:59 -0000 1.62 *************** *** 221,225 **** } ! void GameType::renderObjectiveArrow(GameObject *target, Color c) { GameConnection *gc = gClientGame->getConnectionToServer(); --- 221,225 ---- } ! void GameType::renderObjectiveArrow(GameObject *target, Color c, F32 alphaMod) { GameConnection *gc = gClientGame->getConnectionToServer(); *************** *** 276,280 **** arrowDir.normalize(); Point crossVec(arrowDir.y, -arrowDir.x); ! F32 alpha = (1 - gClientGame->getCommanderZoomFraction()) * 0.6; if(!alpha) return; --- 276,280 ---- arrowDir.normalize(); Point crossVec(arrowDir.y, -arrowDir.x); ! F32 alpha = (1 - gClientGame->getCommanderZoomFraction()) * 0.6 * alphaMod; if(!alpha) return; *************** *** 664,667 **** --- 664,672 ---- } + Color GameType::getTeamColor(GameObject *theObject) + { + return getTeamColor(theObject->getTeam()); + } + Color GameType::getShipColor(Ship *s) { Index: UIGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** UIGame.cpp 1 Oct 2004 00:21:40 -0000 1.48 --- UIGame.cpp 5 Oct 2004 23:41:59 -0000 1.49 *************** *** 30,33 **** --- 30,34 ---- #include "UIGame.h" #include "UIMenus.h" + #include "UIInstructions.h" #include "gameType.h" #include "lpc10.h" *************** *** 453,456 **** --- 454,463 ---- } + void GameUserInterface::onSpecialKeyDown(U32 key) + { + if(key == GLUT_KEY_F1) + gInstructionsUserInterface.activate(); + } + void GameUserInterface::onKeyDown(U32 key) { Index: UIMenus.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** UIMenus.h 2 Aug 2004 18:11:54 -0000 1.12 --- UIMenus.h 5 Oct 2004 23:41:59 -0000 1.13 *************** *** 96,99 **** --- 96,100 ---- void setupMenus(); void onActivate(); + void toggleFullscreen(); }; Index: HTFGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/HTFGame.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** HTFGame.cpp 5 Oct 2004 00:16:34 -0000 1.3 --- HTFGame.cpp 5 Oct 2004 23:41:59 -0000 1.4 *************** *** 257,260 **** --- 257,262 ---- for(k = 0; k < mFlags.size(); k++) { + if(!mFlags[k].isValid()) + continue; if(mFlags[k]->getZone() == mZones[j]) break; Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** game.h 5 Oct 2004 00:16:34 -0000 1.67 --- game.h 5 Oct 2004 23:41:59 -0000 1.68 *************** *** 236,240 **** extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.5" }; --- 236,240 ---- extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.6" }; Index: retrieveGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/retrieveGame.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** retrieveGame.cpp 5 Oct 2004 00:16:34 -0000 1.4 --- retrieveGame.cpp 5 Oct 2004 23:41:59 -0000 1.5 *************** *** 240,243 **** --- 240,245 ---- for(k = 0; k < mFlags.size(); k++) { + if(!mFlags[k].isValid()) + continue; if(mFlags[k]->getZone() == mZones[j]) break; Index: UIInstructions.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIInstructions.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UIInstructions.h 1 Jul 2004 19:23:36 -0000 1.3 --- UIInstructions.h 5 Oct 2004 23:41:59 -0000 1.4 *************** *** 46,49 **** --- 46,50 ---- void onKeyDown(U32 key); void onActivate(); + void exitInstructions(); }; Index: footballGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/footballGame.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** footballGame.cpp 5 Oct 2004 00:16:34 -0000 1.13 --- footballGame.cpp 5 Oct 2004 23:41:59 -0000 1.14 *************** *** 41,45 **** --- 41,59 ---- Vector<GoalZone*> mZones; SafePtr<FlagItem> mFlag; + S32 mFlagTeam; public: + ZoneControlGameType() + { + mFlagTeam = -1; + } + + void onGhostAvailable(GhostConnection *theConnection) + { + Parent::onGhostAvailable(theConnection); + NetObject::setRPCDestConnection(theConnection); + s2cSetFlagTeam(mFlagTeam); + NetObject::setRPCDestConnection(NULL); + } + void shipTouchFlag(Ship *theShip, FlagItem *theFlag); void flagDropped(Ship *theShip, FlagItem *theFlag); *************** *** 56,59 **** --- 70,74 ---- void performProxyScopeQuery(GameObject *scopeObject, GameConnection *connection); + TNL_DECLARE_RPC(s2cSetFlagTeam, (S32 newFlagTeam)); TNL_DECLARE_CLASS(ZoneControlGameType); }; *************** *** 61,64 **** --- 76,83 ---- TNL_IMPLEMENT_NETOBJECT(ZoneControlGameType); + GAMETYPE_RPC_S2C(ZoneControlGameType, s2cSetFlagTeam, (S32 flagTeam)) + { + mFlagTeam = flagTeam; + } void ZoneControlGameType::shipTouchFlag(Ship *theShip, FlagItem *theFlag) *************** *** 76,83 **** --- 95,105 ---- mClientList[i]->clientConnection->s2cDisplayMessageE(GameConnection::ColorNuclearGreen, SFXFlagSnatch, takeString, e); theFlag->mountToShip(theShip); + mFlagTeam = theShip->getTeam(); + s2cSetFlagTeam(mFlagTeam); } void ZoneControlGameType::flagDropped(Ship *theShip, FlagItem *theFlag) { + s2cSetFlagTeam(-1); static StringTableEntry dropString("%e0 dropped the flag!"); Vector<StringTableEntry> e; *************** *** 150,153 **** --- 172,177 ---- } } + mFlagTeam = -1; + s2cSetFlagTeam(-1); } *************** *** 179,211 **** return; ! if(mFlag.isValid() && mFlag->getMount() == u) { - // the ship has the flag, so render zones not controlled by his team for(S32 i = 0; i < mZones.size(); i++) ! if(mZones[i]->getTeam() != u->getTeam()) ! renderObjectiveArrow(mZones[i], getTeamColor(mZones[i]->getTeam())); } ! else { if(mFlag.isValid()) { if(!mFlag->isMounted()) ! renderObjectiveArrow(mFlag, getTeamColor(mFlag->getTeam())); else { Ship *mount = mFlag->getMount(); if(mount) ! renderObjectiveArrow(mount, getTeamColor(mount->getTeam())); ! } ! } ! for(S32 i = 0; i < mZones.size(); i++) ! { ! if(mZones[i]->didRecentlyChangeTeam() && mZones[i]->getTeam() != -1) ! { ! Color c = getTeamColor(mZones[i]->getTeam()); ! if(mZones[i]->isFlashing()) ! c *= 0.8; ! renderObjectiveArrow(mZones[i], c); ! } } --- 203,237 ---- return; ! bool hasFlag = mFlag.isValid() && mFlag->getMount() == u; ! ! // first render all zones that are not yet taken by the flag holding team ! if(mFlagTeam != -1) { for(S32 i = 0; i < mZones.size(); i++) ! { ! if(mZones[i]->getTeam() != mFlagTeam) ! renderObjectiveArrow(mZones[i], getTeamColor(mZones[i]), hasFlag ? 1.0 : 0.4); ! else if(mZones[i]->didRecentlyChangeTeam() && mZones[i]->getTeam() != -1 && u->getTeam() != mFlagTeam) ! { ! // render a blinky arrow for a recently taken zone ! Color c = getTeamColor(mZones[i]); ! if(mZones[i]->isFlashing()) ! c *= 0.7; ! renderObjectiveArrow(mZones[i], c); ! } ! } ! } ! if(!hasFlag) { if(mFlag.isValid()) { if(!mFlag->isMounted()) ! renderObjectiveArrow(mFlag, getTeamColor(mFlag)); else { Ship *mount = mFlag->getMount(); if(mount) ! renderObjectiveArrow(mount, getTeamColor(mount)); } } Index: gameType.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.h,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** gameType.h 4 Oct 2004 19:23:59 -0000 1.35 --- gameType.h 5 Oct 2004 23:41:59 -0000 1.36 *************** *** 155,159 **** virtual void renderInterfaceOverlay(bool scoreboardVisible); ! void renderObjectiveArrow(GameObject *target, Color c); void renderTimeLeft(); --- 155,159 ---- virtual void renderInterfaceOverlay(bool scoreboardVisible); ! void renderObjectiveArrow(GameObject *target, Color c, F32 alphaMod = 1.0f); void renderTimeLeft(); *************** *** 166,169 **** --- 166,170 ---- virtual Color getShipColor(Ship *s); Color getTeamColor(S32 team); + Color getTeamColor(GameObject *theObject); // game type flag methods for CTF, Rabbit, Football virtual void addFlag(FlagItem *theFlag) {} Index: UIMenus.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** UIMenus.cpp 29 Sep 2004 23:53:21 -0000 1.25 --- UIMenus.cpp 5 Oct 2004 23:41:59 -0000 1.26 *************** *** 310,313 **** --- 310,325 ---- } + void OptionsMenuUserInterface::toggleFullscreen() + { + if(fullscreen) + { + glutPositionWindow(100, 100); + glutReshapeWindow(800, 600); + } + else + glutFullScreen(); + fullscreen = !fullscreen; + } + void OptionsMenuUserInterface::processSelection(U32 index) { *************** *** 318,329 **** break; case 1: ! if(fullscreen) ! { ! glutPositionWindow(100, 100); ! glutReshapeWindow(800, 600); ! } ! else ! glutFullScreen(); ! fullscreen = !fullscreen; break; case 2: --- 330,334 ---- break; case 1: ! toggleFullscreen(); break; case 2: Index: UIGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** UIGame.h 2 Aug 2004 18:11:53 -0000 1.16 --- UIGame.h 5 Oct 2004 23:41:59 -0000 1.17 *************** *** 144,147 **** --- 144,148 ---- void onModifierKeyDown(U32 key); void onModifierKeyUp(U32 key); + void onSpecialKeyDown(U32 key); void onControllerButtonDown(U32 buttonIndex); void onControllerButtonUp(U32 buttonIndex); Index: UIInstructions.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIInstructions.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** UIInstructions.cpp 28 Sep 2004 18:45:25 -0000 1.8 --- UIInstructions.cpp 5 Oct 2004 23:41:59 -0000 1.9 *************** *** 412,415 **** --- 412,423 ---- } + void InstructionsUserInterface::exitInstructions() + { + if(gClientGame->isConnectedToServer()) + gGameUserInterface.activate(); + else + gMainMenuUserInterface.activate(); + } + void InstructionsUserInterface::onSpecialKeyDown(U32 key) { *************** *** 422,425 **** --- 430,436 ---- nextPage(); break; + case GLUT_KEY_F1: + exitInstructions(); + break; } } *************** *** 434,441 **** case '\r': case 27: ! if(gClientGame->isConnectedToServer()) ! gGameUserInterface.activate(); ! else ! gMainMenuUserInterface.activate(); break; } --- 445,449 ---- case '\r': case 27: ! exitInstructions(); break; } |
From: Mark F. <mar...@us...> - 2004-10-05 23:42:12
|
Update of /cvsroot/opentnl/tnl/exe/levels In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18710/exe/levels Modified Files: football5.txt Added Files: retrieve3.txt Removed Files: htf1.txt Log Message: More fixes for game type objective arrows Removed HTF level Added new retrieve level changed zone-control 5 to be 3 team instead of 4 Added ALT-ENTER for video mode change Added F1 in game for help --- htf1.txt DELETED --- Index: football5.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/levels/football5.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** football5.txt 20 Aug 2004 23:16:07 -0000 1.1 --- football5.txt 5 Oct 2004 23:41:58 -0000 1.2 *************** *** 2,6 **** Team Blue 0 0 1 Team Red 1 0 0 - Team Green 0 1 0 Team Yellow 1 1 0 LevelName "Home Turf" --- 2,5 ---- *************** *** 8,12 **** GoalZone -1 -0.9 -5.9 -0.0999999 -5.9 -0.0999999 -5.1 -0.9 -5.1 LoadoutZone 0 -5.1 -8.4 -3.9 -8.4 -4.1 -8 -4.9 -8 ! FlagItem -1 0 0 Spawn 0 -4.7 -8.6 Spawn 0 -5.1 -8.8 --- 7,11 ---- GoalZone -1 -0.9 -5.9 -0.0999999 -5.9 -0.0999999 -5.1 -0.9 -5.1 LoadoutZone 0 -5.1 -8.4 -3.9 -8.4 -4.1 -8 -4.9 -8 ! FlagItem -1 0.6 -1.7 Spawn 0 -4.7 -8.6 Spawn 0 -5.1 -8.8 *************** *** 21,25 **** BarrierMaker -5 -7.5 -4.8 -7.5 -4.7 -7.3 -4.3 -7.3 -4.2 -7.5 -4 -7.5 -3.5 -8.5 -3 -8.5 -3 -9.5 -6 -9.5 -6 -8.5 -5.5 -8.5 -5 -7.5 Teleporter -4.5 -7.7 0 -8 ! BarrierMaker -1.6 -5.4 -1.5 -5.5 -1.5 -6.5 -0.5 -7.5 -0.5 -8.5 1.5 -8.5 2.5 -9.5 4.5 -9.5 5 -9 5 -7.8 4.5 -7.3 4.5 -6.5 3.5 -5.5 3.5 -3.5 5.5 -1.5 GoalZone -1 3.1 -8.9 3.9 -8.9 3.9 -8.1 3.1 -8.1 BarrierMaker -1 -4.5 -0.3 -4.5 0.2 -4 --- 20,24 ---- BarrierMaker -5 -7.5 -4.8 -7.5 -4.7 -7.3 -4.3 -7.3 -4.2 -7.5 -4 -7.5 -3.5 -8.5 -3 -8.5 -3 -9.5 -6 -9.5 -6 -8.5 -5.5 -8.5 -5 -7.5 Teleporter -4.5 -7.7 0 -8 ! BarrierMaker -1.7 -5.1 -1.5 -5.5 -1.5 -6.5 -0.5 -7.5 -0.5 -8.5 1.5 -8.5 2.5 -9.5 4.5 -9.5 5 -9 5 -7.8 4.5 -7.3 4.5 -6.5 3.5 -5.5 3.5 -3.5 5.4 -1.6 GoalZone -1 3.1 -8.9 3.9 -8.9 3.9 -8.1 3.1 -8.1 BarrierMaker -1 -4.5 -0.3 -4.5 0.2 -4 *************** *** 32,40 **** BarrierMaker 0.5 -7.5 1 -7.5 1.3 -7.8 1.9 -7.8 BarrierMaker 1.5 -5.5 1.8 -5.5 1.8 -5.8 - BarrierMaker 1 -2.5 1.5 -2 2.2 -2 2.5 -1.7 3.4 -1.7 3.6 -1.9 3.6 -2.3 3.2 -2.7 2.8 -2.7 2.5 -2.4 1.6 -2.4 1.5 -2.5 1.5 -2.6 1.4 -2.7 1.1 -2.7 1 -2.6 1 -2.5 - BarrierMaker -1.5 -2 -1 -2.5 0 -2.5 BarrierMaker 2.3 -4.2 1.8 -3.7 1.8 -3.4 1.9 -3.3 2.5 -3.3 2.9 -3.7 - BarrierMaker 0.5 -1 1 -0.5 - BarrierMaker -0.4 -1.7 -0.4 -1.8 -0.3 -1.9 0.3 -1.9 0.4 -1.8 0.4 -1.7 0.1 -1.4 -0.1 -1.4 -0.4 -1.7 Turret 0 0.2 -6.7 Turret 0 3.6 -9.4 --- 31,35 ---- *************** *** 43,164 **** ForceFieldProjector 0 0.7 -7.4 LoadoutZone 0 -0.4 -3.7 0.4 -3.7 0.4 -3.3 -0.4 -3.3 - GoalZone -1 5.9 -0.9 5.9 -0.0999999 5.1 -0.0999999 5.1 -0.9 - LoadoutZone 1 8.4 -5.1 8.4 -3.9 8 -4.1 8 -4.9 - Spawn 1 8.6 -4.7 - Spawn 1 8.8 -5.1 - Spawn 1 9 -4.5 - Spawn 1 8.8 -3.9 - Spawn 1 8.6 -4.3 - Spawn 1 9 -3.4 - Spawn 1 9.3 -3.9 - Spawn 1 9.3 -4.5 - Spawn 1 9.3 -5.1 - Spawn 1 9 -5.6 - BarrierMaker 7.5 -5 7.5 -4.8 7.3 -4.7 7.3 -4.3 7.5 -4.2 7.5 -4 8.5 -3.5 8.5 -3 9.5 -3 9.5 -6 8.5 -6 8.5 -5.5 7.5 -5 - Teleporter 7.7 -4.5 8 -1.49012e-007 - BarrierMaker 5.4 -1.6 5.5 -1.5 6.5 -1.5 7.5 -0.5 8.5 -0.5 8.5 1.5 9.5 2.5 9.5 4.5 9 5 7.8 5 7.3 4.5 6.5 4.5 5.5 3.5 3.5 3.5 1.5 5.5 1.5 5.6 - GoalZone -1 8.9 3.1 8.9 3.9 8.1 3.9 8.1 3.1 - BarrierMaker 4.5 -1 4.5 -0.3 4 0.2 - BarrierMaker 3.9 -0.5 3.2 -0.5 3.2 0.9 - BarrierMaker 3.8 1 4.7 1.9 - BarrierMaker 5 0.6 4.2 1.4 - BarrierMaker 6.8 0.1 6.8 0.9 6.4 1.3 6.4 2.3 5.8 2.9 - BarrierMaker 8.5 2.8 7.9 2.8 - BarrierMaker 7.2 2.5 7.2 3.2 7.8 3.8 7.8 3.9 - BarrierMaker 7.5 0.5 7.5 1 7.8 1.3 7.8 1.9 - BarrierMaker 5.5 1.5 5.5 1.8 5.8 1.8 - BarrierMaker 2.5 1 2 1.5 2 2.2 1.7 2.5 1.7 3.4 1.9 3.6 2.3 3.6 2.7 3.2 2.7 2.8 2.4 2.5 2.4 1.6 2.5 1.5 2.6 1.5 2.7 1.4 2.7 1.1 2.6 1 2.5 1 - BarrierMaker 2 -1.5 2.5 -1 2.5 5.96046e-008 - BarrierMaker 4.2 2.3 3.7 1.8 3.4 1.8 3.3 1.9 3.3 2.5 3.7 2.9 - BarrierMaker 1 0.5 0.5 1 - BarrierMaker 1.7 -0.4 1.8 -0.4 1.9 -0.3 1.9 0.3 1.8 0.4 1.7 0.4 1.4 0.1 1.4 -0.1 1.7 -0.4 - Turret 1 6.7 0.2 - Turret 1 9.4 3.6 - BarrierMaker 8.7 4.4 8.7 4.2 8.6 4.1 8.3 4.1 - ForceFieldProjector 1 4.2 0.1 - ForceFieldProjector 1 7.4 0.7 - LoadoutZone 1 3.7 -0.4 3.7 0.4 3.3 0.4 3.3 -0.4 - GoalZone -1 0.9 5.9 0.0999999 5.9 0.0999999 5.1 0.9 5.1 - LoadoutZone 2 5.1 8.4 3.9 8.4 4.1 8 4.9 8 - Spawn 2 4.7 8.6 - Spawn 2 5.1 8.8 - Spawn 2 4.5 9 - Spawn 2 3.9 8.8 - Spawn 2 4.3 8.6 - Spawn 2 3.4 9 - Spawn 2 3.9 9.3 - Spawn 2 4.5 9.3 - Spawn 2 5.1 9.3 - Spawn 2 5.6 9 - BarrierMaker 5 7.5 4.8 7.5 4.7 7.3 4.3 7.3 4.2 7.5 4 7.5 3.5 8.5 3 8.5 3 9.5 6 9.5 6 8.5 5.5 8.5 5 7.5 - Teleporter 4.5 7.7 3.8743e-007 8 - BarrierMaker 1.5 5.6 1.5 6.5 0.5 7.5 0.5 8.5 -1.5 8.5 -2.5 9.5 -4.5 9.5 -5 9 -5 7.8 -4.5 7.3 -4.5 6.5 -3.5 5.5 -3.5 3.5 -5.5 1.5 -5.6 1.5 - GoalZone -1 -3.1 8.9 -3.9 8.9 -3.9 8.1 -3.1 8.1 - BarrierMaker 1 4.5 0.3 4.5 -0.2 4 - BarrierMaker 0.5 3.9 0.5 3.2 -0.9 3.2 - BarrierMaker -1 3.8 -1.9 4.7 - BarrierMaker -0.6 5 -1.4 4.2 - BarrierMaker -0.1 6.8 -0.9 6.8 -1.3 6.4 -2.3 6.4 -2.9 5.8 - BarrierMaker -2.8 8.5 -2.8 7.9 - BarrierMaker -2.5 7.2 -3.2 7.2 -3.8 7.8 -3.9 7.8 - BarrierMaker -0.500001 7.5 -1 7.5 -1.3 7.8 -1.9 7.8 - BarrierMaker -1.5 5.5 -1.8 5.5 -1.8 5.8 - BarrierMaker -1 2.5 -1.5 2 -2.2 2 -2.5 1.7 -3.4 1.7 -3.6 1.9 -3.6 2.3 -3.2 2.7 -2.8 2.7 -2.5 2.4 -1.6 2.4 -1.5 2.5 -1.5 2.6 -1.4 2.7 -1.1 2.7 -1 2.6 -1 2.5 - BarrierMaker 1.5 2 1 2.5 -5.96046e-008 2.5 - BarrierMaker -2.3 4.2 -1.8 3.7 -1.8 3.4 -1.9 3.3 -2.5 3.3 -2.9 3.7 - BarrierMaker -0.5 1 -1 0.5 - BarrierMaker 0.4 1.7 0.4 1.8 0.3 1.9 -0.3 1.9 -0.4 1.8 -0.4 1.7 -0.1 1.4 0.1 1.4 0.4 1.7 - Turret 2 -0.2 6.7 - Turret 2 -3.6 9.4 - BarrierMaker -4.4 8.7 -4.2 8.7 -4.1 8.6 -4.1 8.3 - ForceFieldProjector 2 -0.0999998 4.2 - ForceFieldProjector 2 -0.7 7.4 - LoadoutZone 2 0.4 3.7 -0.4 3.7 -0.4 3.3 0.4 3.3 - GoalZone -1 -5.9 0.899999 -5.9 0.0999994 -5.1 0.1 -5.1 0.9 - LoadoutZone 3 -8.4 5.1 -8.4 3.9 -8 4.1 -8 4.9 - Spawn 3 -8.6 4.7 - Spawn 3 -8.8 5.1 - Spawn 3 -9 4.5 - Spawn 3 -8.8 3.9 - Spawn 3 -8.6 4.3 - Spawn 3 -9 3.4 - Spawn 3 -9.3 3.9 - Spawn 3 -9.3 4.5 - Spawn 3 -9.3 5.1 - Spawn 3 -9 5.6 - BarrierMaker -7.5 5 -7.5 4.8 -7.3 4.7 -7.3 4.3 -7.5 4.2 -7.5 4 -8.5 3.5 -8.5 3 -9.5 3 -9.5 6 -8.5 6 -8.5 5.5 -7.5 5 - Teleporter -7.7 4.5 -8 1.19209e-007 - BarrierMaker -5.6 1.5 -6.5 1.5 -7.5 0.5 -8.5 0.499999 -8.5 -1.5 -9.5 -2.5 -9.5 -4.5 -9 -5 -7.8 -5 -7.3 -4.5 -6.5 -4.5 -5.5 -3.5 -3.5 -3.5 -1.6 -5.4 - GoalZone -1 -8.9 -3.1 -8.9 -3.9 -8.1 -3.9 -8.1 -3.1 - BarrierMaker -4.5 1 -4.5 0.299999 -4 -0.2 - BarrierMaker -3.9 0.5 -3.2 0.5 -3.2 -0.9 - BarrierMaker -3.8 -1 -4.7 -1.9 - BarrierMaker -5 -0.6 -4.2 -1.4 - BarrierMaker -6.8 -0.1 -6.8 -0.9 -6.4 -1.3 -6.4 -2.3 -5.8 -2.9 - BarrierMaker -8.5 -2.8 -7.9 -2.8 - BarrierMaker -7.2 -2.5 -7.2 -3.2 -7.8 -3.8 -7.8 -3.9 - BarrierMaker -7.5 -0.5 -7.5 -1 -7.8 -1.3 -7.8 -1.9 - BarrierMaker -5.5 -1.5 -5.5 -1.8 -5.8 -1.8 - BarrierMaker -2.5 -1 -2 -1.5 -2 -2.2 -1.7 -2.5 -1.7 -3.4 -1.9 -3.6 -2.3 -3.6 -2.7 -3.2 -2.7 -2.8 -2.4 -2.5 -2.4 -1.6 -2.5 -1.5 -2.6 -1.5 -2.7 -1.4 -2.7 -1.1 -2.6 -1 -2.5 -1 - BarrierMaker -2 1.5 -2.5 1 -2.5 2.98023e-008 - BarrierMaker -4.2 -2.3 -3.7 -1.8 -3.4 -1.8 -3.3 -1.9 -3.3 -2.5 -3.7 -2.9 - BarrierMaker -1 -0.5 -0.5 -1 - BarrierMaker -1.7 0.4 -1.8 0.4 -1.9 0.3 -1.9 -0.3 -1.8 -0.4 -1.7 -0.4 -1.4 -0.1 -1.4 0.1 -1.7 0.4 - Turret 3 -6.7 -0.200001 - Turret 3 -9.4 -3.6 - BarrierMaker -8.7 -4.4 -8.7 -4.2 -8.6 -4.1 -8.3 -4.1 - ForceFieldProjector 3 -4.2 -0.1 - ForceFieldProjector 3 -7.4 -0.7 - LoadoutZone 3 -3.7 0.4 -3.7 -0.4 -3.3 -0.4 -3.3 0.4 - Turret -1 -1.3 0 - Turret -1 1.3 0 - Turret -1 0 -1.3 - Turret -1 0 1.3 - ForceFieldProjector -1 3.7 3.4 - ForceFieldProjector -1 -3.4 3.7 - ForceFieldProjector -1 -3.7 -3.4 ForceFieldProjector -1 3.4 -3.7 ! BarrierMaker 0.6 -0.2 0.6 0.2 ! BarrierMaker 0.2 0.6 -0.2 0.6 ! BarrierMaker -0.6 0.2 -0.6 -0.2 ! BarrierMaker -0.2 -0.6 0.2 -0.6 --- 38,116 ---- ForceFieldProjector 0 0.7 -7.4 LoadoutZone 0 -0.4 -3.7 0.4 -3.7 0.4 -3.3 -0.4 -3.3 ForceFieldProjector -1 3.4 -3.7 ! GoalZone -1 5.55955 -0.629423 5.15955 0.0633973 4.46673 -0.336603 4.86673 -1.02942 ! LoadoutZone 1 9.82461 -3.01673 9.22461 -1.9775 8.9782 -2.3507 9.3782 -3.04352 ! Spawn 1 9.79782 -2.57032 ! Spawn 1 10.171 -2.81673 ! Spawn 1 10.0442 -2.19711 ! Spawn 1 9.57102 -1.7775 ! Spawn 1 9.59782 -2.22391 ! Spawn 1 9.49423 -1.24449 ! Spawn 1 10.004 -1.5275 ! Spawn 1 10.304 -2.04711 ! Spawn 1 10.604 -2.56673 ! Spawn 1 10.5942 -3.14974 ! BarrierMaker 8.99519 -3.38013 8.89519 -3.20692 8.67198 -3.22032 8.47199 -2.87391 8.59519 -2.68731 8.49519 -2.5141 9.11121 -1.58109 8.86121 -1.14808 9.72724 -0.648077 11.2272 -3.24615 10.3612 -3.74615 10.1112 -3.31314 8.99519 -3.38013 ! Teleporter 8.9184 -2.84711 6.9282 1.2 ! BarrierMaker 5.4 -1.6 6.37916 -0.849038 6.74519 0.516987 7.61121 1.01699 6.61121 2.74904 6.97724 4.11506 5.97724 5.84711 5.29423 6.03012 4.255 5.43013 4.07199 4.74711 3.37916 4.34711 3.01314 2.98109 1.28109 1.98109 -1.3 2.7 ! GoalZone -1 6.15763 4.33468 5.75763 5.0275 5.06481 4.6275 5.46481 3.93468 ! BarrierMaker 4.39711 -1.41603 4.04711 -0.809808 3.3641 -0.626795 ! BarrierMaker 3.6275 -1.28301 3.02128 -1.63301 2.32128 -0.420578 ! BarrierMaker 2.7909 -0.0339749 3.12032 1.19545 ! BarrierMaker 4.03013 0.219615 2.93731 0.512435 ! BarrierMaker 5.83897 0.686602 5.43897 1.37942 4.89256 1.52583 4.39256 2.39186 3.57295 2.61147 ! BarrierMaker 5.96122 3.87487 5.4416 3.57487 ! BarrierMaker 4.98538 2.96506 4.63538 3.57128 4.855 4.3909 4.805 4.4775 ! BarrierMaker 6.24519 1.38301 5.99519 1.81603 6.105 2.22583 5.805 2.74545 ! BarrierMaker 4.01314 1.24904 3.86314 1.50885 4.12295 1.65885 ! BarrierMaker 2.48731 1.29186 2.30429 0.608846 2.04449 0.458845 1.90788 0.495448 1.60788 1.01506 1.75429 1.56147 ! Turret 1 5.70237 0.723205 ! Turret 1 6.34064 5.01769 ! BarrierMaker 5.33442 5.36051 5.43442 5.1873 5.39782 5.0507 5.13801 4.9007 ! ForceFieldProjector 1 3.58731 -0.613398 ! ForceFieldProjector 1 6.05859 1.50622 ! LoadoutZone 1 3.40429 -1.29641 3.00429 -0.60359 2.65788 -0.80359 3.05788 -1.49641 ! ForceFieldProjector -1 1.50429 1.99449 ! GoalZone -1 -2.15955 2.22942 -2.55955 1.5366 -1.86673 1.1366 -1.46673 1.82942 ! LoadoutZone 2 -2.22461 7.11673 -2.82461 6.0775 -2.3782 6.0507 -1.9782 6.74352 ! Spawn 2 -2.59782 6.87032 ! Spawn 2 -2.57102 7.31673 ! Spawn 2 -3.04423 6.89711 ! Spawn 2 -3.17102 6.2775 ! Spawn 2 -2.79782 6.52391 ! Spawn 2 -3.59423 5.94448 ! Spawn 2 -3.60403 6.5275 ! Spawn 2 -3.30404 7.04711 ! Spawn 2 -3.00404 7.56673 ! Spawn 2 -2.49423 7.84974 ! BarrierMaker -1.49519 6.58012 -1.59519 6.40692 -1.47198 6.22031 -1.67199 5.87391 -1.89519 5.8873 -1.99519 5.7141 -3.11121 5.78109 -3.36121 5.34807 -4.22724 5.84807 -2.72724 8.44615 -1.86121 7.94615 -2.11122 7.51314 -1.49519 6.58012 ! Teleporter -1.9184 6.24711 -4.4282 2.5 ! BarrierMaker -1.3 2.7 -2.37916 3.04904 -3.74519 2.68301 -4.61121 3.18301 -5.61121 1.45096 -6.97724 1.08493 -7.97724 -0.647115 -7.79422 -1.33013 -6.755 -1.93013 -6.07199 -1.74711 -5.37916 -2.14711 -4.01314 -1.78109 -2.28109 -2.78109 -1.7 -5.1 ! GoalZone -1 -6.75763 0.265321 -7.15763 -0.427499 -6.4648 -0.827499 -6.0648 -0.134678 ! BarrierMaker -0.897113 1.61602 -1.24711 1.00981 -1.0641 0.326794 ! BarrierMaker -0.627498 0.883012 -0.0212805 0.533012 -0.72128 -0.679423 ! BarrierMaker -1.2909 -0.466026 -2.52032 -0.79545 ! BarrierMaker -2.13013 0.480385 -1.83731 -0.612436 ! BarrierMaker -3.43897 1.8134 -3.83897 1.12058 -3.69256 0.574166 -4.19256 -0.291859 -3.97295 -1.11147 ! BarrierMaker -6.26121 0.325129 -5.7416 0.0251285 ! BarrierMaker -4.98538 -0.0650647 -5.33538 -0.671283 -6.155 -0.890896 -6.205 -0.977499 ! BarrierMaker -4.24519 1.81699 -4.49519 1.38397 -4.905 1.27417 -5.205 0.75455 ! BarrierMaker -3.01314 -0.0490381 -3.16314 -0.308846 -3.42295 -0.158846 ! BarrierMaker -2.28731 -1.39186 -1.60429 -1.20885 -1.34448 -1.35885 -1.30788 -1.49545 -1.60788 -2.01506 -2.15429 -2.16147 ! Turret 2 -3.40237 1.6768 ! Turret 2 -7.44064 0.0823084 ! BarrierMaker -7.23442 -0.960512 -7.13442 -0.787307 -6.99782 -0.750704 -6.73801 -0.900704 ! ForceFieldProjector 2 -1.18731 0.513397 ! ForceFieldProjector 2 -4.25859 1.59378 ! LoadoutZone 2 -0.504293 0.696409 -0.904293 0.00358891 -0.557883 -0.196411 -0.157883 0.496409 ! ForceFieldProjector -1 -2.40429 -2.59449 ! BarrierMaker -0.5 -1.8 0.1 -0.7 0.4 -0.7 ! BarrierMaker 1.4364 -2.33934 0.234315 -2.69289 0.0221825 -2.48076 ! BarrierMaker 1.01924 -0.959441 2.11924 -1.55944 2.11924 -1.85944 ! BarrierMaker 2.7 -2.7 2.7 -2.2 2.9 -2.2 3.1 -2.1 ! BarrierMaker 3.4 -2.6 3.8 -2.3 3.8 -1.9 4.1 -1.9 ! BarrierMaker 0.6 1.3 0.6 0.9 1.1 0.7 1.4 0.3 1.6 -0.1 ! BarrierMaker 0.9 0.3 0.5 -0.2 0.2 -0.1 0.1 -0.2 ! Turret -1 -0.3 -1.2 ! Turret -1 1.7 -1.2 ! Turret -1 0.9 -2.6 --- NEW FILE: retrieve3.txt --- RetrieveGameType 10 25 Team Blue 0 0 1 Team Red 1 0 0 LevelName "The Law of Fives" GridSize 350 LoadoutZone 0 8 -4.6 7.7 -4.6 7.7 -3.4 8 -3.4 Spawn 0 8.2 -4 Spawn 0 8.2 -4.3 Spawn 0 8.2 -4.6 GoalZone 0 4.5 -5.9 4.7 -5.9 4.7 -6.1 4.5 -6.1 FlagItem -1 -3.9 -3.4 BarrierMaker -6.5 0 -6.5 -2 -4.5 -4 -2.5 -4 -1.5 -3 0.5 -3 1.5 -5 3.5 -7 6.5 -7 8.5 -5 8.5 -3 6.5 -1 6.5 0 BarrierMaker 4.5 -6.3 5.5 -6.3 5.8 -6 5.8 -5.6 GoalZone 0 5.3 -5.9 5.5 -5.9 5.5 -6.1 5.3 -6.1 GoalZone 0 4.9 -5.5 5.1 -5.5 5.1 -5.7 4.9 -5.7 GoalZone 0 5.3 -5.1 5.5 -5.1 5.5 -5.3 5.3 -5.3 GoalZone 0 4.5 -5.1 4.7 -5.1 4.7 -5.3 4.5 -5.3 BarrierMaker 3.9 -5.7 3.9 -5 4.3 -4.6 4.5 -4.6 BarrierMaker 6.6 -6 6.6 -5.4 6 -4.8 5.6 -4.8 BarrierMaker 4.4 -4.2 6.2 -4.2 6.5 -4.5 BarrierMaker 6.1 -6.3 6.1 -6.6 5.9 -6.8 5.6 -6.8 5.4 -7 BarrierMaker 3.8 -6.5 3.2 -5.9 3.2 -5.3 2.7 -4.9 2.7 -4.5 3.2 -4 BarrierMaker 3.4 -4.6 3.8 -4.2 3.8 -3.7 Spawn 0 8.2 -3.7 Spawn 0 8.2 -3.4 BarrierMaker 7.8 -5 7.6 -4.8 7.6 -3.2 7.8 -3 BarrierMaker 7.1 -4.7 7.1 -4 6.5 -3.4 5.9 -3.4 BarrierMaker 4.6 -3.6 4.4 -3.6 4 -3.1 4 -2.9 4.1 -2.8 4.8 -2.8 5 -3 5 -3.1 4.6 -3.6 BarrierMaker 5.5 -3.6 5.5 -3 6 -2.5 6.5 -2.5 6.6 -2.6 6.9 -2.6 7.1 -2.8 BarrierMaker -4.2 -2.7 -4.5 -2.7 -4.8 -2.4 -4.8 -1.9 -4.5 -1.6 -4.2 -1.6 -3.9 -1.9 -3.9 -2.4 -4.2 -2.7 BarrierMaker -2.7 -1.9 -3 -1.9 -3.3 -1.6 -3.3 -1.1 -3 -0.8 -2.7 -0.8 -2.4 -1.1 -2.4 -1.6 -2.7 -1.9 BarrierMaker -2.8 -3.5 -3.1 -3.5 -3.4 -3.2 -3.4 -2.7 -3.1 -2.4 -2.8 -2.4 -2.5 -2.7 -2.5 -3.2 -2.8 -3.5 BarrierMaker -1.2 -2.3 -1.5 -2.3 -1.8 -2 -1.8 -1.5 -1.5 -1.2 -1.2 -1.2 -0.9 -1.5 -0.9 -2 -1.2 -2.3 BarrierMaker -4 -1.1 -4.3 -1.1 -4.6 -0.8 -4.6 -0.3 -4.3 -5.96046e-008 -4 -5.96046e-008 -3.7 -0.3 -3.7 -0.8 -4 -1.1 BarrierMaker -5.5 -1.7 -5.8 -1.7 -6.1 -1.4 -6.1 -0.9 -5.8 -0.6 -5.5 -0.6 -5.2 -0.9 -5.2 -1.4 -5.5 -1.7 FlagItem -1 0 -9.68575e-008 BarrierMaker 2 -4 3 -3 3 -2.6 3.6 -2 5 -2 5.8 -1.3 5.8 -1 BarrierMaker 1.7 -3 1.5 -3 1.1 -2.4 1.1 -2.2 1.2 -2.1 1.9 -2.1 2 -2.2 2 -2.4 1.7 -3 BarrierMaker 1.4 -0.8 1.6 -0.8 2 -1.4 2 -1.6 1.9 -1.7 1.2 -1.7 1.1 -1.6 1.1 -1.4 1.4 -0.8 BarrierMaker 3.4 -1.6 3.4 -1.4 2.8 -1 2.6 -1 2.5 -1.1 2.5 -1.8 2.6 -1.9 2.8 -1.9 3.4 -1.6 BarrierMaker 3.6 -1 3.1 -0.5 2.6 -0.5 BarrierMaker 4 0 3.3 -0.7 BarrierMaker 4 -0.6 4.5 -1.1 4.9 -0.7 BarrierMaker 4 -1.2 4 -1.6 4.4 -1.6 BarrierMaker 4.5 -0.4 4.9 0 5.1 0 5.5 -0.4 BarrierMaker -0.4 -2.3 -0.4 -0.6 -0.2 -0.6 -0.2 -2.3 -0.4 -2.3 BarrierMaker 0.6 -2.3 0.5 -2.3 0.3 -2.1 0.3 -1.7 0.7 -1.3 0.7 -0.8 0.3 -0.4 0.3 -0.2 0.5 0 1.1 0 1.4 -0.3 1.8 -0.3 2.1 0 2.5 0 FlagItem -1 6 0 Turret 0 5.1 -4.1 Turret 0 2.6 -4.7 ForceFieldProjector 0 2.5 -3.6 Turret 0 4.2 -4.9 ForceFieldProjector 0 5.6 -4.3 Turret -1 -2.5 -1.8 Turret -1 -4.7 -1.6 ForceFieldProjector -1 0.5 -2.4 RepairItem 4.2 -1.4 LoadoutZone 1 -8 4.6 -7.7 4.6 -7.7 3.4 -8 3.4 Spawn 1 -8.2 4 Spawn 1 -8.2 4.3 Spawn 1 -8.2 4.6 GoalZone 1 -4.5 5.9 -4.7 5.9 -4.7 6.1 -4.5 6.1 FlagItem -1 3.9 3.4 BarrierMaker 6.5 0 6.5 2 4.5 4 2.5 4 1.5 3 -0.5 3 -1.5 5 -3.5 7 -6.5 7 -8.5 5 -8.5 3 -6.5 1 -6.5 0 BarrierMaker -4.5 6.3 -5.5 6.3 -5.8 6 -5.8 5.6 GoalZone 1 -5.3 5.9 -5.5 5.9 -5.5 6.1 -5.3 6.1 GoalZone 1 -4.9 5.5 -5.1 5.5 -5.1 5.7 -4.9 5.7 GoalZone 1 -5.3 5.1 -5.5 5.1 -5.5 5.3 -5.3 5.3 GoalZone 1 -4.5 5.1 -4.7 5.1 -4.7 5.3 -4.5 5.3 BarrierMaker -3.9 5.7 -3.9 5 -4.3 4.6 -4.5 4.6 BarrierMaker -6.6 6 -6.6 5.4 -6 4.8 -5.6 4.8 BarrierMaker -4.4 4.2 -6.2 4.2 -6.5 4.5 BarrierMaker -6.1 6.3 -6.1 6.6 -5.9 6.8 -5.6 6.8 -5.4 7 BarrierMaker -3.8 6.5 -3.2 5.9 -3.2 5.3 -2.7 4.9 -2.7 4.5 -3.2 4 BarrierMaker -3.4 4.6 -3.8 4.2 -3.8 3.7 Spawn 1 -8.2 3.7 Spawn 1 -8.2 3.4 BarrierMaker -7.8 5 -7.6 4.8 -7.6 3.2 -7.8 3 BarrierMaker -7.1 4.7 -7.1 4 -6.5 3.4 -5.9 3.4 BarrierMaker -4.6 3.6 -4.4 3.6 -4 3.1 -4 2.9 -4.1 2.8 -4.8 2.8 -5 3 -5 3.1 -4.6 3.6 BarrierMaker -5.5 3.6 -5.5 3 -6 2.5 -6.5 2.5 -6.6 2.6 -6.9 2.6 -7.1 2.8 BarrierMaker 4.2 2.7 4.5 2.7 4.8 2.4 4.8 1.9 4.5 1.6 4.2 1.6 3.9 1.9 3.9 2.4 4.2 2.7 BarrierMaker 2.7 1.9 3 1.9 3.3 1.6 3.3 1.1 3 0.8 2.7 0.8 2.4 1.1 2.4 1.6 2.7 1.9 BarrierMaker 2.8 3.5 3.1 3.5 3.4 3.2 3.4 2.7 3.1 2.4 2.8 2.4 2.5 2.7 2.5 3.2 2.8 3.5 BarrierMaker 1.2 2.3 1.5 2.3 1.8 2 1.8 1.5 1.5 1.2 1.2 1.2 0.9 1.5 0.9 2 1.2 2.3 BarrierMaker 4 1.1 4.3 1.1 4.6 0.8 4.6 0.3 4.3 0 4 0 3.7 0.3 3.7 0.8 4 1.1 BarrierMaker 5.5 1.7 5.8 1.7 6.1 1.4 6.1 0.9 5.8 0.6 5.5 0.6 5.2 0.9 5.2 1.4 5.5 1.7 BarrierMaker -2 4 -3 3 -3 2.6 -3.6 2 -5 2 -5.8 1.3 -5.8 1 BarrierMaker -1.7 3 -1.5 3 -1.1 2.4 -1.1 2.2 -1.2 2.1 -1.9 2.1 -2 2.2 -2 2.4 -1.7 3 BarrierMaker -1.4 0.8 -1.6 0.8 -2 1.4 -2 1.6 -1.9 1.7 -1.2 1.7 -1.1 1.6 -1.1 1.4 -1.4 0.8 BarrierMaker -3.4 1.6 -3.4 1.4 -2.8 1 -2.6 1 -2.5 1.1 -2.5 1.8 -2.6 1.9 -2.8 1.9 -3.4 1.6 BarrierMaker -3.6 1 -3.1 0.5 -2.6 0.5 BarrierMaker -4 0 -3.3 0.7 BarrierMaker -4 0.6 -4.5 1.1 -4.9 0.7 BarrierMaker -4 1.2 -4 1.6 -4.4 1.6 BarrierMaker -4.5 0.4 -4.9 0 -5.1 0 -5.5 0.4 BarrierMaker 0.4 2.3 0.4 0.6 0.2 0.6 0.2 2.3 0.4 2.3 BarrierMaker -0.6 2.3 -0.5 2.3 -0.3 2.1 -0.3 1.7 -0.7 1.3 -0.7 0.8 -0.3 0.4 -0.3 0.2 -0.5 0 -1.1 0 -1.4 0.3 -1.8 0.3 -2.1 0 -2.5 0 FlagItem -1 -6 0 Turret 1 -5.1 4.1 Turret 1 -2.6 4.7 ForceFieldProjector 1 -2.5 3.6 Turret 1 -4.2 4.9 ForceFieldProjector 1 -5.6 4.3 Turret -1 2.5 1.8 Turret -1 4.7 1.6 ForceFieldProjector -1 -0.5 2.4 RepairItem -4.2 1.4 |
From: Mark F. <mar...@us...> - 2004-10-05 00:16:47
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16345/zap Modified Files: CTFGame.cpp CTFGame.h HTFGame.cpp footballGame.cpp game.h gameType.cpp item.cpp item.h retrieveGame.cpp soccerGame.cpp soccerGame.h Log Message: Updated all team game types to use objective arrows Arrows now rotate around ellipse on screen, not edges of screen. Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** gameType.cpp 4 Oct 2004 19:23:59 -0000 1.60 --- gameType.cpp 5 Oct 2004 00:16:34 -0000 1.61 *************** *** 245,248 **** --- 245,249 ---- Point center(400, 300); Point arrowDir = rp - center; + /* if(rp.x > UserInterface::horizMargin && rp.x < UserInterface::canvasWidth - UserInterface::horizMargin && *************** *** 251,255 **** return; - Point np = rp; if(rp.x < UserInterface::horizMargin) rp.x = UserInterface::horizMargin; --- 252,255 ---- *************** *** 260,263 **** --- 260,274 ---- if(rp.y > UserInterface::canvasHeight - UserInterface::vertMargin) rp.y = UserInterface::canvasHeight - UserInterface::vertMargin; + */ + + F32 er = arrowDir.x * arrowDir.x / (350 * 350) + arrowDir.y * arrowDir.y / (250 * 250); + if(er < 1) + return; + Point np = rp; + + er = sqrt(er); + rp.x = arrowDir.x / er; + rp.y = arrowDir.y / er; + rp += center; F32 dist = (np - rp).len(); *************** *** 265,269 **** arrowDir.normalize(); Point crossVec(arrowDir.y, -arrowDir.x); ! F32 alpha = (1 - gClientGame->getCommanderZoomFraction()) * 0.8; if(!alpha) return; --- 276,280 ---- arrowDir.normalize(); Point crossVec(arrowDir.y, -arrowDir.x); ! F32 alpha = (1 - gClientGame->getCommanderZoomFraction()) * 0.6; if(!alpha) return; *************** *** 275,287 **** Point p3 = rp - arrowDir * 23 - crossVec * 8; - glColor3f(0,0,0); - glLineWidth(4); - glBegin(GL_LINE_LOOP); - glVertex(rp); - glVertex(p2); - glVertex(p3); - glEnd(); - glLineWidth(2); - glEnable(GL_BLEND); glColor(c * 0.7, alpha); --- 286,289 ---- Index: soccerGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/soccerGame.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** soccerGame.cpp 1 Jul 2004 23:07:46 -0000 1.19 --- soccerGame.cpp 5 Oct 2004 00:16:34 -0000 1.20 *************** *** 68,71 **** --- 68,81 ---- } + void SoccerGameType::addZone(GoalZone *theZone) + { + mGoals.push_back(theZone); + } + + void SoccerGameType::setBall(SoccerBallItem *theBall) + { + mBall = theBall; + } + void SoccerGameType::scoreGoal(StringTableEntry playerName, U32 goalTeamIndex) { *************** *** 93,96 **** --- 103,122 ---- } + void SoccerGameType::renderInterfaceOverlay(bool scoreboardVisible) + { + Parent::renderInterfaceOverlay(scoreboardVisible); + Ship *u = (Ship *) gClientGame->getConnectionToServer()->getControlObject(); + if(!u) + return; + + for(S32 i = 0; i < mGoals.size(); i++) + { + if(mGoals[i]->getTeam() != u->getTeam()) + renderObjectiveArrow(mGoals[i], getTeamColor(mGoals[i]->getTeam())); + } + if(mBall.isValid()) + renderObjectiveArrow(mBall, getTeamColor(-1)); + } + TNL_IMPLEMENT_NETOBJECT(SoccerBallItem); *************** *** 108,111 **** --- 134,144 ---- } + void SoccerBallItem::onAddedToGame(Game *theGame) + { + if(!isGhost()) + theGame->getGameType()->addItemOfInterest(this); + ((SoccerGameType *) theGame->getGameType())->setBall(this); + } + void SoccerBallItem::renderItem(Point pos) { Index: HTFGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/HTFGame.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** HTFGame.cpp 28 Sep 2004 18:45:25 -0000 1.2 --- HTFGame.cpp 5 Oct 2004 00:16:34 -0000 1.3 *************** *** 41,46 **** Vector<GoalZone *> mZones; ! Vector<FlagItem *> mFlags; ! Vector<GoalZone *> mFlagZones; enum { CapScore = 2, --- 41,45 ---- Vector<GoalZone *> mZones; ! Vector<SafePtr<FlagItem> > mFlags; enum { CapScore = 2, *************** *** 52,57 **** void addFlag(FlagItem *theFlag) { ! mFlags.push_back(theFlag); ! mFlagZones.push_back(NULL); } --- 51,68 ---- void addFlag(FlagItem *theFlag) { ! S32 i; ! for(i = 0; i < mFlags.size(); i++) ! { ! if(mFlags[i] == NULL) ! { ! mFlags[i] = theFlag; ! break; ! } ! } ! if(i == mFlags.size()) ! mFlags.push_back(theFlag); ! ! if(!isGhost()) ! addItemOfInterest(theFlag); } *************** *** 80,84 **** // see if this flag is already in a flag zone owned by the ship's team ! if(mFlagZones[flagIndex] != NULL && mFlagZones[flagIndex]->getTeam() == theShip->getTeam()) return; --- 91,95 ---- // see if this flag is already in a flag zone owned by the ship's team ! if(theFlag->getZone() != NULL && theFlag->getZone()->getTeam() == theShip->getTeam()) return; *************** *** 88,97 **** S32 teamIndex; ! if(mFlagZones[flagIndex] == NULL) teamIndex = cl->teamId; else { r = stealString; ! teamIndex = mFlagZones[flagIndex]->getTeam(); } Vector<StringTableEntry> e; --- 99,108 ---- S32 teamIndex; ! if(theFlag->getZone() == NULL) teamIndex = cl->teamId; else { r = stealString; ! teamIndex = theFlag->getZone()->getTeam(); } Vector<StringTableEntry> e; *************** *** 108,112 **** GameConnection::ColorNuclearGreen, SFXFlagSnatch, r, e); theFlag->mountToShip(theShip); ! mFlagZones[flagIndex] = NULL; } --- 119,123 ---- GameConnection::ColorNuclearGreen, SFXFlagSnatch, r, e); theFlag->mountToShip(theShip); ! theFlag->setZone(NULL); } *************** *** 140,145 **** // see if this zone already has a flag in it... ! for(S32 i = 0; i < mFlagZones.size(); i++) ! if(mFlagZones[i] == z) return; --- 151,156 ---- // see if this zone already has a flag in it... ! for(S32 i = 0; i < mFlags.size(); i++) ! if(mFlags[i]->getZone() == z) return; *************** *** 179,183 **** break; ! mFlagZones[flagIndex] = z; mountedFlag->setActualPos(z->getExtent().getCenter()); --- 190,194 ---- break; ! mFlags[flagIndex]->setZone(z); mountedFlag->setActualPos(z->getExtent().getCenter()); *************** *** 196,202 **** for(S32 flagIndex = 0; flagIndex < mFlags.size(); flagIndex++) { ! if(mFlagZones[flagIndex] != NULL) { ! S32 team = mFlagZones[flagIndex]->getTeam(); setTeamScore(team, mTeams[team].score + 1); } --- 207,213 ---- for(S32 flagIndex = 0; flagIndex < mFlags.size(); flagIndex++) { ! if(mFlags[flagIndex]->getZone() != NULL) { ! S32 team = mFlags[flagIndex]->getZone()->getTeam(); setTeamScore(team, mTeams[team].score + 1); } *************** *** 205,208 **** --- 216,293 ---- } + void performProxyScopeQuery(GameObject *scopeObject, GameConnection *connection) + { + Parent::performProxyScopeQuery(scopeObject, connection); + S32 uTeam = scopeObject->getTeam(); + + for(S32 i = 0; i < mFlags.size(); i++) + { + if(mFlags[i]->isAtHome() || mFlags[i]->getZone()) + connection->objectInScope(mFlags[i]); + else + { + Ship *mount = mFlags[i]->getMount(); + if(mount && mount->getTeam() == uTeam) + { + connection->objectInScope(mount); + connection->objectInScope(mFlags[i]); + } + } + } + } + + void renderInterfaceOverlay(bool scoreboardVisible) + { + Parent::renderInterfaceOverlay(scoreboardVisible); + Ship *u = (Ship *) gClientGame->getConnectionToServer()->getControlObject(); + if(!u) + return; + bool uFlag = false; + + for(S32 i = 0; i < mFlags.size(); i++) + { + if(mFlags[i].isValid() && mFlags[i]->getMount() == u) + { + for(S32 j = 0; j < mZones.size(); j++) + { + // see if this is one of our zones and that it doesn't have a flag in it. + if(mZones[j]->getTeam() != u->getTeam()) + continue; + S32 k; + for(k = 0; k < mFlags.size(); k++) + { + if(mFlags[k]->getZone() == mZones[j]) + break; + } + if(k == mFlags.size()) + renderObjectiveArrow(mZones[j], getTeamColor(u->getTeam())); + } + uFlag = true; + break; + } + } + + for(S32 i = 0; i < mFlags.size(); i++) + { + if(!mFlags[i].isValid()) + continue; + + if(!mFlags[i]->isMounted() && !uFlag) + { + GoalZone *gz = mFlags[i]->getZone(); + if(gz && gz->getTeam() != u->getTeam()) + renderObjectiveArrow(mFlags[i], getTeamColor(gz->getTeam())); + else if(!gz) + renderObjectiveArrow(mFlags[i], getTeamColor(-1)); + } + else + { + Ship *mount = mFlags[i]->getMount(); + if(mount && mount != u) + renderObjectiveArrow(mount, getTeamColor(mount->getTeam())); + } + } + } + const char *getGameTypeString() { return "Hold the Flag"; } const char *getInstructionString() { return "Hold the flags at your capture zones!"; } Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** game.h 1 Oct 2004 00:21:40 -0000 1.66 --- game.h 5 Oct 2004 00:16:34 -0000 1.67 *************** *** 236,240 **** extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.4" }; --- 236,240 ---- extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.5" }; Index: retrieveGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/retrieveGame.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** retrieveGame.cpp 4 Aug 2004 18:25:27 -0000 1.3 --- retrieveGame.cpp 5 Oct 2004 00:16:34 -0000 1.4 *************** *** 36,42 **** class RetrieveGameType : public GameType { Vector<GoalZone *> mZones; ! Vector<FlagItem *> mFlags; ! Vector<GoalZone *> mFlagZones; enum { CapScore = 2, --- 36,42 ---- class RetrieveGameType : public GameType { + typedef GameType Parent; Vector<GoalZone *> mZones; ! Vector<SafePtr<FlagItem> > mFlags; enum { CapScore = 2, *************** *** 45,50 **** void addFlag(FlagItem *theFlag) { ! mFlags.push_back(theFlag); ! mFlagZones.push_back(NULL); } --- 45,62 ---- void addFlag(FlagItem *theFlag) { ! S32 i; ! for(i = 0; i < mFlags.size(); i++) ! { ! if(mFlags[i] == NULL) ! { ! mFlags[i] = theFlag; ! break; ! } ! } ! if(i == mFlags.size()) ! mFlags.push_back(theFlag); ! ! if(!isGhost()) ! addItemOfInterest(theFlag); } *************** *** 73,77 **** // see if this flag is already in a flag zone owned by the ship's team ! if(mFlagZones[flagIndex] != NULL && mFlagZones[flagIndex]->getTeam() == theShip->getTeam()) return; --- 85,89 ---- // see if this flag is already in a flag zone owned by the ship's team ! if(theFlag->getZone() != NULL && theFlag->getZone()->getTeam() == theShip->getTeam()) return; *************** *** 84,93 **** S32 teamIndex; ! if(mFlagZones[flagIndex] == NULL) teamIndex = cl->teamId; else { r = stealString; ! teamIndex = mFlagZones[flagIndex]->getTeam(); setTeamScore(teamIndex, mTeams[teamIndex].score - 1); } --- 96,105 ---- S32 teamIndex; ! if(theFlag->getZone() == NULL) teamIndex = cl->teamId; else { r = stealString; ! teamIndex = theFlag->getZone()->getTeam(); setTeamScore(teamIndex, mTeams[teamIndex].score - 1); } *************** *** 99,103 **** GameConnection::ColorNuclearGreen, SFXFlagSnatch, r, e); theFlag->mountToShip(theShip); ! mFlagZones[flagIndex] = NULL; } --- 111,115 ---- GameConnection::ColorNuclearGreen, SFXFlagSnatch, r, e); theFlag->mountToShip(theShip); ! theFlag->setZone(NULL); } *************** *** 124,129 **** // see if this zone already has a flag in it... ! for(S32 i = 0; i < mFlagZones.size(); i++) ! if(mFlagZones[i] == z) return; --- 136,141 ---- // see if this zone already has a flag in it... ! for(S32 i = 0; i < mFlags.size(); i++) ! if(mFlags[i]->getZone() == z) return; *************** *** 161,172 **** break; ! mFlagZones[flagIndex] = z; mountedFlag->setActualPos(z->getExtent().getCenter()); cl->score += CapScore; // see if all the flags are owned by one team ! for(S32 i = 0; i < mFlagZones.size(); i++) { ! if(!mFlagZones[i] || mFlagZones[i]->getTeam() != cl->teamId) return; } --- 173,184 ---- break; ! mFlags[flagIndex]->setZone(z); mountedFlag->setActualPos(z->getExtent().getCenter()); cl->score += CapScore; // see if all the flags are owned by one team ! for(S32 i = 0; i < mFlags.size(); i++) { ! if(!mFlags[i]->getZone() || mFlags[i]->getZone()->getTeam() != cl->teamId) return; } *************** *** 181,185 **** for(S32 i = 0; i < mFlags.size(); i++) { ! mFlagZones[i] = NULL; mFlags[i]->sendHome(); } --- 193,197 ---- for(S32 i = 0; i < mFlags.size(); i++) { ! mFlags[i]->setZone(NULL); mFlags[i]->sendHome(); } *************** *** 187,190 **** --- 199,276 ---- } + void performProxyScopeQuery(GameObject *scopeObject, GameConnection *connection) + { + Parent::performProxyScopeQuery(scopeObject, connection); + S32 uTeam = scopeObject->getTeam(); + + for(S32 i = 0; i < mFlags.size(); i++) + { + if(mFlags[i]->isAtHome() || mFlags[i]->getZone()) + connection->objectInScope(mFlags[i]); + else + { + Ship *mount = mFlags[i]->getMount(); + if(mount && mount->getTeam() == uTeam) + { + connection->objectInScope(mount); + connection->objectInScope(mFlags[i]); + } + } + } + } + + void renderInterfaceOverlay(bool scoreboardVisible) + { + Parent::renderInterfaceOverlay(scoreboardVisible); + Ship *u = (Ship *) gClientGame->getConnectionToServer()->getControlObject(); + if(!u) + return; + bool uFlag = false; + + for(S32 i = 0; i < mFlags.size(); i++) + { + if(mFlags[i].isValid() && mFlags[i]->getMount() == u) + { + for(S32 j = 0; j < mZones.size(); j++) + { + // see if this is one of our zones and that it doesn't have a flag in it. + if(mZones[j]->getTeam() != u->getTeam()) + continue; + S32 k; + for(k = 0; k < mFlags.size(); k++) + { + if(mFlags[k]->getZone() == mZones[j]) + break; + } + if(k == mFlags.size()) + renderObjectiveArrow(mZones[j], getTeamColor(u->getTeam())); + } + uFlag = true; + break; + } + } + + for(S32 i = 0; i < mFlags.size(); i++) + { + if(!mFlags[i].isValid()) + continue; + + if(!mFlags[i]->isMounted() && !uFlag) + { + GoalZone *gz = mFlags[i]->getZone(); + if(gz && gz->getTeam() != u->getTeam()) + renderObjectiveArrow(mFlags[i], getTeamColor(gz->getTeam())); + else if(!gz) + renderObjectiveArrow(mFlags[i], getTeamColor(-1)); + } + else + { + Ship *mount = mFlags[i]->getMount(); + if(mount && mount != u) + renderObjectiveArrow(mount, getTeamColor(mount->getTeam())); + } + } + } + const char *getGameTypeString() { return "Retrieve"; } const char *getInstructionString() { return "Bring all the flags to your capture zones!"; } Index: CTFGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** CTFGame.h 4 Aug 2004 18:25:27 -0000 1.16 --- CTFGame.h 5 Oct 2004 00:16:34 -0000 1.17 *************** *** 48,54 **** --- 48,58 ---- }; + Vector<SafePtr<FlagItem> > mFlags; public: + void addFlag(FlagItem *theFlag); void shipTouchFlag(Ship *theShip, FlagItem *theFlag); void flagDropped(Ship *theShip, FlagItem *theFlag); + void performProxyScopeQuery(GameObject *scopeObject, GameConnection *connection); + void renderInterfaceOverlay(bool scoreboardVisible); const char *getGameTypeString() { return "Capture the Flag"; } const char *getInstructionString() { return "Take the opposing team's flag and touch it to your flag!"; } Index: item.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/item.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** item.h 4 Aug 2004 18:25:27 -0000 1.8 --- item.h 5 Oct 2004 00:16:34 -0000 1.9 *************** *** 35,38 **** --- 35,39 ---- class Ship; + class GoalZone; class Item : public MoveObject *************** *** 44,51 **** WarpPositionMask = BIT(2), MountMask = BIT(3), ! FirstFreeMask = BIT(4), }; SafePtr<Ship> mMount; bool mIsMounted; bool mIsCollideable; --- 45,55 ---- WarpPositionMask = BIT(2), MountMask = BIT(3), ! ZoneMask = BIT(4), ! FirstFreeMask = BIT(5), }; SafePtr<Ship> mMount; + SafePtr<GoalZone> mZone; + bool mIsMounted; bool mIsCollideable; *************** *** 65,68 **** --- 69,75 ---- void mountToShip(Ship *theShip); bool isMounted() { return mIsMounted; } + void setZone(GoalZone *theZone); + GoalZone *getZone(); + Ship *getMount(); void dismount(); Index: footballGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/footballGame.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** footballGame.cpp 4 Oct 2004 19:23:59 -0000 1.12 --- footballGame.cpp 5 Oct 2004 00:16:34 -0000 1.13 *************** *** 174,215 **** void ZoneControlGameType::renderInterfaceOverlay(bool scoreboardVisible) { Ship *u = (Ship *) gClientGame->getConnectionToServer()->getControlObject(); ! if(u) { ! if(mFlag.isValid() && mFlag->getMount() == u) ! { ! // the ship has the flag, so render zones not controlled by his team ! for(S32 i = 0; i < mZones.size(); i++) ! if(mZones[i]->getTeam() != u->getTeam()) ! renderObjectiveArrow(mZones[i], getTeamColor(mZones[i]->getTeam())); ! } ! else { ! if(mFlag.isValid()) { ! if(!mFlag->isMounted()) ! renderObjectiveArrow(mFlag, getTeamColor(mFlag->getTeam())); ! else ! { ! Ship *mount = mFlag->getMount(); ! if(mount) ! renderObjectiveArrow(mount, getTeamColor(mount->getTeam())); ! } } ! for(S32 i = 0; i < mZones.size(); i++) { ! if(mZones[i]->didRecentlyChangeTeam() && mZones[i]->getTeam() != -1) ! { ! Color c = getTeamColor(mZones[i]->getTeam()); ! if(mZones[i]->isFlashing()) ! c *= 0.8; ! renderObjectiveArrow(mZones[i], c); - } } } } - - Parent::renderInterfaceOverlay(scoreboardVisible); } --- 174,214 ---- void ZoneControlGameType::renderInterfaceOverlay(bool scoreboardVisible) { + Parent::renderInterfaceOverlay(scoreboardVisible); Ship *u = (Ship *) gClientGame->getConnectionToServer()->getControlObject(); ! if(!u) ! return; ! ! if(mFlag.isValid() && mFlag->getMount() == u) { ! // the ship has the flag, so render zones not controlled by his team ! for(S32 i = 0; i < mZones.size(); i++) ! if(mZones[i]->getTeam() != u->getTeam()) ! renderObjectiveArrow(mZones[i], getTeamColor(mZones[i]->getTeam())); ! } ! else ! { ! if(mFlag.isValid()) { ! if(!mFlag->isMounted()) ! renderObjectiveArrow(mFlag, getTeamColor(mFlag->getTeam())); ! else { ! Ship *mount = mFlag->getMount(); ! if(mount) ! renderObjectiveArrow(mount, getTeamColor(mount->getTeam())); } ! } ! for(S32 i = 0; i < mZones.size(); i++) ! { ! if(mZones[i]->didRecentlyChangeTeam() && mZones[i]->getTeam() != -1) { ! Color c = getTeamColor(mZones[i]->getTeam()); ! if(mZones[i]->isFlashing()) ! c *= 0.8; ! renderObjectiveArrow(mZones[i], c); } } } } Index: CTFGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** CTFGame.cpp 4 Aug 2004 18:25:27 -0000 1.32 --- CTFGame.cpp 5 Oct 2004 00:16:34 -0000 1.33 *************** *** 39,42 **** --- 39,60 ---- TNL_IMPLEMENT_NETOBJECT(CTFGameType); + void CTFGameType::addFlag(FlagItem *theFlag) + { + S32 i; + for(i = 0; i < mFlags.size(); i++) + { + if(mFlags[i] == NULL) + { + mFlags[i] = theFlag; + break; + } + } + if(i == mFlags.size()) + mFlags.push_back(theFlag); + + if(!isGhost()) + addItemOfInterest(theFlag); + } + void CTFGameType::shipTouchFlag(Ship *theShip, FlagItem *theFlag) { *************** *** 109,112 **** --- 127,176 ---- } + void CTFGameType::performProxyScopeQuery(GameObject *scopeObject, GameConnection *connection) + { + Parent::performProxyScopeQuery(scopeObject, connection); + S32 uTeam = scopeObject->getTeam(); + + for(S32 i = 0; i < mFlags.size(); i++) + { + if(mFlags[i]->isAtHome() || mFlags[i]->getZone()) + connection->objectInScope(mFlags[i]); + else + { + Ship *mount = mFlags[i]->getMount(); + if(mount && mount->getTeam() == uTeam) + { + connection->objectInScope(mount); + connection->objectInScope(mFlags[i]); + } + } + } + } + + + void CTFGameType::renderInterfaceOverlay(bool scoreboardVisible) + { + Parent::renderInterfaceOverlay(scoreboardVisible); + Ship *u = (Ship *) gClientGame->getConnectionToServer()->getControlObject(); + if(!u) + return; + + for(S32 i = 0; i < mFlags.size(); i++) + { + if(!mFlags[i].isValid()) + continue; + + if(mFlags[i]->isMounted()) + { + Ship *mount = mFlags[i]->getMount(); + if(mount) + renderObjectiveArrow(mount, getTeamColor(mount->getTeam())); + } + else + renderObjectiveArrow(mFlags[i], getTeamColor(mFlags[i]->getTeam())); + } + } + + }; Index: item.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/item.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** item.cpp 1 Oct 2004 00:21:40 -0000 1.20 --- item.cpp 5 Oct 2004 00:16:34 -0000 1.21 *************** *** 27,31 **** #include "item.h" #include "ship.h" ! #include "glutInclude.h" --- 27,31 ---- #include "item.h" #include "ship.h" ! #include "goalZone.h" #include "glutInclude.h" *************** *** 115,118 **** --- 115,129 ---- } + void Item::setZone(GoalZone *theZone) + { + mZone = theZone; + setMaskBits(ZoneMask); + } + + GoalZone *Item::getZone() + { + return mZone; + } + void Item::idle(GameObject::IdleCallPath path) { *************** *** 164,168 **** stream->writeFlag(updateMask & WarpPositionMask); } ! if(stream->writeFlag(MountMask) && stream->writeFlag(mIsMounted)) { S32 index = connection->getGhostIndex(mMount); --- 175,179 ---- stream->writeFlag(updateMask & WarpPositionMask); } ! if(stream->writeFlag(updateMask & MountMask) && stream->writeFlag(mIsMounted)) { S32 index = connection->getGhostIndex(mMount); *************** *** 170,174 **** stream->writeInt(index, GhostConnection::GhostIdBitSize); else ! retMask = MountMask; } return retMask; --- 181,198 ---- stream->writeInt(index, GhostConnection::GhostIdBitSize); else ! retMask |= MountMask; ! } ! if(stream->writeFlag(updateMask & ZoneMask)) ! { ! if(mZone.isValid()) ! { ! S32 index = connection->getGhostIndex(mZone); ! if(stream->writeFlag(index != -1)) ! stream->writeInt(index, GhostConnection::GhostIdBitSize); ! else ! retMask |= ZoneMask; ! } ! else ! stream->writeFlag(false); } return retMask; *************** *** 203,206 **** --- 227,238 ---- dismount(); } + if(stream->readFlag()) + { + bool hasZone = stream->readFlag(); + if(hasZone) + mZone = (GoalZone *) connection->resolveGhost(stream->readInt(GhostConnection::GhostIdBitSize)); + else + mZone = NULL; + } if(positionChanged) Index: soccerGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/soccerGame.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** soccerGame.h 20 Jul 2004 18:31:43 -0000 1.11 --- soccerGame.h 5 Oct 2004 00:16:34 -0000 1.12 *************** *** 45,50 **** --- 45,56 ---- GoalScore = 5, }; + Vector<GoalZone *> mGoals; + SafePtr<SoccerBallItem> mBall; + public: void scoreGoal(StringTableEntry playerName, U32 goalTeamIndex); + void addZone(GoalZone *theZone); + void setBall(SoccerBallItem *theBall); + void renderInterfaceOverlay(bool scoreboardVisible); enum { *************** *** 74,77 **** --- 80,84 ---- void idle(GameObject::IdleCallPath path); void processArguments(S32 argc, const char **argv); + void onAddedToGame(Game *theGame); bool collide(GameObject *hitObject); |
From: Mark F. <mar...@us...> - 2004-10-04 19:24:28
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9966/zap Modified Files: footballGame.cpp gameType.cpp gameType.h Log Message: Added "Items of interest" to game types to allow carried flags to be added to team's waypoint views Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** gameType.cpp 1 Oct 2004 00:21:40 -0000 1.59 --- gameType.cpp 4 Oct 2004 19:23:59 -0000 1.60 *************** *** 68,71 **** --- 68,72 ---- return; } + queryItemsOfInterest(); if(mScoreboardUpdateTimer.update(deltaT)) { *************** *** 271,278 **** alpha *= dist * 0.02; glEnable(GL_BLEND); glColor(c * 0.7, alpha); - Point p2 = rp - arrowDir * 20 + crossVec * 10; - Point p3 = rp - arrowDir * 20 - crossVec * 10; glBegin(GL_POLYGON); glVertex(rp); --- 272,289 ---- alpha *= dist * 0.02; + Point p2 = rp - arrowDir * 23 + crossVec * 8; + Point p3 = rp - arrowDir * 23 - crossVec * 8; + + glColor3f(0,0,0); + glLineWidth(4); + glBegin(GL_LINE_LOOP); + glVertex(rp); + glVertex(p2); + glVertex(p3); + glEnd(); + glLineWidth(2); + glEnable(GL_BLEND); glColor(c * 0.7, alpha); glBegin(GL_POLYGON); glVertex(rp); *************** *** 532,535 **** --- 543,585 ---- } + void GameType::addItemOfInterest(Item *theItem) + { + ItemOfInterest i; + i.theItem = theItem; + i.teamVisMask = 0; + mItemsOfInterest.push_back(i); + } + + void GameType::queryItemsOfInterest() + { + static Vector<GameObject *> fillVector; + for(S32 i = 0; i < mItemsOfInterest.size(); i++) + { + ItemOfInterest &ioi = mItemsOfInterest[i]; + ioi.teamVisMask = 0; + Point pos = ioi.theItem->getActualPos(); + Point scopeRange(Game::PlayerSensorHorizVisDistance, + Game::PlayerSensorVertVisDistance); + Rect queryRect(pos, pos); + + queryRect.expand(scopeRange); + findObjects(ShipType, fillVector, queryRect); + for(S32 j = 0; j < fillVector.size(); j++) + { + Ship *theShip = (Ship *) fillVector[j]; + Point delta = theShip->getActualPos() - pos; + delta.x = fabs(delta.x); + delta.y = fabs(delta.y); + + if( (theShip->isSensorActive() && delta.x < Game::PlayerSensorHorizVisDistance && + delta.y < Game::PlayerSensorVertVisDistance) || + (delta.x < Game::PlayerHorizVisDistance && + delta.y < Game::PlayerVertVisDistance)) + ioi.teamVisMask |= (1 << theShip->getTeam()); + } + fillVector.clear(); + } + } + void GameType::performProxyScopeQuery(GameObject *scopeObject, GameConnection *connection) { *************** *** 537,540 **** --- 587,604 ---- fillVector.clear(); + if(mTeams.size() > 1) + { + for(S32 i = 0; i < mItemsOfInterest.size(); i++) + { + if(mItemsOfInterest[i].teamVisMask & (1 << scopeObject->getTeam())) + { + Item *theItem = mItemsOfInterest[i].theItem; + connection->objectInScope(theItem); + if(theItem->isMounted()) + connection->objectInScope(theItem->getMount()); + } + } + } + if(connection->isInCommanderMap() && mTeams.size() > 1) { Index: footballGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/footballGame.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** footballGame.cpp 1 Oct 2004 00:21:40 -0000 1.11 --- footballGame.cpp 4 Oct 2004 19:23:59 -0000 1.12 *************** *** 45,49 **** void flagDropped(Ship *theShip, FlagItem *theFlag); void addZone(GoalZone *z); ! void addFlag(FlagItem *theFlag) { mFlag = theFlag; } void shipTouchZone(Ship *s, GoalZone *z); const char *getGameTypeString() { return "Zone Control"; } --- 45,53 ---- void flagDropped(Ship *theShip, FlagItem *theFlag); void addZone(GoalZone *z); ! void addFlag(FlagItem *theFlag) ! { ! mFlag = theFlag; ! addItemOfInterest(theFlag); ! } void shipTouchZone(Ship *s, GoalZone *z); const char *getGameTypeString() { return "Zone Control"; } *************** *** 195,199 **** for(S32 i = 0; i < mZones.size(); i++) { ! if(mZones[i]->didRecentlyChangeTeam()) { Color c = getTeamColor(mZones[i]->getTeam()); --- 199,203 ---- for(S32 i = 0; i < mZones.size(); i++) { ! if(mZones[i]->didRecentlyChangeTeam() && mZones[i]->getTeam() != -1) { Color c = getTeamColor(mZones[i]->getTeam()); Index: gameType.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.h,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** gameType.h 1 Oct 2004 00:21:40 -0000 1.34 --- gameType.h 4 Oct 2004 19:23:59 -0000 1.35 *************** *** 39,42 **** --- 39,43 ---- class GoalZone; struct MenuItem; + class Item; class ClientRef : public Object *************** *** 95,98 **** --- 96,109 ---- StringTableEntry mLevelDescription; + struct ItemOfInterest + { + SafePtr<Item> theItem; + U32 teamVisMask; + }; + + Vector<ItemOfInterest> mItemsOfInterest; + + void addItemOfInterest(Item *theItem); + Timer mScoreboardUpdateTimer; Timer mGameTimer; *************** *** 163,166 **** --- 174,178 ---- virtual void shipTouchZone(Ship *theShip, GoalZone *theZone) {} + void queryItemsOfInterest(); void performScopeQuery(GhostConnection *connection); virtual void performProxyScopeQuery(GameObject *scopeObject, GameConnection *connection); |
From: Mark F. <mar...@us...> - 2004-10-01 00:21:51
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2166/zap Modified Files: UIGame.cpp flagItem.cpp footballGame.cpp game.cpp game.h gameObject.cpp gameObject.h gameType.cpp gameType.h goalZone.cpp goalZone.h input.cpp item.cpp point.h ship.cpp Log Message: Added objective waypoints facility to main game screen Removed weapon switch on stick press Index: flagItem.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/flagItem.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** flagItem.cpp 6 Aug 2004 00:02:46 -0000 1.5 --- flagItem.cpp 1 Oct 2004 00:21:40 -0000 1.6 *************** *** 44,49 **** void FlagItem::onAddedToGame(Game *theGame) { ! if(!isGhost()) ! theGame->getGameType()->addFlag(this); } --- 44,48 ---- void FlagItem::onAddedToGame(Game *theGame) { ! theGame->getGameType()->addFlag(this); } Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** gameType.cpp 6 Aug 2004 00:02:47 -0000 1.58 --- gameType.cpp 1 Oct 2004 00:21:40 -0000 1.59 *************** *** 220,223 **** --- 220,292 ---- } + void GameType::renderObjectiveArrow(GameObject *target, Color c) + { + GameConnection *gc = gClientGame->getConnectionToServer(); + GameObject *co = NULL; + if(gc) + co = gc->getControlObject(); + if(!co) + return; + Rect r = target->getBounds(MoveObject::RenderState); + Point nearestPoint = co->getRenderPos(); + + if(r.max.x < nearestPoint.x) + nearestPoint.x = r.max.x; + if(r.min.x > nearestPoint.x) + nearestPoint.x = r.min.x; + if(r.max.y < nearestPoint.y) + nearestPoint.y = r.max.y; + if(r.min.y > nearestPoint.y) + nearestPoint.y = r.min.y; + + Point rp = gClientGame->worldToScreenPoint(nearestPoint); + + Point center(400, 300); + Point arrowDir = rp - center; + if(rp.x > UserInterface::horizMargin && + rp.x < UserInterface::canvasWidth - UserInterface::horizMargin && + rp.y > UserInterface::vertMargin && + rp.y < UserInterface::canvasHeight - UserInterface::vertMargin) + return; + + Point np = rp; + if(rp.x < UserInterface::horizMargin) + rp.x = UserInterface::horizMargin; + if(rp.x > UserInterface::canvasWidth - UserInterface::horizMargin) + rp.x = UserInterface::canvasWidth - UserInterface::horizMargin; + if(rp.y < UserInterface::vertMargin) + rp.y = UserInterface::vertMargin; + if(rp.y > UserInterface::canvasHeight - UserInterface::vertMargin) + rp.y = UserInterface::canvasHeight - UserInterface::vertMargin; + + F32 dist = (np - rp).len(); + + arrowDir.normalize(); + Point crossVec(arrowDir.y, -arrowDir.x); + F32 alpha = (1 - gClientGame->getCommanderZoomFraction()) * 0.8; + if(!alpha) + return; + + if(dist < 50) + alpha *= dist * 0.02; + + glEnable(GL_BLEND); + glColor(c * 0.7, alpha); + Point p2 = rp - arrowDir * 20 + crossVec * 10; + Point p3 = rp - arrowDir * 20 - crossVec * 10; + glBegin(GL_POLYGON); + glVertex(rp); + glVertex(p2); + glVertex(p3); + glEnd(); + glColor(c, alpha); + glBegin(GL_LINE_LOOP); + glVertex(rp); + glVertex(p2); + glVertex(p3); + glEnd(); + glDisable(GL_BLEND); + } + void GameType::renderTimeLeft() { Index: UIGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** UIGame.cpp 29 Sep 2004 23:53:21 -0000 1.47 --- UIGame.cpp 1 Oct 2004 00:21:40 -0000 1.48 *************** *** 132,137 **** } ! if(gClientGame) ! gClientGame->render(); glMatrixMode(GL_MODELVIEW); --- 132,136 ---- } ! gClientGame->render(); glMatrixMode(GL_MODELVIEW); Index: game.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** game.cpp 23 Aug 2004 19:32:44 -0000 1.49 --- game.cpp 1 Oct 2004 00:21:40 -0000 1.50 *************** *** 551,554 **** --- 551,594 ---- } + Point ClientGame::worldToScreenPoint(Point p) + { + GameObject *controlObject = mConnectionToServer->getControlObject(); + Ship *u = (Ship *) controlObject; + Point position = u->getRenderPos(); + + if(mCommanderZoomDelta) + { + F32 zoomFrac = getCommanderZoomFraction(); + Point worldCenter = mWorldBounds.getCenter(); + Point worldExtents = mWorldBounds.getExtents(); + worldExtents.x *= UserInterface::canvasWidth / F32(UserInterface::canvasWidth - (UserInterface::horizMargin * 2)); + worldExtents.y *= UserInterface::canvasHeight / F32(UserInterface::canvasHeight - (UserInterface::vertMargin * 2)); + + F32 aspectRatio = worldExtents.x / worldExtents.y; + F32 screenAspectRatio = UserInterface::canvasWidth / F32(UserInterface::canvasHeight); + if(aspectRatio > screenAspectRatio) + worldExtents.y *= aspectRatio / screenAspectRatio; + else + worldExtents.x *= screenAspectRatio / aspectRatio; + + Point offset = (worldCenter - position) * zoomFrac + position; + Point visSize = computePlayerVisArea(u) * 2; + Point modVisSize = (worldExtents - visSize) * zoomFrac + visSize; + + Point visScale(UserInterface::canvasWidth / modVisSize.x, + UserInterface::canvasHeight / modVisSize.y ); + + Point ret = (p - offset) * visScale + Point(400, 300); + return ret; + } + else + { + Point visExt = computePlayerVisArea((Ship *) u); + Point scaleFactor(400 / visExt.x, 300 / visExt.y); + Point ret = (p - position) * scaleFactor + Point(400, 300); + return ret; + } + } + void ClientGame::renderCommander() { *************** *** 561,564 **** --- 601,605 ---- // Set up the view to show the whole level. Rect worldBounds = computeWorldObjectExtents(); + mWorldBounds = worldBounds; Point worldCenter = worldBounds.getCenter(); Index: gameObject.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameObject.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** gameObject.cpp 26 Jun 2004 18:07:43 -0000 1.19 --- gameObject.cpp 1 Oct 2004 00:21:40 -0000 1.20 *************** *** 280,283 **** --- 280,304 ---- } + Rect GameObject::getBounds(U32 stateIndex) + { + Rect ret; + Point p; + float radius; + Vector<Point> bounds; + + if(getCollisionCircle(stateIndex, p, radius)) + { + ret.max = p + Point(radius, radius); + ret.min = p - Point(radius, radius); + } + else if(getCollisionPoly(bounds)) + { + ret.min = ret.max = bounds[0]; + for(S32 i = 1; i < bounds.size(); i++) + ret.unionPoint(bounds[i]); + } + return ret; + } + void GameObject::render() { Index: goalZone.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/goalZone.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** goalZone.cpp 1 Jul 2004 23:07:46 -0000 1.1 --- goalZone.cpp 1 Oct 2004 00:21:40 -0000 1.2 *************** *** 44,49 **** void GoalZone::render() { ! bool isFlashing = mFlashCount & 1; ! renderGoalZone(mPolyBounds, getGame()->getGameType()->getTeamColor(getTeam()), isFlashing); } --- 44,48 ---- void GoalZone::render() { ! renderGoalZone(mPolyBounds, getGame()->getGameType()->getTeamColor(getTeam()), isFlashing()); } *************** *** 78,85 **** { if(!isGhost()) - { setScopeAlways(); ! theGame->getGameType()->addZone(this); ! } } --- 77,82 ---- { if(!isGhost()) setScopeAlways(); ! theGame->getGameType()->addZone(this); } Index: point.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/point.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** point.h 26 Jun 2004 18:07:44 -0000 1.9 --- point.h 1 Oct 2004 00:21:40 -0000 1.10 *************** *** 54,57 **** --- 54,59 ---- Point &operator*=(const member_type f) { x *= f; y *= f; return *this; } + Point operator*(const Point &pt) { return Point(x * pt.x, y * pt.y); } + Point &operator=(const Point &pt) { x = pt.x; y = pt.y; return *this; } bool operator==(const Point &pt) { return x == pt.x && y == pt.y; } Index: gameObject.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameObject.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** gameObject.h 26 Jun 2004 18:07:43 -0000 1.27 --- gameObject.h 1 Oct 2004 00:21:40 -0000 1.28 *************** *** 137,140 **** --- 137,141 ---- virtual bool getCollisionPoly(Vector<Point> &polyPoints); virtual bool getCollisionCircle(U32 stateIndex, Point &point, float &radius); + Rect getBounds(U32 stateIndex); const Move &getCurrentMove() { return mCurrentMove; } Index: footballGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/footballGame.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** footballGame.cpp 4 Aug 2004 18:25:27 -0000 1.10 --- footballGame.cpp 1 Oct 2004 00:21:40 -0000 1.11 *************** *** 40,50 **** --- 40,54 ---- Vector<GoalZone*> mZones; + SafePtr<FlagItem> mFlag; public: void shipTouchFlag(Ship *theShip, FlagItem *theFlag); void flagDropped(Ship *theShip, FlagItem *theFlag); void addZone(GoalZone *z); + void addFlag(FlagItem *theFlag) { mFlag = theFlag; } void shipTouchZone(Ship *s, GoalZone *z); const char *getGameTypeString() { return "Zone Control"; } const char *getInstructionString() { return "Carry the flag into each of the capture zones!"; } + void renderInterfaceOverlay(bool scoreboardVisible); + void performProxyScopeQuery(GameObject *scopeObject, GameConnection *connection); TNL_DECLARE_CLASS(ZoneControlGameType); *************** *** 144,146 **** --- 148,213 ---- } + void ZoneControlGameType::performProxyScopeQuery(GameObject *scopeObject, GameConnection *connection) + { + Parent::performProxyScopeQuery(scopeObject, connection); + S32 uTeam = scopeObject->getTeam(); + if(mFlag.isValid()) + { + if(mFlag->isAtHome()) + connection->objectInScope(mFlag); + else + { + Ship *mount = mFlag->getMount(); + if(mount && mount->getTeam() == uTeam) + { + connection->objectInScope(mount); + connection->objectInScope(mFlag); + } + } + } + } + + void ZoneControlGameType::renderInterfaceOverlay(bool scoreboardVisible) + { + Ship *u = (Ship *) gClientGame->getConnectionToServer()->getControlObject(); + if(u) + { + if(mFlag.isValid() && mFlag->getMount() == u) + { + // the ship has the flag, so render zones not controlled by his team + for(S32 i = 0; i < mZones.size(); i++) + if(mZones[i]->getTeam() != u->getTeam()) + renderObjectiveArrow(mZones[i], getTeamColor(mZones[i]->getTeam())); + } + else + { + if(mFlag.isValid()) + { + if(!mFlag->isMounted()) + renderObjectiveArrow(mFlag, getTeamColor(mFlag->getTeam())); + else + { + Ship *mount = mFlag->getMount(); + if(mount) + renderObjectiveArrow(mount, getTeamColor(mount->getTeam())); + } + } + for(S32 i = 0; i < mZones.size(); i++) + { + if(mZones[i]->didRecentlyChangeTeam()) + { + Color c = getTeamColor(mZones[i]->getTeam()); + if(mZones[i]->isFlashing()) + c *= 0.8; + renderObjectiveArrow(mZones[i], c); + + } + } + } + } + + Parent::renderInterfaceOverlay(scoreboardVisible); + } + + }; \ No newline at end of file Index: gameType.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.h,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** gameType.h 4 Aug 2004 18:25:27 -0000 1.33 --- gameType.h 1 Oct 2004 00:21:40 -0000 1.34 *************** *** 144,147 **** --- 144,149 ---- virtual void renderInterfaceOverlay(bool scoreboardVisible); + void renderObjectiveArrow(GameObject *target, Color c); + void renderTimeLeft(); void renderTalkingClients(); Index: goalZone.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/goalZone.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** goalZone.h 1 Jul 2004 23:07:46 -0000 1.1 --- goalZone.h 1 Oct 2004 00:21:40 -0000 1.2 *************** *** 51,54 **** --- 51,57 ---- GoalZone(); void render(); + + bool isFlashing() { return mFlashCount & 1; } + bool didRecentlyChangeTeam() { return mFlashCount != 0; } S32 getRenderSortValue(); void processArguments(S32 argc, const char **argv); Index: item.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/item.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** item.cpp 4 Aug 2004 18:25:27 -0000 1.19 --- item.cpp 1 Oct 2004 00:21:40 -0000 1.20 *************** *** 172,176 **** retMask = MountMask; } ! return MountMask; } --- 172,176 ---- retMask = MountMask; } ! return retMask; } Index: input.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/input.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** input.cpp 29 Sep 2004 23:53:21 -0000 1.4 --- input.cpp 1 Oct 2004 00:21:40 -0000 1.5 *************** *** 178,182 **** ControllerButtonRightTrigger, 0, ! ControllerButton1, ControllerButtonBack, 0, --- 178,182 ---- ControllerButtonRightTrigger, 0, ! 0, ControllerButtonBack, 0, *************** *** 201,205 **** ControllerButtonBack, 0, ! ControllerButton1, ControllerButtonStart, }; --- 201,205 ---- ControllerButtonBack, 0, ! 0, ControllerButtonStart, }; *************** *** 222,226 **** ControllerButtonBack, 0, ! ControllerButton1, ControllerButtonLeftTrigger, ControllerButtonRightTrigger, --- 222,226 ---- ControllerButtonBack, 0, ! 0, ControllerButtonLeftTrigger, ControllerButtonRightTrigger, Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** game.h 29 Sep 2004 23:53:21 -0000 1.65 --- game.h 1 Oct 2004 00:21:40 -0000 1.66 *************** *** 200,203 **** --- 200,204 ---- }; Point mStars[NumStars]; + Rect mWorldBounds; SafePtr<GameConnection> mConnectionToServer; // If this is a client game, this is the connection to the server *************** *** 214,217 **** --- 215,219 ---- F32 getCommanderZoomFraction() { return mCommanderZoomDelta / F32(CommanderMapZoomTime); } + Point worldToScreenPoint(Point p); void setConnectionToServer(GameConnection *connection); void drawStars(F32 alphaFrac, Point cameraPos, Point visibleExtent); *************** *** 234,238 **** extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.3" }; --- 236,240 ---- extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.4" }; Index: ship.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.cpp,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** ship.cpp 17 Sep 2004 00:14:34 -0000 1.76 --- ship.cpp 1 Oct 2004 00:21:40 -0000 1.77 *************** *** 354,359 **** { GameObject *s = hitObjects[i]; ! if(!s->isDestroyed() && s->getHealth() < 1 && (s->getRenderPos() - pos).len() < (RepairRadius + CollisionRadius)) ! mRepairTargets.push_back(s); } return mRepairTargets.size() != 0; --- 354,364 ---- { GameObject *s = hitObjects[i]; ! if(s->isDestroyed() || s->getHealth() >= 1) ! continue; ! if((s->getRenderPos() - pos).len() > (RepairRadius + CollisionRadius)) ! continue; ! if(s->getTeam() != -1 && s->getTeam() != getTeam()) ! continue; ! mRepairTargets.push_back(s); } return mRepairTargets.size() != 0; |
From: Mark F. <mar...@us...> - 2004-09-29 23:53:31
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3717/zap Modified Files: UIGame.cpp UIMenus.cpp ZAP.vcproj game.h input.cpp main.cpp winJoystick.cpp Log Message: Updated input code for some tweakage Win32 release build is not console app All builds start in fullscreen mode by default Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** main.cpp 28 Sep 2004 17:34:13 -0000 1.70 --- main.cpp 29 Sep 2004 23:53:21 -0000 1.71 *************** *** 594,597 **** --- 594,601 ---- gMaxPlayers = atoi(argv[i+1]); } + else if(!stricmp(argv[i], "-window")) + { + OptionsMenuUserInterface::fullscreen = false; + } else if(!stricmp(argv[i], "-edit")) { *************** *** 717,720 **** --- 721,726 ---- atexit(onExit); + if(OptionsMenuUserInterface::fullscreen) + glutFullScreen(); glutMainLoop(); Index: UIMenus.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** UIMenus.cpp 25 Sep 2004 01:26:37 -0000 1.24 --- UIMenus.cpp 29 Sep 2004 23:53:21 -0000 1.25 *************** *** 252,256 **** bool OptionsMenuUserInterface::controlsRelative = false; ! bool OptionsMenuUserInterface::fullscreen = false; S32 OptionsMenuUserInterface::joystickType = -1; bool OptionsMenuUserInterface::echoVoice = false; --- 252,256 ---- bool OptionsMenuUserInterface::controlsRelative = false; ! bool OptionsMenuUserInterface::fullscreen = true; S32 OptionsMenuUserInterface::joystickType = -1; bool OptionsMenuUserInterface::echoVoice = false; Index: ZAP.vcproj =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ZAP.vcproj,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** ZAP.vcproj 17 Sep 2004 00:14:34 -0000 1.39 --- ZAP.vcproj 29 Sep 2004 23:53:21 -0000 1.40 *************** *** 88,92 **** LinkIncremental="1" GenerateDebugInformation="TRUE" ! SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" --- 88,92 ---- LinkIncremental="1" GenerateDebugInformation="TRUE" ! SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** game.h 17 Sep 2004 00:14:34 -0000 1.64 --- game.h 29 Sep 2004 23:53:21 -0000 1.65 *************** *** 234,238 **** extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.2" }; --- 234,238 ---- extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.3" }; Index: UIGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** UIGame.cpp 20 Aug 2004 18:26:58 -0000 1.46 --- UIGame.cpp 29 Sep 2004 23:53:21 -0000 1.47 *************** *** 52,56 **** mCurrentMode = PlayMode; mInScoreboardMode = false; ! #ifdef TNL_OS_XBOX mFPSVisible = true; #else --- 52,56 ---- mCurrentMode = PlayMode; mInScoreboardMode = false; ! #if 0 //defined(TNL_OS_XBOX) mFPSVisible = true; #else Index: input.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/input.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** input.cpp 28 Sep 2004 17:34:13 -0000 1.3 --- input.cpp 29 Sep 2004 23:53:21 -0000 1.4 *************** *** 39,42 **** --- 39,45 ---- { F32 axes[MaxJoystickAxes]; + static F32 minValues[2] = { - 0.5, -0.5 }; + static F32 maxValues[2] = { 0.5, 0.5 }; + if(!ReadJoystick(axes, buttonMask)) return false; *************** *** 49,52 **** --- 52,74 ---- controls[1] = axes[1]; + if(controls[0] < minValues[0]) + minValues[0] = controls[0]; + if(controls[0] > maxValues[0]) + maxValues[0] = controls[0]; + if(controls[1] < minValues[1]) + minValues[1] = controls[1]; + if(controls[1] > maxValues[1]) + maxValues[1] = controls[1]; + + if(controls[0] < 0) + controls[0] = - (controls[0] / minValues[0]); + else if(controls[0] > 0) + controls[0] = (controls[0] / maxValues[0]); + + if(controls[1] < 0) + controls[1] = - (controls[1] / minValues[1]); + else if(controls[1] > 0) + controls[1] = (controls[1] / maxValues[1]); + // xbox control inputs are in a circle, not a square, which makes // diagonal movement inputs "slower" *************** *** 223,226 **** --- 245,250 ---- if(!strncmp(joystickName, "WingMan", 7)) ret = LogitechWingman; + else if(!strcmp(joystickName, "XBoxOnXBox")) + ret = XBoxControllerOnXBox; else if(strstr(joystickName, "XBox")) ret = XBoxController; Index: winJoystick.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/winJoystick.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** winJoystick.cpp 28 Sep 2004 17:34:13 -0000 1.20 --- winJoystick.cpp 29 Sep 2004 23:53:21 -0000 1.21 *************** *** 153,157 **** return false; // The device should have been acquired during the Poll() ! F32 scale = 1.15 / 32768.0f; axes[0] = (F32(js.lX) - 32768.0f) * scale; axes[1] = (F32(js.lY) - 32768.0f) * scale; --- 153,157 ---- return false; // The device should have been acquired during the Poll() ! F32 scale = 1 / 32768.0f; axes[0] = (F32(js.lX) - 32768.0f) * scale; axes[1] = (F32(js.lY) - 32768.0f) * scale; *************** *** 166,176 **** axes[10] = 0; axes[11] = 0; - for(S32 i = 0; i < 12; i++) - { - if(axes[i] > 1) - axes[i] = 1; - if(axes[i] < -1) - axes[i] = -1; - } // check the state of the buttons: --- 166,169 ---- *************** *** 179,189 **** for( U32 i = 0; i < 12; i++ ) - { if((js.rgbButtons[i] & 0x80) != 0) - { - logprintf("Button down %d", i); buttonMask |= BIT(i); - } - } switch(pov) --- 172,177 ---- |
From: Mark F. <mar...@us...> - 2004-09-29 20:40:28
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25393/zap Modified Files: osxInput.cpp sfx.cpp Log Message: Index: osxInput.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/osxInput.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** osxInput.cpp 29 Jun 2004 21:30:21 -0000 1.5 --- osxInput.cpp 29 Sep 2004 20:40:18 -0000 1.6 *************** *** 213,217 **** } ! void InitJoystick() { --- 213,221 ---- } ! enum { ! MaxJoystickNameLen = 256, ! }; ! char gJoystickName[MaxJoystickNameLen + 1] = { 0, }; ! const char *GetJoystickName() { return gJoystickName; } void InitJoystick() { *************** *** 243,246 **** --- 247,263 ---- { CFTypeRef refCF = 0; + refCF = CFDictionaryGetValue (hidProperties, CFSTR(kIOHIDProductKey)); + + if(CFGetTypeID(refCF) == CFStringGetTypeID()) + { + CFIndex bufferSize = CFStringGetLength (refCF) + 1; + char * buffer = (char *)malloc (bufferSize); + if (buffer) + { + if (CFStringGetCString (refCF, buffer, bufferSize, CFStringGetSystemEncoding ())) + strncpy(gJoystickName, buffer, MaxJoystickNameLen); + free(buffer); + } + } refCF = CFDictionaryGetValue (hidProperties, CFSTR(kIOHIDPrimaryUsagePageKey)); long usage, usagePage; Index: sfx.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/sfx.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** sfx.cpp 2 Aug 2004 18:11:54 -0000 1.36 --- sfx.cpp 29 Sep 2004 20:40:18 -0000 1.37 *************** *** 294,300 **** alSourcei(source, AL_LOOPING, mProfile->isLooping); ! //alSourcef(source, AL_REFERENCE_DISTANCE,9000); ! //alSourcef(source, AL_ROLLOFF_FACTOR,1); ! //alSourcef(source, AL_MAX_DISTANCE, 10000); updateMovementParams(); --- 294,303 ---- alSourcei(source, AL_LOOPING, mProfile->isLooping); ! #ifdef TNL_OS_MAC_OSX ! // This is a workaround for the broken OS X implementation of AL_NONE distance model. ! alSourcef(source, AL_REFERENCE_DISTANCE,9000); ! alSourcef(source, AL_ROLLOFF_FACTOR,1); ! alSourcef(source, AL_MAX_DISTANCE, 10000); ! #endif updateMovementParams(); |
From: Mark F. <mar...@us...> - 2004-09-29 20:40:28
|
Update of /cvsroot/opentnl/tnl/osx/tnl.xcode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25393/osx/tnl.xcode Modified Files: project.pbxproj Log Message: Index: project.pbxproj =================================================================== RCS file: /cvsroot/opentnl/tnl/osx/tnl.xcode/project.pbxproj,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** project.pbxproj 29 Jun 2004 21:07:53 -0000 1.9 --- project.pbxproj 29 Sep 2004 20:40:17 -0000 1.10 *************** *** 98,101 **** --- 98,146 ---- //1D3 //1D4 + 1D3CACC90694D76300313D6F = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + name = goalZone.cpp; + path = ../zap/goalZone.cpp; + refType = 2; + sourceTree = SOURCE_ROOT; + }; + 1D3CACCA0694D76300313D6F = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.h; + name = goalZone.h; + path = ../zap/goalZone.h; + refType = 2; + sourceTree = SOURCE_ROOT; + }; + 1D3CACCB0694D76300313D6F = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + name = retrieveGame.cpp; + path = ../zap/retrieveGame.cpp; + refType = 2; + sourceTree = SOURCE_ROOT; + }; + 1D3CACCC0694D76300313D6F = { + fileRef = 1D3CACC90694D76300313D6F; + isa = PBXBuildFile; + settings = { + }; + }; + 1D3CACCD0694D76300313D6F = { + fileRef = 1D3CACCA0694D76300313D6F; + isa = PBXBuildFile; + settings = { + }; + }; + 1D3CACCE0694D76300313D6F = { + fileRef = 1D3CACCB0694D76300313D6F; + isa = PBXBuildFile; + settings = { + }; + }; 1D3E3EE90666A7EE005D645B = { fileEncoding = 30; *************** *** 427,430 **** --- 472,490 ---- }; }; + 1DD229E2070B4A02000DFF1F = { + fileEncoding = 30; + isa = PBXFileReference; + lastKnownFileType = sourcecode.cpp.cpp; + name = HTFGame.cpp; + path = ../zap/HTFGame.cpp; + refType = 2; + sourceTree = SOURCE_ROOT; + }; + 1DD229E3070B4A02000DFF1F = { + fileRef = 1DD229E2070B4A02000DFF1F; + isa = PBXBuildFile; + settings = { + }; + }; 1DE1EC6906909AB400D93C76 = { fileEncoding = 30; *************** *** 2366,2369 **** --- 2426,2430 ---- 1DE1ED0E06909D0A00D93C76, 1D49BDC80691F8E000643C72, + 1D3CACCD0694D76300313D6F, ); isa = PBXHeadersBuildPhase; *************** *** 2422,2425 **** --- 2483,2489 ---- 1DE1EDF50690BA1600D93C76, 1D49BDC70691F8E000643C72, + 1D3CACCC0694D76300313D6F, + 1D3CACCE0694D76300313D6F, + 1DD229E3070B4A02000DFF1F, ); isa = PBXSourcesBuildPhase; *************** *** 2856,2859 **** --- 2920,2927 ---- 6692C0E606247C3B00D5ADFE = { children = ( + 1DD229E2070B4A02000DFF1F, + 1D3CACC90694D76300313D6F, + 1D3CACCA0694D76300313D6F, + 1D3CACCB0694D76300313D6F, 1D49BDC50691F8E000643C72, 1D49BDC60691F8E000643C72, |
From: Mark F. <mar...@us...> - 2004-09-28 19:08:29
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20088/zap Modified Files: Makefile linuxInput.cpp Log Message: Updated Makefiles and source for linux compile. Index: linuxInput.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/linuxInput.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** linuxInput.cpp 29 Jun 2004 22:46:03 -0000 1.1 --- linuxInput.cpp 28 Sep 2004 19:08:17 -0000 1.2 *************** *** 46,49 **** --- 46,54 ---- } + const char *GetJoystickName() + { + return ""; + } + void ShutdownJoystick() { Index: Makefile =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/Makefile,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Makefile 23 Aug 2004 19:45:36 -0000 1.17 --- Makefile 28 Sep 2004 19:08:17 -0000 1.18 *************** *** 9,12 **** --- 9,13 ---- OBJECTS_ZAP=\ CTFGame.o\ + HTFGame.o\ LoadoutZone.o\ SweptEllipsoid.o\ |
From: Mark F. <mar...@us...> - 2004-09-28 19:08:27
|
Update of /cvsroot/opentnl/tnl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20088/test Modified Files: Makefile Log Message: Updated Makefiles and source for linux compile. Index: Makefile =================================================================== RCS file: /cvsroot/opentnl/tnl/test/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 20 Apr 2004 09:25:06 -0000 1.2 --- Makefile 28 Sep 2004 19:08:17 -0000 1.3 *************** *** 14,21 **** server.o - OBJECTS_CLIENT=\ - testGame.o\ - client.o - OBJECTS_TNLTEST=\ testGame.o\ --- 14,17 ---- *************** *** 31,35 **** @echo Building linux dedicated server... $(CC) -o server $(OBJECTS_SERVER) ../tnl/libtnl.a ../libtomcrypt/libtomcrypt.a -lstdc++ -lm - $(CC) -o client $(OBJECTS_CLIENT) ../tnl/libtnl.a ../libtomcrypt/libtomcrypt.a -lstdc++ -lm tnltest: $(OBJECTS_TNLTEST) --- 27,30 ---- |
From: Mark F. <mar...@us...> - 2004-09-28 18:59:36
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18189/tnl Modified Files: tnlMethodDispatch.h tnlNetObject.h tnlRPC.h Log Message: Updated RPC code for linux compile Index: tnlRPC.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlRPC.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tnlRPC.h 28 Sep 2004 18:45:25 -0000 1.10 --- tnlRPC.h 28 Sep 2004 18:59:23 -0000 1.11 *************** *** 193,197 **** public: \ void (FN_CDECL className::*mFuncPtr) args; \ - TNL::U32 pad; \ RPC_##className##_##name() : TNL::RPCEvent(&RPC##className##name, guaranteeType, eventDirection) \ { mFuncPtr = &className::name##_remote; } \ --- 193,196 ---- Index: tnlMethodDispatch.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlMethodDispatch.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tnlMethodDispatch.h 28 Sep 2004 18:45:25 -0000 1.7 --- tnlMethodDispatch.h 28 Sep 2004 18:59:23 -0000 1.8 *************** *** 161,165 **** extern void *TNL_gBasePtr; namespace TNL { ! #define SAVE_PARAMS TNL_gBasePtr = (void *) ((U8 *) __builtin_frame_address(0) + 8); #elif defined(TNL_SUPPORTS_GCC_INLINE_PPC_ASM ) --- 161,165 ---- extern void *TNL_gBasePtr; namespace TNL { ! #define SAVE_PARAMS TNL_gBasePtr = (void *) ((TNL::U8 *) __builtin_frame_address(0) + 8); #elif defined(TNL_SUPPORTS_GCC_INLINE_PPC_ASM ) Index: tnlNetObject.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlNetObject.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tnlNetObject.h 28 Sep 2004 18:45:25 -0000 1.9 --- tnlNetObject.h 28 Sep 2004 18:59:23 -0000 1.10 *************** *** 410,414 **** public: typedef void (FN_CDECL className::*RPCFuncPtr) args; \ RPCFuncPtr mFuncPtr; \ - TNL::U32 pad; \ RPCEV_##className##_##name(TNL::NetObject *theObject = NULL) : TNL::NetObjectRPCEvent(theObject, &RPC##className##name, guaranteeType, eventDirection) \ { mFuncPtr = &className::name##_remote; } \ --- 410,413 ---- |
From: Mark F. <mar...@us...> - 2004-09-28 18:46:06
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14491/tnl Modified Files: eventConnection.cpp netConnection.cpp tnlJournal.h tnlMethodDispatch.cpp tnlMethodDispatch.h tnlNetConnection.h tnlNetObject.h tnlNetStringTable.h tnlPlatform.h tnlRPC.h tnlTypes.h Log Message: Integrated Norbert's patch for Win32 CodeWarrior support Changed instructions screen to display help for current controls configuration Index: tnlJournal.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlJournal.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tnlJournal.h 28 Jun 2004 20:47:54 -0000 1.8 --- tnlJournal.h 28 Sep 2004 18:45:25 -0000 1.9 *************** *** 108,111 **** --- 108,112 ---- m.v1 = *((U32 *) &fptr); \ if(sizeof(fptr) > sizeof(U32)) m.v2 = *(((U32 *) &fptr) + 1); \ + if(sizeof(fptr) > 2*sizeof(U32)) m.v3 = *(((U32 *) &fptr) + 2); \ }; \ Journal_##className##_##func##_er(const char *name, MethodArgList *methodArgList) : JournalEntryRecord(name, methodArgList) {} \ Index: tnlNetConnection.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlNetConnection.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tnlNetConnection.h 20 Aug 2004 18:26:58 -0000 1.7 --- tnlNetConnection.h 28 Sep 2004 18:45:25 -0000 1.8 *************** *** 164,175 **** MessageSignatureBytes = 5, ///< Special data bytes written into the end of the packet to guarantee data consistency }; - /// Constants controlling the behavior of pings and timeouts - enum PingConstants { - AdaptiveInitialPingTimeout = 60000, - AdaptivePingRetryCount = 4, - PingTimeout = 5000, ///< Milliseconds to wait before sending a ping packet. - PingRetryCount = 10, ///< Number of unacknowledged pings to send before timing out. - }; - U32 mLastPacketRecvTime; ///< Time of the receipt of the last data packet. U32 mLastSeqRecvdAtSend[MaxPacketWindowSize]; ///< The sequence number of the last packet received from the remote host when we sent the packet with sequence X & PacketWindowMask. --- 164,167 ---- *************** *** 193,196 **** --- 185,197 ---- InvalidPacketType, }; + /// Constants controlling the behavior of pings and timeouts + enum DefaultPingConstants { + AdaptiveInitialPingTimeout = 60000, + AdaptivePingRetryCount = 4, + DefaultPingTimeout = 5000, ///< Default milliseconds to wait before sending a ping packet. + DefaultPingRetryCount = 10, ///< Default number of unacknowledged pings to send before timing out. + }; + U32 mPingTimeout; ///< Milliseconds to wait before sending a ping packet. + U32 mPingRetryCount; ///< Number of unacknowledged pings to send before timing out. public: struct PacketNotify; *************** *** 436,439 **** --- 437,444 ---- virtual NetClassGroup getNetClassGroup() const { return NetClassGroupInvalid; } + /// Sets the ping/timeout characteristics for a fixed-rate connection. Total timeout is msPerPing * pingRetryCount. + void setPingTimeouts(U32 msPerPing, U32 pingRetryCount) + { mPingRetryCount = pingRetryCount; mPingTimeout = msPerPing; } + /// Simulates a network situation with a percentage random packet loss and a connection one way latency as specified. void setSimulatedNetParams(F32 packetLoss, U32 latency) Index: tnlNetStringTable.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlNetStringTable.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tnlNetStringTable.h 2 Aug 2004 20:36:01 -0000 1.2 --- tnlNetStringTable.h 28 Sep 2004 18:45:25 -0000 1.3 *************** *** 28,31 **** --- 28,35 ---- #define _TNL_NETSTRINGTABLE_H_ + #ifndef _TNL_TYPES_H_ + #include "tnlTypes.h" + #endif + namespace TNL { Index: tnlRPC.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlRPC.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tnlRPC.h 19 Aug 2004 21:20:15 -0000 1.9 --- tnlRPC.h 28 Sep 2004 18:45:25 -0000 1.10 *************** *** 198,202 **** TNL_DECLARE_CLASS( RPC_##className##_##name ); \ bool checkClassType(TNL::Object *theObject) { return dynamic_cast<className *>(theObject) != NULL; } \ ! void getFuncPtr(TNL::MethodPointer &m) { m.v1=*((TNL::U32 *) &mFuncPtr); m.v2 = *(((TNL::U32 *) &mFuncPtr) + 1); } }; \ TNL_IMPLEMENT_NETEVENT( RPC_##className##_##name, groupMask, rpcVersion ); \ TNL::MethodArgList RPC##className##name (#className, #args); \ --- 198,204 ---- TNL_DECLARE_CLASS( RPC_##className##_##name ); \ bool checkClassType(TNL::Object *theObject) { return dynamic_cast<className *>(theObject) != NULL; } \ ! void getFuncPtr(TNL::MethodPointer &m) { m.v1=*((TNL::U32 *) &mFuncPtr); \ ! if(sizeof(mFuncPtr) > sizeof(TNL::U32)) m.v2 = *(((TNL::U32 *) &mFuncPtr) + 1); \ ! if(sizeof(mFuncPtr) > 2*sizeof(TNL::U32)) m.v3 = *(((TNL::U32 *) &mFuncPtr) + 2); } }; \ TNL_IMPLEMENT_NETEVENT( RPC_##className##_##name, groupMask, rpcVersion ); \ TNL::MethodArgList RPC##className##name (#className, #args); \ Index: eventConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/eventConnection.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** eventConnection.cpp 3 Jul 2004 20:01:46 -0000 1.4 --- eventConnection.cpp 28 Sep 2004 18:45:24 -0000 1.5 *************** *** 460,464 **** { S32 classId = theEvent->getClassId(getNetClassGroup()); ! if(classId >= mEventClassCount) return false; --- 460,464 ---- { S32 classId = theEvent->getClassId(getNetClassGroup()); ! if(U32(classId) >= mEventClassCount) return false; Index: tnlMethodDispatch.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlMethodDispatch.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tnlMethodDispatch.cpp 21 Aug 2004 03:40:28 -0000 1.15 --- tnlMethodDispatch.cpp 28 Sep 2004 18:45:25 -0000 1.16 *************** *** 615,618 **** --- 615,619 ---- func = method->v1; funcOffset = method->v2; + void *mptr = &method->v1; void *args = unmarshalledData.getBuffer(); *************** *** 650,653 **** --- 651,704 ---- pop esi } + + #elif defined(TNL_SUPPORTS_MWERKS_INLINE_X86_ASM) + _asm + { + push esi + push edi + push ecx + push edx + push ebx + mov saveESP, esp + + mov ecx, sz // get size of buffer + mov esi, args // get buffer + sub esp, ecx // allocate stack space + mov edi, esp // start of destination stack frame + shr ecx, 2 // make it dwords + rep movsd // copy it + mov ecx, thisPtr // set "this" + push ecx + mov eax, mptr + push eax + call jmp_method + mov esp, saveESP + + pop ebx + pop edx + pop ecx + pop edi + pop esi + jmp jmp_continue + + jmp_method: + pop eax + pop edx + mov ecx,dword ptr [esp] + push eax + add ecx,dword ptr [edx] + mov dword ptr [esp+0x4],ecx + cmp dword ptr [edx+0x4],0xffffffff + je jmp_now + mov eax,dword ptr [edx+0x8] + mov eax,dword ptr [ecx+eax] + add eax,dword ptr [edx+0x4] + jmp dword ptr [eax] + lea eax,dword ptr [eax+0x0] + jmp_now: + jmp dword ptr [edx+0x8] + + jmp_continue: + } #elif defined(TNL_SUPPORTS_GCC_INLINE_X86_ASM) Index: tnlNetObject.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlNetObject.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tnlNetObject.h 19 Aug 2004 21:20:15 -0000 1.8 --- tnlNetObject.h 28 Sep 2004 18:45:25 -0000 1.9 *************** *** 415,419 **** TNL_DECLARE_CLASS( RPCEV_##className##_##name ); \ bool checkClassType(TNL::Object *theObject) { return dynamic_cast<className *>(theObject) != NULL; } \ ! void getFuncPtr(TNL::MethodPointer &p) { p.v1=*((TNL::U32 *) &mFuncPtr); p.v2 = *(((TNL::U32 *) &mFuncPtr) + 1); } }; \ TNL_IMPLEMENT_NETEVENT( RPCEV_##className##_##name, groupMask, rpcVersion ); \ TNL::MethodArgList RPC##className##name (#className, #args); \ --- 415,421 ---- TNL_DECLARE_CLASS( RPCEV_##className##_##name ); \ bool checkClassType(TNL::Object *theObject) { return dynamic_cast<className *>(theObject) != NULL; } \ ! void getFuncPtr(TNL::MethodPointer &p) { p.v1=*((TNL::U32 *) &mFuncPtr); \ ! if(sizeof(mFuncPtr) > sizeof(TNL::U32)) p.v2 = *(((TNL::U32 *) &mFuncPtr) + 1); \ ! if(sizeof(mFuncPtr) > 2*sizeof(TNL::U32)) p.v3 = *(((TNL::U32 *) &mFuncPtr) + 2); } }; \ TNL_IMPLEMENT_NETEVENT( RPCEV_##className##_##name, groupMask, rpcVersion ); \ TNL::MethodArgList RPC##className##name (#className, #args); \ Index: tnlTypes.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlTypes.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tnlTypes.h 23 Jul 2004 23:08:45 -0000 1.9 --- tnlTypes.h 28 Sep 2004 18:45:25 -0000 1.10 *************** *** 210,213 **** --- 210,220 ---- #pragma warning(disable: 4800) + #elif defined(__MWERKS__) && defined(_WIN32) + + typedef signed long long S64; ///< Compiler independent signed 64-bit integer + typedef unsigned long long U64; ///< Compiler independent unsigned 64-bit integer + + #define TNL_COMPILER_STRING "Metrowerks CW Win32" + #elif defined(__GNUC__) *************** *** 293,296 **** --- 300,305 ---- # endif # define TNL_SUPPORTS_GCC_INLINE_X86_ASM + # elif defined (__MWERKS__) + # define TNL_SUPPORTS_MWERKS_INLINE_X86_ASM # else # define TNL_SUPPORTS_VC_INLINE_X86_ASM Index: tnlPlatform.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlPlatform.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tnlPlatform.h 20 Apr 2004 04:27:19 -0000 1.1 --- tnlPlatform.h 28 Sep 2004 18:45:25 -0000 1.2 *************** *** 85,89 **** #define TIME_BLOCK(name,block) { S64 st = Platform::getHighPrecisionTimerValue(); {block} S64 delta = Platform::getHighPrecisionTimerValue() - st; F64 ms = Platform::getHighPrecisionMilliseconds(delta); logprintf("Timer: %s Elapsed: %g ms", #name, ms); } ! #if defined (TNL_SUPPORTS_VC_INLINE_X86_ASM) #define TNL_DEBUGBREAK() { __asm { int 3 }; } #elif defined(TNL_SUPPORTS_GCC_INLINE_X86_ASM) --- 85,89 ---- #define TIME_BLOCK(name,block) { S64 st = Platform::getHighPrecisionTimerValue(); {block} S64 delta = Platform::getHighPrecisionTimerValue() - st; F64 ms = Platform::getHighPrecisionMilliseconds(delta); logprintf("Timer: %s Elapsed: %g ms", #name, ms); } ! #if defined (TNL_SUPPORTS_VC_INLINE_X86_ASM) || defined (TNL_SUPPORTS_MWERKS_INLINE_X86_ASM) #define TNL_DEBUGBREAK() { __asm { int 3 }; } #elif defined(TNL_SUPPORTS_GCC_INLINE_X86_ASM) Index: netConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/netConnection.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** netConnection.cpp 19 Aug 2004 20:24:51 -0000 1.10 --- netConnection.cpp 28 Sep 2004 18:45:25 -0000 1.11 *************** *** 106,109 **** --- 106,112 ---- ssthresh = 30; mLastSeqRecvdAck = 0; + + mPingTimeout = DefaultPingTimeout; + mPingRetryCount = DefaultPingRetryCount; } *************** *** 151,156 **** mLastPingSendTime = time; ! U32 timeout = PingTimeout; ! U32 timeoutCount = PingRetryCount; if(isAdaptive()) --- 154,159 ---- mLastPingSendTime = time; ! U32 timeout = mPingTimeout; ! U32 timeoutCount = mPingRetryCount; if(isAdaptive()) Index: tnlMethodDispatch.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlMethodDispatch.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tnlMethodDispatch.h 21 Aug 2004 03:40:28 -0000 1.6 --- tnlMethodDispatch.h 28 Sep 2004 18:45:25 -0000 1.7 *************** *** 114,117 **** --- 114,118 ---- U32 v1; U32 v2; + U32 v3; }; *************** *** 145,153 **** }; ! #if defined(TNL_SUPPORTS_VC_INLINE_X86_ASM) }; ! // VC 6.0 has problems with the usage of a namespace reference inside an inline assembly block ! // so we close the namespace and add this as a global global. extern void *TNL_gBasePtr; --- 146,154 ---- }; ! #if defined(TNL_SUPPORTS_VC_INLINE_X86_ASM) || defined(TNL_SUPPORTS_MWERKS_INLINE_X86_ASM) }; ! // VC 6.0 and Codewarrior have problems with the usage of a namespace reference inside an ! // inline assembly block, so we close the namespace and add this as a global global. extern void *TNL_gBasePtr; |
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 */ |
From: Mark F. <mar...@us...> - 2004-09-28 18:46:05
|
Update of /cvsroot/opentnl/tnl/libtomcrypt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14491/libtomcrypt Modified Files: mycrypt_custom.h Log Message: Integrated Norbert's patch for Win32 CodeWarrior support Changed instructions screen to display help for current controls configuration Index: mycrypt_custom.h =================================================================== RCS file: /cvsroot/opentnl/tnl/libtomcrypt/mycrypt_custom.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mycrypt_custom.h 20 Apr 2004 04:27:14 -0000 1.1 --- mycrypt_custom.h 28 Sep 2004 18:45:23 -0000 1.2 *************** *** 10,17 **** --- 10,26 ---- #endif + #if defined(__MWERKS__) && defined(__cplusplus) + // codewarrior needs namespace version for c++ (otherwise we get ambiguity errors) + #include <stdlib.h> + #define XMALLOC std::malloc + #define XREALLOC std::realloc + #define XCALLOC std::calloc + #define XFREE std::free + #else #define XMALLOC malloc #define XREALLOC realloc #define XCALLOC calloc #define XFREE free + #endif #define XCLOCK clock #define XCLOCKS_PER_SEC CLOCKS_PER_SEC |
From: Mark F. <mar...@us...> - 2004-09-28 18:46:05
|
Update of /cvsroot/opentnl/tnl/glut In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14491/glut Modified Files: glut.h Log Message: Integrated Norbert's patch for Win32 CodeWarrior support Changed instructions screen to display help for current controls configuration Index: glut.h =================================================================== RCS file: /cvsroot/opentnl/tnl/glut/glut.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** glut.h 20 Apr 2004 04:27:13 -0000 1.1 --- glut.h 28 Sep 2004 18:45:22 -0000 1.2 *************** *** 144,148 **** #if defined(_WIN32) # ifndef GLUT_BUILDING_LIB ! extern _CRTIMP void __cdecl exit(int); # endif #else --- 144,155 ---- #if defined(_WIN32) # ifndef GLUT_BUILDING_LIB ! /* CodeWarrior for Win32 does a "using std::exit;" in stdlib.h. ! So declaring ::exit(int) would cause an ambiguous error if ! someone would include stdlib.h before glut.h. */ ! # if defined(__MWERKS__) && defined(__cplusplus) ! extern _CRTIMP void __cdecl std::exit(int); ! # else ! extern _CRTIMP void __cdecl exit(int); ! # endif # endif #else |
From: Mark F. <mar...@us...> - 2004-09-28 18:46:04
|
Update of /cvsroot/opentnl/tnl/master In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14491/master Modified Files: Makefile Log Message: Integrated Norbert's patch for Win32 CodeWarrior support Changed instructions screen to display help for current controls configuration Index: Makefile =================================================================== RCS file: /cvsroot/opentnl/tnl/master/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 20 Apr 2004 04:27:15 -0000 1.1 --- Makefile 28 Sep 2004 18:45:23 -0000 1.2 *************** *** 12,16 **** OBJECTS_MASTER=\ main.o\ ! masterInterface.o CFLAGS= --- 12,17 ---- OBJECTS_MASTER=\ main.o\ ! masterInterface.o\ ! config.o CFLAGS= |
From: Mark F. <mar...@us...> - 2004-09-28 18:45:38
|
Update of /cvsroot/opentnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14491 Added Files: cwPrefixWin32.h tnl.mcp Log Message: Integrated Norbert's patch for Win32 CodeWarrior support Changed instructions screen to display help for current controls configuration --- NEW FILE: cwPrefixWin32.h --- // prefix include file for Metrowerks CodeWarrior #define TNL_DEBUG // enable to have TNL asserts or logging //#define TNL_ENABLE_ASSERTS //#define TNL_ENABLE_LOGGING // You might also want to call TNLLogEnable(xyz, true) to enable special // logging output. xyz could be LogNetConnection, LogNetConnection, e.t.c. // See tnlLog.h for more logging targets. --- NEW FILE: tnl.mcp --- (This appears to be a binary file; contents omitted.) |
From: Mark F. <mar...@us...> - 2004-09-28 17:34:23
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30367/zap Modified Files: input.cpp input.h main.cpp winJoystick.cpp Log Message: Updated controller code to autodetect controller type on Win32 Index: input.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/input.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** input.h 25 Sep 2004 01:26:37 -0000 1.2 --- input.h 28 Sep 2004 17:34:13 -0000 1.3 *************** *** 68,71 **** --- 68,73 ---- void InitJoystick(); + const char *GetJoystickName(); + S32 autodetectJoystickType(); void ShutdownJoystick(); bool ReadJoystick(F32 axes[MaxJoystickAxes], U32 &buttonMask); Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** main.cpp 17 Sep 2004 00:14:34 -0000 1.69 --- main.cpp 28 Sep 2004 17:34:13 -0000 1.70 *************** *** 690,693 **** --- 690,694 ---- SFXObject::init(); InitJoystick(); + OptionsMenuUserInterface::joystickType = autodetectJoystickType(); glutInitWindowSize(800, 600); Index: input.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/input.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** input.cpp 25 Sep 2004 01:26:37 -0000 1.2 --- input.cpp 28 Sep 2004 17:34:13 -0000 1.3 *************** *** 144,147 **** --- 144,169 ---- } } + else if(OptionsMenuUserInterface::joystickType == SaitekDualAnalog) + { + static U32 retMasks[12] = { + ControllerButton1, + ControllerButton2, + ControllerButton3, + ControllerButton4, + ControllerButton5, + ControllerButton6, + ControllerButtonLeftTrigger, + ControllerButtonRightTrigger, + 0, + ControllerButton1, + ControllerButtonBack, + 0, + }; + U32 retMask = 0; + for(S32 i = 0; i < 12; i++) + if(buttonMask & (1 << i)) + retMask |= retMasks[i]; + buttonMask = retMask; + } else if(OptionsMenuUserInterface::joystickType == PS2DualShock) { *************** *** 191,194 **** --- 213,237 ---- } + S32 autodetectJoystickType() + { + S32 ret = -1; + TNL_JOURNAL_READ_BLOCK(JoystickAutodetect, + TNL_JOURNAL_READ((&ret)); + return ret; + ) + const char *joystickName = GetJoystickName(); + if(!strncmp(joystickName, "WingMan", 7)) + ret = LogitechWingman; + else if(strstr(joystickName, "XBox")) + ret = XBoxController; + else if(!strcmp(joystickName, "4 axis 16 button joystick")) + ret = PS2DualShock; + else if(strstr(joystickName, "P880")) + ret = SaitekDualAnalog; + TNL_JOURNAL_WRITE_BLOCK(JoystickAutodetect, + TNL_JOURNAL_WRITE((ret)); + ) + return ret; + } static bool updateMoveJournaled( Move *theMove, U32 &buttonMask ) Index: winJoystick.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/winJoystick.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** winJoystick.cpp 25 Sep 2004 01:26:37 -0000 1.19 --- winJoystick.cpp 28 Sep 2004 17:34:13 -0000 1.20 *************** *** 93,96 **** --- 93,97 ---- LPDIRECTINPUT8 gDirectInput = NULL; LPDIRECTINPUTDEVICE8 gJoystick = NULL; + char gJoystickName[MAX_PATH] = ""; void InitJoystick() *************** *** 109,116 **** if( FAILED(gJoystick->SetDataFormat( &c_dfDIJoystick2 ) ) ) return; - - // since we passed in a NULL window, we don't bother setting the cooperative level. } BOOL CALLBACK EnumJoysticksCallback( const DIDEVICEINSTANCE* pdidInstance, --- 110,119 ---- if( FAILED(gJoystick->SetDataFormat( &c_dfDIJoystick2 ) ) ) return; } + const char *GetJoystickName() + { + return gJoystickName; + } BOOL CALLBACK EnumJoysticksCallback( const DIDEVICEINSTANCE* pdidInstance, *************** *** 120,124 **** if(FAILED(gDirectInput->CreateDevice( pdidInstance->guidInstance, &gJoystick, NULL ))) return DIENUM_CONTINUE; ! return DIENUM_STOP; } --- 123,127 ---- if(FAILED(gDirectInput->CreateDevice( pdidInstance->guidInstance, &gJoystick, NULL ))) return DIENUM_CONTINUE; ! strcpy(gJoystickName, pdidInstance->tszProductName); return DIENUM_STOP; } |