opentnl-cvs Mailing List for Torque Network Library (Page 8)
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-08-06 00:05:38
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18402/zap Modified Files: game.h Log Message: Updated game version Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** game.h 2 Aug 2004 20:36:01 -0000 1.61 --- game.h 6 Aug 2004 00:05:25 -0000 1.62 *************** *** 234,238 **** extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.0 rc 11" }; --- 234,238 ---- extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.0 rc 12" }; |
From: Mark F. <mar...@us...> - 2004-08-06 00:02:59
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17978/zap Modified Files: UIMenus.cpp UIQueryServers.cpp flagItem.cpp game.cpp gameConnection.cpp gameNetInterface.cpp gameNetInterface.h gameType.cpp main.cpp masterConnection.cpp Log Message: Added ban list Added new "War" mission Updated README Index: gameNetInterface.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameNetInterface.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** gameNetInterface.h 20 Apr 2004 04:27:20 -0000 1.1 --- gameNetInterface.h 6 Aug 2004 00:02:47 -0000 1.2 *************** *** 42,45 **** --- 42,50 ---- Game *mGame; + struct BannedHost { + Address theAddress; + U32 banDuration; + }; + Vector<BannedHost> mBanList; public: enum PacketType *************** *** 54,57 **** --- 59,66 ---- void sendPing(const Address &theAddress, const Nonce &clientNonce); void sendQuery(const Address &theAddress, const Nonce &clientNonce, U32 identityToken); + void processPacket(const Address &sourceAddress, BitStream *pStream); + void banHost(const Address &bannedAddress, U32 bannedMilliseconds); + void checkBanlistTimeouts(U32 timeElapsed); + bool isHostBanned(const Address &theAddress); }; Index: gameConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameConnection.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** gameConnection.cpp 2 Aug 2004 18:11:54 -0000 1.24 --- gameConnection.cpp 6 Aug 2004 00:02:47 -0000 1.25 *************** *** 28,31 **** --- 28,32 ---- #include "game.h" #include "gameType.h" + #include "gameNetInterface.h" #include "UIGame.h" *************** *** 132,144 **** break; case PlayerMenuUserInterface::Kick: - msg = kickMessage; - if(theClient->isAdmin()) { ! static StringTableEntry nokick("Administrators cannot be kicked."); ! s2cDisplayMessage(ColorAqua, SFXIncomingMessage, nokick); ! return; } - theClient->disconnect("You were kicked from the game."); - break; default: return; --- 133,152 ---- break; case PlayerMenuUserInterface::Kick: { ! msg = kickMessage; ! if(theClient->isAdmin()) ! { ! static StringTableEntry nokick("Administrators cannot be kicked."); ! s2cDisplayMessage(ColorAqua, SFXIncomingMessage, nokick); ! return; ! } ! ConnectionParameters &p = theClient->getConnectionParameters(); ! if(p.mIsArranged) ! gServerGame->getNetInterface()->banHost(p.mPossibleAddresses[0], 30000); ! gServerGame->getNetInterface()->banHost(theClient->getNetAddress(), 30000); ! ! theClient->disconnect("You were kicked from the game."); ! break; } default: return; *************** *** 339,344 **** size_t len = strlen(buf); ! if(len > 252) ! len = 252; U32 index = 0; --- 347,370 ---- size_t len = strlen(buf); ! if(len > 30) ! len = 30; ! ! // strip leading and trailing spaces... ! char *name = buf; ! while(len && *name == ' ') ! { ! name++; ! len--; ! } ! while(len && name[len-1] == ' ') ! len--; ! ! // remove invisible chars ! for(size_t i = 0; i < len; i++) ! if(name[i] < ' ' || name[i] > 127) ! name[i] = 'X'; ! ! name[len] = 0; ! U32 index = 0; *************** *** 346,352 **** for(GameConnection *walk = getClientList(); walk; walk = walk->getNextClient()) { ! if(!strcmp(walk->mClientName.getString(), buf)) { ! dSprintf(buf + len, 3, ".%d", index); index++; goto checkPlayerName; --- 372,378 ---- for(GameConnection *walk = getClientList(); walk; walk = walk->getNextClient()) { ! if(!strcmp(walk->mClientName.getString(), name)) { ! dSprintf(name + len, 3, ".%d", index); index++; goto checkPlayerName; *************** *** 354,358 **** } ! mClientName = buf; return true; } --- 380,384 ---- } ! mClientName = name; return true; } Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** main.cpp 4 Aug 2004 15:38:51 -0000 1.66 --- main.cpp 6 Aug 2004 00:02:47 -0000 1.67 *************** *** 74,77 **** --- 74,78 ---- "football2.txt " "football3.txt " + "football4.txt " "rabbit1.txt " "soccer1.txt " Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** gameType.cpp 4 Aug 2004 18:25:27 -0000 1.57 --- gameType.cpp 6 Aug 2004 00:02:47 -0000 1.58 *************** *** 113,120 **** glEnable(GL_BLEND); glColor4f(1,1,1, alpha); ! UserInterface::drawCenteredStringf(60, 30, "Level: %s", mLevelName.getString()); ! UserInterface::drawCenteredStringf(100, 30, "Game Type: %s", getGameTypeString()); ! UserInterface::drawCenteredString(140, 20, getInstructionString()); ! UserInterface::drawCenteredString(530, 20, mLevelDescription.getString()); glDisable(GL_BLEND); } --- 113,120 ---- glEnable(GL_BLEND); glColor4f(1,1,1, alpha); ! UserInterface::drawCenteredStringf(UserInterface::vertMargin + 90, 30, "Level: %s", mLevelName.getString()); ! UserInterface::drawCenteredStringf(UserInterface::vertMargin + 130, 30, "Game Type: %s", getGameTypeString()); ! UserInterface::drawCenteredString(UserInterface::canvasHeight - UserInterface::vertMargin - 90, 20, getInstructionString()); ! UserInterface::drawCenteredString(UserInterface::canvasHeight - UserInterface::vertMargin - 60, 20, mLevelDescription.getString()); glDisable(GL_BLEND); } *************** *** 122,126 **** { U32 totalWidth = UserInterface::canvasWidth - UserInterface::horizMargin * 2; ! U32 teamWidth = totalWidth / mTeams.size(); U32 maxTeamPlayers = 0; countTeamPlayers(); --- 122,130 ---- { U32 totalWidth = UserInterface::canvasWidth - UserInterface::horizMargin * 2; ! U32 columnCount = mTeams.size(); ! if(columnCount > 2) ! columnCount = 2; ! ! U32 teamWidth = totalWidth / columnCount; U32 maxTeamPlayers = 0; countTeamPlayers(); *************** *** 137,152 **** teamAreaHeight = 0; ! U32 totalHeight = UserInterface::canvasHeight - UserInterface::vertMargin * 2; U32 maxHeight = (totalHeight - teamAreaHeight) / maxTeamPlayers; if(maxHeight > 30) maxHeight = 30; ! totalHeight = teamAreaHeight + maxHeight * maxTeamPlayers; ! U32 yt = (600 - totalHeight) / 2; ! U32 yb = yt + totalHeight; for(S32 i = 0; i < mTeams.size(); i++) { ! U32 xl = 10 + i * teamWidth; U32 xr = xl + teamWidth - 2; --- 141,159 ---- teamAreaHeight = 0; ! U32 numTeamRows = (mTeams.size() + 1) >> 1; ! ! U32 totalHeight = (UserInterface::canvasHeight - UserInterface::vertMargin * 2) / numTeamRows - (numTeamRows - 1) * 2; U32 maxHeight = (totalHeight - teamAreaHeight) / maxTeamPlayers; if(maxHeight > 30) maxHeight = 30; ! U32 sectionHeight = (teamAreaHeight + maxHeight * maxTeamPlayers); ! totalHeight = sectionHeight * numTeamRows + (numTeamRows - 1) * 2; for(S32 i = 0; i < mTeams.size(); i++) { ! U32 yt = (UserInterface::canvasHeight - totalHeight) / 2 + (i >> 1) * (sectionHeight + 2); ! U32 yb = yt + sectionHeight; ! U32 xl = 10 + (i & 1) * teamWidth; U32 xr = xl + teamWidth - 2; Index: UIMenus.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** UIMenus.cpp 2 Aug 2004 18:11:53 -0000 1.22 --- UIMenus.cpp 6 Aug 2004 00:02:46 -0000 1.23 *************** *** 53,57 **** { gGameUserInterface.render(); ! glColor4f(0, 0, 0, 0.5); glEnable(GL_BLEND); glBegin(GL_POLYGON); --- 53,57 ---- { gGameUserInterface.render(); ! glColor4f(0, 0, 0, 0.6); glEnable(GL_BLEND); glBegin(GL_POLYGON); *************** *** 65,71 **** glColor3f(1,1,1); ! drawCenteredString( 10, 30, menuTitle); ! drawCenteredString( 45, 18, menuSubTitle); ! drawCenteredString( 570, 18, menuFooter); if(selectionIndex >= menuItems.size()) --- 65,71 ---- glColor3f(1,1,1); ! drawCenteredString( vertMargin, 30, menuTitle); ! drawCenteredString( vertMargin + 35, 18, menuSubTitle); ! drawCenteredString( canvasHeight - vertMargin - 20, 18, menuFooter); if(selectionIndex >= menuItems.size()) Index: gameNetInterface.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameNetInterface.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** gameNetInterface.cpp 4 Aug 2004 15:38:51 -0000 1.4 --- gameNetInterface.cpp 6 Aug 2004 00:02:47 -0000 1.5 *************** *** 41,44 **** --- 41,82 ---- }; + void GameNetInterface::banHost(const Address &bannedAddress, U32 bannedMilliseconds) + { + BannedHost h; + h.theAddress = bannedAddress; + h.banDuration = bannedMilliseconds; + mBanList.push_back(h); + } + + bool GameNetInterface::isHostBanned(const Address &theAddress) + { + for(S32 i = 0; i < mBanList.size(); i++) + if(theAddress.isEqualAddress(mBanList[i].theAddress)) + return true; + return false; + } + + void GameNetInterface::processPacket(const Address &sourceAddress, BitStream *pStream) + { + for(S32 i = 0; i < mBanList.size(); i++) + if(sourceAddress.isEqualAddress(mBanList[i].theAddress)) + return; + Parent::processPacket(sourceAddress, pStream); + } + + void GameNetInterface::checkBanlistTimeouts(U32 timeElapsed) + { + for(S32 i = 0; i < mBanList.size(); ) + { + if(mBanList[i].banDuration < timeElapsed) + mBanList.erase_fast(i); + else + { + mBanList[i].banDuration -= timeElapsed; + i++; + } + } + } + void GameNetInterface::handleInfoPacket(const Address &remoteAddress, U8 packetType, BitStream *stream) { Index: game.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** game.cpp 2 Aug 2004 20:36:01 -0000 1.47 --- game.cpp 6 Aug 2004 00:02:47 -0000 1.48 *************** *** 336,339 **** --- 336,340 ---- { mCurrentTime += timeDelta; + mNetInterface->checkBanlistTimeouts(timeDelta); mNetInterface->checkIncomingPackets(); Game::checkConnectionToMaster(timeDelta); Index: UIQueryServers.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIQueryServers.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** UIQueryServers.cpp 4 Aug 2004 18:25:27 -0000 1.6 --- UIQueryServers.cpp 6 Aug 2004 00:02:46 -0000 1.7 *************** *** 307,317 **** glColor3f(1,1,1); ! drawCenteredString(0, 25, "CHOOSE A SERVER TO JOIN:"); ! drawCenteredString(560, 18, "UP, DOWN, PAGEUP, PAGEDOWN to select, ENTER to join."); ! drawCenteredString(580, 18, "LEFT, RIGHT select sort column, SPACE to sort. ESC exits."); for(S32 i = 0; i < columns.size(); i++) { ! drawString(columns[i].xStart, 45, 24, columns[i].name); } --- 307,320 ---- glColor3f(1,1,1); ! drawCenteredString(vertMargin, 25, "CHOOSE A SERVER TO JOIN:"); ! drawCenteredString(canvasHeight - vertMargin - 40, 18, "UP, DOWN, PAGEUP, PAGEDOWN to select, ENTER to join."); ! drawCenteredString(canvasHeight - vertMargin - 20, 18, "LEFT, RIGHT select sort column, SPACE to sort. ESC exits."); ! ! U32 top = vertMargin + 45; ! U32 bottom = canvasHeight - vertMargin - 60; for(S32 i = 0; i < columns.size(); i++) { ! drawString(columns[i].xStart, top, 24, columns[i].name); } *************** *** 324,332 **** glBegin(GL_LINE_LOOP); ! glVertex2f(x1, 43); ! glVertex2f(x2, 43); ! glVertex2f(x2, 71); ! glVertex2f(x1, 71); glEnd(); if(servers.size()) --- 327,343 ---- glBegin(GL_LINE_LOOP); ! glVertex2f(x1, top - 2); ! glVertex2f(x2, top - 2); ! glVertex2f(x2, top + 26); ! glVertex2f(x1, top + 26); glEnd(); + top += 30; + + U32 totalRows = (bottom - top) / 24; + if(!(totalRows & 1)) + totalRows--; + bottom = top + totalRows * 24; + + U32 serversAboveBelow = totalRows >> 1; if(servers.size()) *************** *** 336,341 **** selectedIndex = 0; ! S32 firstServer = selectedIndex - ServersAbove; ! S32 lastServer = selectedIndex + ServersBelow; if(firstServer < 0) --- 347,352 ---- selectedIndex = 0; ! S32 firstServer = selectedIndex - serversAboveBelow; ! S32 lastServer = selectedIndex + serversAboveBelow; if(firstServer < 0) *************** *** 351,355 **** for(S32 i = firstServer; i <= lastServer; i++) { ! U32 y = 75 + (i - firstServer) * 24; U32 fontSize = 21; ServerRef &s = servers[i]; --- 362,366 ---- for(S32 i = firstServer; i <= lastServer; i++) { ! U32 y = top + (i - firstServer) * 24; U32 fontSize = 21; ServerRef &s = servers[i]; *************** *** 420,430 **** { glBegin(GL_LINES); ! glVertex2f(columns[i].xStart - 4, 45); ! glVertex2f(columns[i].xStart - 4, 540); glEnd(); } glBegin(GL_LINES); ! glVertex2f(0, 72); ! glVertex2f(800, 72); glEnd(); } --- 431,441 ---- { glBegin(GL_LINES); ! glVertex2f(columns[i].xStart - 4, top - 30); ! glVertex2f(columns[i].xStart - 4, bottom); glEnd(); } glBegin(GL_LINES); ! glVertex2f(0, top - 3); ! glVertex2f(800, top - 3); glEnd(); } Index: flagItem.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/flagItem.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** flagItem.cpp 4 Aug 2004 18:25:27 -0000 1.4 --- flagItem.cpp 6 Aug 2004 00:02:46 -0000 1.5 *************** *** 105,110 **** if(mIsMounted) return false; ! if(!(hitObject->getObjectTypeMask() & ShipType)) return true; if(isGhost() || ((Ship *) hitObject)->hasExploded) --- 105,112 ---- if(mIsMounted) return false; ! if(hitObject->getObjectTypeMask() & (BarrierType | ForceFieldType)) return true; + if(!(hitObject->getObjectTypeMask() & ShipType)) + return false; if(isGhost() || ((Ship *) hitObject)->hasExploded) Index: masterConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/masterConnection.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** masterConnection.cpp 3 Jul 2004 20:01:47 -0000 1.12 --- masterConnection.cpp 6 Aug 2004 00:02:47 -0000 1.13 *************** *** 29,32 **** --- 29,33 ---- #include "../tnl/tnlNetInterface.h" #include "gameConnection.h" + #include "gameNetInterface.h" #include "UIQueryServers.h" #include "UIMenus.h" *************** *** 106,136 **** logprintf("Rejecting arranged connection from %s", Address(possibleAddresses[0]).toString()); c2mRejectArrangedConnection(requestId, connectionParameters); } ! else { ! // Ok, let's do the arranged connection! ! U8 data[Nonce::NonceSize * 2 + SymmetricCipher::KeySize * 2]; ! ByteBuffer b(data, sizeof(data)); ! Random::read(data, sizeof(data)); ! IPAddress localAddress = getInterface()->getFirstBoundInterfaceAddress().toIPAddress(); ! c2mAcceptArrangedConnection(requestId, localAddress, b); ! GameConnection *conn = new GameConnection(); ! Vector<Address> fullPossibleAddresses; ! for(S32 i = 0; i < possibleAddresses.size(); i++) ! fullPossibleAddresses.push_back(Address(possibleAddresses[i])); ! conn->setNetAddress(fullPossibleAddresses[0]); ! logprintf("Accepting arranged connection from %s", Address(fullPossibleAddresses[0]).toString()); ! logprintf(" Generated shared secret data: %s", b.encodeBase64()->getBuffer()); ! ByteBufferPtr theSharedData = new ByteBuffer(data + 2 * Nonce::NonceSize, sizeof(data) - 2 * Nonce::NonceSize); ! Nonce nonce(data); ! Nonce serverNonce(data + Nonce::NonceSize); ! conn->connectArranged(getInterface(), fullPossibleAddresses, ! nonce, serverNonce, theSharedData,false); ! } } --- 107,144 ---- logprintf("Rejecting arranged connection from %s", Address(possibleAddresses[0]).toString()); c2mRejectArrangedConnection(requestId, connectionParameters); + return; } ! ! Vector<Address> fullPossibleAddresses; ! for(S32 i = 0; i < possibleAddresses.size(); i++) ! fullPossibleAddresses.push_back(Address(possibleAddresses[i])); ! ! // First check if the specified host is banned on this server ! if(gServerGame->getNetInterface()->isHostBanned(fullPossibleAddresses[0])) { ! logprintf("Blocking connection from banned host %s", fullPossibleAddresses[0].toString()); ! c2mRejectArrangedConnection(requestId, connectionParameters); ! return; ! } ! // Ok, let's do the arranged connection! ! U8 data[Nonce::NonceSize * 2 + SymmetricCipher::KeySize * 2]; ! ByteBuffer b(data, sizeof(data)); ! Random::read(data, sizeof(data)); ! IPAddress localAddress = getInterface()->getFirstBoundInterfaceAddress().toIPAddress(); ! c2mAcceptArrangedConnection(requestId, localAddress, b); ! GameConnection *conn = new GameConnection(); ! conn->setNetAddress(fullPossibleAddresses[0]); ! logprintf("Accepting arranged connection from %s", Address(fullPossibleAddresses[0]).toString()); ! logprintf(" Generated shared secret data: %s", b.encodeBase64()->getBuffer()); ! ByteBufferPtr theSharedData = new ByteBuffer(data + 2 * Nonce::NonceSize, sizeof(data) - 2 * Nonce::NonceSize); ! Nonce nonce(data); ! Nonce serverNonce(data + Nonce::NonceSize); ! conn->connectArranged(getInterface(), fullPossibleAddresses, ! nonce, serverNonce, theSharedData,false); } |
From: Mark F. <mar...@us...> - 2004-08-06 00:02:58
|
Update of /cvsroot/opentnl/tnl/exe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17978/exe Modified Files: README.txt Log Message: Added ban list Added new "War" mission Updated README Index: README.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/README.txt,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** README.txt 2 Aug 2004 18:11:52 -0000 1.30 --- README.txt 6 Aug 2004 00:02:46 -0000 1.31 *************** *** 22,28 **** and the team scores a point. If the capture zone was already owned by a different team, the team that lost the zone loses a point. If ! all the zones on the level are captured by a single team, that team ! earns an additional point for the "touchdown", and the zones and flag ! reset. Hunters - Solo game where the objective is to collect flags from --- 22,33 ---- and the team scores a point. If the capture zone was already owned by a different team, the team that lost the zone loses a point. If ! all the zones on the level are captured by a single team, that scores ! a "touchdown", and the zones and flag reset. ! ! Retrieve - In Retrieve, one or more flags are scattered throughout the level. ! Teams compete to bring these flags back to team-colored goal zones. Each ! retrieved flag is worth one point to the capturing team. If a team retrieves ! all the flags on the level, the team keeps the points for the flags and the ! flags reset to their original locations. Hunters - Solo game where the objective is to collect flags from |
From: Mark F. <mar...@us...> - 2004-08-06 00:02:58
|
Update of /cvsroot/opentnl/tnl/exe/levels In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17978/exe/levels Added Files: football4.txt Log Message: Added ban list Added new "War" mission Updated README --- NEW FILE: football4.txt --- ZoneControlGameType 10 32 Team Blue 0 0 1 Team Red 1 0 0 LevelName War GridSize 270 FlagItem -1 0 0 LoadoutZone 0 -0.6 6.8 0.6 6.8 0.4 6.4 -0.4 6.4 Spawn 0 -0.200001 7.3 Spawn 0 -0.6 7.5 Spawn 0 0 7.7 Spawn 0 0.6 7.5 Spawn 0 0.200001 7.3 Spawn 0 1.1 7.7 Spawn 0 0.6 8 Spawn 0 0 8 Spawn 0 -0.6 8 Spawn 0 -1.1 7.7 BarrierMaker 0 9.1 -0.2 9.1 -0.3 9 -1 9 -3 8 -5 8 -6 9 -8 9 -9 8 -9 6 -7 5 -6 3 -3 1 -3 0 BarrierMaker 0 9.1 0.2 9.1 0.3 9 1 9 3 8 5 8 6 9 8 9 9 8 9 6 7 5 6 3 3 1 3 0 GoalZone -1 -7.4 7.4 -6.6 7.4 -6.6 6.6 -7.4 6.6 GoalZone -1 -0.4 5.4 0.4 5.4 0.4 4.6 -0.4 4.6 GoalZone -1 6.6 7.4 7.4 7.4 7.4 6.6 6.6 6.6 GoalZone -1 -0.4 2.4 0.4 2.4 0.4 1.6 -0.4 1.6 BarrierMaker -2 7 -1 6 -0.5 6 BarrierMaker 0.5 6 1 6 2 7 BarrierMaker 3 7 3 6.5 3.4 6.1 4 6.1 4.5 5.6 4.5 5.1 5 4.6 5.6 4.6 BarrierMaker 3.9 7.3 4.3 6.9 5.2 6.9 BarrierMaker 6 6.3 6 5.5 6.2 5.3 BarrierMaker 8.2 6.7 8.2 7.5 7.8 7.9 7.4 7.9 BarrierMaker 5.9 7.6 6.6 8.3 Turret 0 6.1 6.1 Turret 0 1.6 6.5 Turret 0 0.6 5.9 Turret 0 -0.6 5.9 Turret 0 -1.6 6.5 BarrierMaker 2.2 5.1 2.8 5.1 2.9 5.2 2.9 5.4 3 5.5 3.2 5.5 3.9 4.8 3.9 4.6 3.8 4.5 2.5 4.5 2.3 4.4 2.1 4.4 2 4.5 2 4.9 2.2 5.1 BarrierMaker 4 3.6 4 3.7 4.3 4 4.5 4 4.8 3.7 4.8 3.6 4.7 3.5 4.1 3.5 4 3.6 BarrierMaker 3.4 3.5 3.4 3.7 3.3 3.8 2.8 3.8 2.7 3.9 2 3.9 1.8 3.7 1.6 3.7 1 3.1 BarrierMaker 0.6 4 0.1 3.5 -1.9 3.5 -2.9 2.5 -3.4 2.5 -3.7 2.8 -3.7 3.7 -4.2 4.2 -4.2 4.3 BarrierMaker -0.5 -0.8 -0.5 0.8 BarrierMaker 0.5 -0.8 0.5 0.8 BarrierMaker -2.1 0.5 -1.3 0.8 -1 0.8 BarrierMaker 1.3 0.8 2 0.8 2 1.4 3 2 3 2.6 2 2.6 1.8 2.4 1.8 2 1 1.6 1 1.4 1.3 0.8 Turret -1 1.5 0.7 Turret 0 -0.4 3.4 ForceFieldProjector 0 1 3.2 ForceFieldProjector 0 2.2 4.3 BarrierMaker -0.699999 4.4 -0.699999 4.8 BarrierMaker 0.6 4.6 0.6 5 0.700001 5.1 1.2 5.1 1.3 5 1.3 4.9 0.9 4.5 0.700001 4.5 0.6 4.6 BarrierMaker 1.9 5.7 2.3 5.7 2.6 6 BarrierMaker -3 5.9 -3 7 -3.5 7 BarrierMaker -4 6.5 -3.5 6 -3.5 5 BarrierMaker -4.2 5.5 -5.2 5.5 BarrierMaker -4.8 6.6 -4.8 5.5 BarrierMaker -4.7 7.2 -4 7.2 BarrierMaker -6.4 5.9 -6 6.3 -6 6.7 -5.7 7 -5.3 7 BarrierMaker -6.1 5.2 -5.6 4.2 -5.2 3.8 -4.8 3.6 -4.7 3.6 -4.7 3.7 -4.4 3.7 BarrierMaker -6 7.7 -6.4 8.1 BarrierMaker -6.9 8.2 -7.5 8.2 BarrierMaker -6.5 8.6 -6.5 9 BarrierMaker -8.6 7.4 -8.2 7 -8.1 7 -8 7.8 -8.1 7.9 -8.6 7.6 -8.6 7.4 BarrierMaker -8.3 6.5 -7.5 6.1 -7 6.1 -6.9 6 -6.9 5.6 -6.6 5.4 BarrierMaker -0.4 8.3 -0.4 9 BarrierMaker 0.4 8.3 0.4 9 Teleporter 0 8.7 1 0 ForceFieldProjector 0 -0.299999 8.4 LoadoutZone 1 0.6 -6.8 -0.6 -6.8 -0.4 -6.4 0.4 -6.4 Spawn 1 0.200001 -7.3 Spawn 1 0.6 -7.5 Spawn 1 0 -7.7 Spawn 1 -0.6 -7.5 Spawn 1 -0.200001 -7.3 Spawn 1 -1.1 -7.7 Spawn 1 -0.6 -8 Spawn 1 0 -8 Spawn 1 0.6 -8 Spawn 1 1.1 -7.7 BarrierMaker 0 -9.1 0.2 -9.1 0.3 -9 1 -9 3 -8 5 -8 6 -9 8 -9 9 -8 9 -6 7 -5 6 -3 3 -1 3 0 BarrierMaker 0 -9.1 -0.2 -9.1 -0.3 -9 -1 -9 -3 -8 -5 -8 -6 -9 -8 -9 -9 -8 -9 -6 -7 -5 -6 -3 -3 -1 -3 0 GoalZone -1 7.4 -7.4 6.6 -7.4 6.6 -6.6 7.4 -6.6 GoalZone -1 0.4 -5.4 -0.4 -5.4 -0.4 -4.6 0.4 -4.6 GoalZone -1 -6.6 -7.4 -7.4 -7.4 -7.4 -6.6 -6.6 -6.6 GoalZone -1 0.4 -2.4 -0.4 -2.4 -0.4 -1.6 0.4 -1.6 BarrierMaker 2 -7 1 -6 0.5 -6 BarrierMaker -0.5 -6 -1 -6 -2 -7 BarrierMaker -3 -7 -3 -6.5 -3.4 -6.1 -4 -6.1 -4.5 -5.6 -4.5 -5.1 -5 -4.6 -5.6 -4.6 BarrierMaker -3.9 -7.3 -4.3 -6.9 -5.2 -6.9 BarrierMaker -6 -6.3 -6 -5.5 -6.2 -5.3 BarrierMaker -8.2 -6.7 -8.2 -7.5 -7.8 -7.9 -7.4 -7.9 BarrierMaker -5.9 -7.6 -6.6 -8.3 Turret 1 -6.1 -6.1 Turret 1 -1.6 -6.5 Turret 1 -0.6 -5.9 Turret 1 0.6 -5.9 Turret 1 1.6 -6.5 BarrierMaker -2.2 -5.1 -2.8 -5.1 -2.9 -5.2 -2.9 -5.4 -3 -5.5 -3.2 -5.5 -3.9 -4.8 -3.9 -4.6 -3.8 -4.5 -2.5 -4.5 -2.3 -4.4 -2.1 -4.4 -2 -4.5 -2 -4.9 -2.2 -5.1 BarrierMaker -4 -3.6 -4 -3.7 -4.3 -4 -4.5 -4 -4.8 -3.7 -4.8 -3.6 -4.7 -3.5 -4.1 -3.5 -4 -3.6 BarrierMaker -3.4 -3.5 -3.4 -3.7 -3.3 -3.8 -2.8 -3.8 -2.7 -3.9 -2 -3.9 -1.8 -3.7 -1.6 -3.7 -1 -3.1 BarrierMaker -0.6 -4 -0.1 -3.5 1.9 -3.5 2.9 -2.5 3.4 -2.5 3.7 -2.8 3.7 -3.7 4.2 -4.2 4.2 -4.3 BarrierMaker 2.1 -0.5 1.3 -0.8 1 -0.8 BarrierMaker -1.3 -0.8 -2 -0.8 -2 -1.4 -3 -2 -3 -2.6 -2 -2.6 -1.8 -2.4 -1.8 -2 -1 -1.6 -1 -1.4 -1.3 -0.8 Turret -1 -1.5 -0.7 Turret 1 0.4 -3.4 ForceFieldProjector 1 -1 -3.2 ForceFieldProjector 1 -2.2 -4.3 BarrierMaker 0.699999 -4.4 0.699999 -4.8 BarrierMaker -0.6 -4.6 -0.6 -5 -0.700001 -5.1 -1.2 -5.1 -1.3 -5 -1.3 -4.9 -0.9 -4.5 -0.700001 -4.5 -0.6 -4.6 BarrierMaker -1.9 -5.7 -2.3 -5.7 -2.6 -6 BarrierMaker 3 -5.9 3 -7 3.5 -7 BarrierMaker 4 -6.5 3.5 -6 3.5 -5 BarrierMaker 4.2 -5.5 5.2 -5.5 BarrierMaker 4.8 -6.6 4.8 -5.5 BarrierMaker 4.7 -7.2 4 -7.2 BarrierMaker 6.4 -5.9 6 -6.3 6 -6.7 5.7 -7 5.3 -7 BarrierMaker 6.1 -5.2 5.6 -4.2 5.2 -3.8 4.8 -3.6 4.7 -3.6 4.7 -3.7 4.4 -3.7 BarrierMaker 6 -7.7 6.4 -8.1 BarrierMaker 6.9 -8.2 7.5 -8.2 BarrierMaker 6.5 -8.6 6.5 -9 BarrierMaker 8.6 -7.4 8.2 -7 8.1 -7 8 -7.8 8.1 -7.9 8.6 -7.6 8.6 -7.4 BarrierMaker 8.3 -6.5 7.5 -6.1 7 -6.1 6.9 -6 6.9 -5.6 6.6 -5.4 BarrierMaker 0.4 -8.3 0.4 -9 BarrierMaker -0.4 -8.3 -0.4 -9 Teleporter 0 -8.7 -1 0 ForceFieldProjector 1 0.299999 -8.4 |
From: Mark F. <mar...@us...> - 2004-08-04 18:25:38
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12294/zap Modified Files: CTFGame.cpp CTFGame.h UICredits.cpp UICredits.h UIQueryServers.cpp engineeredObjects.h flagItem.cpp footballGame.cpp gameType.cpp gameType.h item.cpp item.h rabbitGame.cpp rabbitGame.h retrieveGame.cpp ship.cpp ship.h Log Message: Fixed exit memory leak in netBase.cpp Fixed flagDropped gameType function to be more consistent and useful Allowed game types to dynamically assign colors to ships Fixed xbox exit crash Made force fields more useful Major cleanup and fixes to Rabbit game type Index: rabbitGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/rabbitGame.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** rabbitGame.cpp 29 Jun 2004 00:14:52 -0000 1.9 --- rabbitGame.cpp 4 Aug 2004 18:25:27 -0000 1.10 *************** *** 90,98 **** void RabbitGameType::processArguments(S32 argc, const char **argv) { ! if (argc != 2) return; ! mScoreLimit = atoi(argv[0]); ! Parent::processArguments(argc-1, argv+1); } --- 90,100 ---- void RabbitGameType::processArguments(S32 argc, const char **argv) { ! if (argc != 4) return; ! Parent::processArguments(argc, argv); ! ! mFlagReturnTimer = Timer(atoi(argv[2]) * 1000); ! mFlagScoreTimer = Timer(1.0f / atoi(argv[3]) * 60 * 1000); //secs per point } *************** *** 109,116 **** return true; - //if one of them isn't a ship, default to whatever the parent is - if(!(damager->getObjectTypeMask() & victim->getObjectTypeMask() & ShipType)) - return Parent::objectCanDamageObject(damager, victim); - GameConnection *c1 = damager->getOwner(); GameConnection *c2 = victim->getOwner(); --- 111,114 ---- *************** *** 129,132 **** --- 127,142 ---- } + Color RabbitGameType::getShipColor(Ship *s) + { + GameConnection *gc = gClientGame->getConnectionToServer(); + if(!gc) + return Color(); + Ship *co = (Ship *) gc->getControlObject(); + + if(s == co || shipHasFlag(s) == shipHasFlag(co)) + return Color(0,1,0); + return Color(1,0,0); + } + bool RabbitGameType::shipHasFlag(Ship *ship) { *************** *** 136,143 **** for (S32 k = 0; k < ship->mMountedItems.size(); k++) { ! if (RabbitFlagItem *flag = dynamic_cast<RabbitFlagItem *>(ship->mMountedItems[k].getPointer())) return true; } - return false; } --- 146,152 ---- for (S32 k = 0; k < ship->mMountedItems.size(); k++) { ! if (dynamic_cast<FlagItem *>(ship->mMountedItems[k].getPointer())) return true; } return false; } *************** *** 152,159 **** cl->score += howMuch; ! if (cl->score >= mScoreLimit) gameOverManGameOver(); } void RabbitGameType::controlObjectForClientKilled(GameConnection *theClient, GameObject *clientObject, GameObject *killerObject) { --- 161,198 ---- cl->score += howMuch; ! if (cl->score >= mTeamScoreLimit) gameOverManGameOver(); } + void RabbitGameType::idle(GameObject::IdleCallPath path) + { + Parent::idle(path); + if(path != GameObject::ServerIdleMainLoop || !mRabbitFlag) + return; + + U32 deltaT = mCurrentMove.time; + + if (mRabbitFlag->isMounted()) + { + if (mFlagScoreTimer.update(deltaT)) + { + onFlagHeld(mRabbitFlag->getMount()); + mFlagScoreTimer.reset(); + } + } + else + { + if (!mRabbitFlag->isAtHome() && mFlagReturnTimer.update(deltaT)) + { + mFlagReturnTimer.reset(); + mRabbitFlag->sendHome(); + static StringTableEntry returnString("The carrot has been returned!"); + for (S32 i = 0; i < mClientList.size(); i++) + mClientList[i]->clientConnection->s2cDisplayMessageE(GameConnection::ColorNuclearGreen, SFXFlagReturn, returnString, NULL); + } + } + Parent::idle(path); + } + void RabbitGameType::controlObjectForClientKilled(GameConnection *theClient, GameObject *clientObject, GameObject *killerObject) { *************** *** 182,192 **** } ! void RabbitGameType::onFlagGrabbed(Ship *ship, RabbitFlagItem *flag) { ! s2cRabbitMessage(RabbitMsgGrab, ship->mPlayerName.getString()); flag->mountToShip(ship); } void RabbitGameType::onFlagHeld(Ship *ship) { --- 221,240 ---- } ! void RabbitGameType::shipTouchFlag(Ship *ship, FlagItem *flag) { ! s2cRabbitMessage(RabbitMsgGrab, ship->mPlayerName); flag->mountToShip(ship); } + void RabbitGameType::flagDropped(Ship *theShip, FlagItem *theFlag) + { + mFlagScoreTimer.reset(); + mFlagReturnTimer.reset(); + s2cRabbitMessage(RabbitMsgDrop, theShip->mPlayerName); + Point vel = theShip->getActualVel(); + theFlag->setActualVel(vel); + } + void RabbitGameType::onFlagHeld(Ship *ship) { *************** *** 194,205 **** } ! void RabbitGameType::onFlagDropped(Ship *victimShip) { ! s2cRabbitMessage(RabbitMsgDrop, victimShip->mPlayerName.getString()); } void RabbitGameType::onFlaggerKill(Ship *rabbitShip) { ! s2cRabbitMessage(RabbitMsgRabbitKill, rabbitShip->mPlayerName.getString()); onClientScore(rabbitShip, RabbidRabbitBonus); } --- 242,254 ---- } ! void RabbitGameType::addFlag(FlagItem *theFlag) { ! mRabbitFlag = theFlag; ! theFlag->setScopeAlways(); } void RabbitGameType::onFlaggerKill(Ship *rabbitShip) { ! s2cRabbitMessage(RabbitMsgRabbitKill, rabbitShip->mPlayerName); onClientScore(rabbitShip, RabbidRabbitBonus); } *************** *** 207,345 **** void RabbitGameType::onFlaggerDead(Ship *killerShip) { ! s2cRabbitMessage(RabbitMsgRabbitDead, killerShip->mPlayerName.getString()); onClientScore(killerShip, RabbitKillBonus); } - void RabbitGameType::onFlagReturned() - { - static StringTableEntry returnString("The carrot has been returned!"); - for (S32 i = 0; i < mClientList.size(); i++) - mClientList[i]->clientConnection->s2cDisplayMessageE(GameConnection::ColorNuclearGreen, SFXFlagReturn, returnString, NULL); - } - - //----------------------------------------------------- - // RabbitFlagItem - //----------------------------------------------------- - TNL_IMPLEMENT_NETOBJECT(RabbitFlagItem); - - RabbitFlagItem::RabbitFlagItem(Point pos) : Item(pos, false, 20) - { - mTeam = 0; - mNetFlags.set(Ghostable); - mObjectTypeMask |= CommandMapVisType; - } - - void RabbitFlagItem::processArguments(S32 argc, const char **argv) - { - if(argc < 4) - return; - - mReturnTimer = Timer(atoi(argv[0]) * 1000); - mScoreTimer = Timer(1.0f / atoi(argv[1]) * 60 * 1000); //secs per point - Parent::processArguments(argc-2, argv+2); - initialPos = mMoveState[ActualState].pos; - } - - void RabbitFlagItem::onAddedToGame(Game *theGame) - { - if(!isGhost()) - setScopeAlways(); - } - - void RabbitFlagItem::renderItem(Point pos) - { - Point offset; - - if(mIsMounted) - offset.set(15, -15); - - Color c; - GameType *gt = getGame()->getGameType(); - - c = gt->mTeams[getTeam()].color; - - renderFlag(pos + offset, c); - } - - bool RabbitFlagItem::collide(GameObject *hitObject) - { - if(mIsMounted) - return false; - - if(!(hitObject->getObjectTypeMask() & ShipType)) - return true; - - if(isGhost() || ((Ship *) hitObject)->hasExploded) - return false; - - RabbitGameType *theGameType = dynamic_cast<RabbitGameType *>(getGame()->getGameType()); - if(theGameType) - { - theGameType->onFlagGrabbed((Ship *) hitObject, this); - return true; - } - return false; - } - - void RabbitFlagItem::onMountDestroyed() - { - RabbitGameType *game = dynamic_cast<RabbitGameType *>(getGame()->getGameType()); - if(!game) - return; - - if(!mMount.isValid()) - return; - - mScoreTimer.reset(); - mReturnTimer.reset(); - - game->onFlagDropped(this->mMount); - Point vel = mMount->getActualVel(); - dismount(); - - mMoveState[ActualState].vel = vel; - setMaskBits(WarpPositionMask | PositionMask); - } - - void RabbitFlagItem::sendHome() - { - setActualPos(initialPos); - - RabbitGameType *game = dynamic_cast<RabbitGameType *>(getGame()->getGameType()); - if(!game) - return; - - game->onFlagReturned(); - } - - - void RabbitFlagItem::idle(GameObject::IdleCallPath path) - { - U32 deltaT = mCurrentMove.time; - - if (mMount) - { - if (mScoreTimer.update(deltaT)) - { - RabbitGameType *theGameType = dynamic_cast<RabbitGameType *>(getGame()->getGameType()); - if(!theGameType) - return; - - theGameType->onFlagHeld(mMount); - mScoreTimer.reset(); - } - } - else - { - if (!(initialPos == mMoveState[ActualState].pos) && mReturnTimer.update(deltaT)) - { - mReturnTimer.reset(); - sendHome(); - } - } - Parent::idle(path); - } - - }; //namespace Zap --- 256,263 ---- void RabbitGameType::onFlaggerDead(Ship *killerShip) { ! s2cRabbitMessage(RabbitMsgRabbitDead, killerShip->mPlayerName); onClientScore(killerShip, RabbitKillBonus); } }; //namespace Zap Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** gameType.cpp 2 Aug 2004 18:11:54 -0000 1.56 --- gameType.cpp 4 Aug 2004 18:25:27 -0000 1.57 *************** *** 522,525 **** --- 522,530 ---- } + Color GameType::getShipColor(Ship *s) + { + return getTeamColor(s->getTeam()); + } + void GameType::countTeamPlayers() { Index: engineeredObjects.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/engineeredObjects.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** engineeredObjects.h 29 Jun 2004 22:46:03 -0000 1.12 --- engineeredObjects.h 4 Aug 2004 18:25:27 -0000 1.13 *************** *** 94,98 **** StatusMask = BIT(1), ! FieldDownTime = 1000, }; --- 94,98 ---- StatusMask = BIT(1), ! FieldDownTime = 250, }; Index: flagItem.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/flagItem.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** flagItem.cpp 1 Jul 2004 23:07:46 -0000 1.3 --- flagItem.cpp 4 Aug 2004 18:25:27 -0000 1.4 *************** *** 81,84 **** --- 81,85 ---- { mMoveState[ActualState].pos = mMoveState[RenderState].pos = initialPos; + mMoveState[ActualState].vel = Point(0,0); setMaskBits(PositionMask); updateExtent(); *************** *** 102,112 **** bool FlagItem::collide(GameObject *hitObject) { ! if(isGhost() || mIsMounted) return false; - if(!(hitObject->getObjectTypeMask() & ShipType)) ! return false; ! if(((Ship *) hitObject)->hasExploded) return false; --- 103,112 ---- bool FlagItem::collide(GameObject *hitObject) { ! if(mIsMounted) return false; if(!(hitObject->getObjectTypeMask() & ShipType)) ! return true; ! if(isGhost() || ((Ship *) hitObject)->hasExploded) return false; *************** *** 126,130 **** return; ! gt->flagDropped(mMount->mPlayerName, getTeam()); dismount(); } --- 126,130 ---- return; ! gt->flagDropped(mMount, this); dismount(); } Index: retrieveGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/retrieveGame.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** retrieveGame.cpp 2 Aug 2004 20:36:01 -0000 1.2 --- retrieveGame.cpp 4 Aug 2004 18:25:27 -0000 1.3 *************** *** 102,110 **** } ! void flagDropped(const StringTableEntry &playerName, S32 flagTeamIndex) { static StringTableEntry dropString("%e0 dropped a flag!"); Vector<StringTableEntry> e; ! e.push_back(playerName); for(S32 i = 0; i < mClientList.size(); i++) mClientList[i]->clientConnection->s2cDisplayMessageE(GameConnection::ColorNuclearGreen, SFXFlagDrop, dropString, e); --- 102,110 ---- } ! void flagDropped(Ship *theShip, FlagItem *theFlag) { static StringTableEntry dropString("%e0 dropped a flag!"); Vector<StringTableEntry> e; ! e.push_back(theShip->mPlayerName); for(S32 i = 0; i < mClientList.size(); i++) mClientList[i]->clientConnection->s2cDisplayMessageE(GameConnection::ColorNuclearGreen, SFXFlagDrop, dropString, e); Index: UICredits.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UICredits.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** UICredits.h 18 May 2004 18:55:04 -0000 1.5 --- UICredits.h 4 Aug 2004 18:25:27 -0000 1.6 *************** *** 101,105 **** } void render(); ! void onKeyDown(U32 key) { exit(0); } // exit for now }; extern CreditsUserInterface gCreditsUserInterface; --- 101,107 ---- } void render(); ! void quit(); ! void onControllerButtonDown(U32 button) { quit(); } ! void onKeyDown(U32 key) { quit(); } // exit for now }; extern CreditsUserInterface gCreditsUserInterface; Index: rabbitGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/rabbitGame.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** rabbitGame.h 29 Jun 2004 00:14:52 -0000 1.5 --- rabbitGame.h 4 Aug 2004 18:25:27 -0000 1.6 *************** *** 42,46 **** typedef GameType Parent; ! S32 mScoreLimit; public: --- 42,48 ---- typedef GameType Parent; ! FlagItem *mRabbitFlag; ! Timer mFlagReturnTimer; ! Timer mFlagScoreTimer; public: *************** *** 65,69 **** RabbitGameType() { ! mScoreLimit = 100; } --- 67,72 ---- RabbitGameType() { ! mTeamScoreLimit = 100; ! mRabbitFlag = NULL; } *************** *** 71,77 **** --- 74,87 ---- void spawnShip(GameConnection *theClient); + void idle(GameObject::IdleCallPath path); + + void addFlag(FlagItem *theFlag); + void flagDropped(Ship *theShip, FlagItem *theFlag); + void shipTouchFlag(Ship *theShip, FlagItem *theFlag); + bool objectCanDamageObject(GameObject *damager, GameObject *victim); void controlObjectForClientKilled(GameConnection *theClient, GameObject *clientObject, GameObject *killerObject); bool shipHasFlag(Ship *ship); + Color getShipColor(Ship *s); void onFlagGrabbed(Ship *ship, RabbitFlagItem *flag); *************** *** 90,120 **** }; - class RabbitFlagItem : public Item - { - typedef Item Parent; - - Timer mReturnTimer; - Timer mScoreTimer; - - Point initialPos; - - public: - RabbitFlagItem(Point pos = Point()); - void processArguments(S32 argc, const char **argv); - void onAddedToGame(Game *theGame); - - void renderItem(Point pos); - bool collide(GameObject *hitObject); - - void idle(GameObject::IdleCallPath path); - void onMountDestroyed(); - - void sendHome(); - - - TNL_DECLARE_CLASS(RabbitFlagItem); - - }; - }; --- 100,103 ---- Index: UICredits.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UICredits.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** UICredits.cpp 25 Jun 2004 23:03:19 -0000 1.5 --- UICredits.cpp 4 Aug 2004 18:25:27 -0000 1.6 *************** *** 88,91 **** --- 88,101 ---- } + void CreditsUserInterface::quit() + { + #ifdef TNL_OS_XBOX + extern void xboxexit(); + xboxexit(); + #else + exit(0); + #endif + } + //----------------------------------------------------- // CreditsFX Objects Index: ship.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.h,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** ship.h 3 Jul 2004 00:11:25 -0000 1.37 --- ship.h 4 Aug 2004 18:25:27 -0000 1.38 *************** *** 115,119 **** FXTrail mTrail[TrailCount]; - Color color; // color of the ship F32 mass; // mass of ship bool hasExploded; --- 115,118 ---- Index: footballGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/footballGame.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** footballGame.cpp 2 Aug 2004 20:36:01 -0000 1.9 --- footballGame.cpp 4 Aug 2004 18:25:27 -0000 1.10 *************** *** 42,46 **** public: void shipTouchFlag(Ship *theShip, FlagItem *theFlag); ! void flagDropped(const StringTableEntry &playerName, S32 flagTeamIndex); void addZone(GoalZone *z); void shipTouchZone(Ship *s, GoalZone *z); --- 42,46 ---- public: void shipTouchFlag(Ship *theShip, FlagItem *theFlag); ! void flagDropped(Ship *theShip, FlagItem *theFlag); void addZone(GoalZone *z); void shipTouchZone(Ship *s, GoalZone *z); *************** *** 70,78 **** } ! void ZoneControlGameType::flagDropped(const StringTableEntry &playerName, S32 flagTeamIndex) { static StringTableEntry dropString("%e0 dropped the flag!"); Vector<StringTableEntry> e; ! e.push_back(playerName); for(S32 i = 0; i < mClientList.size(); i++) mClientList[i]->clientConnection->s2cDisplayMessageE(GameConnection::ColorNuclearGreen, SFXFlagDrop, dropString, e); --- 70,78 ---- } ! void ZoneControlGameType::flagDropped(Ship *theShip, FlagItem *theFlag) { static StringTableEntry dropString("%e0 dropped the flag!"); Vector<StringTableEntry> e; ! e.push_back(theShip->mPlayerName); for(S32 i = 0; i < mClientList.size(); i++) mClientList[i]->clientConnection->s2cDisplayMessageE(GameConnection::ColorNuclearGreen, SFXFlagDrop, dropString, e); Index: CTFGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** CTFGame.cpp 25 Jun 2004 02:59:55 -0000 1.31 --- CTFGame.cpp 4 Aug 2004 18:25:27 -0000 1.32 *************** *** 99,108 **** } ! void CTFGameType::flagDropped(const StringTableEntry &playerName, S32 flagTeamIndex) { static StringTableEntry dropString("%e0 dropped the %e1 flag!"); Vector<StringTableEntry> e; ! e.push_back(playerName); ! e.push_back(mTeams[flagTeamIndex].name); for(S32 i = 0; i < mClientList.size(); i++) mClientList[i]->clientConnection->s2cDisplayMessageE(GameConnection::ColorNuclearGreen, SFXFlagDrop, dropString, e); --- 99,108 ---- } ! void CTFGameType::flagDropped(Ship *theShip, FlagItem *theFlag) { static StringTableEntry dropString("%e0 dropped the %e1 flag!"); Vector<StringTableEntry> e; ! e.push_back(theShip->mPlayerName); ! e.push_back(mTeams[theFlag->getTeam()].name); for(S32 i = 0; i < mClientList.size(); i++) mClientList[i]->clientConnection->s2cDisplayMessageE(GameConnection::ColorNuclearGreen, SFXFlagDrop, dropString, e); Index: gameType.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** gameType.h 2 Aug 2004 18:11:54 -0000 1.32 --- gameType.h 4 Aug 2004 18:25:27 -0000 1.33 *************** *** 151,158 **** void setClientShipLoadout(ClientRef *cl, const Vector<U32> &loadout); Color getTeamColor(S32 team); // game type flag methods for CTF, Rabbit, Football virtual void addFlag(FlagItem *theFlag) {} ! virtual void flagDropped(const StringTableEntry &playerName, S32 flagTeamIndex) {} virtual void shipTouchFlag(Ship *theShip, FlagItem *theFlag) {} --- 151,159 ---- void setClientShipLoadout(ClientRef *cl, const Vector<U32> &loadout); + virtual Color getShipColor(Ship *s); Color getTeamColor(S32 team); // game type flag methods for CTF, Rabbit, Football virtual void addFlag(FlagItem *theFlag) {} ! virtual void flagDropped(Ship *theShip, FlagItem *theFlag) {} virtual void shipTouchFlag(Ship *theShip, FlagItem *theFlag) {} Index: UIQueryServers.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIQueryServers.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** UIQueryServers.cpp 4 Aug 2004 15:38:51 -0000 1.5 --- UIQueryServers.cpp 4 Aug 2004 18:25:27 -0000 1.6 *************** *** 41,45 **** { servers.clear(); ! for(U32 i = 0;i < 512; i++) { ServerRef s; --- 41,45 ---- { servers.clear(); ! /*for(U32 i = 0;i < 512; i++) { ServerRef s; *************** *** 52,56 **** s.playerCount = Random::readF() * s.maxPlayers; servers.push_back(s); ! } sortColumn = 0; pendingPings = 0; --- 52,56 ---- s.playerCount = Random::readF() * s.maxPlayers; servers.push_back(s); ! }*/ sortColumn = 0; pendingPings = 0; Index: item.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/item.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** item.cpp 24 Jun 2004 22:50:19 -0000 1.18 --- item.cpp 4 Aug 2004 18:25:27 -0000 1.19 *************** *** 104,107 **** --- 104,118 ---- } + void Item::setActualVel(Point vel) + { + mMoveState[ActualState].vel = vel; + setMaskBits(WarpPositionMask | PositionMask); + } + + Ship *Item::getMount() + { + return mMount; + } + void Item::idle(GameObject::IdleCallPath path) { Index: CTFGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/CTFGame.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** CTFGame.h 24 Jun 2004 22:50:19 -0000 1.15 --- CTFGame.h 4 Aug 2004 18:25:27 -0000 1.16 *************** *** 50,54 **** public: void shipTouchFlag(Ship *theShip, FlagItem *theFlag); ! void flagDropped(const StringTableEntry &playerName, S32 flagTeamIndex); const char *getGameTypeString() { return "Capture the Flag"; } const char *getInstructionString() { return "Take the opposing team's flag and touch it to your flag!"; } --- 50,54 ---- public: void shipTouchFlag(Ship *theShip, FlagItem *theFlag); ! void flagDropped(Ship *theShip, FlagItem *theFlag); 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.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** item.h 30 May 2004 00:16:13 -0000 1.7 --- item.h 4 Aug 2004 18:25:27 -0000 1.8 *************** *** 61,67 **** --- 61,69 ---- void setActualPos(Point p); + void setActualVel(Point vel); void mountToShip(Ship *theShip); bool isMounted() { return mIsMounted; } + Ship *getMount(); void dismount(); void render(); Index: ship.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.cpp,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** ship.cpp 2 Aug 2004 18:11:54 -0000 1.74 --- ship.cpp 4 Aug 2004 18:25:27 -0000 1.75 *************** *** 112,116 **** } - color.read(argv + 2); updateExtent(); } --- 112,115 ---- *************** *** 666,673 **** mPlayerName = connection->unpackStringTableEntry(stream); - GameType *g = gClientGame->getGameType(); - if(g) - color = g->getClientColor(mPlayerName); - stream->read(&mass); mTeam = stream->readRangedU32(0, gClientGame->getTeamCount()) - 1; --- 665,668 ---- *************** *** 1061,1064 **** --- 1056,1064 ---- return; + GameType *g = gClientGame->getGameType(); + Color color; + if(g) + color = g->getShipColor(this); + F32 alpha = 1.0; if(isCloakActive()) |
From: Mark F. <mar...@us...> - 2004-08-04 18:25:36
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12294/tnl Modified Files: netBase.cpp tnlNetBase.h Log Message: Fixed exit memory leak in netBase.cpp Fixed flagDropped gameType function to be more consistent and useful Allowed game types to dynamically assign colors to ships Fixed xbox exit crash Made force fields more useful Major cleanup and fixes to Rabbit game type Index: netBase.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/netBase.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** netBase.cpp 14 May 2004 18:49:53 -0000 1.3 --- netBase.cpp 4 Aug 2004 18:25:27 -0000 1.4 *************** *** 36,42 **** NetClassRep *NetClassRep::mClassLinkList = NULL; - U32 NetClassRep::mNetClassCount[NetClassGroupCount][NetClassTypeCount] = {{0, },}; U32 NetClassRep::mNetClassBitSize[NetClassGroupCount][NetClassTypeCount] = {{0, },}; ! NetClassRep **NetClassRep::mClassTable[NetClassGroupCount][NetClassTypeCount]; U32 NetClassRep::mClassCRC[NetClassGroupCount] = {INITIAL_CRC_VALUE, }; --- 36,41 ---- NetClassRep *NetClassRep::mClassLinkList = NULL; U32 NetClassRep::mNetClassBitSize[NetClassGroupCount][NetClassTypeCount] = {{0, },}; ! Vector<NetClassRep *> NetClassRep::mClassTable[NetClassGroupCount][NetClassTypeCount]; U32 NetClassRep::mClassCRC[NetClassGroupCount] = {INITIAL_CRC_VALUE, }; *************** *** 67,71 **** { TNLAssert(mInitialized, "creating an object before NetClassRep::initialize."); ! TNLAssert(classId < mNetClassCount[groupId][typeId], "Class id out of range."); TNLAssert(mClassTable[groupId][typeId][classId] != NULL, "No class with declared id type."); --- 66,70 ---- { TNLAssert(mInitialized, "creating an object before NetClassRep::initialize."); ! TNLAssert(classId < U32(mClassTable[groupId][typeId].size()), "Class id out of range."); TNLAssert(mClassTable[groupId][typeId][classId] != NULL, "No class with declared id type."); *************** *** 105,110 **** dynamicTable.push_back(walk); } ! mNetClassCount[group][type] = dynamicTable.size(); ! if(!mNetClassCount[group][type]) continue; --- 104,108 ---- dynamicTable.push_back(walk); } ! if(!dynamicTable.size()) continue; *************** *** 118,131 **** ) ! mClassTable[group][type] = new NetClassRep*[mNetClassCount[group][type]]; ! for(U32 i = 0; i < mNetClassCount[group][type];i++) ! { ! mClassTable[group][type][i] = dynamicTable[i]; ! dynamicTable[i]->mClassId[group] = i; - } mNetClassBitSize[group][type] = ! getBinLog2(getNextPow2(mNetClassCount[group][type] + 1)); dynamicTable.clear(); } --- 116,126 ---- ) ! mClassTable[group][type] = dynamicTable; ! for(U32 i = 0; i < mClassTable[group][type].size();i++) ! mClassTable[group][type][i]->mClassId[group] = i; mNetClassBitSize[group][type] = ! getBinLog2(getNextPow2(mClassTable[group][type].size() + 1)); dynamicTable.clear(); } Index: tnlNetBase.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlNetBase.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tnlNetBase.h 3 Jul 2004 20:01:46 -0000 1.3 --- tnlNetBase.h 4 Aug 2004 18:25:27 -0000 1.4 *************** *** 208,218 **** static NetClassRep *mClassLinkList; ///< Head of the linked class list. ! static NetClassRep **mClassTable[NetClassGroupCount][NetClassTypeCount]; ///< Table of NetClassReps for construction by class ID. static U32 mClassCRC[NetClassGroupCount]; ///< Internally computed class group CRC. static bool mInitialized; ///< Set once the class tables are built, from initialize. - /// mNetClassCount holds the number of classes of each group and type. - static U32 mNetClassCount[NetClassGroupCount][NetClassTypeCount]; - /// mNetClassBitSize is the number of bits needed to transmit the class ID for a group and type. static U32 mNetClassBitSize[NetClassGroupCount][NetClassTypeCount]; --- 208,215 ---- static NetClassRep *mClassLinkList; ///< Head of the linked class list. ! static Vector<NetClassRep *> mClassTable[NetClassGroupCount][NetClassTypeCount]; ///< Table of NetClassReps for construction by class ID. static U32 mClassCRC[NetClassGroupCount]; ///< Internally computed class group CRC. static bool mInitialized; ///< Set once the class tables are built, from initialize. /// mNetClassBitSize is the number of bits needed to transmit the class ID for a group and type. static U32 mNetClassBitSize[NetClassGroupCount][NetClassTypeCount]; *************** *** 254,258 **** /// Returns the number of classes registered under classGroup and classType. static U32 getNetClassCount(U32 classGroup, U32 classType) ! { return mNetClassCount[classGroup][classType]; } /// Returns the number of bits necessary to transmit class ids of the specified classGroup and classType. --- 251,255 ---- /// Returns the number of classes registered under classGroup and classType. static U32 getNetClassCount(U32 classGroup, U32 classType) ! { return mClassTable[classGroup][classType].size(); } /// Returns the number of bits necessary to transmit class ids of the specified classGroup and classType. *************** *** 262,266 **** /// Returns true if the given class count is on a version boundary static bool isVersionBorderCount(U32 classGroup, U32 classType, U32 count) ! { return count == mNetClassCount[classGroup][classType] || (count > 0 && mClassTable[classGroup][classType][count]->getClassVersion() != mClassTable[classGroup][classType][count - 1]->getClassVersion()); } --- 259,263 ---- /// Returns true if the given class count is on a version boundary static bool isVersionBorderCount(U32 classGroup, U32 classType, U32 count) ! { return count == U32(mClassTable[classGroup][classType].size()) || (count > 0 && mClassTable[classGroup][classType][count]->getClassVersion() != mClassTable[classGroup][classType][count - 1]->getClassVersion()); } |
From: Mark F. <mar...@us...> - 2004-08-04 18:25:35
|
Update of /cvsroot/opentnl/tnl/exe/levels In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12294/exe/levels Modified Files: rabbit1.txt rabbit2.txt Log Message: Fixed exit memory leak in netBase.cpp Fixed flagDropped gameType function to be more consistent and useful Allowed game types to dynamically assign colors to ships Fixed xbox exit crash Made force fields more useful Major cleanup and fixes to Rabbit game type Index: rabbit2.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/levels/rabbit2.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** rabbit2.txt 24 Jun 2004 22:50:18 -0000 1.2 --- rabbit2.txt 4 Aug 2004 18:25:26 -0000 1.3 *************** *** 1,6 **** ! RabbitGameType 100 8 LevelName "Carrot Crazy" Team Orange 1 0.5 0 ! RabbitFlagItem 10 30 4.7 4.7 GridSize 300 BarrierMaker 1 1 3 3 --- 1,6 ---- ! RabbitGameType 100 8 10 30 LevelName "Carrot Crazy" Team Orange 1 0.5 0 ! FlagItem 4.7 4.7 GridSize 300 BarrierMaker 1 1 3 3 Index: rabbit1.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/levels/rabbit1.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rabbit1.txt 24 Jun 2004 22:50:18 -0000 1.3 --- rabbit1.txt 4 Aug 2004 18:25:26 -0000 1.4 *************** *** 1,7 **** ! RabbitGameType 100 8 LevelName "Elmer's Revenge" Team Orange 1 0.5 0 ! RabbitFlagItem 10 30 4.7 4.7 GridSize 300 BarrierMaker 4 -0.6 2.3 -0.3 0.7 0.7 -0.3 2.3 -0.6 4 -0.3 5.7 0.7 7.3 2.3 8.3 4 8.6 5.7 8.3 7.3 7.3 8.3 5.7 8.6 4 8.3 2.3 7.3 0.7 5.7 -0.3 4 -0.6 --- 1,7 ---- ! RabbitGameType 8 100 10 30 LevelName "Elmer's Revenge" Team Orange 1 0.5 0 ! FlagItem -1 4.7 4.7 GridSize 300 BarrierMaker 4 -0.6 2.3 -0.3 0.7 0.7 -0.3 2.3 -0.6 4 -0.3 5.7 0.7 7.3 2.3 8.3 4 8.6 5.7 8.3 7.3 7.3 8.3 5.7 8.6 4 8.3 2.3 7.3 0.7 5.7 -0.3 4 -0.6 |
From: Mark F. <mar...@us...> - 2004-08-04 15:39:04
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13587/zap Modified Files: UIQueryServers.cpp UIQueryServers.h gameNetInterface.cpp main.cpp Log Message: Updated server query interface to show lock and passworded status Index: UIQueryServers.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIQueryServers.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** UIQueryServers.h 28 Jul 2004 23:01:30 -0000 1.2 --- UIQueryServers.h 4 Aug 2004 15:38:51 -0000 1.3 *************** *** 51,55 **** MaxServerNameLen = 20, ServersPerScreen = 21, ! ServersAboveBelow = 10, MaxPendingPings = 15, MaxPendingQueries = 10, --- 51,56 ---- MaxServerNameLen = 20, ServersPerScreen = 21, ! ServersAbove = 9, ! ServersBelow = 9, MaxPendingPings = 15, MaxPendingQueries = 10, *************** *** 74,77 **** --- 75,80 ---- U32 sendCount; bool isFromMaster; + bool dedicated; + bool passwordRequired; Nonce sendNonce; char serverName[MaxServerNameLen+1]; *************** *** 105,109 **** void gotPingResponse(const Address &theAddress, const Nonce &clientNonce, U32 clientIdentityToken); ! void gotQueryResponse(const Address &theAddress, const Nonce &clientNonce, const char *serverName, U32 playerCount, U32 maxPlayers); }; --- 108,112 ---- void gotPingResponse(const Address &theAddress, const Nonce &clientNonce, U32 clientIdentityToken); ! void gotQueryResponse(const Address &theAddress, const Nonce &clientNonce, const char *serverName, U32 playerCount, U32 maxPlayers, bool dedicated, bool passwordRequired); }; Index: UIQueryServers.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIQueryServers.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** UIQueryServers.cpp 28 Jul 2004 23:01:30 -0000 1.4 --- UIQueryServers.cpp 4 Aug 2004 15:38:51 -0000 1.5 *************** *** 41,44 **** --- 41,56 ---- { servers.clear(); + for(U32 i = 0;i < 512; i++) + { + ServerRef s; + dSprintf(s.serverName, MaxServerNameLen, "Svr%8x", Random::readI()); + s.id = i; + s.pingTime = Random::readF() * 512; + s.serverAddress.port = 28000; + s.serverAddress.netNum[0] = Random::readI(); + s.maxPlayers = Random::readF() * 16 + 8; + s.playerCount = Random::readF() * s.maxPlayers; + servers.push_back(s); + } sortColumn = 0; pendingPings = 0; *************** *** 117,121 **** } ! void QueryServersUserInterface::gotQueryResponse(const Address &theAddress, const Nonce &clientNonce, const char *serverName, U32 playerCount, U32 maxPlayers) { for(S32 i = 0; i < servers.size(); i++) --- 129,133 ---- } ! void QueryServersUserInterface::gotQueryResponse(const Address &theAddress, const Nonce &clientNonce, const char *serverName, U32 playerCount, U32 maxPlayers, bool dedicated, bool passwordRequired) { for(S32 i = 0; i < servers.size(); i++) *************** *** 127,130 **** --- 139,145 ---- s.playerCount = playerCount; s.maxPlayers = maxPlayers; + s.dedicated = dedicated; + s.passwordRequired = passwordRequired; + dSprintf(s.serverName, sizeof(s.serverName), "%s", serverName); s.state = ServerRef::ReceivedQuery; *************** *** 216,232 **** QueryServersUserInterface::QueryServersUserInterface() { ! /* ! for(U32 i = 0;i < 512; i++) ! { ! ServerRef s; ! dSprintf(s.serverName, MaxServerNameLen, "Svr%8x", Random::readI()); ! s.id = i; ! s.pingTime = Random::readF() * 512; ! s.serverAddress.port = 28000; ! s.serverAddress.netNum[0] = Random::readI(); ! s.maxPlayers = Random::readF() * 16 + 8; ! s.playerCount = Random::readF() * s.maxPlayers; ! servers.push_back(s); ! }*/ lastUsedServerId = 0; sortColumn = 0; --- 231,235 ---- QueryServersUserInterface::QueryServersUserInterface() { ! lastUsedServerId = 0; sortColumn = 0; *************** *** 235,239 **** columns.push_back(ColumnInfo("SERVER NAME", 3)); ! columns.push_back(ColumnInfo("PING", 300)); columns.push_back(ColumnInfo("PLAYERS", 420)); columns.push_back(ColumnInfo("ADDRESS", 550)); --- 238,243 ---- columns.push_back(ColumnInfo("SERVER NAME", 3)); ! columns.push_back(ColumnInfo("STAT", 250)); ! columns.push_back(ColumnInfo("PING", 330)); columns.push_back(ColumnInfo("PLAYERS", 420)); columns.push_back(ColumnInfo("ADDRESS", 550)); *************** *** 253,256 **** --- 257,301 ---- } + static void renderDedicatedIcon() + { + glBegin(GL_LINE_LOOP); + glVertex2f(0,0); + glVertex2f(0,4); + glVertex2f(3,4); + glVertex2f(3,0); + glEnd(); + + glBegin(GL_LINES); + glVertex2f(0.6, 1); + glVertex2f(2.4, 1); + glVertex2f(0.6, 2); + glVertex2f(2.4, 2); + glVertex2f(0.6, 3); + glVertex2f(2.4, 3); + glEnd(); + } + + static void renderLockIcon() + { + glBegin(GL_LINE_LOOP); + glVertex2f(0,2); + glVertex2f(0,4); + glVertex2f(3,4); + glVertex2f(3,2); + glEnd(); + + glBegin(GL_LINE_STRIP); + glVertex2f(2.6, 2); + glVertex2f(2.6, 1.3); + glVertex2f(2.4, 0.9); + glVertex2f(1.9, 0.6); + glVertex2f(1.1, 0.6); + glVertex2f(0.6, 0.9); + glVertex2f(0.4, 1.3); + glVertex2f(0.4, 2); + glEnd(); + + } + void QueryServersUserInterface::render() { *************** *** 268,272 **** for(S32 i = 0; i < columns.size(); i++) { ! drawString(columns[i].xStart, 35, 24, columns[i].name); } --- 313,317 ---- for(S32 i = 0; i < columns.size(); i++) { ! drawString(columns[i].xStart, 45, 24, columns[i].name); } *************** *** 279,286 **** glBegin(GL_LINE_LOOP); ! glVertex2f(x1, 33); ! glVertex2f(x2, 33); ! glVertex2f(x2, 61); ! glVertex2f(x1, 61); glEnd(); --- 324,331 ---- glBegin(GL_LINE_LOOP); ! glVertex2f(x1, 43); ! glVertex2f(x2, 43); ! glVertex2f(x2, 71); ! glVertex2f(x1, 71); glEnd(); *************** *** 291,296 **** selectedIndex = 0; ! S32 firstServer = selectedIndex - ServersAboveBelow; ! S32 lastServer = selectedIndex + ServersAboveBelow; if(firstServer < 0) --- 336,341 ---- selectedIndex = 0; ! S32 firstServer = selectedIndex - ServersAbove; ! S32 lastServer = selectedIndex + ServersBelow; if(firstServer < 0) *************** *** 306,311 **** for(S32 i = firstServer; i <= lastServer; i++) { ! U32 y = 65 + (i - firstServer) * 23; ! U32 fontSize = 20; if(i == selectedIndex) --- 351,357 ---- for(S32 i = firstServer; i <= lastServer; i++) { ! U32 y = 75 + (i - firstServer) * 24; ! U32 fontSize = 21; ! ServerRef &s = servers[i]; if(i == selectedIndex) *************** *** 315,320 **** glVertex2f(0, y); glVertex2f(799, y); ! glVertex2f(799, y + 22); ! glVertex2f(0, y + 22); glEnd(); glColor3f(0,0,1.0); --- 361,366 ---- glVertex2f(0, y); glVertex2f(799, y); ! glVertex2f(799, y + 23); ! glVertex2f(0, y + 23); glEnd(); glColor3f(0,0,1.0); *************** *** 322,353 **** glVertex2f(0, y); glVertex2f(799, y); ! glVertex2f(799, y + 22); ! glVertex2f(0, y + 22); glEnd(); } glColor3f(1,1,1); ! drawString(columns[0].xStart, y, fontSize, servers[i].serverName); ! if(servers[i].pingTime < 100) glColor3f(0,1,0); ! else if(servers[i].pingTime < 250) glColor3f(1,1,0); else glColor3f(1,0,0); ! drawStringf(columns[1].xStart, y, fontSize, "%d", servers[i].pingTime); ! if(servers[i].playerCount == servers[i].maxPlayers) glColor3f(1,0,0); ! else if(servers[i].playerCount == 0) glColor3f(1,1,0); else glColor3f(0,1,0); ! if(servers[i].playerCount < 0) ! drawString(columns[2].xStart, y, fontSize, "?? / ??"); else ! drawStringf(columns[2].xStart, y, fontSize, "%d / %d", servers[i].playerCount, servers[i].maxPlayers); glColor3f(1,1,1); ! drawString(columns[3].xStart, y, fontSize, servers[i].serverAddress.toString()); } } --- 368,417 ---- glVertex2f(0, y); glVertex2f(799, y); ! glVertex2f(799, y + 23); ! glVertex2f(0, y + 23); glEnd(); } glColor3f(1,1,1); ! drawString(columns[0].xStart, y, fontSize, s.serverName); ! glColor3f(0,1,0); ! if(s.dedicated) ! { ! glPushMatrix(); ! glTranslatef(columns[1].xStart+5, y+2, 0); ! glScalef(5, 5, 1); ! renderDedicatedIcon(); ! glPopMatrix(); ! } ! if(s.passwordRequired) ! { ! glPushMatrix(); ! glTranslatef(columns[1].xStart + 25, y+2, 0); ! glScalef(5, 5, 1); ! renderLockIcon(); ! glPopMatrix(); ! } ! ! if(s.pingTime < 100) glColor3f(0,1,0); ! else if(s.pingTime < 250) glColor3f(1,1,0); else glColor3f(1,0,0); ! drawStringf(columns[2].xStart, y, fontSize, "%d", s.pingTime); ! if(s.playerCount == s.maxPlayers) glColor3f(1,0,0); ! else if(s.playerCount == 0) glColor3f(1,1,0); else glColor3f(0,1,0); ! if(s.playerCount < 0) ! drawString(columns[3].xStart, y, fontSize, "?? / ??"); else ! drawStringf(columns[3].xStart, y, fontSize, "%d / %d", s.playerCount, s.maxPlayers); glColor3f(1,1,1); ! drawString(columns[4].xStart, y, fontSize, s.serverAddress.toString()); } } *************** *** 356,366 **** { glBegin(GL_LINES); ! glVertex2f(columns[i].xStart - 4, 35); ! glVertex2f(columns[i].xStart - 4, 550); glEnd(); } glBegin(GL_LINES); ! glVertex2f(0, 62); ! glVertex2f(800, 62); glEnd(); } --- 420,430 ---- { glBegin(GL_LINES); ! glVertex2f(columns[i].xStart - 4, 45); ! glVertex2f(columns[i].xStart - 4, 540); glEnd(); } glBegin(GL_LINES); ! glVertex2f(0, 72); ! glVertex2f(800, 72); glEnd(); } *************** *** 488,498 **** qsort(servers.address(), servers.size(), sizeof(ServerRef), compareFuncName); break; ! case 1: qsort(servers.address(), servers.size(), sizeof(ServerRef), compareFuncPing); break; ! case 2: qsort(servers.address(), servers.size(), sizeof(ServerRef), compareFuncPlayers); break; ! case 3: qsort(servers.address(), servers.size(), sizeof(ServerRef), compareFuncAddress); break; --- 552,562 ---- qsort(servers.address(), servers.size(), sizeof(ServerRef), compareFuncName); break; ! case 2: qsort(servers.address(), servers.size(), sizeof(ServerRef), compareFuncPing); break; ! case 3: qsort(servers.address(), servers.size(), sizeof(ServerRef), compareFuncPlayers); break; ! case 4: qsort(servers.address(), servers.size(), sizeof(ServerRef), compareFuncAddress); break; Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** main.cpp 3 Aug 2004 22:48:43 -0000 1.65 --- main.cpp 4 Aug 2004 15:38:51 -0000 1.66 *************** *** 58,61 **** --- 58,62 ---- U32 gSimulatedPing = 0; F32 gSimulatedPacketLoss = 0; + bool gDedicatedServer = false; const char *gMasterAddressString = "IP:master.opentnl.org:29005"; *************** *** 553,556 **** --- 554,558 ---- hasClient = false; hasServer = true; + gDedicatedServer = true; if(hasAdditionalArg) gBindAddress.set(argv[i+1]); Index: gameNetInterface.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameNetInterface.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gameNetInterface.cpp 20 May 2004 20:16:08 -0000 1.3 --- gameNetInterface.cpp 4 Aug 2004 15:38:51 -0000 1.4 *************** *** 32,35 **** --- 32,38 ---- { + extern const char *gServerPassword; + extern bool gDedicatedServer; + GameNetInterface::GameNetInterface(const Address &bindAddress, Game *theGame) : NetInterface(bindAddress) *************** *** 86,89 **** --- 89,95 ---- queryResponse.write(gServerGame->getPlayerCount()); queryResponse.write(gServerGame->getMaxPlayers()); + queryResponse.writeFlag(gDedicatedServer); + queryResponse.writeFlag(gServerPassword != NULL); + queryResponse.sendto(mSocket, remoteAddress); } *************** *** 96,104 **** char nameString[256]; U32 playerCount, maxPlayers; theNonce.read(stream); stream->readString(nameString); stream->read(&playerCount); stream->read(&maxPlayers); ! gQueryServersUserInterface.gotQueryResponse(remoteAddress, theNonce, nameString, playerCount, maxPlayers); } break; --- 102,113 ---- char nameString[256]; U32 playerCount, maxPlayers; + bool dedicated, passwordRequired; theNonce.read(stream); stream->readString(nameString); stream->read(&playerCount); stream->read(&maxPlayers); ! dedicated = stream->readFlag(); ! passwordRequired = stream->readFlag(); ! gQueryServersUserInterface.gotQueryResponse(remoteAddress, theNonce, nameString, playerCount, maxPlayers, dedicated, passwordRequired); } break; |
From: Mark F. <mar...@us...> - 2004-08-03 22:48:53
|
Update of /cvsroot/opentnl/tnl/exe/levels In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31186/exe/levels Modified Files: football1.txt football2.txt football3.txt retrieve1.txt retrieve2.txt retrieve3.txt Log Message: Fixed score limits on retrieve and zone control maps to match new scoring rules Added retrieve3 to map rotation Index: football2.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/levels/football2.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** football2.txt 14 Jul 2004 00:26:55 -0000 1.5 --- football2.txt 3 Aug 2004 22:48:43 -0000 1.6 *************** *** 1,3 **** ! ZoneControlGameType 10 48 Team Blue 0 0 1 Team Red 1 0 0 --- 1,3 ---- ! ZoneControlGameType 10 35 Team Blue 0 0 1 Team Red 1 0 0 Index: retrieve2.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/levels/retrieve2.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** retrieve2.txt 15 Jul 2004 00:14:20 -0000 1.2 --- retrieve2.txt 3 Aug 2004 22:48:43 -0000 1.3 *************** *** 1,3 **** ! RetrieveGameType 10 24 Team Blue 0 0 1 Team Red 1 0 0 --- 1,3 ---- ! RetrieveGameType 10 16 Team Blue 0 0 1 Team Red 1 0 0 Index: football3.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/levels/football3.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** football3.txt 14 Jul 2004 00:26:55 -0000 1.2 --- football3.txt 3 Aug 2004 22:48:43 -0000 1.3 *************** *** 1,3 **** ! ZoneControlGameType 10 36 Team Blue 0 0 1 Team Red 1 0 0 --- 1,3 ---- ! ZoneControlGameType 10 32 Team Blue 0 0 1 Team Red 1 0 0 Index: football1.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/levels/football1.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** football1.txt 14 Jul 2004 00:26:55 -0000 1.6 --- football1.txt 3 Aug 2004 22:48:43 -0000 1.7 *************** *** 1,3 **** ! ZoneControlGameType 10 40 LevelName "Diamond" Team Blue 0 0 1 --- 1,3 ---- ! ZoneControlGameType 10 32 LevelName "Diamond" Team Blue 0 0 1 Index: retrieve3.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/levels/retrieve3.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** retrieve3.txt 2 Aug 2004 21:01:31 -0000 1.1 --- retrieve3.txt 3 Aug 2004 22:48:43 -0000 1.2 *************** *** 1,3 **** ! RetrieveGameType 10 20 Team Blue 0 0 1 Team Red 1 0 0 --- 1,3 ---- ! RetrieveGameType 10 10 Team Blue 0 0 1 Team Red 1 0 0 Index: retrieve1.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/levels/retrieve1.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** retrieve1.txt 1 Jul 2004 23:29:58 -0000 1.2 --- retrieve1.txt 3 Aug 2004 22:48:43 -0000 1.3 *************** *** 1,3 **** ! RetrieveGameType 10 20 Team Blue 0 0 1 Team Red 1 0 0 --- 1,3 ---- ! RetrieveGameType 10 15 Team Blue 0 0 1 Team Red 1 0 0 |
From: Mark F. <mar...@us...> - 2004-08-03 22:48:53
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31186/zap Modified Files: main.cpp Log Message: Fixed score limits on retrieve and zone control maps to match new scoring rules Added retrieve3 to map rotation Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** main.cpp 2 Aug 2004 18:11:54 -0000 1.64 --- main.cpp 3 Aug 2004 22:48:43 -0000 1.65 *************** *** 69,72 **** --- 69,73 ---- const char *gLevelList = "retrieve1.txt " "retrieve2.txt " + "retrieve3.txt " "football1.txt " "football2.txt " |
From: Mark F. <mar...@us...> - 2004-08-02 21:01:42
|
Update of /cvsroot/opentnl/tnl/exe/levels In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2498/exe/levels Added Files: retrieve3.txt Log Message: Added new retrieve level Fixed editor rotation to be always around origin --- NEW FILE: retrieve3.txt --- RetrieveGameType 10 20 Team Blue 0 0 1 Team Red 1 0 0 Team Green 0 1 0 Team Yellow 1 1 0 LevelName "Quad Damage" GridSize 350 LoadoutZone 0 -2.6 -0.7 -3.4 -0.7 -3.4 -0.4 -2.6 -0.4 Spawn 0 -3.2 -1.2 FlagItem -1 1.5 7.5 GoalZone 0 1.2 -3.4 1.8 -3.4 1.7 -3.9 1.3 -3.9 BarrierMaker -3.4817 -1.51092 -2.4817 -1.51093 -2.4817 -0.31093 -2.5817 -0.31092 -2.6817 0.28907 -3.2817 0.28907 -3.3817 -0.31093 -3.4817 -0.31092 -3.4817 -1.51092 Teleporter -3 0 0.9 1.7 BarrierMaker 0.5 7 1 6.5 BarrierMaker -2.5 3.5 -2.5 3.5 0.5 0.5 0.5 -0.5 0 -1.5 0 -2.5 0.5 -3.5 1 -3.5 1.1 -4 1.2 -4 1.2 -4.5 1.8 -4.5 1.8 -4 1.9 -4 2 -3.5 2.5 -3.5 3 -2.5 3 -1.5 2.5 -0.5 2.5 0.5 5.5 3.5 BarrierMaker 1.5 -0.2 1.5 0.7 1.3 0.9 1.3 1.2 BarrierMaker 0.9 -1.2 1.5 -1.5 BarrierMaker 2.5 -2.6 2.1 -2.4 BarrierMaker 2 -2.8 1.2 -2.8 BarrierMaker 0.799999 -3.2 0.799999 -2.6 BarrierMaker -1.5 3.5 -1.5 3.4 0.4 1.5 0.5 1.5 0.5 3.5 -1.5 3.5 BarrierMaker 2.5 1.5 2.5 3.5 4.5 3.5 4.5 3.4 2.6 1.5 2.5 1.5 Teleporter 1.5 -4.2 2.6 10 BarrierMaker 1 5.5 2 5.5 2.3 5.8 2.5 5.8 3 5.3 BarrierMaker 0 5.5 0 5.1 -0.5 5.1 -0.5 4.5 BarrierMaker 0.4 4.5 0.800001 4.9 1.2 4.9 1.6 4.5 BarrierMaker 1.9 3.9 2.7 4.7 2.9 4.7 3.5 4.1 Spawn 0 -2.8 -1.2 Spawn 0 -3 -1 Spawn 0 -2.8 -0.9 Spawn 0 -3.2 -0.9 BarrierMaker 1.4 1.7 1.6 1.7 1.8 1.9 1.8 2.1 1.6 2.3 1.4 2.3 1.2 2.1 1.2 1.9 1.4 1.7 BarrierMaker 1.2 2.9 1.8 2.9 1.8 3 1.6 3.5 1.4 3.5 1.2 3 1.2 2.9 BarrierMaker 0.9 3.9 1 3.9 1.2 4.1 1.2 4.3 0.700001 4.3 0.700001 4.1 0.9 3.9 BarrierMaker 0.6 -2.1 1.1 -1.3 BarrierMaker 1.6 -2 2.4 -1.5 BarrierMaker 1.8 -0.8 2.2 -1.6 LoadoutZone 1 9.7 3.4 9.7 2.6 9.4 2.6 9.4 3.4 Spawn 1 10.2 2.8 GoalZone 1 12.4 7.2 12.4 7.8 12.9 7.7 12.9 7.3 BarrierMaker 10.5109 2.5183 10.5109 3.5183 9.31093 3.5183 9.31092 3.4183 8.71093 3.3183 8.71093 2.7183 9.31093 2.6183 9.31092 2.5183 10.5109 2.5183 Teleporter 9 3 7.3 6.9 BarrierMaker 2 6.5 2.5 7 BarrierMaker 5.5 3.5 5.5 3.5 8.5 6.5 9.5 6.5 10.5 6 11.5 6 12.5 6.5 12.5 7 13 7.1 13 7.2 13.5 7.2 13.5 7.8 13 7.8 13 7.9 12.5 8 12.5 8.5 11.5 9 10.5 9 9.5 8.5 8.5 8.5 5.5 11.5 BarrierMaker 9.2 7.5 8.3 7.5 8.1 7.3 7.8 7.3 BarrierMaker 10.2 6.9 10.5 7.5 BarrierMaker 11.6 8.5 11.4 8.1 BarrierMaker 11.8 8 11.8 7.2 BarrierMaker 12.2 6.8 11.6 6.8 BarrierMaker 5.5 4.5 5.6 4.5 7.5 6.4 7.5 6.5 5.5 6.5 5.5 4.5 BarrierMaker 7.5 8.5 5.5 8.5 5.5 10.5 5.6 10.5 7.5 8.6 7.5 8.5 Teleporter 13.2 7.5 -0.999999 8.6 BarrierMaker 3.5 7 3.5 8 3.2 8.3 3.2 8.5 3.7 9 BarrierMaker 3.5 6 3.9 6 3.9 5.5 4.5 5.5 BarrierMaker 4.5 6.4 4.1 6.8 4.1 7.2 4.5 7.6 BarrierMaker 5.1 7.9 4.3 8.7 4.3 8.9 4.9 9.5 Spawn 1 10.2 3.2 Spawn 1 10 3 Spawn 1 9.9 3.2 Spawn 1 9.9 2.8 BarrierMaker 7.3 7.4 7.3 7.6 7.1 7.8 6.9 7.8 6.7 7.6 6.7 7.4 6.9 7.2 7.1 7.2 7.3 7.4 BarrierMaker 6.1 7.2 6.1 7.8 6 7.8 5.5 7.6 5.5 7.4 6 7.2 6.1 7.2 BarrierMaker 5.1 6.9 5.1 7 4.9 7.2 4.7 7.2 4.7 6.7 4.9 6.7 5.1 6.9 BarrierMaker 11.1 6.6 10.3 7.1 BarrierMaker 11 7.6 10.5 8.4 BarrierMaker 9.8 7.8 10.6 8.2 LoadoutZone 2 5.6 15.7 6.4 15.7 6.4 15.4 5.6 15.4 Spawn 2 6.2 16.2 GoalZone 2 1.8 18.4 1.2 18.4 1.3 18.9 1.7 18.9 BarrierMaker 6.4817 16.5109 5.4817 16.5109 5.4817 15.3109 5.5817 15.3109 5.6817 14.7109 6.2817 14.7109 6.3817 15.3109 6.4817 15.3109 6.4817 16.5109 Teleporter 6 15 2.1 13.3 BarrierMaker 2.5 8 2 8.5 BarrierMaker 5.5 11.5 5.5 11.5 2.5 14.5 2.5 15.5 3 16.5 3 17.5 2.5 18.5 2 18.5 1.9 19 1.8 19 1.8 19.5 1.2 19.5 1.2 19 1.1 19 1 18.5 0.500001 18.5 9.53674e-007 17.5 9.53674e-007 16.5 0.5 15.5 0.500001 14.5 -2.5 11.5 BarrierMaker 1.5 15.2 1.5 14.3 1.7 14.1 1.7 13.8 BarrierMaker 2.1 16.2 1.5 16.5 BarrierMaker 0.500001 17.6 0.900002 17.4 BarrierMaker 1 17.8 1.8 17.8 BarrierMaker 2.2 18.2 2.2 17.6 BarrierMaker 4.5 11.5 4.5 11.6 2.6 13.5 2.5 13.5 2.5 11.5 4.5 11.5 BarrierMaker 0.500001 13.5 0.5 11.5 -1.5 11.5 -1.5 11.6 0.400002 13.5 0.500001 13.5 Teleporter 1.5 19.2 0.4 5 BarrierMaker 2 9.5 1 9.5 0.700002 9.2 0.5 9.2 1.90735e-006 9.7 BarrierMaker 3 9.5 3 9.9 3.5 9.9 3.5 10.5 BarrierMaker 2.6 10.5 2.2 10.1 1.8 10.1 1.4 10.5 BarrierMaker 1.1 11.1 0.300001 10.3 0.1 10.3 -0.499999 10.9 Spawn 2 5.8 16.2 Spawn 2 6 16 Spawn 2 5.8 15.9 Spawn 2 6.2 15.9 BarrierMaker 1.6 13.3 1.4 13.3 1.2 13.1 1.2 12.9 1.4 12.7 1.6 12.7 1.8 12.9 1.8 13.1 1.6 13.3 BarrierMaker 1.8 12.1 1.2 12.1 1.2 12 1.4 11.5 1.6 11.5 1.8 12 1.8 12.1 BarrierMaker 2.1 11.1 2 11.1 1.8 10.9 1.8 10.7 2.3 10.7 2.3 10.9 2.1 11.1 BarrierMaker 2.4 17.1 1.9 16.3 BarrierMaker 1.4 17 0.600001 16.5 BarrierMaker 1.2 15.8 0.8 16.6 LoadoutZone 3 -6.7 11.6 -6.7 12.4 -6.4 12.4 -6.4 11.6 Spawn 3 -7.2 12.2 GoalZone 3 -9.4 7.8 -9.4 7.2 -9.9 7.3 -9.9 7.7 BarrierMaker -7.51092 12.4817 -7.51093 11.4817 -6.31093 11.4817 -6.31092 11.5817 -5.71093 11.6817 -5.71093 12.2817 -6.31093 12.3817 -6.31092 12.4817 -7.51092 12.4817 Teleporter -6 12 -4.3 8.1 BarrierMaker 1 8.5 0.5 8 BarrierMaker -2.5 11.5 -2.5 11.5 -5.5 8.5 -6.5 8.5 -7.5 9 -8.5 9 -9.5 8.5 -9.5 8 -10 7.9 -10 7.8 -10.5 7.8 -10.5 7.2 -9.99999 7.2 -10 7.1 -9.5 7 -9.5 6.5 -8.5 6 -7.5 6 -6.5 6.5 -5.5 6.5 -2.5 3.5 BarrierMaker -6.2 7.5 -5.3 7.5 -5.1 7.7 -4.8 7.7 BarrierMaker -7.2 8.1 -7.5 7.5 BarrierMaker -8.6 6.5 -8.4 6.9 BarrierMaker -8.8 7 -8.8 7.8 BarrierMaker -9.2 8.2 -8.6 8.2 BarrierMaker -2.5 10.5 -2.6 10.5 -4.5 8.6 -4.5 8.5 -2.5 8.5 -2.5 10.5 BarrierMaker -4.5 6.5 -2.5 6.5 -2.5 4.5 -2.6 4.5 -4.5 6.4 -4.5 6.5 Teleporter -10.2 7.5 4 6.4 BarrierMaker -0.5 8 -0.5 7 -0.199999 6.7 -0.199999 6.5 -0.699998 6 BarrierMaker -0.499999 9 -0.899999 9 -0.899999 9.5 -1.5 9.5 BarrierMaker -1.5 8.6 -1.1 8.2 -1.1 7.8 -1.5 7.4 BarrierMaker -2.1 7.1 -1.3 6.3 -1.3 6.1 -1.9 5.5 Spawn 3 -7.2 11.8 Spawn 3 -7 12 Spawn 3 -6.9 11.8 Spawn 3 -6.9 12.2 BarrierMaker -4.3 7.6 -4.3 7.4 -4.1 7.2 -3.9 7.2 -3.7 7.4 -3.7 7.6 -3.9 7.8 -4.1 7.8 -4.3 7.6 BarrierMaker -3.1 7.8 -3.1 7.2 -3 7.2 -2.5 7.4 -2.5 7.6 -3 7.8 -3.1 7.8 BarrierMaker -2.1 8.1 -2.1 8 -1.9 7.8 -1.7 7.8 -1.7 8.3 -1.9 8.3 -2.1 8.1 BarrierMaker -8.1 8.4 -7.3 7.9 BarrierMaker -8 7.4 -7.5 6.6 BarrierMaker -6.8 7.2 -7.6 6.8 RepairItem -0.3 4.9 RepairItem 4.1 5.7 RepairItem 3.3 10.1 RepairItem -1.1 9.3 |
From: Mark F. <mar...@us...> - 2004-08-02 21:01:38
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2498/zap Modified Files: UIEditor.cpp Log Message: Added new retrieve level Fixed editor rotation to be always around origin Index: UIEditor.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIEditor.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** UIEditor.cpp 20 Jul 2004 18:09:51 -0000 1.18 --- UIEditor.cpp 2 Aug 2004 21:01:30 -0000 1.19 *************** *** 237,240 **** --- 237,250 ---- glEnd(); } + glColor3f(0.7, 0.7, 0.7); + glLineWidth(3); + Point origin = convertLevelToCanvasCoord(Point(0,0)); + glBegin(GL_LINES ); + glVertex2f(0, origin.y); + glVertex2f(canvasWidth, origin.y); + glVertex2f(origin.x, 0); + glVertex2f(origin.x, canvasHeight); + glEnd(); + glLineWidth(1); for(S32 i = 0; i < mItems.size(); i++) *************** *** 470,474 **** Point min, max; computeSelectionMinMax(min,max); ! Point ctr = (min + max)*0.5; F32 sinTheta = sin(angle * Float2Pi / 360.0f); F32 cosTheta = cos(angle * Float2Pi / 360.0f); --- 480,486 ---- Point min, max; computeSelectionMinMax(min,max); ! //Point ctr = (min + max)*0.5; ! //ctr.x = floor(ctr.x * 10) * 0.1f; ! //ctr.y = floor(ctr.y * 10) * 0.1f; F32 sinTheta = sin(angle * Float2Pi / 360.0f); F32 cosTheta = cos(angle * Float2Pi / 360.0f); *************** *** 480,486 **** for(S32 j = 0; j < itm.verts.size(); j++) { ! Point v = itm.verts[j] - ctr; Point n(v.x * cosTheta + v.y * sinTheta, v.y * cosTheta - v.x * sinTheta); ! itm.verts[j] = n + ctr; } } --- 492,498 ---- for(S32 j = 0; j < itm.verts.size(); j++) { ! Point v = itm.verts[j];// - ctr; Point n(v.x * cosTheta + v.y * sinTheta, v.y * cosTheta - v.x * sinTheta); ! itm.verts[j] = n;// + ctr; } } |
From: Mark F. <mar...@us...> - 2004-08-02 20:36:10
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29546/zap Modified Files: footballGame.cpp game.cpp game.h retrieveGame.cpp Log Message: Added more informative strings when only one flag is present in retrieve FIxed a nasty StringTableEntry bug Updated game version fixed rendering line glitch on energy bar Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** game.h 2 Aug 2004 18:11:54 -0000 1.60 --- game.h 2 Aug 2004 20:36:01 -0000 1.61 *************** *** 234,238 **** extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.0 rc 10" }; --- 234,238 ---- extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.0 rc 11" }; Index: retrieveGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/retrieveGame.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** retrieveGame.cpp 1 Jul 2004 23:07:46 -0000 1.1 --- retrieveGame.cpp 2 Aug 2004 20:36:01 -0000 1.2 *************** *** 78,83 **** static StringTableEntry stealString("%e0 stole a flag from team %e1!"); static StringTableEntry takeString("%e0 of team %e1 took a flag!"); StringTableEntry r = takeString; ! S32 teamIndex; --- 78,85 ---- static StringTableEntry stealString("%e0 stole a flag from team %e1!"); static StringTableEntry takeString("%e0 of team %e1 took a flag!"); + static StringTableEntry oneFlagTakeString("%e0 of team %e1 took the flag!"); StringTableEntry r = takeString; ! if(mFlags.size() == 1) ! r = oneFlagTakeString; S32 teamIndex; *************** *** 94,98 **** e.push_back(mTeams[teamIndex].name); for(S32 i = 0; i < mClientList.size(); i++) ! mClientList[i]->clientConnection->s2cDisplayMessageE(GameConnection::ColorNuclearGreen, SFXFlagSnatch, r, e); theFlag->mountToShip(theShip); mFlagZones[flagIndex] = NULL; --- 96,101 ---- e.push_back(mTeams[teamIndex].name); for(S32 i = 0; i < mClientList.size(); i++) ! mClientList[i]->clientConnection->s2cDisplayMessageE( ! GameConnection::ColorNuclearGreen, SFXFlagSnatch, r, e); theFlag->mountToShip(theShip); mFlagZones[flagIndex] = NULL; *************** *** 142,149 **** static StringTableEntry capString("%e0 retrieved a flag!"); Vector<StringTableEntry> e; e.push_back(cl->name); for(S32 i = 0; i < mClientList.size(); i++) ! mClientList[i]->clientConnection->s2cDisplayMessageE(GameConnection::ColorNuclearGreen, SFXFlagCapture, capString, e); // score the flag for the client's team... --- 145,155 ---- static StringTableEntry capString("%e0 retrieved a flag!"); + static StringTableEntry oneFlagCapString("%e0 retrieved the flag!"); + Vector<StringTableEntry> e; e.push_back(cl->name); for(S32 i = 0; i < mClientList.size(); i++) ! mClientList[i]->clientConnection->s2cDisplayMessageE(GameConnection::ColorNuclearGreen, ! SFXFlagCapture, (mFlags.size() == 1) ? oneFlagCapString : capString, e); // score the flag for the client's team... *************** *** 165,176 **** return; } - // ok all of them are taken... - // cap for the team - setTeamScore(cl->teamId, mTeams[cl->teamId].score + 1); ! static StringTableEntry capAllString("Team %e0 retrieved all the flags!"); ! e[0] = mTeams[cl->teamId].name; ! for(S32 i = 0; i < mClientList.size(); i++) ! mClientList[i]->clientConnection->s2cDisplayMessageE(GameConnection::ColorNuclearGreen, SFXFlagCapture, capAllString, e); for(S32 i = 0; i < mFlags.size(); i++) { --- 171,182 ---- return; } ! if(mFlags.size() != 1) ! { ! static StringTableEntry capAllString("Team %e0 retrieved all the flags!"); ! e[0] = mTeams[cl->teamId].name; ! for(S32 i = 0; i < mClientList.size(); i++) ! mClientList[i]->clientConnection->s2cDisplayMessageE(GameConnection::ColorNuclearGreen, SFXFlagCapture, capAllString, e); ! } for(S32 i = 0; i < mFlags.size(); i++) { Index: footballGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/footballGame.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** footballGame.cpp 14 Jul 2004 00:26:55 -0000 1.8 --- footballGame.cpp 2 Aug 2004 20:36:01 -0000 1.9 *************** *** 124,130 **** } - // score another point - setTeamScore(s->getTeam(), mTeams[s->getTeam()].score + 1); - static StringTableEntry tdString("Team %e0 scored a touchdown!"); Vector<StringTableEntry> e; --- 124,127 ---- Index: game.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** game.cpp 2 Aug 2004 18:11:54 -0000 1.46 --- game.cpp 2 Aug 2004 20:36:01 -0000 1.47 *************** *** 688,691 **** --- 688,701 ---- U32 totalLineCount = 100; + F32 full = energy * totalLineCount; + glBegin(GL_POLYGON); + glColor3f(0, 0, 1); + glVertex2f(UserInterface::horizMargin, UserInterface::canvasHeight - UserInterface::vertMargin - 20); + glVertex2f(UserInterface::horizMargin, UserInterface::canvasHeight - UserInterface::vertMargin); + glColor3f(0, 1, 1); + glVertex2f(UserInterface::horizMargin + full * 2, UserInterface::canvasHeight - UserInterface::vertMargin); + glVertex2f(UserInterface::horizMargin + full * 2, UserInterface::canvasHeight - UserInterface::vertMargin - 20); + glEnd(); + glColor3f(1, 1 ,1); glBegin(GL_LINES); *************** *** 700,726 **** glVertex2f(UserInterface::horizMargin + cutoffx, UserInterface::canvasHeight - UserInterface::vertMargin + 4); glEnd(); - F32 halfway = totalLineCount * 0.5; - F32 full = energy * totalLineCount; - glBegin(GL_POLYGON); - glColor3f(0, 0, 1); - glVertex2f(UserInterface::horizMargin, UserInterface::canvasHeight - UserInterface::vertMargin - 20); - glVertex2f(UserInterface::horizMargin, UserInterface::canvasHeight - UserInterface::vertMargin); - glColor3f(0, 1, 1); - glVertex2f(UserInterface::horizMargin + full * 2, UserInterface::canvasHeight - UserInterface::vertMargin); - glVertex2f(UserInterface::horizMargin + full * 2, UserInterface::canvasHeight - UserInterface::vertMargin - 20); - glEnd(); - /* - for(U32 i = 1; i < full; i++) - { - if(i < halfway) - glColor3f(1 - i / halfway, 0, i / halfway); - else - glColor3f(0, (i - halfway) / halfway, 1); - - glColor3f(0, i / full, 1); - glVertex2f(15 + i * 2, 565); - glVertex2f(15 + i * 2, 585); - }*/ - glEnd(); } } --- 710,713 ---- |
From: Mark F. <mar...@us...> - 2004-08-02 20:36:10
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29546/tnl Modified Files: tnlNetStringTable.h Log Message: Added more informative strings when only one flag is present in retrieve FIxed a nasty StringTableEntry bug Updated game version fixed rendering line glitch on energy bar Index: tnlNetStringTable.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlNetStringTable.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tnlNetStringTable.h 20 Apr 2004 04:27:19 -0000 1.1 --- tnlNetStringTable.h 2 Aug 2004 20:36:01 -0000 1.2 *************** *** 96,100 **** mIndex = StringTable::insert(string, caseSensitive); } ! StringTableEntry &operator= (const StringTableEntry &s) { --- 96,104 ---- mIndex = StringTable::insert(string, caseSensitive); } ! inline StringTableEntry(const StringTableEntry &theString) ! { ! mIndex = theString.mIndex; ! incRef(); ! } StringTableEntry &operator= (const StringTableEntry &s) { |
From: Mark F. <mar...@us...> - 2004-08-02 18:12:14
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28200/zap Modified Files: UIGame.cpp UIGame.h UIMenus.cpp UIMenus.h UINameEntry.cpp UINameEntry.h game.cpp game.h gameConnection.cpp gameConnection.h gameType.cpp gameType.h loadoutSelect.cpp loadoutSelect.h main.cpp sfx.cpp sfx.h ship.cpp Log Message: Added server password function Added admin password Added more admin options -- kick and teamchange Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** main.cpp 28 Jul 2004 23:01:31 -0000 1.63 --- main.cpp 2 Aug 2004 18:11:54 -0000 1.64 *************** *** 60,63 **** --- 60,66 ---- const char *gMasterAddressString = "IP:master.opentnl.org:29005"; + const char *gServerPassword = NULL; + const char *gAdminPassword = NULL; + Address gMasterAddress; Address gConnectAddress; *************** *** 560,563 **** --- 563,576 ---- } } + else if(!stricmp(argv[i], "-password")) + { + if(hasAdditionalArg) + gServerPassword = strdup(argv[i+1]); + } + else if(!stricmp(argv[i], "-adminpassword")) + { + if(hasAdditionalArg) + gAdminPassword = strdup(argv[i+1]); + } else if(!stricmp(argv[i], "-levels")) { Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** gameType.cpp 28 Jul 2004 23:01:31 -0000 1.55 --- gameType.cpp 2 Aug 2004 18:11:54 -0000 1.56 *************** *** 29,32 **** --- 29,33 ---- #include "UIGame.h" #include "UIMenus.h" + #include "UINameEntry.h" #include "gameNetInterface.h" #include "flagItem.h" *************** *** 427,436 **** } - void GameType::clientRequestEngineerBuild(GameConnection *client, U32 buildObject) - { - engClientCreateObject(client, buildObject); - } - - void GameType::performScopeQuery(GhostConnection *connection) { --- 428,431 ---- *************** *** 607,614 **** if(mTeams.size() > 1) menuOptions.push_back(MenuItem("CHANGE TEAMS",1000)); - GameConnection *gc = gClientGame->getConnectionToServer(); - if(gc && gc->isAdmin()) - menuOptions.push_back(MenuItem("CHANGE LEVEL",1001)); - } --- 602,605 ---- *************** *** 617,622 **** if(index == 1000) c2sChangeTeams(); - else if(index == 1001) - gLevelMenuUserInterface.activate(); } --- 608,611 ---- *************** *** 643,650 **** GAMETYPE_RPC_C2S(GameType, c2sChangeTeams, ()) { if(mTeams.size() <= 1) return; - GameConnection *source = (GameConnection *) NetObject::getRPCSourceConnection(); ClientRef *cl = source->getClientRef(); --- 632,644 ---- GAMETYPE_RPC_C2S(GameType, c2sChangeTeams, ()) { + GameConnection *source = (GameConnection *) NetObject::getRPCSourceConnection(); + changeClientTeam(source); + } + + void GameType::changeClientTeam(GameConnection *source) + { if(mTeams.size() <= 1) return; ClientRef *cl = source->getClientRef(); Index: UIGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** UIGame.cpp 28 Jul 2004 23:01:29 -0000 1.44 --- UIGame.cpp 2 Aug 2004 18:11:53 -0000 1.45 *************** *** 152,157 **** else if(mCurrentMode == LoadoutMode) mLoadout.render(); - else if(mCurrentMode == EngineerBuildMode) - mEngineerBuild.render(); GameType *theGameType = gClientGame->getGameType(); --- 152,155 ---- *************** *** 343,353 **** } - void GameUserInterface::displayEngineerBuildMenu() - { - UserInterface::playBoop(); - mEngineerBuild.show(false); - mCurrentMode = EngineerBuildMode; - } - void GameUserInterface::onControllerButtonDown(U32 buttonIndex) { --- 341,344 ---- *************** *** 402,409 **** mLoadout.processKey(buttonIndex); } - else if(mCurrentMode == EngineerBuildMode) - { - mEngineerBuild.processKey(buttonIndex); - } } } --- 393,396 ---- *************** *** 439,444 **** void GameUserInterface::onModifierKeyDown(U32 key) { ! if(mCurrentMode == EngineerBuildMode || ! mCurrentMode == LoadoutMode || mCurrentMode == PlayMode) { --- 426,430 ---- void GameUserInterface::onModifierKeyDown(U32 key) { ! if(mCurrentMode == LoadoutMode || mCurrentMode == PlayMode) { *************** *** 452,457 **** void GameUserInterface::onModifierKeyUp(U32 key) { ! if(mCurrentMode == EngineerBuildMode || ! mCurrentMode == LoadoutMode || mCurrentMode == PlayMode) { --- 438,442 ---- void GameUserInterface::onModifierKeyUp(U32 key) { ! if(mCurrentMode == LoadoutMode || mCurrentMode == PlayMode) { *************** *** 468,477 **** if(mLoadout.processKey(key)) return; ! if(mCurrentMode == EngineerBuildMode) ! if(mEngineerBuild.processKey(key)) ! return; ! ! if(mCurrentMode == EngineerBuildMode || ! mCurrentMode == LoadoutMode || mCurrentMode == PlayMode) { --- 453,457 ---- if(mLoadout.processKey(key)) return; ! if(mCurrentMode == LoadoutMode || mCurrentMode == PlayMode) { *************** *** 596,601 **** void GameUserInterface::onKeyUp(U32 key) { ! if(mCurrentMode == EngineerBuildMode || ! mCurrentMode == LoadoutMode || mCurrentMode == PlayMode) { --- 576,580 ---- void GameUserInterface::onKeyUp(U32 key) { ! if(mCurrentMode == LoadoutMode || mCurrentMode == PlayMode) { Index: UIMenus.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** UIMenus.h 28 Jul 2004 02:06:14 -0000 1.11 --- UIMenus.h 2 Aug 2004 18:11:54 -0000 1.12 *************** *** 54,64 **** S32 selectionIndex; ! MenuUserInterface() ! { ! menuTitle = "Menu"; ! menuSubTitle = ""; ! menuFooter = ""; ! selectionIndex = 0; ! } void render(); --- 54,58 ---- S32 selectionIndex; ! MenuUserInterface(); void render(); *************** *** 134,137 **** --- 128,158 ---- extern LevelMenuUserInterface gLevelMenuUserInterface; + class AdminMenuUserInterface : public MenuUserInterface + { + typedef MenuUserInterface Parent; + public: + void onActivate(); + void processSelection(U32 index); + void onEscape(); + }; + + extern AdminMenuUserInterface gAdminMenuUserInterface; + + class PlayerMenuUserInterface : public MenuUserInterface + { + typedef MenuUserInterface Parent; + public: + enum Action { + Kick, + ChangeTeam, + ActionCount, + } action; + void render(); + void processSelection(U32 index); + void onEscape(); + }; + + extern PlayerMenuUserInterface gPlayerMenuUserInterface; + }; Index: sfx.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/sfx.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** sfx.cpp 28 Jul 2004 02:06:15 -0000 1.35 --- sfx.cpp 2 Aug 2004 18:11:54 -0000 1.36 *************** *** 92,95 **** --- 92,96 ---- { "comm_up.wav", true, 0.4f, false, 150, 600 }, { "comm_down.wav", true, 0.4f, false, 150, 600 }, + { "boop.wav", true, 0.25f, false, 150, 600 }, { NULL, false, 0, false, 0, 0 }, Index: loadoutSelect.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/loadoutSelect.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** loadoutSelect.cpp 28 Jul 2004 23:01:31 -0000 1.13 --- loadoutSelect.cpp 2 Aug 2004 18:11:54 -0000 1.14 *************** *** 198,271 **** } - const char *gEngineerTitle = "Choose Object to Build:"; - - LoadoutItem gEngineerBuildOptions[] = { - { '1', 0, EngineeredTurret, "Sentry Turret" }, - { '2', 1, EngineeredForceField, "Force Field Projector" }, - { 0, 0, 0, NULL }, - }; - - EngineerBuildHelper::EngineerBuildHelper() - { - } - - void EngineerBuildHelper::show(bool fromController) - { - } - - void EngineerBuildHelper::render() - { - S32 curPos = 300; - const int fontSize = 15; - - glColor3f(0.8, 1, 0.8); - - UserInterface::drawStringf(20, curPos, fontSize, "%s", gEngineerTitle); - curPos += fontSize + 4; - - LoadoutItem *list = gEngineerBuildOptions; - - for(S32 i = 0; list[i].text; i++) - { - renderControllerButton(20, curPos, list[i].button, list[i].key); - glColor3f(0.1, 1.0, 0.1); - - UserInterface::drawStringf(40, curPos, fontSize, "- %s", list[i].text); - curPos += fontSize + 4; - } - - } - - bool EngineerBuildHelper::processKey(U32 key) - { - if(key == 27 || key == 8) - { - gGameUserInterface.setPlayMode(); - return true; - } - key = toupper(key); - U32 index; - LoadoutItem *list = gEngineerBuildOptions; - - for(index = 0; list[index].text; index++) - { - if(key == list[index].key || - key == list[index].button) - { - break; - } - } - if(!list[index].text) - return false; - - GameConnection *gc = gClientGame->getConnectionToServer(); - if(gc) - gc->c2sRequestEngineerBuild(list[index].index); - gGameUserInterface.setPlayMode(); - return true; - } - - - }; --- 198,201 ---- Index: UINameEntry.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UINameEntry.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** UINameEntry.cpp 25 Jun 2004 23:03:19 -0000 1.6 --- UINameEntry.cpp 2 Aug 2004 18:11:54 -0000 1.7 *************** *** 27,31 **** --- 27,33 ---- #include "UINameEntry.h" #include "UIMenus.h" + #include "UIGame.h" #include "game.h" + #include "gameConnection.h" #include "glutInclude.h" *************** *** 34,40 **** { ! NameEntryUserInterface gNameEntryUserInterface; ! void NameEntryUserInterface::render() { glColor3f(1,1,1); --- 36,49 ---- { ! void TextEntryUserInterface::onActivate() ! { ! if(resetOnActivate) ! { ! buffer[0] = 0; ! cursorPos = 0; ! } ! } ! void TextEntryUserInterface::render() { glColor3f(1,1,1); *************** *** 43,58 **** drawCenteredString(y, 20, title); - y += 45; - drawCenteredString(y, 30, buffer); ! U32 width = getStringWidth(30, buffer); U32 x = (canvasWidth - width) / 2; if(blink) ! drawString(x + getStringWidth(30, buffer, cursorPos), y, 30, "_"); } ! void NameEntryUserInterface::idle(U32 t) { if(mBlinkTimer.update(t)) --- 52,82 ---- drawCenteredString(y, 20, title); y += 45; ! char astbuffer[MaxTextLen+1]; ! const char *renderBuffer=buffer; ! if(secret) ! { ! ! S32 i; ! for(i = 0; i < MaxTextLen;i++) ! { ! if(!buffer[i]) ! break; ! astbuffer[i] = '*'; ! } ! astbuffer[i] = 0; ! renderBuffer = astbuffer; ! } ! drawCenteredString(y, 30, renderBuffer); ! ! U32 width = getStringWidth(30, renderBuffer); U32 x = (canvasWidth - width) / 2; if(blink) ! drawString(x + getStringWidth(30, renderBuffer, cursorPos), y, 30, "_"); } ! void TextEntryUserInterface::idle(U32 t) { if(mBlinkTimer.update(t)) *************** *** 63,70 **** } ! void NameEntryUserInterface::onKeyDown(U32 key) { if(key == '\r') ! onAccept(); else if(key == 8 || key == 127) { --- 87,94 ---- } ! void TextEntryUserInterface::onKeyDown(U32 key) { if(key == '\r') ! onAccept(buffer); else if(key == 8 || key == 127) { *************** *** 83,89 **** else { ! for(U32 i = MaxNameLen - 1; i > cursorPos; i--) buffer[i] = buffer[i-1]; ! if(cursorPos < MaxNameLen-1) { buffer[cursorPos] = key; --- 107,113 ---- else { ! for(U32 i = MaxTextLen - 1; i > cursorPos; i--) buffer[i] = buffer[i-1]; ! if(cursorPos < MaxTextLen-1) { buffer[cursorPos] = key; *************** *** 93,111 **** } ! void NameEntryUserInterface::onKeyUp(U32 key) { } ! void NameEntryUserInterface::onEscape() ! { ! } ! ! void NameEntryUserInterface::setText(const char *text) { ! if(strlen(text) > MaxNameLen) { ! strncpy(buffer, text, MaxNameLen); ! buffer[MaxNameLen] = 0; } else --- 117,131 ---- } ! void TextEntryUserInterface::onKeyUp(U32 key) { } ! void TextEntryUserInterface::setText(const char *text) { ! if(strlen(text) > MaxTextLen) { ! strncpy(buffer, text, MaxTextLen); ! buffer[MaxTextLen] = 0; } else *************** *** 113,121 **** } ! void NameEntryUserInterface::onAccept() { gMainMenuUserInterface.activate(); } }; --- 133,192 ---- } ! ! NameEntryUserInterface gNameEntryUserInterface; ! ! void NameEntryUserInterface::onEscape() ! { ! } ! ! void NameEntryUserInterface::onAccept(const char *text) ! { ! gMainMenuUserInterface.activate(); ! } ! ! PasswordEntryUserInterface gPasswordEntryUserInterface; ! ! void PasswordEntryUserInterface::onEscape() { gMainMenuUserInterface.activate(); } + void PasswordEntryUserInterface::onAccept(const char *text) + { + joinGame(connectAddress, false, false); + } + + AdminPasswordEntryUserInterface gAdminPasswordEntryUserInterface; + + void AdminPasswordEntryUserInterface::render() + { + gGameUserInterface.render(); + glColor4f(0, 0, 0, 0.5); + glEnable(GL_BLEND); + glBegin(GL_POLYGON); + glVertex2f(0, 0); + glVertex2f(canvasWidth, 0); + glVertex2f(canvasWidth, canvasHeight); + glVertex2f(0, canvasHeight); + glEnd(); + glDisable(GL_BLEND); + Parent::render(); + } + + void AdminPasswordEntryUserInterface::onEscape() + { + gGameUserInterface.activate(); + } + + void AdminPasswordEntryUserInterface::onAccept(const char *text) + { + gGameUserInterface.activate(); + GameConnection *gc = gClientGame->getConnectionToServer(); + if(gc) + gc->c2sAdminPassword(text); + } + + + }; Index: UINameEntry.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UINameEntry.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UINameEntry.h 24 Jun 2004 01:12:09 -0000 1.3 --- UINameEntry.h 2 Aug 2004 18:11:54 -0000 1.4 *************** *** 34,44 **** { ! class NameEntryUserInterface : public UserInterface { enum { ! MaxNameLen = 32, BlinkTime = 100, }; ! char buffer[MaxNameLen+1]; U32 cursorPos; bool blink; --- 34,44 ---- { ! class TextEntryUserInterface : public UserInterface { enum { ! MaxTextLen = 32, BlinkTime = 100, }; ! char buffer[MaxTextLen+1]; U32 cursorPos; bool blink; *************** *** 47,59 **** protected: const char *title; public: ! NameEntryUserInterface() : mBlinkTimer(BlinkTime) { ! title = "ENTER YOUR NAME:"; buffer[0] = 0; memset(buffer, 0, sizeof(buffer)); blink = false; } void render(); void idle(U32 t); --- 47,65 ---- protected: const char *title; + bool secret; + bool resetOnActivate; public: ! TextEntryUserInterface() : mBlinkTimer(BlinkTime) { ! title = "ENTER TEXT:"; buffer[0] = 0; memset(buffer, 0, sizeof(buffer)); blink = false; + secret = false; + cursorPos = 0; + resetOnActivate = true; } + void onActivate(); void render(); void idle(U32 t); *************** *** 62,73 **** void onKeyUp(U32 key); ! virtual void onAccept(); ! virtual void onEscape(); const char *getText() { return buffer; } void setText(const char *text); }; extern NameEntryUserInterface gNameEntryUserInterface; }; --- 68,123 ---- void onKeyUp(U32 key); ! virtual void onAccept(const char *text) = 0; ! virtual void onEscape() = 0; const char *getText() { return buffer; } void setText(const char *text); }; + class NameEntryUserInterface : public TextEntryUserInterface + { + public: + NameEntryUserInterface() + { + title = "ENTER YOUR NAME:"; + resetOnActivate = false; + } + virtual void onAccept(const char *text); + virtual void onEscape(); + }; + extern NameEntryUserInterface gNameEntryUserInterface; + class PasswordEntryUserInterface : public TextEntryUserInterface + { + Address connectAddress; + public: + PasswordEntryUserInterface() + { + title = "ENTER SERVER PASSWORD:"; + secret = true; + } + void onAccept(const char *text); + void onEscape(); + void setConnectServer(const Address &addr) { connectAddress = addr; } + }; + + extern PasswordEntryUserInterface gPasswordEntryUserInterface; + + class AdminPasswordEntryUserInterface : public TextEntryUserInterface + { + typedef TextEntryUserInterface Parent; + public: + AdminPasswordEntryUserInterface() + { + title = "ENTER ADMIN PASSWORD:"; + secret = true; + } + void onAccept(const char *text); + void onEscape(); + void render(); + }; + + extern AdminPasswordEntryUserInterface gAdminPasswordEntryUserInterface; + }; Index: sfx.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/sfx.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** sfx.h 10 Jun 2004 06:15:53 -0000 1.18 --- sfx.h 2 Aug 2004 18:11:54 -0000 1.19 *************** *** 92,95 **** --- 92,96 ---- SFXUICommUp, SFXUICommDown, + SFXIncomingMessage, NumSFXBuffers Index: gameConnection.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameConnection.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** gameConnection.h 20 Jul 2004 18:09:52 -0000 1.18 --- gameConnection.h 2 Aug 2004 18:11:54 -0000 1.19 *************** *** 93,96 **** --- 93,100 ---- bool isAdmin() { return mIsAdmin; } void setIsAdmin(bool admin) { mIsAdmin = admin; } + TNL_DECLARE_RPC(c2sAdminPassword, (const char *pass)); + TNL_DECLARE_RPC(s2cSetIsAdmin, ()); + TNL_DECLARE_RPC(c2sAdminPlayerAction, (StringTableEntryRef playerName, U32 actionIndex)); + bool isInCommanderMap() { return mInCommanderMap; } TNL_DECLARE_RPC(c2sRequestCommanderMap, ()); *************** *** 98,102 **** TNL_DECLARE_RPC(c2sRequestLoadout, (const Vector<U32> &loadout)); - TNL_DECLARE_RPC(c2sRequestEngineerBuild, (U32 buildObject)); TNL_DECLARE_RPC(s2cDisplayMessageESI, (RangedU32<0, ColorCount> color, RangedU32<0, NumSFXBuffers> sfx, StringTableEntryRef formatString, --- 102,105 ---- Index: gameConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameConnection.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** gameConnection.cpp 20 Jul 2004 18:09:52 -0000 1.23 --- gameConnection.cpp 2 Aug 2004 18:11:54 -0000 1.24 *************** *** 31,34 **** --- 31,35 ---- #include "UIGame.h" #include "UIMenus.h" + #include "UINameEntry.h" namespace Zap *************** *** 37,40 **** --- 38,44 ---- GameConnection GameConnection::gClientList; + extern const char *gServerPassword; + extern const char *gAdminPassword; + TNL_IMPLEMENT_NETCONNECTION(GameConnection, NetClassGroupGame, true); *************** *** 88,91 **** --- 92,157 ---- } + TNL_IMPLEMENT_RPC(GameConnection, c2sAdminPassword, (const char *pass), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCDirClientToServer, 1) + { + if(gAdminPassword && !strcmp(gAdminPassword, pass)) + { + setIsAdmin(true); + static StringTableEntry msg("Administrator access granted."); + s2cDisplayMessage(ColorAqua, SFXIncomingMessage, msg); + s2cSetIsAdmin(); + } + } + + TNL_IMPLEMENT_RPC(GameConnection, c2sAdminPlayerAction, (StringTableEntryRef playerName, U32 actionIndex), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCDirClientToServer, 1) + { + if(isAdmin()) + { + GameConnection *theClient; + for(theClient = getClientList(); theClient; theClient = theClient->getNextClient()) + if(theClient->getClientName() == playerName) + break; + + if(!theClient) + return; + + StringTableEntry msg; + static StringTableEntry kickMessage("%e0 was kicked from the game by %e1."); + static StringTableEntry changeTeamMessage("%e0 was team changed by %e1."); + Vector<StringTableEntry> e; + e.push_back(theClient->getClientName()); + e.push_back(getClientName()); + + switch(actionIndex) + { + case PlayerMenuUserInterface::ChangeTeam: + msg = changeTeamMessage; + { + GameType *gt = gServerGame->getGameType(); + gt->changeClientTeam(theClient); + } + break; + case PlayerMenuUserInterface::Kick: + msg = kickMessage; + if(theClient->isAdmin()) + { + static StringTableEntry nokick("Administrators cannot be kicked."); + s2cDisplayMessage(ColorAqua, SFXIncomingMessage, nokick); + return; + } + theClient->disconnect("You were kicked from the game."); + break; + default: + return; + } + for(GameConnection *walk = getClientList(); walk; walk = walk->getNextClient()) + walk->s2cDisplayMessageE(ColorAqua, SFXIncomingMessage, msg, e); + } + } + + TNL_IMPLEMENT_RPC(GameConnection, s2cSetIsAdmin, (), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCDirServerToClient, 1) + { + setIsAdmin(true); + } + TNL_IMPLEMENT_RPC(GameConnection, c2sRequestCommanderMap, (), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCDirClientToServer, 1) { *************** *** 106,116 **** } - TNL_IMPLEMENT_RPC(GameConnection, c2sRequestEngineerBuild, (U32 buildObject), NetClassGroupGameMask, RPCGuaranteedOrdered, RPCDirClientToServer, 1) - { - GameType *gt = gServerGame->getGameType(); - if(gt) - gt->clientRequestEngineerBuild(this, buildObject); - } - TNL_DECLARE_MEMBER_ENUM(GameConnection, ColorCount); TNL_DECLARE_ENUM(NumSFXBuffers); --- 172,175 ---- *************** *** 235,239 **** --- 294,306 ---- if(mIsAdmin) { + static StringTableEntry msg("%e0 changed the level to %e1."); + Vector<StringTableEntry> e; + e.push_back(getClientName()); + e.push_back(gServerGame->getLevelName(newLevelIndex)); + gServerGame->cycleLevel(newLevelIndex); + for(GameConnection *walk = getClientList(); walk; walk = walk->getNextClient()) + walk->s2cDisplayMessageE(ColorYellow, SFXNone, msg, e); + } } *************** *** 243,246 **** --- 310,314 ---- Parent::writeConnectRequest(stream); + stream->writeString(gPasswordEntryUserInterface.getText()); stream->writeString(mClientName.getString()); } *************** *** 257,263 **** --- 325,340 ---- } + // first read out the password. char buf[256]; stream->readString(buf); + if(gServerPassword && stricmp(buf, gServerPassword)) + { + *errorString = "PASSWORD"; + return false; + } + + //now read the player name + stream->readString(buf); size_t len = strlen(buf); *************** *** 319,323 **** { if(isInitiator()) ! gMainMenuUserInterface.activate(); } --- 396,408 ---- { if(isInitiator()) ! { ! if(!strcmp(string, "PASSWORD")) ! { ! gPasswordEntryUserInterface.setConnectServer(getNetAddress()); ! gPasswordEntryUserInterface.activate(); ! } ! else ! gMainMenuUserInterface.activate(); ! } } Index: UIMenus.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** UIMenus.cpp 28 Jul 2004 16:05:27 -0000 1.21 --- UIMenus.cpp 2 Aug 2004 18:11:53 -0000 1.22 *************** *** 40,43 **** --- 40,51 ---- { + MenuUserInterface::MenuUserInterface() + { + menuTitle = "Menu"; + menuSubTitle = ""; + menuFooter = "UP, DOWN to choose ENTER to select ESC exits menu"; + selectionIndex = 0; + } + void MenuUserInterface::render() { *************** *** 61,72 **** drawCenteredString( 570, 18, menuFooter); ! U32 yStart = (canvasHeight - menuItems.size() * 45) / 2; //glColor3f(0,1,0); ! for(S32 i = 0; i < menuItems.size(); i++) { U32 y = yStart + i * 45; ! if(selectionIndex == i) { glColor3f(0,0,0.4); --- 69,96 ---- drawCenteredString( 570, 18, menuFooter); ! if(selectionIndex >= menuItems.size()) ! selectionIndex = 0; ! ! S32 offset = 0; ! S32 count = menuItems.size(); ! ! if(count > 7) ! { ! count = 7; ! offset = selectionIndex - 3; ! if(offset < 0) ! offset = 0; ! else if(offset + count >= menuItems.size()) ! offset = menuItems.size() - count; ! } ! ! U32 yStart = (canvasHeight - count * 45) / 2; //glColor3f(0,1,0); ! for(S32 i = 0; i < count; i++) { U32 y = yStart + i * 45; ! if(selectionIndex == i + offset) { glColor3f(0,0,0.4); *************** *** 86,90 **** } glColor3f(1,1,1); ! drawCenteredString(y, 25, menuItems[i].mText); } } --- 110,114 ---- } glColor3f(1,1,1); ! drawCenteredString(y, 25, menuItems[i+offset].mText); } } *************** *** 96,101 **** selectionIndex--; if(selectionIndex < 0) ! selectionIndex = menuItems.size() - 1; ! UserInterface::playBoop(); } --- 120,132 ---- selectionIndex--; if(selectionIndex < 0) ! { ! if(menuItems.size() > 7) ! { ! selectionIndex = 0; ! return; ! } ! else ! selectionIndex = menuItems.size() - 1; ! } UserInterface::playBoop(); } *************** *** 104,108 **** selectionIndex++; if(selectionIndex >= menuItems.size()) ! selectionIndex = 0; UserInterface::playBoop(); --- 135,147 ---- selectionIndex++; if(selectionIndex >= menuItems.size()) ! { ! if(menuItems.size() > 7) ! { ! selectionIndex = menuItems.size() - 1; ! return; ! } ! else ! selectionIndex = 0; ! } UserInterface::playBoop(); *************** *** 266,274 **** else menuItems.push_back(MenuItem("VOICE ECHO: DISABLED",3)); - - if(gClientGame->getConnectionToServer()) - menuItems.push_back(MenuItem("RETURN TO GAME",4)); - else - menuItems.push_back(MenuItem("GO TO MAIN MENU",4)); } --- 305,308 ---- *************** *** 298,307 **** echoVoice = !echoVoice; break; - case 4: - if(gClientGame->getConnectionToServer()) - gGameUserInterface.activate(); - else - gMainMenuUserInterface.activate(); - break; }; setupMenus(); --- 332,335 ---- *************** *** 328,335 **** Parent::onActivate(); menuItems.clear(); - menuItems.push_back(MenuItem("RETURN TO GAME",0)); menuItems.push_back(MenuItem("OPTIONS",1)); menuItems.push_back(MenuItem("INSTRUCTIONS",2)); - menuItems.push_back(MenuItem("LEAVE GAME",3)); GameType *theGameType = gClientGame->getGameType(); if(theGameType) --- 356,361 ---- *************** *** 338,341 **** --- 364,376 ---- theGameType->addClientGameMenuOptions(menuItems); } + GameConnection *gc = gClientGame->getConnectionToServer(); + if(gc) + { + if(gc->isAdmin()) + menuItems.push_back(MenuItem("ADMIN",4)); + else + menuItems.push_back(MenuItem("ENTER ADMIN PASSWORD",5)); + } + menuItems.push_back(MenuItem("LEAVE GAME",3)); } *************** *** 344,350 **** switch(index) { - case 0: - gGameUserInterface.activate(); - break; case 1: gOptionsMenuUserInterface.activate(); --- 379,382 ---- *************** *** 360,363 **** --- 392,401 ---- gMainMenuUserInterface.activate(); break; + case 4: + gAdminMenuUserInterface.activate(); + break; + case 5: + gAdminPasswordEntryUserInterface.activate(); + break; default: gGameUserInterface.activate(); *************** *** 430,433 **** } ! }; --- 468,536 ---- } ! AdminMenuUserInterface gAdminMenuUserInterface; ! ! void AdminMenuUserInterface::onActivate() ! { ! menuTitle = "ADMINISTRATOR OPTIONS:"; ! menuItems.clear(); ! menuItems.push_back(MenuItem("CHANGE LEVEL",0)); ! menuItems.push_back(MenuItem("CHANGE A PLAYER'S TEAM",1)); ! menuItems.push_back(MenuItem("KICK A PLAYER",2)); ! } + void AdminMenuUserInterface::onEscape() + { + gGameUserInterface.activate(); + } + + void AdminMenuUserInterface::processSelection(U32 index) + { + switch(index) + { + case 0: + gLevelMenuUserInterface.activate(); + break; + case 1: + gPlayerMenuUserInterface.action = PlayerMenuUserInterface::ChangeTeam; + gPlayerMenuUserInterface.activate(); + break; + case 2: + gPlayerMenuUserInterface.action = PlayerMenuUserInterface::Kick; + gPlayerMenuUserInterface.activate(); + break; + } + } + + PlayerMenuUserInterface gPlayerMenuUserInterface; + + void PlayerMenuUserInterface::render() + { + menuItems.clear(); + GameType *gt = gClientGame->getGameType(); + if(gt) + { + for(S32 i = 0; i < gt->mClientList.size(); i++) + menuItems.push_back(MenuItem(gt->mClientList[i]->name.getString(), i)); + } + if(action == Kick) + menuTitle = "CHOOSE PLAYER TO KICK:"; + else if(action == ChangeTeam) + menuTitle = "CHOOSE PLAYER WHOSE TEAM TO CHANGE:"; + Parent::render(); + } + + void PlayerMenuUserInterface::onEscape() + { + gGameUserInterface.activate(); + } + + void PlayerMenuUserInterface::processSelection(U32 index) + { + StringTableEntry e(menuItems[index].mText); + GameConnection *gc = gClientGame->getConnectionToServer(); + if(gc) + gc->c2sAdminPlayerAction(e, action); + gGameUserInterface.activate(); + } + + }; \ No newline at end of file Index: loadoutSelect.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/loadoutSelect.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** loadoutSelect.h 30 May 2004 00:16:13 -0000 1.5 --- loadoutSelect.h 2 Aug 2004 18:11:54 -0000 1.6 *************** *** 48,60 **** }; - class EngineerBuildHelper - { - public: - EngineerBuildHelper(); - void render(); - void show(bool fromController); - bool processKey(U32 key); - }; - }; --- 48,51 ---- Index: gameType.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.h,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** gameType.h 20 Jul 2004 18:09:52 -0000 1.31 --- gameType.h 2 Aug 2004 18:11:54 -0000 1.32 *************** *** 141,144 **** --- 141,145 ---- virtual void spawnShip(GameConnection *theClient); + virtual void changeClientTeam(GameConnection *theClient); virtual void renderInterfaceOverlay(bool scoreboardVisible); *************** *** 148,152 **** virtual void updateShipLoadout(GameObject *shipObject); // called from LoadoutZone when a Ship touches the zone - virtual void clientRequestEngineerBuild(GameConnection *client, U32 buildObject); void setClientShipLoadout(ClientRef *cl, const Vector<U32> &loadout); --- 149,152 ---- Index: game.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** game.cpp 28 Jul 2004 23:01:30 -0000 1.45 --- game.cpp 2 Aug 2004 18:11:54 -0000 1.46 *************** *** 228,231 **** --- 228,238 ---- } + StringTableEntry ServerGame::getLevelName(S32 index) + { + if(index < 0 || index >= mLevelNames.size()) + return StringTableEntry(); + return mLevelNames[index]; + } + void ServerGame::cycleLevel(S32 nextLevel) { Index: UIGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** UIGame.h 3 Jun 2004 23:32:46 -0000 1.15 --- UIGame.h 2 Aug 2004 18:11:53 -0000 1.16 *************** *** 64,68 **** VChatMode, LoadoutMode, - EngineerBuildMode, }; enum ChatType { --- 64,67 ---- *************** *** 90,94 **** VChatHelper mVChat; LoadoutHelper mLoadout; - EngineerBuildHelper mEngineerBuild; struct VoiceRecorder --- 89,92 ---- *************** *** 124,128 **** void displayMessage(Color messageColor, const char *format, ...); - void displayEngineerBuildMenu(); void render(); --- 122,125 ---- Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** game.h 28 Jul 2004 23:01:30 -0000 1.59 --- game.h 2 Aug 2004 18:11:54 -0000 1.60 *************** *** 185,188 **** --- 185,189 ---- void loadLevel(const char *fileName); void cycleLevel(S32 newLevelIndex = -1); + StringTableEntry getLevelName(S32 index); void processLevelLoadLine(int argc, const char **argv); Index: ship.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.cpp,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** ship.cpp 28 Jul 2004 23:01:31 -0000 1.73 --- ship.cpp 2 Aug 2004 18:11:54 -0000 1.74 *************** *** 312,327 **** } - // if we're on the client and the user has just activated - // the engineering pack, notify the game user interface - // that it should display the buildable items list. - if(path == GameObject::ClientIdleControlMain && - !engineerWasActive && isEngineerActive() && - carryingResource()) - { - // it's kind of gross to have this here... but this - // module behaves in a pretty non-standard way. - gGameUserInterface.displayEngineerBuildMenu(); - } - if(path == GameObject::ClientIdleMainRemote) { --- 312,315 ---- *************** *** 351,356 **** bool Ship::findRepairTargets() { Vector<GameObject *> hitObjects; ! Point pos = getActualPos(); Point extend(RepairRadius, RepairRadius); Rect r(pos - extend, pos + extend); --- 339,349 ---- bool Ship::findRepairTargets() { + // We use the render position in findRepairTargets so that + // ships that are moving can repair each other (server) and + // so that ships don't render funny repair lines to interpolating + // ships (client) + Vector<GameObject *> hitObjects; ! Point pos = getRenderPos(); Point extend(RepairRadius, RepairRadius); Rect r(pos - extend, pos + extend); *************** *** 361,365 **** { GameObject *s = hitObjects[i]; ! if(!s->isDestroyed() && s->getHealth() < 1 && (s->getActualPos() - pos).len() < (RepairRadius + CollisionRadius)) mRepairTargets.push_back(s); } --- 354,358 ---- { GameObject *s = hitObjects[i]; ! if(!s->isDestroyed() && s->getHealth() < 1 && (s->getRenderPos() - pos).len() < (RepairRadius + CollisionRadius)) mRepairTargets.push_back(s); } |
From: Mark F. <mar...@us...> - 2004-08-02 18:12:01
|
Update of /cvsroot/opentnl/tnl/exe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28200/exe Modified Files: README.txt Log Message: Added server password function Added admin password Added more admin options -- kick and teamchange Index: README.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/README.txt,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** README.txt 14 Jul 2004 00:26:55 -0000 1.29 --- README.txt 2 Aug 2004 18:11:52 -0000 1.30 *************** *** 139,142 **** --- 139,144 ---- -maxplayers [number] sets the maximum number of players allowed on the server + -password [password] sets the password for access to the server. + -adminpassword [password] sets the administrator password for the server. -joystick [joystickType] enables dual analog control pad. The joystickType argument can be either 0, 1 or 2. If the right |
From: Mark F. <mar...@us...> - 2004-07-28 23:01:44
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17552/zap Modified Files: UI.cpp UI.h UIGame.cpp UIQueryServers.cpp UIQueryServers.h game.cpp game.h gameObjectRender.cpp gameType.cpp loadoutSelect.cpp main.cpp quickChat.cpp ship.cpp Log Message: Added some xb render stuff and cleaned up screen margins Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** main.cpp 28 Jul 2004 16:05:27 -0000 1.62 --- main.cpp 28 Jul 2004 23:01:31 -0000 1.63 *************** *** 617,621 **** --- 617,625 ---- using namespace Zap; + #ifdef TNL_OS_XBOX int zapmain(int argc, char **argv) + #else + int main(int argc, char **argv) + #endif { //TNLLogEnable(LogConnectionProtocol, true); Index: gameType.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** gameType.cpp 20 Jul 2004 18:09:52 -0000 1.54 --- gameType.cpp 28 Jul 2004 23:01:31 -0000 1.55 *************** *** 120,124 **** if((mGameOver || scoreboardVisible) && mTeams.size() > 0) { ! U32 totalWidth = 780; U32 teamWidth = totalWidth / mTeams.size(); U32 maxTeamPlayers = 0; --- 120,124 ---- if((mGameOver || scoreboardVisible) && mTeams.size() > 0) { ! U32 totalWidth = UserInterface::canvasWidth - UserInterface::horizMargin * 2; U32 teamWidth = totalWidth / mTeams.size(); U32 maxTeamPlayers = 0; *************** *** 136,140 **** teamAreaHeight = 0; ! U32 totalHeight = 580; U32 maxHeight = (totalHeight - teamAreaHeight) / maxTeamPlayers; if(maxHeight > 30) --- 136,140 ---- teamAreaHeight = 0; ! U32 totalHeight = UserInterface::canvasHeight - UserInterface::vertMargin * 2; U32 maxHeight = (totalHeight - teamAreaHeight) / maxTeamPlayers; if(maxHeight > 30) *************** *** 202,206 **** for(S32 i = 0; i < mTeams.size(); i++) { ! Point pos(750, 535 - i * 38); renderFlag(pos + Point(-20, 18), mTeams[i].color); glColor3f(1,1,1); --- 202,206 ---- for(S32 i = 0; i < mTeams.size(); i++) { ! Point pos(UserInterface::canvasWidth - UserInterface::horizMargin - 35, UserInterface::canvasHeight - UserInterface::vertMargin - 60 - i * 38); renderFlag(pos + Point(-20, 18), mTeams[i].color); glColor3f(1,1,1); *************** *** 219,223 **** U32 minsRemaining = timeLeft / (60000); U32 secsRemaining = (timeLeft - (minsRemaining * 60000)) / 1000; ! UserInterface::drawStringf(720, 577, 20, "%02d:%02d", minsRemaining, secsRemaining); } --- 219,224 ---- U32 minsRemaining = timeLeft / (60000); U32 secsRemaining = (timeLeft - (minsRemaining * 60000)) / 1000; ! UserInterface::drawStringf(UserInterface::canvasWidth - UserInterface::horizMargin - 65, ! UserInterface::canvasHeight - UserInterface::vertMargin - 20, 20, "%02d:%02d", minsRemaining, secsRemaining); } Index: loadoutSelect.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/loadoutSelect.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** loadoutSelect.cpp 28 Jun 2004 21:14:10 -0000 1.12 --- loadoutSelect.cpp 28 Jul 2004 23:01:31 -0000 1.13 *************** *** 91,95 **** glColor3f(0.8, 1, 0.8); ! UserInterface::drawStringf(20, curPos, fontSize, "%s", gLoadoutTitles[mCurrentIndex]); curPos += fontSize + 4; --- 91,95 ---- glColor3f(0.8, 1, 0.8); ! UserInterface::drawStringf(UserInterface::horizMargin, curPos, fontSize, "%s", gLoadoutTitles[mCurrentIndex]); curPos += fontSize + 4; *************** *** 112,119 **** glColor(c); ! renderControllerButton(20, curPos, list[i].button, list[i].key); glColor(c); ! UserInterface::drawStringf(40, curPos, fontSize, "- %s", list[i].text); curPos += fontSize + 4; --- 112,119 ---- glColor(c); ! renderControllerButton(UserInterface::horizMargin, curPos, list[i].button, list[i].key); glColor(c); ! UserInterface::drawStringf(UserInterface::horizMargin + 20, curPos, fontSize, "- %s", list[i].text); curPos += fontSize + 4; Index: UIQueryServers.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIQueryServers.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** UIQueryServers.cpp 25 Jun 2004 23:03:19 -0000 1.3 --- UIQueryServers.cpp 28 Jul 2004 23:01:30 -0000 1.4 *************** *** 366,369 **** --- 366,377 ---- } + void QueryServersUserInterface::onControllerButtonDown(U32 buttonIndex) + { + if(buttonIndex == 0) + onKeyDown('\r'); + else if(buttonIndex == 1) + onKeyDown(27); + } + void QueryServersUserInterface::onKeyDown(U32 key) { Index: gameObjectRender.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameObjectRender.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** gameObjectRender.cpp 28 Jul 2004 16:05:27 -0000 1.11 --- gameObjectRender.cpp 28 Jul 2004 23:01:31 -0000 1.12 *************** *** 37,41 **** const float gShapeLineWidth = 2.0f; #else ! const float gShapeLineWidth = 1.0f; #endif --- 37,41 ---- const float gShapeLineWidth = 2.0f; #else ! const float gShapeLineWidth = 2.0f; #endif *************** *** 509,512 **** --- 509,515 ---- mod = 1.0; } + else + glLineWidth(1); + glColor3f(mod,mod,mod); drawCircle(pos, 10); *************** *** 517,520 **** --- 520,524 ---- drawCircle(pos, 6); } + glLineWidth(DefaultLineWidth); } Index: UIGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** UIGame.cpp 26 Jun 2004 18:07:43 -0000 1.43 --- UIGame.cpp 28 Jul 2004 23:01:29 -0000 1.44 *************** *** 248,252 **** glColor3f(1,1,1); ! U32 y = 5; for(S32 i = 3; i >= 0; i--) { --- 248,252 ---- glColor3f(1,1,1); ! U32 y = UserInterface::vertMargin; for(S32 i = 3; i >= 0; i--) { *************** *** 255,259 **** glColor(mDisplayMessageColor[i]); ! drawString(5, y, 20, mDisplayMessage[i]); y += 24; } --- 255,259 ---- glColor(mDisplayMessageColor[i]); ! drawString(UserInterface::horizMargin, y, 20, mDisplayMessage[i]); y += 24; } *************** *** 285,293 **** U32 width = getStringWidth(20, promptStr); ! drawString(5, 100, 20, promptStr); ! drawString(5 + width, 100, 20, mChatBuffer); if(mChatBlink) ! drawString(5 + width + getStringWidth(20, mChatBuffer, mChatCursorPos), 100, 20, "_"); } } --- 285,293 ---- U32 width = getStringWidth(20, promptStr); ! drawString(UserInterface::horizMargin, UserInterface::vertMargin + 95, 20, promptStr); ! drawString(UserInterface::horizMargin + width, UserInterface::vertMargin + 95, 20, mChatBuffer); if(mChatBlink) ! drawString(UserInterface::horizMargin + width + getStringWidth(20, mChatBuffer, mChatCursorPos), UserInterface::vertMargin + 95, 20, "_"); } } Index: UI.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UI.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** UI.h 28 Jul 2004 16:05:27 -0000 1.10 --- UI.h 28 Jul 2004 23:01:29 -0000 1.11 *************** *** 43,46 **** --- 43,47 ---- static S32 windowWidth, windowHeight, canvasWidth, canvasHeight; + static S32 vertMargin, horizMargin; static void renderCurrent(); Index: quickChat.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/quickChat.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** quickChat.cpp 26 Jun 2004 18:07:44 -0000 1.14 --- quickChat.cpp 28 Jul 2004 23:01:31 -0000 1.15 *************** *** 170,177 **** { glColor3f(0.3, 1.0, 0.3); ! renderControllerButton(20, curPos, renderNodes[i]->buttonIndex, renderNodes[i]->trigger); glColor3f(0.3, 1.0, 0.3); ! UserInterface::drawStringf(40, curPos, fontSize, "- %s", renderNodes[i]->caption); curPos += fontSize + 4; --- 170,177 ---- { glColor3f(0.3, 1.0, 0.3); ! renderControllerButton(UserInterface::horizMargin, curPos, renderNodes[i]->buttonIndex, renderNodes[i]->trigger); glColor3f(0.3, 1.0, 0.3); ! UserInterface::drawStringf(UserInterface::horizMargin + 20, curPos, fontSize, "- %s", renderNodes[i]->caption); curPos += fontSize + 4; Index: game.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** game.cpp 23 Jul 2004 23:08:45 -0000 1.44 --- game.cpp 28 Jul 2004 23:01:30 -0000 1.45 *************** *** 547,551 **** Point position = u->getRenderPos(); ! F32 zoomFrac = mCommanderZoomDelta / F32(CommanderMapZoomTime); // Set up the view to show the whole level. Rect worldBounds = computeWorldObjectExtents(); --- 547,551 ---- Point position = u->getRenderPos(); ! F32 zoomFrac = getCommanderZoomFraction(); // Set up the view to show the whole level. Rect worldBounds = computeWorldObjectExtents(); *************** *** 553,556 **** --- 553,558 ---- Point worldCenter = worldBounds.getCenter(); Point worldExtents = worldBounds.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; *************** *** 681,712 **** glColor3f(1, 1 ,1); glBegin(GL_LINES); ! glVertex2f(15, 565); ! glVertex2f(15, 585); ! glVertex2f(15 + totalLineCount * 2, 565); ! glVertex2f(15 + totalLineCount * 2, 585); ! F32 halfway = totalLineCount * 0.5; F32 full = energy * totalLineCount; for(U32 i = 1; i < full; i++) { ! /*if(i < halfway) glColor3f(1 - i / halfway, 0, i / halfway); else glColor3f(0, (i - halfway) / halfway, 1); ! */ glColor3f(0, i / full, 1); glVertex2f(15 + i * 2, 565); glVertex2f(15 + i * 2, 585); ! } ! glEnd(); ! ! // Show safety line. ! glColor3f(1, 1, 0); ! glBegin(GL_LINES); ! F32 cutoffx = (Ship::EnergyCooldownThreshold * totalLineCount * 2) / Ship::EnergyMax; ! glVertex2f(15 + cutoffx, 562); ! glVertex2f(15 + cutoffx, 589); glEnd(); - } } --- 683,719 ---- glColor3f(1, 1 ,1); glBegin(GL_LINES); ! glVertex2f(UserInterface::horizMargin, UserInterface::canvasHeight - UserInterface::vertMargin - 20); ! glVertex2f(UserInterface::horizMargin, UserInterface::canvasHeight - UserInterface::vertMargin); ! glVertex2f(UserInterface::horizMargin + totalLineCount * 2, UserInterface::canvasHeight - UserInterface::vertMargin - 20); ! glVertex2f(UserInterface::horizMargin + totalLineCount * 2, UserInterface::canvasHeight - UserInterface::vertMargin); ! // Show safety line. ! glColor3f(1, 1, 0); ! F32 cutoffx = (Ship::EnergyCooldownThreshold * totalLineCount * 2) / Ship::EnergyMax; ! glVertex2f(UserInterface::horizMargin + cutoffx, UserInterface::canvasHeight - UserInterface::vertMargin - 23); ! glVertex2f(UserInterface::horizMargin + cutoffx, UserInterface::canvasHeight - UserInterface::vertMargin + 4); ! glEnd(); F32 halfway = totalLineCount * 0.5; F32 full = energy * totalLineCount; + glBegin(GL_POLYGON); + glColor3f(0, 0, 1); + glVertex2f(UserInterface::horizMargin, UserInterface::canvasHeight - UserInterface::vertMargin - 20); + glVertex2f(UserInterface::horizMargin, UserInterface::canvasHeight - UserInterface::vertMargin); + glColor3f(0, 1, 1); + glVertex2f(UserInterface::horizMargin + full * 2, UserInterface::canvasHeight - UserInterface::vertMargin); + glVertex2f(UserInterface::horizMargin + full * 2, UserInterface::canvasHeight - UserInterface::vertMargin - 20); + glEnd(); + /* for(U32 i = 1; i < full; i++) { ! if(i < halfway) glColor3f(1 - i / halfway, 0, i / halfway); else glColor3f(0, (i - halfway) / halfway, 1); ! glColor3f(0, i / full, 1); glVertex2f(15 + i * 2, 565); glVertex2f(15 + i * 2, 585); ! }*/ glEnd(); } } Index: UIQueryServers.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIQueryServers.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** UIQueryServers.h 20 Apr 2004 04:27:19 -0000 1.1 --- UIQueryServers.h 28 Jul 2004 23:01:30 -0000 1.2 *************** *** 94,97 **** --- 94,98 ---- void onKeyDown(U32 key); void onSpecialKeyDown(U32 key); + void onControllerButtonDown(U32 buttonIndex); void onActivate(); Index: UI.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UI.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** UI.cpp 25 Jun 2004 23:03:19 -0000 1.9 --- UI.cpp 28 Jul 2004 23:01:29 -0000 1.10 *************** *** 41,44 **** --- 41,52 ---- { + #ifdef TNL_OS_XBOX + S32 UserInterface::horizMargin = 50; + S32 UserInterface::vertMargin = 38; + #else + S32 UserInterface::horizMargin = 15; + S32 UserInterface::vertMargin = 15; + #endif + S32 UserInterface::canvasWidth = 800; S32 UserInterface::canvasHeight = 600; Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** game.h 24 Jul 2004 00:29:45 -0000 1.58 --- game.h 28 Jul 2004 23:01:30 -0000 1.59 *************** *** 212,215 **** --- 212,216 ---- bool isConnectedToServer(); + F32 getCommanderZoomFraction() { return mCommanderZoomDelta / F32(CommanderMapZoomTime); } void setConnectionToServer(GameConnection *connection); void drawStars(F32 alphaFrac, Point cameraPos, Point visibleExtent); *************** *** 232,236 **** extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.0 rc 9" }; --- 233,237 ---- extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.0 rc 10" }; Index: ship.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.cpp,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** ship.cpp 28 Jul 2004 16:05:27 -0000 1.72 --- ship.cpp 28 Jul 2004 23:01:31 -0000 1.73 *************** *** 1118,1124 **** const char *string = mPlayerName.getString(); glEnable(GL_BLEND); ! glColor4f(1,1,1,0.5 * alpha); ! UserInterface::drawString( U32( UserInterface::getStringWidth(14, string) * -0.5), 30, 14, string ); glDisable(GL_BLEND); } else --- 1118,1133 ---- const char *string = mPlayerName.getString(); glEnable(GL_BLEND); ! F32 textAlpha = 0.5 * alpha; ! F32 textSize = 14; ! #ifdef TNL_OS_XBOX ! textAlpha *= 1 - gClientGame->getCommanderZoomFraction(); ! textSize = 23; ! #else ! glLineWidth(1); ! #endif ! glColor4f(1,1,1,textAlpha); ! UserInterface::drawString( U32( UserInterface::getStringWidth(textSize, string) * -0.5), 30, textSize, string ); glDisable(GL_BLEND); + glLineWidth(DefaultLineWidth); } else |
From: Mark F. <mar...@us...> - 2004-07-28 16:05:51
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5046/zap Modified Files: UI.h UIInstructions.cpp UIMenus.cpp barrier.cpp gameObjectRender.cpp main.cpp ship.cpp Log Message: Updated some line width stuff Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** main.cpp 28 Jul 2004 02:06:14 -0000 1.61 --- main.cpp 28 Jul 2004 16:05:27 -0000 1.62 *************** *** 690,693 **** --- 690,694 ---- glTranslatef(400, 300, 0); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glLineWidth(DefaultLineWidth); atexit(onExit); Index: UIMenus.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** UIMenus.cpp 28 Jul 2004 02:06:14 -0000 1.20 --- UIMenus.cpp 28 Jul 2004 16:05:27 -0000 1.21 *************** *** 55,61 **** glDisable(GL_BLEND); } - #ifdef TNL_OS_XBOX - glLineWidth(2); - #endif glColor3f(1,1,1); --- 55,58 ---- *************** *** 91,97 **** drawCenteredString(y, 25, menuItems[i].mText); } - #ifdef TNL_OS_XBOX - glLineWidth(1); - #endif } --- 88,91 ---- Index: UI.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UI.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** UI.h 25 Jun 2004 23:03:19 -0000 1.9 --- UI.h 28 Jul 2004 16:05:27 -0000 1.10 *************** *** 35,38 **** --- 35,40 ---- { + static const float DefaultLineWidth = 2.0f; + class UserInterface { Index: UIInstructions.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIInstructions.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** UIInstructions.cpp 1 Jul 2004 19:23:36 -0000 1.6 --- UIInstructions.cpp 28 Jul 2004 16:05:27 -0000 1.7 *************** *** 220,224 **** glColor3f(1,0,0); drawCircle(Point(0,0), Ship::RepairDisplayRadius); ! glLineWidth(1); } break; --- 220,224 ---- glColor3f(1,0,0); drawCircle(Point(0,0), Ship::RepairDisplayRadius); ! glLineWidth(DefaultLineWidth); } break; Index: ship.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.cpp,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** ship.cpp 3 Jul 2004 00:11:25 -0000 1.71 --- ship.cpp 28 Jul 2004 16:05:27 -0000 1.72 *************** *** 1169,1173 **** } } ! glLineWidth(1); } } --- 1169,1173 ---- } } ! glLineWidth(DefaultLineWidth); } } Index: gameObjectRender.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameObjectRender.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** gameObjectRender.cpp 28 Jul 2004 02:06:14 -0000 1.10 --- gameObjectRender.cpp 28 Jul 2004 16:05:27 -0000 1.11 *************** *** 72,76 **** void renderShip(Color c, F32 alpha, F32 thrusts[], F32 health, F32 radius, bool cloakActive, bool shieldActive) { - glLineWidth(gShapeLineWidth); if(alpha != 1.0) glEnable(GL_BLEND); --- 72,75 ---- *************** *** 202,206 **** glEnd(); ! glColor4f(1,1,1, alpha); glBegin(GL_LINE_LOOP); glVertex2f(-20, -15); --- 201,205 ---- glEnd(); ! glColor4f(0.7,0.7,0.7, alpha); glBegin(GL_LINE_LOOP); glVertex2f(-20, -15); *************** *** 225,229 **** if(alpha != 1.0) glDisable(GL_BLEND); - glLineWidth(1.0f); } --- 224,227 ---- *************** *** 350,354 **** { glColor(c); ! glLineWidth(gShapeLineWidth); Point cross(normal.y, -normal.x); Point aimCenter = anchor + normal * aimOffset; --- 348,352 ---- { glColor(c); ! Point cross(normal.y, -normal.x); Point aimCenter = anchor + normal * aimOffset; *************** *** 370,374 **** glVertex(aimCenter + aimDelta * 30); glEnd(); ! glLineWidth(gShapeLineWidth); if(enabled) --- 368,372 ---- glVertex(aimCenter + aimDelta * 30); glEnd(); ! glLineWidth(DefaultLineWidth); if(enabled) *************** *** 401,405 **** glVertex(lsegEnd + n); glEnd(); - glLineWidth(1.0f); } --- 399,402 ---- *************** *** 408,412 **** glPushMatrix(); glTranslatef(pos.x, pos.y, 0); ! glLineWidth(gShapeLineWidth); glColor3f(c.r, c.g, c.b); glBegin(GL_LINES); --- 405,409 ---- glPushMatrix(); glTranslatef(pos.x, pos.y, 0); ! glColor3f(c.r, c.g, c.b); glBegin(GL_LINES); *************** *** 426,430 **** glVertex2f(-15, 15); glEnd(); ! glLineWidth(1.0f); glPopMatrix(); } --- 423,427 ---- glVertex2f(-15, 15); glEnd(); ! glPopMatrix(); } *************** *** 438,442 **** void renderLoadoutZone(Color theColor, Vector<Point> &bounds, Rect extent) { - glLineWidth(gShapeLineWidth); F32 alpha = 0.5; glColor(theColor * 0.5); --- 435,438 ---- *************** *** 461,470 **** renderCenteredString(Point(0,0), 25, "LOADOUT ZONE"); glPopMatrix(); - glLineWidth(1.0f); } void renderProjectile(Point pos, U32 type, U32 time) { - glLineWidth(gShapeLineWidth); ProjectileInfo *pi = gProjInfo + type; --- 457,464 ---- *************** *** 504,513 **** glPopMatrix(); - glLineWidth(1.0f); } void renderMine(Point pos, bool armed, bool visible) { - glLineWidth(gShapeLineWidth); F32 mod = 0.3; if(visible) --- 498,505 ---- *************** *** 525,534 **** drawCircle(pos, 6); } - glLineWidth(1.0f); } void renderGrenade(Point pos) { - glLineWidth(gShapeLineWidth); glColor3f(1,1,1); drawCircle(pos, 10); --- 517,524 ---- *************** *** 536,540 **** glColor3f(1,0,0); drawCircle(pos, 6); - glLineWidth(1.0f); } --- 526,529 ---- *************** *** 542,546 **** void renderRepairItem(Point pos) { - glLineWidth(gShapeLineWidth); glPushMatrix(); glTranslatef(pos.x, pos.y, 0); --- 531,534 ---- *************** *** 575,584 **** glPopMatrix(); - glLineWidth(1.0f); } void renderForceFieldProjector(Point pos, Point normal, Color c, bool enabled) { - glLineWidth(gShapeLineWidth); Point cross(normal.y, -normal.x); if(c.r < 0.7) --- 563,570 ---- *************** *** 598,607 **** glVertex(pos - cross * 12); glEnd(); - glLineWidth(1.0f); } void renderForceField(Point start, Point end, Color c, bool fieldUp) { - glLineWidth(gShapeLineWidth); if(c.r < 0.5) c.r = 0.5; --- 584,591 ---- *************** *** 624,633 **** glVertex(start - normal); glEnd(); - glLineWidth(1.0f); } void renderGoalZone(Vector<Point> &bounds, Color c, bool isFlashing) { - glLineWidth(gShapeLineWidth); F32 alpha = 0.5; glColor(c * 0.5f); --- 608,615 ---- *************** *** 645,649 **** glVertex(bounds[i]); glEnd(); - glLineWidth(1.0f); } --- 627,630 ---- Index: barrier.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/barrier.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** barrier.cpp 28 Jul 2004 02:06:14 -0000 1.14 --- barrier.cpp 28 Jul 2004 16:05:27 -0000 1.15 *************** *** 259,268 **** } glColor(f); - glLineWidth(2); glBegin(GL_LINES); for(S32 i = 0; i < mRenderLineSegments.size(); i++) glVertex2f(mRenderLineSegments[i].x, mRenderLineSegments[i].y); glEnd(); - glLineWidth(1); } } --- 259,266 ---- |
From: Mark F. <mar...@us...> - 2004-07-28 16:05:50
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5046/tnl Modified Files: log.cpp Log Message: Updated some line width stuff Index: log.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/log.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** log.cpp 20 Apr 2004 04:27:18 -0000 1.1 --- log.cpp 28 Jul 2004 16:05:26 -0000 1.2 *************** *** 104,107 **** --- 104,108 ---- va_end(s); Platform::outputDebugString(buffer); + Platform::outputDebugString("\n"); } |
From: Mark F. <mar...@us...> - 2004-07-28 02:06:24
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9624/zap Modified Files: UIMenus.cpp UIMenus.h barrier.cpp gameObjectRender.cpp main.cpp sfx.cpp Log Message: Added some game render stuff for xbox Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** main.cpp 20 Jul 2004 18:09:52 -0000 1.60 --- main.cpp 28 Jul 2004 02:06:14 -0000 1.61 *************** *** 617,621 **** using namespace Zap; ! int main(int argc, char **argv) { //TNLLogEnable(LogConnectionProtocol, true); --- 617,621 ---- using namespace Zap; ! int zapmain(int argc, char **argv) { //TNLLogEnable(LogConnectionProtocol, true); Index: UIMenus.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** UIMenus.cpp 20 Jul 2004 18:09:51 -0000 1.19 --- UIMenus.cpp 28 Jul 2004 02:06:14 -0000 1.20 *************** *** 55,58 **** --- 55,61 ---- glDisable(GL_BLEND); } + #ifdef TNL_OS_XBOX + glLineWidth(2); + #endif glColor3f(1,1,1); *************** *** 88,91 **** --- 91,97 ---- drawCenteredString(y, 25, menuItems[i].mText); } + #ifdef TNL_OS_XBOX + glLineWidth(1); + #endif } *************** *** 110,113 **** --- 116,133 ---- } + void MenuUserInterface::onControllerButtonDown(U32 buttonIndex) + { + if(buttonIndex == 0) + { + UserInterface::playBoop(); + processSelection(menuItems[selectionIndex].mIndex); + } + else if(buttonIndex == 1) + { + UserInterface::playBoop(); + onEscape(); + } + } + void MenuUserInterface::onKeyDown(U32 key) { Index: UIMenus.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** UIMenus.h 20 Jul 2004 18:09:51 -0000 1.10 --- UIMenus.h 28 Jul 2004 02:06:14 -0000 1.11 *************** *** 65,68 **** --- 65,69 ---- void onSpecialKeyDown(U32 key); void onKeyDown(U32 key); + void onControllerButtonDown(U32 buttonIndex); void onActivate() { selectionIndex = 0; } Index: sfx.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/sfx.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** sfx.cpp 23 Jul 2004 23:08:46 -0000 1.34 --- sfx.cpp 28 Jul 2004 02:06:15 -0000 1.35 *************** *** 559,563 **** }; ! #else using namespace TNL; --- 559,563 ---- }; ! #elif defined (ZAP_DEDICATED) using namespace TNL; Index: gameObjectRender.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameObjectRender.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** gameObjectRender.cpp 1 Jul 2004 23:07:46 -0000 1.9 --- gameObjectRender.cpp 28 Jul 2004 02:06:14 -0000 1.10 *************** *** 34,37 **** --- 34,43 ---- { + #ifdef TNL_OS_XBOX + const float gShapeLineWidth = 2.0f; + #else + const float gShapeLineWidth = 1.0f; + #endif + void glVertex(Point p) { *************** *** 66,69 **** --- 72,76 ---- void renderShip(Color c, F32 alpha, F32 thrusts[], F32 health, F32 radius, bool cloakActive, bool shieldActive) { + glLineWidth(gShapeLineWidth); if(alpha != 1.0) glEnable(GL_BLEND); *************** *** 218,221 **** --- 225,229 ---- if(alpha != 1.0) glDisable(GL_BLEND); + glLineWidth(1.0f); } *************** *** 342,346 **** { glColor(c); ! Point cross(normal.y, -normal.x); Point aimCenter = anchor + normal * aimOffset; --- 350,354 ---- { glColor(c); ! glLineWidth(gShapeLineWidth); Point cross(normal.y, -normal.x); Point aimCenter = anchor + normal * aimOffset; *************** *** 362,366 **** glVertex(aimCenter + aimDelta * 30); glEnd(); ! glLineWidth(1); if(enabled) --- 370,374 ---- glVertex(aimCenter + aimDelta * 30); glEnd(); ! glLineWidth(gShapeLineWidth); if(enabled) *************** *** 393,396 **** --- 401,405 ---- glVertex(lsegEnd + n); glEnd(); + glLineWidth(1.0f); } *************** *** 399,403 **** glPushMatrix(); glTranslatef(pos.x, pos.y, 0); ! glColor3f(c.r, c.g, c.b); glBegin(GL_LINES); --- 408,412 ---- glPushMatrix(); glTranslatef(pos.x, pos.y, 0); ! glLineWidth(gShapeLineWidth); glColor3f(c.r, c.g, c.b); glBegin(GL_LINES); *************** *** 417,421 **** glVertex2f(-15, 15); glEnd(); ! glPopMatrix(); } --- 426,430 ---- glVertex2f(-15, 15); glEnd(); ! glLineWidth(1.0f); glPopMatrix(); } *************** *** 429,432 **** --- 438,442 ---- void renderLoadoutZone(Color theColor, Vector<Point> &bounds, Rect extent) { + glLineWidth(gShapeLineWidth); F32 alpha = 0.5; glColor(theColor * 0.5); *************** *** 451,458 **** --- 461,470 ---- renderCenteredString(Point(0,0), 25, "LOADOUT ZONE"); glPopMatrix(); + glLineWidth(1.0f); } void renderProjectile(Point pos, U32 type, U32 time) { + glLineWidth(gShapeLineWidth); ProjectileInfo *pi = gProjInfo + type; *************** *** 492,499 **** --- 504,513 ---- glPopMatrix(); + glLineWidth(1.0f); } void renderMine(Point pos, bool armed, bool visible) { + glLineWidth(gShapeLineWidth); F32 mod = 0.3; if(visible) *************** *** 511,518 **** --- 525,534 ---- drawCircle(pos, 6); } + glLineWidth(1.0f); } void renderGrenade(Point pos) { + glLineWidth(gShapeLineWidth); glColor3f(1,1,1); drawCircle(pos, 10); *************** *** 520,523 **** --- 536,540 ---- glColor3f(1,0,0); drawCircle(pos, 6); + glLineWidth(1.0f); } *************** *** 525,528 **** --- 542,546 ---- void renderRepairItem(Point pos) { + glLineWidth(gShapeLineWidth); glPushMatrix(); glTranslatef(pos.x, pos.y, 0); *************** *** 557,564 **** --- 575,584 ---- glPopMatrix(); + glLineWidth(1.0f); } void renderForceFieldProjector(Point pos, Point normal, Color c, bool enabled) { + glLineWidth(gShapeLineWidth); Point cross(normal.y, -normal.x); if(c.r < 0.7) *************** *** 578,585 **** --- 598,607 ---- glVertex(pos - cross * 12); glEnd(); + glLineWidth(1.0f); } void renderForceField(Point start, Point end, Color c, bool fieldUp) { + glLineWidth(gShapeLineWidth); if(c.r < 0.5) c.r = 0.5; *************** *** 602,609 **** --- 624,633 ---- glVertex(start - normal); glEnd(); + glLineWidth(1.0f); } void renderGoalZone(Vector<Point> &bounds, Color c, bool isFlashing) { + glLineWidth(gShapeLineWidth); F32 alpha = 0.5; glColor(c * 0.5f); *************** *** 621,624 **** --- 645,649 ---- glVertex(bounds[i]); glEnd(); + glLineWidth(1.0f); } Index: barrier.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/barrier.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** barrier.cpp 26 Jun 2004 18:07:43 -0000 1.13 --- barrier.cpp 28 Jul 2004 02:06:14 -0000 1.14 *************** *** 259,266 **** --- 259,268 ---- } glColor(f); + glLineWidth(2); glBegin(GL_LINES); for(S32 i = 0; i < mRenderLineSegments.size(); i++) glVertex2f(mRenderLineSegments[i].x, mRenderLineSegments[i].y); glEnd(); + glLineWidth(1); } } |
From: Mark F. <mar...@us...> - 2004-07-28 02:06:22
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9624/tnl Modified Files: udp.cpp Log Message: Added some game render stuff for xbox Index: udp.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/udp.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** udp.cpp 19 May 2004 20:47:46 -0000 1.5 --- udp.cpp 28 Jul 2004 02:06:14 -0000 1.6 *************** *** 116,120 **** { bool success = true; ! #ifdef TNL_OS_WIN32 if(!initCount) { --- 116,120 ---- { bool success = true; ! #if defined ( TNL_OS_WIN32 ) if(!initCount) { *************** *** 124,127 **** --- 124,143 ---- logprintf("Winsock initialization %s", success ? "succeeded." : "failed!"); } + #elif defined( TNL_OS_XBOX ) + XNetStartupParams xnsp; + memset( &xnsp, 0, sizeof(xnsp) ); + xnsp.cfgSizeOfStruct = sizeof(xnsp); + xnsp.cfgFlags = XNET_STARTUP_BYPASS_SECURITY; + INT iResult = XNetStartup( &xnsp ); + if( iResult != NO_ERROR ) + success = false; + + + WSADATA WsaData; + iResult = WSAStartup( 0x0101, &WsaData ); + if( iResult != NO_ERROR ) + success = false; + + logprintf("Winsock initialization %s", success ? "succeeded." : "failed!"); #endif initCount++; |
From: Mark F. <mar...@us...> - 2004-07-24 00:30:01
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28229/zap Modified Files: game.h Log Message: Updated game version Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** game.h 20 Jul 2004 18:09:52 -0000 1.57 --- game.h 24 Jul 2004 00:29:45 -0000 1.58 *************** *** 232,236 **** extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.0 rc 8" }; --- 232,236 ---- extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.0 rc 9" }; |
From: Mark F. <mar...@us...> - 2004-07-23 23:08:55
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15818/tnl Modified Files: platform.cpp tnlTypes.h Log Message: Added some xbox stuff Index: platform.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/platform.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** platform.cpp 19 May 2004 20:47:46 -0000 1.5 --- platform.cpp 23 Jul 2004 23:08:45 -0000 1.6 *************** *** 69,73 **** void Platform::forceQuit() { ! // do nothing... } --- 69,76 ---- void Platform::forceQuit() { ! logprintf("-Force Quit-"); ! // Reboot! ! LD_LAUNCH_DASHBOARD LaunchData = { XLD_LAUNCH_DASHBOARD_MAIN_MENU }; ! XLaunchNewImage( NULL, (LAUNCH_DATA*)&LaunchData ); } *************** *** 75,80 **** { U32 tickCount; ! TNL_JOURNAL_READ_BLOCK ! ( TNL_JOURNAL_READ( (&tickCount) ); return tickCount; --- 78,82 ---- { U32 tickCount; ! TNL_JOURNAL_READ_BLOCK ( getRealMilliseconds, TNL_JOURNAL_READ( (&tickCount) ); return tickCount; *************** *** 83,93 **** tickCount = GetTickCount(); ! TNL_JOURNAL_WRITE_BLOCK ! ( ! TNL_JOURNAL_WRITE(tickCount); ) return tickCount; } //-------------------------------------- void Platform::AlertOK(const char *windowTitle, const char *message) --- 85,95 ---- tickCount = GetTickCount(); ! TNL_JOURNAL_WRITE_BLOCK ( getRealMilliseconds, ! TNL_JOURNAL_WRITE( (tickCount) ); ) return tickCount; } + //-------------------------------------- void Platform::AlertOK(const char *windowTitle, const char *message) *************** *** 117,120 **** --- 119,174 ---- } + + class WinTimer + { + private: + F64 mPeriod; + bool mUsingPerfCounter; + public: + WinTimer() + { + S64 frequency; + mUsingPerfCounter = QueryPerformanceFrequency((LARGE_INTEGER *) &frequency); + mPeriod = 1000.0f / F64(frequency); + } + S64 getCurrentTime() + { + if(mUsingPerfCounter) + { + S64 value; + QueryPerformanceCounter( (LARGE_INTEGER *) &value); + return value; + } + else + { + return GetTickCount(); + } + } + F64 convertToMS(S64 delta) + { + if(mUsingPerfCounter) + return mPeriod * F64(delta); + else + return F64(delta); + } + }; + + static WinTimer gTimer; + + S64 Platform::getHighPrecisionTimerValue() + { + return gTimer.getCurrentTime(); + } + + F64 Platform::getHighPrecisionMilliseconds(S64 timerDelta) + { + return gTimer.convertToMS(timerDelta); + } + + void Platform::sleep(U32 msCount) + { + // no need to sleep on the xbox... + } + #elif defined (TNL_OS_WIN32) Index: tnlTypes.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlTypes.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tnlTypes.h 20 May 2004 20:16:07 -0000 1.8 --- tnlTypes.h 23 Jul 2004 23:08:45 -0000 1.9 *************** *** 233,237 **** //---------------------------------------------------------------------------------- ! #if defined(__XBOX__) # define TNL_OS_STRING "XBox" # define TNL_OS_XBOX --- 233,237 ---- //---------------------------------------------------------------------------------- ! #if defined (_XBOX) || defined(__XBOX__) # define TNL_OS_STRING "XBox" # define TNL_OS_XBOX |
From: Mark F. <mar...@us...> - 2004-07-23 23:08:55
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15818/zap Modified Files: game.cpp sfx.cpp Log Message: Added some xbox stuff Index: game.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** game.cpp 20 Jul 2004 18:09:52 -0000 1.43 --- game.cpp 23 Jul 2004 23:08:45 -0000 1.44 *************** *** 271,275 **** --- 271,279 ---- mGridSize = DefaultGridSize; char fileBuffer[256]; + #ifdef TNL_OS_XBOX + dSprintf(fileBuffer, sizeof(fileBuffer), "d:\\media\\levels\\%s", fileName); + #else dSprintf(fileBuffer, sizeof(fileBuffer), "levels/%s", fileName); + #endif initLevelFromFile(fileBuffer); if(!getGameType()) Index: sfx.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/sfx.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** sfx.cpp 10 Jun 2004 06:15:53 -0000 1.33 --- sfx.cpp 23 Jul 2004 23:08:46 -0000 1.34 *************** *** 30,34 **** #include "tnlRandom.h" ! #if !defined (ZAP_DEDICATED) #include "alInclude.h" --- 30,34 ---- #include "tnlRandom.h" ! #if !defined (ZAP_DEDICATED) && !defined (TNL_OS_XBOX) #include "alInclude.h" |
From: Mark F. <mar...@us...> - 2004-07-23 23:08:54
|
Update of /cvsroot/opentnl/tnl/glut In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15818/glut Modified Files: glutInclude.h Log Message: Added some xbox stuff Index: glutInclude.h =================================================================== RCS file: /cvsroot/opentnl/tnl/glut/glutInclude.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** glutInclude.h 20 May 2004 00:20:31 -0000 1.3 --- glutInclude.h 23 Jul 2004 23:08:45 -0000 1.4 *************** *** 28,38 **** #define GLUT_INCLUDE ! #ifdef ZAP_DEDICATED ! #include "glDedicated.h" ! #else ! #ifdef TNL_OS_MAC_OSX #include <GLUT/glut.h> --- 28,40 ---- #define GLUT_INCLUDE ! #if defined(TNL_OS_XBOX) ! #include "glXBox.h" ! #elif defined( ZAP_DEDICATED ) ! #include "glDedicated.h" ! ! #elif defined (TNL_OS_MAC_OSX ) #include <GLUT/glut.h> *************** *** 45,48 **** #endif - - #endif --- 47,48 ---- |