opentnl-cvs Mailing List for Torque Network Library (Page 7)
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-09-25 01:26:47
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18487/zap Modified Files: UIMenus.cpp huntersGame.cpp input.cpp input.h quickChat.cpp winJoystick.cpp Log Message: Added much improved controller support for circular analog sticks Added D-pad support for menu navigation Added proper rendering and bindings for PS2 dual shock controllers Updated README with correct controls for PS2 and XBox controllers Index: input.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/input.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** input.h 29 Jun 2004 18:52:28 -0000 1.1 --- input.h 25 Sep 2004 01:26:37 -0000 1.2 *************** *** 39,47 **** PS2DualShock, XBoxController, }; ! enum { MaxJoystickAxes = 12, ! MaxJoystickButtons = 12, }; --- 39,63 ---- PS2DualShock, XBoxController, + XBoxControllerOnXBox, }; ! enum ButtonInfo { MaxJoystickAxes = 12, ! MaxJoystickButtons = 14, ! ControllerButton1 = 1 << 0, ! ControllerButton2 = 1 << 1, ! ControllerButton3 = 1 << 2, ! ControllerButton4 = 1 << 3, ! ControllerButton5 = 1 << 4, ! ControllerButton6 = 1 << 5, ! ControllerButtonLeftTrigger = 1 << 6, ! ControllerButtonRightTrigger = 1 << 7, ! ControllerGameButtonCount = 8, ! ControllerButtonStart = 1 << 16, ! ControllerButtonBack = 1 << 17, ! ControllerButtonDPadUp = 1 << 18, ! ControllerButtonDPadDown = 1 << 19, ! ControllerButtonDPadLeft = 1 << 20, ! ControllerButtonDPadRight = 1 << 21, }; Index: UIMenus.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** UIMenus.cpp 6 Aug 2004 00:02:46 -0000 1.23 --- UIMenus.cpp 25 Sep 2004 01:26:37 -0000 1.24 *************** *** 116,120 **** void MenuUserInterface::onSpecialKeyDown(U32 key) { ! if(key == GLUT_KEY_UP || key == GLUT_KEY_LEFT) { selectionIndex--; --- 116,120 ---- void MenuUserInterface::onSpecialKeyDown(U32 key) { ! if(key == GLUT_KEY_UP) { selectionIndex--; *************** *** 131,135 **** UserInterface::playBoop(); } ! else if(key == GLUT_KEY_DOWN || key == GLUT_KEY_RIGHT) { selectionIndex++; --- 131,135 ---- UserInterface::playBoop(); } ! else if(key == GLUT_KEY_DOWN) { selectionIndex++; *************** *** 297,300 **** --- 297,303 ---- menuItems.push_back(MenuItem("INPUT: XBOX CONTROLLER USB",2)); break; + case 4: + menuItems.push_back(MenuItem("INPUT: XBOX CONTROLLER",2)); + break; default: menuItems.push_back(MenuItem("INPUT: UNKNOWN",2)); Index: huntersGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/huntersGame.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** huntersGame.cpp 26 Jun 2004 18:07:44 -0000 1.10 --- huntersGame.cpp 25 Sep 2004 01:26:37 -0000 1.11 *************** *** 175,179 **** U32 minsRemaining = timeLeft / (60000); U32 secsRemaining = (timeLeft - (minsRemaining * 60000)) / 1000; ! UserInterface::drawStringf(720, 550, 20, "%02d:%02d", minsRemaining, secsRemaining); } --- 175,180 ---- U32 minsRemaining = timeLeft / (60000); U32 secsRemaining = (timeLeft - (minsRemaining * 60000)) / 1000; ! UserInterface::drawStringf(UserInterface::canvasWidth - UserInterface::horizMargin - 65, ! UserInterface::canvasHeight - UserInterface::vertMargin - 45, 20, "%02d:%02d", minsRemaining, secsRemaining); } Index: quickChat.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/quickChat.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** quickChat.cpp 28 Jul 2004 23:01:31 -0000 1.15 --- quickChat.cpp 25 Sep 2004 01:26:37 -0000 1.16 *************** *** 31,34 **** --- 31,35 ---- #include "UIMenus.h" #include "gameObjectRender.h" + #include "input.h" #include <ctype.h> namespace Zap *************** *** 106,110 **** if(joy == -1) UserInterface::drawStringf(x, y, 15, "%c", keyIndex); ! else if(joy == 0) { glColor3f(1,1,1); --- 107,111 ---- if(joy == -1) UserInterface::drawStringf(x, y, 15, "%c", keyIndex); ! else if(joy == LogitechWingman) { glColor3f(1,1,1); *************** *** 113,117 **** UserInterface::drawStringf(x + 4, y + 2, 12, "%c", buttons[buttonIndex]); } ! else if(joy == 1) { glColor3f(1,1,1); --- 114,118 ---- UserInterface::drawStringf(x + 4, y + 2, 12, "%c", buttons[buttonIndex]); } ! else if(joy == SaitekDualAnalog) { glColor3f(1,1,1); *************** *** 120,135 **** UserInterface::drawStringf(x + 4, y + 2, 12, "%c", buttons[buttonIndex]); } ! else if(joy == 2) { ! UserInterface::drawStringf(x, y, 15, "%c", buttonIndex + '1'); } ! else if(joy == 3) { ! static F32 color[6][3] = { { 0, 0, 1 }, { 0, 1, 0 }, { 1, 1, 1 }, { 1, 1, 0 }, { 1, 0, 0}, { 0, 0, 0} }; Color c(color[buttonIndex][0], color[buttonIndex][1], color[buttonIndex][2]); glColor(c * 0.8f); fillCircle(Point(x + 8, y + 8), 8); ! const char buttons[] = "XA YB "; glColor3f(1,1,1); drawCircle(Point(x + 8, y + 8), 8); --- 121,195 ---- UserInterface::drawStringf(x + 4, y + 2, 12, "%c", buttons[buttonIndex]); } ! else if(joy == PS2DualShock) { ! static F32 color[6][3] = { { 0.5, 0.5, 1 }, ! { 1, 0.5, 0.5 }, ! { 1, 0.5, 1 }, ! { 0.5, 1, 0.5 }, ! { 0.7, 0.7, 0.7 }, ! { 0.7, 0.7, 0.7 } ! }; ! Color c(color[buttonIndex][0], color[buttonIndex][1], color[buttonIndex][2]); ! glColor3f(1.0, 1.0, 1.0); ! Point center(x + 8, y + 8); ! if(buttonIndex < 4) ! { ! drawCircle(center, 8); ! glColor(c); ! switch(buttonIndex) ! { ! case 0: ! glBegin(GL_LINES); ! glVertex(center + Point(-5, -5)); ! glVertex(center + Point(5, 5)); ! glVertex(center + Point(-5, 5)); ! glVertex(center + Point(5, -5)); ! glEnd(); ! break; ! case 1: ! drawCircle(center, 5); ! break; ! case 2: ! glBegin(GL_LINE_LOOP); ! glVertex(center + Point(-5, -5)); ! glVertex(center + Point(-5, 5)); ! glVertex(center + Point(5, 5)); ! glVertex(center + Point(5, -5)); ! glEnd(); ! break; ! case 3: ! glBegin(GL_LINE_LOOP); ! glVertex(center + Point(0, -5)); ! glVertex(center + Point(5, 3)); ! glVertex(center + Point(-5, 3)); ! glEnd(); ! break; ! } ! } ! else ! { ! glBegin(GL_LINE_LOOP); ! glVertex(center + Point(-8, -8)); ! glVertex(center + Point(-8, 8)); ! glVertex(center + Point(10, 8)); ! glVertex(center + Point(10, -8)); ! glEnd(); ! ! UserInterface::drawString(x + 2, y + 2, 11, buttonIndex == 4 ? "L2" : "R2"); ! } } ! else if(joy == XBoxController || joy == XBoxControllerOnXBox) { ! static F32 color[6][3] = { { 0, 1, 0 }, ! { 1, 0, 0 }, ! { 0, 0, 1 }, ! { 1, 1, 0 }, ! { 1, 1, 1 }, ! { 0, 0, 0} }; Color c(color[buttonIndex][0], color[buttonIndex][1], color[buttonIndex][2]); glColor(c * 0.8f); fillCircle(Point(x + 8, y + 8), 8); ! const char buttons[] = "ABXY "; glColor3f(1,1,1); drawCircle(Point(x + 8, y + 8), 8); Index: input.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/input.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** input.cpp 29 Jun 2004 18:52:28 -0000 1.1 --- input.cpp 25 Sep 2004 01:26:37 -0000 1.2 *************** *** 31,34 **** --- 31,35 ---- #include "tnlJournal.h" #include <math.h> + #include "glutInclude.h" namespace Zap *************** *** 47,50 **** --- 48,74 ---- controls[0] = axes[0]; controls[1] = axes[1]; + + // xbox control inputs are in a circle, not a square, which makes + // diagonal movement inputs "slower" + if(OptionsMenuUserInterface::joystickType == XBoxController || + OptionsMenuUserInterface::joystickType == XBoxControllerOnXBox) + { + Point dir(controls[0], controls[1]); + F32 absX = fabs(dir.x); + F32 absY = fabs(dir.y); + + // push out to the edge of the square (-1,-1 -> 1,1 ) + + F32 dirLen = dir.len() * 1.25; + if(dirLen > 1) + dirLen = 1; + + if(absX > absY) + dir *= F32(dirLen / absX); + else + dir *= F32(dirLen / absY); + controls[0] = dir.x; + controls[1] = dir.y; + } switch(OptionsMenuUserInterface::joystickType) { *************** *** 62,65 **** --- 86,90 ---- break; case XBoxController: + case XBoxControllerOnXBox: controls[2] = axes[3]; controls[3] = axes[4]; *************** *** 109,132 **** theMove->fire = false; // Remap crazy xbox inputs... ! if(OptionsMenuUserInterface::joystickType == XBoxController) { U32 retMask = 0; ! if(buttonMask & BIT(2)) ! retMask |= BIT(0); ! if(buttonMask & BIT(0)) ! retMask |= BIT(1); ! if(buttonMask & BIT(5)) ! retMask |= BIT(2); ! if(buttonMask & BIT(3)) ! retMask |= BIT(3); ! if(buttonMask & BIT(1)) ! retMask |= BIT(4); ! if(buttonMask & BIT(4)) ! retMask |= BIT(5); ! if(buttonMask & BIT(10)) ! retMask |= BIT(6); ! if(buttonMask & BIT(11)) ! retMask |= BIT(7); buttonMask = retMask; } --- 134,189 ---- theMove->fire = false; + // Remap crazy xbox inputs... ! if(OptionsMenuUserInterface::joystickType == LogitechWingman) ! { ! if(buttonMask & (1 << 8)) ! { ! buttonMask |= ControllerButtonBack; ! buttonMask &= ~(1 << 8); ! } ! } ! else if(OptionsMenuUserInterface::joystickType == PS2DualShock) { + static U32 retMasks[12] = { + ControllerButton4, + ControllerButton2, + ControllerButton1, + ControllerButton3, + ControllerButton5, + ControllerButton6, + ControllerButtonLeftTrigger, + ControllerButtonRightTrigger, + ControllerButtonBack, + 0, + ControllerButton1, + ControllerButtonStart, + }; U32 retMask = 0; ! for(S32 i = 0; i < 12; i++) ! if(buttonMask & (1 << i)) ! retMask |= retMasks[i]; ! buttonMask = retMask; ! } ! else if(OptionsMenuUserInterface::joystickType == XBoxController) ! { ! static U32 retMasks[12] = { ! ControllerButton1, ! ControllerButton2, ! ControllerButton3, ! ControllerButton4, ! ControllerButton6, ! ControllerButton5, ! ControllerButtonStart, ! ControllerButtonBack, ! 0, ! ControllerButton1, ! ControllerButtonLeftTrigger, ! ControllerButtonRightTrigger, ! }; ! U32 retMask = 0; ! for(S32 i = 0; i < 12; i++) ! if(buttonMask & (1 << i)) ! retMask |= retMasks[i]; buttonMask = retMask; } *************** *** 172,184 **** return; ! for(U32 i = 0; i < MaxJoystickButtons; i++) { U32 mask = 1 << i; ! if(buttonsPressed & ~lastButtonsPressed & mask) UserInterface::current->onControllerButtonDown(i); ! else if(~buttonsPressed & lastButtonsPressed & mask) UserInterface::current->onControllerButtonUp(i); } ! lastButtonsPressed = buttonsPressed; } --- 229,269 ---- return; ! U32 buttonDown = buttonsPressed & ~lastButtonsPressed; ! U32 buttonUp = ~buttonsPressed & lastButtonsPressed; ! lastButtonsPressed = buttonsPressed; ! ! for(U32 i = 0; i < ControllerGameButtonCount; i++) { U32 mask = 1 << i; ! if(buttonDown & mask) UserInterface::current->onControllerButtonDown(i); ! else if(buttonUp & mask) UserInterface::current->onControllerButtonUp(i); } ! if(buttonDown & ControllerButtonStart) ! UserInterface::current->onKeyDown('\r'); ! if(buttonDown & ControllerButtonBack) ! UserInterface::current->onKeyDown(27); ! if(buttonDown & ControllerButtonDPadUp) ! UserInterface::current->onSpecialKeyDown(GLUT_KEY_UP); ! if(buttonDown & ControllerButtonDPadDown) ! UserInterface::current->onSpecialKeyDown(GLUT_KEY_DOWN); ! if(buttonDown & ControllerButtonDPadLeft) ! UserInterface::current->onSpecialKeyDown(GLUT_KEY_LEFT); ! if(buttonDown & ControllerButtonDPadRight) ! UserInterface::current->onSpecialKeyDown(GLUT_KEY_RIGHT); ! ! if(buttonUp & ControllerButtonStart) ! UserInterface::current->onKeyUp('\r'); ! if(buttonUp & ControllerButtonBack) ! UserInterface::current->onKeyUp(27); ! if(buttonUp & ControllerButtonDPadUp) ! UserInterface::current->onSpecialKeyUp(GLUT_KEY_UP); ! if(buttonUp & ControllerButtonDPadDown) ! UserInterface::current->onSpecialKeyUp(GLUT_KEY_DOWN); ! if(buttonUp & ControllerButtonDPadLeft) ! UserInterface::current->onSpecialKeyUp(GLUT_KEY_LEFT); ! if(buttonUp & ControllerButtonDPadRight) ! UserInterface::current->onSpecialKeyUp(GLUT_KEY_RIGHT); } Index: winJoystick.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/winJoystick.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** winJoystick.cpp 29 Jun 2004 18:52:28 -0000 1.18 --- winJoystick.cpp 25 Sep 2004 01:26:37 -0000 1.19 *************** *** 150,154 **** return false; // The device should have been acquired during the Poll() ! F32 scale = 1 / 32768.0f; axes[0] = (F32(js.lX) - 32768.0f) * scale; axes[1] = (F32(js.lY) - 32768.0f) * scale; --- 150,154 ---- return false; // The device should have been acquired during the Poll() ! F32 scale = 1.15 / 32768.0f; axes[0] = (F32(js.lX) - 32768.0f) * scale; axes[1] = (F32(js.lY) - 32768.0f) * scale; *************** *** 163,173 **** --- 163,214 ---- axes[10] = 0; axes[11] = 0; + for(S32 i = 0; i < 12; i++) + { + if(axes[i] > 1) + axes[i] = 1; + if(axes[i] < -1) + axes[i] = -1; + } // check the state of the buttons: buttonMask = 0; + U32 pov = js.rgdwPOV[0]; for( U32 i = 0; i < 12; i++ ) + { if((js.rgbButtons[i] & 0x80) != 0) + { + logprintf("Button down %d", i); buttonMask |= BIT(i); + } + } + + switch(pov) + { + case 0: + buttonMask |= ControllerButtonDPadUp; + break; + case 4500: + buttonMask |= ControllerButtonDPadUp | ControllerButtonDPadRight; + break; + case 9000: + buttonMask |= ControllerButtonDPadRight; + break; + case 13500: + buttonMask |= ControllerButtonDPadRight | ControllerButtonDPadDown; + break; + case 18000: + buttonMask |= ControllerButtonDPadDown; + break; + case 22500: + buttonMask |= ControllerButtonDPadDown | ControllerButtonDPadLeft; + break; + case 27000: + buttonMask |= ControllerButtonDPadLeft; + break; + case 31500: + buttonMask |= ControllerButtonDPadLeft | ControllerButtonDPadUp; + break; + } return true; } |
From: Mark F. <mar...@us...> - 2004-09-25 01:26:46
|
Update of /cvsroot/opentnl/tnl/exe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18487/exe Modified Files: README.txt Log Message: Added much improved controller support for circular analog sticks Added D-pad support for menu navigation Added proper rendering and bindings for PS2 dual shock controllers Updated README with correct controls for PS2 and XBox controllers Index: README.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/README.txt,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** README.txt 17 Sep 2004 00:14:33 -0000 1.32 --- README.txt 25 Sep 2004 01:26:36 -0000 1.33 *************** *** 116,128 **** PS 2 Dual Shock w/USB ! ? XBox controller ! A (green) - ! B (red) - ! X (blue) - ! Y (yellow) - ! white - ! black - In the game you can press ESC to go to the game options screen. --- 116,133 ---- PS 2 Dual Shock w/USB ! X or depress right stick - cycle to next weapon ! O - toggle commander map ! square - open quick chat menu ! triangle - select weapon and module loadout ! L2 - show scores ! R2 - record voice XBox controller ! A (green) - cycle to weapon ! B (red) - toggle commander map ! X (blue) - open quick chat menu ! Y (yellow) - select weapon and module loadout ! white - show scores ! black - record voice In the game you can press ESC to go to the game options screen. |
From: Mark F. <mar...@us...> - 2004-09-23 15:16:34
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30839/zap Modified Files: zap.dsp Log Message: Updated VC6 project file Index: zap.dsp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/zap.dsp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** zap.dsp 21 Aug 2004 03:40:29 -0000 1.12 --- zap.dsp 23 Sep 2004 15:16:22 -0000 1.13 *************** *** 237,240 **** --- 237,244 ---- # Begin Source File + SOURCE=.\HTFGame.cpp + # End Source File + # Begin Source File + SOURCE=.\huntersGame.cpp # End Source File *************** *** 483,486 **** --- 487,494 ---- SOURCE=.\winmain.cpp # End Source File + # Begin Source File + + SOURCE=.\ZAP.rc + # End Source File # End Target # End Project |
From: Mark F. <mar...@us...> - 2004-09-17 00:14:44
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8489/zap Modified Files: ZAP.vcproj game.h main.cpp ship.cpp Added Files: HTFGame.cpp Log Message: Added new game type Updated game version Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** main.cpp 20 Aug 2004 23:16:07 -0000 1.68 --- main.cpp 17 Sep 2004 00:14:34 -0000 1.69 *************** *** 70,74 **** const char *gLevelList = "retrieve1.txt " "retrieve2.txt " ! "retrieve3.txt " "football1.txt " "football2.txt " --- 70,74 ---- const char *gLevelList = "retrieve1.txt " "retrieve2.txt " ! "htf1.txt " "football1.txt " "football2.txt " *************** *** 83,88 **** "ctf3.txt " "ctf4.txt " ! "level8.txt " ! "level2.txt " ; --- 83,89 ---- "ctf3.txt " "ctf4.txt " ! "hunters1.txt " ! "hunters2.txt " ! "zm1.txt " ; Index: ZAP.vcproj =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ZAP.vcproj,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** ZAP.vcproj 24 Aug 2004 22:08:39 -0000 1.38 --- ZAP.vcproj 17 Sep 2004 00:14:34 -0000 1.39 *************** *** 377,380 **** --- 377,383 ---- </File> <File + RelativePath=".\HTFGame.cpp"> + </File> + <File RelativePath=".\huntersGame.cpp"> </File> Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** game.h 20 Aug 2004 23:16:07 -0000 1.63 --- game.h 17 Sep 2004 00:14:34 -0000 1.64 *************** *** 234,238 **** extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.1" }; --- 234,238 ---- extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.2" }; --- NEW FILE: HTFGame.cpp --- //----------------------------------------------------------------------------------- // // Torque Network Library - ZAP example multiplayer vector graphics space game // Copyright (C) 2004 GarageGames.com, Inc. // For more information see http://www.opentnl.org // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // For use in products that are not compatible with the terms of the GNU // General Public License, alternative licensing options are available // from GarageGames.com. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // //------------------------------------------------------------------------------------ #include "goalZone.h" #include "gameType.h" #include "ship.h" #include "flagItem.h" #include "gameObjectRender.h" namespace Zap { class HTFGameType : public GameType { typedef GameType Parent; static StringTableEntry aString; static StringTableEntry theString; Vector<GoalZone *> mZones; Vector<FlagItem *> mFlags; Vector<GoalZone *> mFlagZones; enum { CapScore = 2, ScoreTime = 5000, }; Timer mScoreTimer; public: HTFGameType() : mScoreTimer(ScoreTime) {} void addFlag(FlagItem *theFlag) { mFlags.push_back(theFlag); mFlagZones.push_back(NULL); } void addZone(GoalZone *zone) { mZones.push_back(zone); } void shipTouchFlag(Ship *theShip, FlagItem *theFlag) { // see if the ship is already carrying a flag - can only carry one at a time for(S32 i = 0; i < theShip->mMountedItems.size(); i++) if(theShip->mMountedItems[i].isValid() && (theShip->mMountedItems[i]->getObjectTypeMask() & FlagType)) return; S32 flagIndex; for(flagIndex = 0; flagIndex < mFlags.size(); flagIndex++) if(mFlags[flagIndex] == theFlag) break; GameConnection *controlConnection = theShip->getControllingClient(); ClientRef *cl = controlConnection->getClientRef(); if(!cl) return; // see if this flag is already in a flag zone owned by the ship's team if(mFlagZones[flagIndex] != NULL && mFlagZones[flagIndex]->getTeam() == theShip->getTeam()) return; static StringTableEntry stealString("%e0 stole %e2 flag from team %e1!"); static StringTableEntry takeString("%e0 of team %e1 took %e2 flag!"); StringTableEntry r = takeString; S32 teamIndex; if(mFlagZones[flagIndex] == NULL) teamIndex = cl->teamId; else { r = stealString; teamIndex = mFlagZones[flagIndex]->getTeam(); } Vector<StringTableEntry> e; e.push_back(cl->name); e.push_back(mTeams[teamIndex].name); if(mFlags.size() == 1) e.push_back(theString); else e.push_back(aString); for(S32 i = 0; i < mClientList.size(); i++) mClientList[i]->clientConnection->s2cDisplayMessageE( GameConnection::ColorNuclearGreen, SFXFlagSnatch, r, e); theFlag->mountToShip(theShip); mFlagZones[flagIndex] = NULL; } void flagDropped(Ship *theShip, FlagItem *theFlag) { static StringTableEntry aString("a"); static StringTableEntry theString("the"); static StringTableEntry dropString("%e0 dropped %e1 flag!"); Vector<StringTableEntry> e; e.push_back(theShip->mPlayerName); if(mFlags.size() == 1) e.push_back(theString); else e.push_back(aString); for(S32 i = 0; i < mClientList.size(); i++) mClientList[i]->clientConnection->s2cDisplayMessageE(GameConnection::ColorNuclearGreen, SFXFlagDrop, dropString, e); } void shipTouchZone(Ship *s, GoalZone *z) { GameConnection *controlConnection = s->getControllingClient(); ClientRef *cl = controlConnection->getClientRef(); if(!cl) return; // see if this is an opposing team's zone if(s->getTeam() != z->getTeam()) return; // see if this zone already has a flag in it... for(S32 i = 0; i < mFlagZones.size(); i++) if(mFlagZones[i] == z) return; // ok, it's an empty zone on our team: // see if this ship is carrying a flag S32 i; for(i = 0; i < s->mMountedItems.size(); i++) if(s->mMountedItems[i].isValid() && (s->mMountedItems[i]->getObjectTypeMask() & FlagType)) break; if(i == s->mMountedItems.size()) return; // ok, the ship has a flag and it's on the ship... Item *theItem = s->mMountedItems[i]; FlagItem *mountedFlag = dynamic_cast<FlagItem *>(theItem); if(mountedFlag) { static StringTableEntry capString("%e0 retrieved %e1 flag!"); Vector<StringTableEntry> e; e.push_back(cl->name); if(mFlags.size() == 1) e.push_back(theString); else e.push_back(aString); for(S32 i = 0; i < mClientList.size(); i++) mClientList[i]->clientConnection->s2cDisplayMessageE(GameConnection::ColorNuclearGreen, SFXFlagCapture, capString, e); mountedFlag->dismount(); S32 flagIndex; for(flagIndex = 0; flagIndex < mFlags.size(); flagIndex++) if(mFlags[flagIndex] == mountedFlag) break; mFlagZones[flagIndex] = z; mountedFlag->setActualPos(z->getExtent().getCenter()); cl->score += CapScore; } } void idle(GameObject::IdleCallPath path) { Parent::idle(path); if(path == GameObject::ServerIdleMainLoop) { if(!mScoreTimer.update(mCurrentMove.time)) return; mScoreTimer.reset(); for(S32 flagIndex = 0; flagIndex < mFlags.size(); flagIndex++) { if(mFlagZones[flagIndex] != NULL) { S32 team = mFlagZones[flagIndex]->getTeam(); setTeamScore(team, mTeams[team].score + 1); } } } } const char *getGameTypeString() { return "Hold the Flag"; } const char *getInstructionString() { return "Hold the flags at your capture zones!"; } TNL_DECLARE_CLASS(HTFGameType); }; StringTableEntry HTFGameType::aString("a"); StringTableEntry HTFGameType::theString("the"); TNL_IMPLEMENT_NETOBJECT(HTFGameType); }; Index: ship.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ship.cpp,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** ship.cpp 4 Aug 2004 18:25:27 -0000 1.75 --- ship.cpp 17 Sep 2004 00:14:34 -0000 1.76 *************** *** 133,136 **** --- 133,137 ---- F32 time = mCurrentMove.time * 0.001; Point requestVel(mCurrentMove.right - mCurrentMove.left, mCurrentMove.down - mCurrentMove.up); + requestVel *= maxVel; F32 len = requestVel.len(); |
From: Mark F. <mar...@us...> - 2004-09-17 00:14:44
|
Update of /cvsroot/opentnl/tnl/exe/levels In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8489/exe/levels Modified Files: hunters1.txt Added Files: htf1.txt zm1.txt Removed Files: level2.txt level8.txt retrieve3.txt Log Message: Added new game type Updated game version Index: hunters1.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/levels/hunters1.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** hunters1.txt 24 Jun 2004 22:50:18 -0000 1.2 --- hunters1.txt 17 Sep 2004 00:14:34 -0000 1.3 *************** *** 2,44 **** LevelName "Tin Man's Reprise" Team Orange 1 0.5 0 ! GridSize 300 ! HuntersNexusObject 9 4.7 60 60 ! Spawn 0 3 12.8 ! Spawn 0 9 3.4 ! Spawn 0 15 11.8 ! Spawn 0 10.4 3.6 ! Spawn 0 7.9 5.5 ! Spawn 0 10.1 5.5 ! Spawn 0 9 6.4 ! Spawn 0 7.6 3.6 ! Teleporter 5.9 5.6 4 10.4 ! Teleporter 5.3 14.1 11.6 7.3 ! Teleporter 12.1 3.7 14.7 13.9 ! Teleporter 12.7 11.2 5.6 2.9 ! RepairItem 1.4 12.9 ! RepairItem 11.3 13.1 ! RepairItem 7 12 ! RepairItem 15.7 11.6 ! BarrierMaker 8.2 4.8 8.6 5.2 ! BarrierMaker 9.8 4.8 9.4 5.2 ! BarrierMaker 9.3 4.1 8.7 4.1 ! BarrierMaker 2.4 13.5 3.3 14.7 6.7 14.9 8 13 7.3 10.3 4.5 9.7 2.9 9.7 1.2 10.6 0.4 13.9 2.4 13.5 ! BarrierMaker 2.9 9.7 3.3 11.3 4.6 11.8 5.4 11.3 ! BarrierMaker 6.7 14.9 5.9 13.4 4.1 13.1 ! BarrierMaker 5 1.5 9 0.2 13 1.5 13 7.9 9 9.2 5 7.9 5 1.5 ! BarrierMaker 10.8 10.3 13.1 9.7 15.9 10.1 17.8 12.5 15.8 14.9 11.2 14.7 10.1 12.9 10.8 10.3 ! BarrierMaker 13.7 11.6 12.7 12.1 10.8 10.3 ! BarrierMaker 13.8 13.3 15.5 13.4 15.8 14.9 ! BarrierMaker 6.3 6.2 7 6.9 ! BarrierMaker 11 2.5 11.7 3.2 ! BarrierMaker 11.2 4.7 12.6 4.7 ! BarrierMaker 5.4 4.7 6.8 4.7 ! BarrierMaker 8.4 3.6 7.7 4.5 ! BarrierMaker 8.4 5.8 9.6 5.8 ! BarrierMaker 9.6 3.6 10.3 4.5 ! BarrierMaker 12.5 5.7 11.3 6.2 10.8 7.4 ! BarrierMaker 7.2 2 6.7 3.2 5.5 3.7 ! Teleporter 10 1.7 11.4 13.7 ! Teleporter 8 7.7 6.7 11 ! Teleporter 16.2 13.8 6.4 2.1 ! Teleporter 2.2 11.2 12.4 6.7 --- 2,45 ---- LevelName "Tin Man's Reprise" Team Orange 1 0.5 0 ! GridSize 380 ! HuntersNexusObject 4.4 2.5 50 50 ! Teleporter -0.5 5.5 0 11.5 ! Teleporter 2 12.1 8.8 2.7 ! BarrierMaker 0.5 9 1.2 8.6 1.2 8.5 0.6 8.5 -0.2 8.8 -0.5 9.8 -0.3 10.2 0.4 9.9 0.5 9.8 0.3 9.4 0.5 9 ! RepairItem -0.5 8.9 ! Spawn 0 2.6 1.7 ! Spawn 0 9.1 4.1 ! Spawn 0 5.9 6.7 ! Spawn 0 6.2 3.2 ! Spawn 0 0.5 4.5 ! BarrierMaker 4.2 2 3.9 2.4 ! BarrierMaker 3.9 2.7 4.3 3 ! BarrierMaker 4.5 2 4.9 2.3 ! BarrierMaker 4.9 2.6 4.6 3 ! BarrierMaker 2 1.6 1 2 -1 5 -1 6 -0.1 6 -0.1 5.6 0.1 5.6 1 6.5 1.2 6.5 2.3 5 2.5 5 3.5 6 3.9 6.5 3.9 6.9 4 7.5 4.4 7.7 5.1 7.5 5.5 7.2 5.9 7.1 6.6 7.3 7.2 7.4 7.8 7.4 8.4 6.9 8.6 6 8.6 5.5 8.9 4.9 9.6 4.5 10 3.8 10 3.5 9.4 3.2 9.3 2.9 9.3 2.4 8.8 2.1 8.2 2.4 8 3.2 7.5 4.2 7.3 4.3 7.2 4.2 7.2 4 7.4 2.9 7.2 2 6.7 1.6 6.2 1.6 6 1 6 0.2 5.5 -0.3 5 -0.5 4.2 -0.4 3.3 0.3 2.7 1.1 2 1.6 ! BarrierMaker 0.7 4.8 0.4 5.1 0.5 5.4 1.1 5.2 1.9 4.6 1.8 4.4 0.7 4.8 ! BarrierMaker 1.1 4.1 0.7 4 0.7 3.4 1.6 2.8 2.3 3.3 2.3 3.4 1.1 4.1 ! BarrierMaker 3.5 4.4 3.1 4 3.2 3.5 ! BarrierMaker 8.7 4 8 4.2 7.9 4.4 8 5 8.1 5 8.8 4.2 8.7 4 ! BarrierMaker 6.8 4.5 6.3 3.6 6.1 3.7 6.3 5.2 6.4 5.3 6.8 5.2 6.8 4.5 ! BarrierMaker 4.5 5.2 4.4 5.3 4.9 6.2 5.1 6.2 5.8 5.7 5.8 5.6 4.5 5.2 ! BarrierMaker 5.2 4.8 4.6 4.8 4.6 4.5 ! BarrierMaker 5 4.4 5 4 4.3 4 4 4.4 ! BarrierMaker 4.2 0.7 5.2 1 5.3 0.9 5.4 0.3 5.3 0.2 4.2 0.5 4.2 0.7 ! BarrierMaker 5.7 1.8 5.7 2.8 6.3 2.8 ! BarrierMaker 6.3 2.2 6.8 2.2 6.8 3.4 ! BarrierMaker 7.4 5.3 7.4 6.2 6.7 6.6 6.7 6.8 7.3 7 7.8 6.4 ! Teleporter 4.8 -4.76837e-007 3.9 9.3 ! Teleporter 4.7 7.1 1.8 10.6 ! RepairItem 6 2.5 ! RepairItem 7.3 6.6 ! BarrierMaker 3.3 4.9 3.9 4.9 3.9 5.5 ! BarrierMaker 5 3.5 5.2 3.5 5.5 4.2 5.7 4.2 ! BarrierMaker 5.5 5.1 5.9 4.7 ! BarrierMaker 5.7 6.3 6.3 6 ! BarrierMaker 6.7 5.8 7 5.7 ! BarrierMaker -0.2 11.9 -0.5 10.9 -1 9.9 -0.8 8.7 0.1 7.9 1.2 8 1.8 8.3 1.8 8.8 0.9 9.3 0.9 9.4 1.1 9.6 1.2 9.6 2.7 9 3.5 9.2 4 9 4.1 9 4.3 9.4 4.3 9.5 3.7 9.7 3.2 11 2.7 11.8 2.7 11.9 3.2 12.1 3.2 12.2 2.8 12.6 1.7 12.5 1.4 11.5 1.8 11.2 2.2 11.5 2.3 11.5 2.8 10.4 3.1 9.9 2.9 9.6 2.3 9.7 1.4 10 1.4 10.1 1.6 10.3 1.7 10.3 1.9 10.1 2.5 9.9 2.6 9.9 2.7 10.1 2.2 11.1 2.1 11.1 1.8 10.9 1.2 11.3 1.1 11.2 0.8 10.3 0.5 10.3 0.1 10.7 0.5 11.6 0.4 11.7 -0.1 11.9 -0.2 11.9 ! BarrierMaker 8.4 3 8.8 3.2 ! BarrierMaker 8.4 3.6 8 3.8 ! BarrierMaker 8.7 3.6 9.2 3.7 ! BarrierMaker 2.1 2.5 2.2 2.7 2.6 2.9 3 2.8 3.1 2.4 3.1 2 3.3 1.6 3.8 1.5 4.4 1.5 4.5 1.4 4.4 1.2 3.9 1.1 3.7 0.9 3.5 0.9 3.3 1 3 1.5 2.7 2.1 2.5 2.1 2.3 2.2 2.1 2.4 2.1 2.5 --- level2.txt DELETED --- --- NEW FILE: htf1.txt --- HTFGameType 10 100 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 1.2 -1.9 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 10.9 7.2 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 1.8 16.9 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 -7.9 7.8 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 --- retrieve3.txt DELETED --- --- NEW FILE: zm1.txt --- # World definition - BJG GridSize 128 GameType 0.33 LevelName Intermission LevelDescription "Hint: Use the bouncy balls for defensive relief!" Team Blue 0 0 1 BarrierMaker 0 0 5 0 6 1 7 0 10 0 10 10 0 10 0 0 BarrierMaker 8 4 8 4.5 BarrierMaker 8 5 8.5 6 7.5 6 8 5 BarrierMaker 7 7 9 7 9 9 7 9 7 7 BarrierMaker 5 8 6 7.5 6 8.5 5 8 BarrierMaker 11 8 10 8.5 10 7.5 11 8 BarrierMaker 8 11 7.5 10 8.5 10 8 11 BarrierMaker 8 11.5 8 12 Spawn 0 1 6 Spawn 0 4.5 1.5 Spawn 0 6.5 6.5 Spawn 0 7 2 Spawn 0 9 2 Spawn 0 8 1 TestItem 1 2 TestItem 8 2 TestItem 3 2 TestItem 7 2 TestItem 4 2 TestItem 5 2 TestItem 6 2 --- level8.txt DELETED --- |
From: Mark F. <mar...@us...> - 2004-09-17 00:14:43
|
Update of /cvsroot/opentnl/tnl/exe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8489/exe Modified Files: README.txt Log Message: Added new game type Updated game version Index: README.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/README.txt,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** README.txt 6 Aug 2004 00:02:46 -0000 1.31 --- README.txt 17 Sep 2004 00:14:33 -0000 1.32 *************** *** 1,3 **** ! ZAP 1.4 Introduction --- 1,3 ---- ! ZAP 1.4.1 Introduction *************** *** 65,79 **** 5. Cloak - Turns the ship invisible - Changes since version 1.2.2: - ---------------------------- - - Added built-in level editor! - - Added custom ship modules - - Added Hunters game type - - Added many new maps - - Added different weapon types - - Added deployable objects - - Added support for more controllers - - Fixed many bugs - Controls: --- 65,68 ---- *************** *** 110,119 **** left trigger - activate secondary module (default = shield) ! button 1 - cycle to next weapon ! button 2 - toggle commander map ! button 3 - open quick chat menu ! button 4 - select weapon and module loadout ! button 5 - show scores ! button 6 - record voice In the game you can press ESC to go to the game options screen. --- 99,128 ---- left trigger - activate secondary module (default = shield) ! Buttons (Logitech Wingman Cordless) ! A - cycle to next weapon ! B - toggle commander map ! C - open quick chat menu ! X - select weapon and module loadout ! Y - show scores ! Z - record voice ! ! Saitek P880 Dual Analog ! 1 - cycle to next weapon ! 2 - toggle commander map ! 3 - open quick chat menu ! 4 - select weapon and module loadout ! 5 - show scores ! 6 - record voice ! ! PS 2 Dual Shock w/USB ! ? ! ! XBox controller ! A (green) - ! B (red) - ! X (blue) - ! Y (yellow) - ! white - ! black - In the game you can press ESC to go to the game options screen. |
From: Mark F. <mar...@us...> - 2004-08-24 22:08:49
|
Update of /cvsroot/opentnl/tnl/exe In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5491/exe Modified Files: build.sh Log Message: Added windows installer Added windows icon for Zap Index: build.sh =================================================================== RCS file: /cvsroot/opentnl/tnl/exe/build.sh,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** build.sh 4 Jun 2004 01:45:49 -0000 1.6 --- build.sh 24 Aug 2004 22:08:38 -0000 1.7 *************** *** 45,53 **** if [ "$PLATFORM" = "win32" ]; then ! ../../upx/upx.exe --best --crp-ms=999999 --nrv2d -o "$DIR"/glut32.dll glut32.dll ! ../../upx/upx.exe --best --crp-ms=999999 --nrv2d -o "$DIR"/zap.exe zap.exe cp OpenAL32.dll "$DIR" rm "$DIR"-win32.zip ! zip -r "$DIR"-win32.zip "$DIR" fi --- 45,53 ---- if [ "$PLATFORM" = "win32" ]; then ! ./installer/upx.exe --best --crp-ms=999999 --nrv2d -o "$DIR"/glut32.dll glut32.dll ! ./installer/upx.exe --best --crp-ms=999999 --nrv2d -o "$DIR"/zap.exe zap.exe cp OpenAL32.dll "$DIR" rm "$DIR"-win32.zip ! ./installer/makensis-bz2.exe /Dversion="$VERSION" installer/zap.nsi fi |
From: Mark F. <mar...@us...> - 2004-08-24 22:08:49
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5491/zap Modified Files: ZAP.vcproj Added Files: ZAP.rc resource.h zap_mac_icon.icns zap_win_icon.ico Log Message: Added windows installer Added windows icon for Zap Index: ZAP.vcproj =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/ZAP.vcproj,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** ZAP.vcproj 3 Jul 2004 00:11:25 -0000 1.37 --- ZAP.vcproj 24 Aug 2004 22:08:39 -0000 1.38 *************** *** 468,471 **** --- 468,474 ---- </File> <File + RelativePath=".\resource2.h"> + </File> + <File RelativePath=".\sparkManager.cpp"> </File> *************** *** 482,485 **** --- 485,494 ---- RelativePath=".\winmain.cpp"> </File> + <File + RelativePath=".\ZAP.rc"> + </File> + <File + RelativePath=".\zap_win_icon.ico"> + </File> </Files> <Globals> --- NEW FILE: zap_win_icon.ico --- (This appears to be a binary file; contents omitted.) --- NEW FILE: resource.h --- //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by ZAP.rc // #define IDI_ICON1 101 // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 102 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif --- NEW FILE: ZAP.rc --- // Microsoft Visual C++ generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) #ifdef _WIN32 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) #endif //_WIN32 #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE BEGIN "resource.h\0" END 2 TEXTINCLUDE BEGIN "#include ""afxres.h""\r\n" "\0" END 3 TEXTINCLUDE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Icon // // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. IDI_ICON1 ICON "zap_win_icon.ico" #endif // English (U.S.) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED --- NEW FILE: zap_mac_icon.icns --- (This appears to be a binary file; contents omitted.) |
From: Mark F. <mar...@us...> - 2004-08-24 22:08:49
|
Update of /cvsroot/opentnl/tnl/exe/installer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5491/exe/installer Added Files: makensis-bz2.exe nsisconf.nsi nsisdl.dll upx.exe zap.nsi Log Message: Added windows installer Added windows icon for Zap --- NEW FILE: makensis-bz2.exe --- (This appears to be a binary file; contents omitted.) --- NEW FILE: zap.nsi --- ; zap.nsi ; ; This script is perhaps one of the simplest NSIs you can make. All of the ; optional settings are left to their default settings. The instalelr simply ; prompts the user asking them where to install, and drops of notepad.exe ; there. If your Windows directory is not C:\windows, change it below. ; ; This script assumes that there is a /Dversion=curVersion ; The name of the installer Name "Zap!" BrandingText " " ; The file to write OutFile "Zap-${version}-Installer.exe" ; The default installation directory InstallDir $PROGRAMFILES\Zap AutoCloseWindow true ; Icon ".\main.ico" ; The text to prompt the user to enter a directory DirText "This will install Zap! version ${version} on your computer. Choose a directory" ; The stuff to install Section "Zap! Game Files (required)" ; Set output path to the installation directory. SetOutPath $INSTDIR ; Put file there File /r "zap-${version}\*.*" Delete $INSTDIR\uninst-zap.exe WriteUninstaller $INSTDIR\uninst-zap.exe MessageBox MB_YESNO|MB_ICONQUESTION \ "Zap! has been installed. Would you like to add shortcuts in the start menu?" \ IDNO NoStartMenu SetOutPath $SMPROGRAMS\Zap WriteINIStr "$SMPROGRAMS\Zap\Zap Home Page.url" \ "InternetShortcut" "URL" "http://www.zapthegame.com/" CreateShortCut "$SMPROGRAMS\Zap\Uninstall Zap!.lnk" \ "$INSTDIR\uninst-zap.exe" SetOutPath $INSTDIR CreateShortCut "$SMPROGRAMS\Zap\Zap!.lnk" \ "$INSTDIR\zap.exe" NoStartMenu: MessageBox MB_YESNO|MB_ICONQUESTION \ "Would you like to add a desktop icon for Zap?" IDNO NoDesktopIcon SetOutPath $INSTDIR CreateShortCut "$DESKTOP\Zap!.lnk" "$INSTDIR\Zap.exe" NoDesktopIcon: WriteRegStr HKLM SOFTWARE\Zap "" $INSTDIR WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Zap" \ "DisplayName" "Zap! (remove only)" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Zap" \ "UninstallString" '"$INSTDIR\uninst-zap.exe"' MessageBox MB_YESNO|MB_ICONQUESTION \ "Zap! installation has completed. Would you like to view the README file now?" \ IDNO NoReadme ExecShell open '$INSTDIR\README.txt' NoReadme: SectionEnd ; end the section Section Uninstall MessageBox MB_YESNO|MB_ICONQUESTION \ "Are you sure you wish to uninstall Zap!?" \ IDNO Removed Delete $SMPROGRAMS\Zap\*.* Delete "$DESKTOP\Zap!.lnk" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Zap" DeleteRegKey HKLM SOFTWARE\Zap RMDir $SMPROGRAMS\Zap RMDir /r $INSTDIR IfFileExists $INSTDIR 0 Removed MessageBox MB_OK|MB_ICONEXCLAMATION \ "Note: $INSTDIR could not be removed." Removed: SectionEnd ; eof --- NEW FILE: nsisconf.nsi --- ; this file sets the defaults that will be used ; this file is treated as if it is in the directory ; that you are building from. i.e. the command ; File whatever.dat ; would need whatever.dat to be in your build directory ; (not necessarily the same directory as this file) ; if you want to change the default icon or bitmaps, you can do it here. ;Icon "C:\program files\nsis\newicon.ico" ;EnabledBitmap "C:\program files\nsis\newenabled.bmp" ;DisabledBitmap "C:\program files\nsis\newdisabled.bmp" ; if you want to define symbols, whatever, you can do that to. ;!define poo ; Datablock optimizations can save size, and are fast now. ; SetDatablockOptimize off ;use one of these if you have upx or petite installed ;note that your exe packer should not pack the first icon :) ;and paths should ideally be absolute (since you could be ;building your installer anywhere) ;!packhdr tmp.dat "C:\program files\upx\upx -9 -q tmp.dat" ;!packhdr tmp.dat "C:\program files\petite\petite -9 -b0 -r** -p0 -y tmp.dat" --- NEW FILE: upx.exe --- (This appears to be a binary file; contents omitted.) --- NEW FILE: nsisdl.dll --- (This appears to be a binary file; contents omitted.) |
From: Mark F. <mar...@us...> - 2004-08-24 22:06:45
|
Update of /cvsroot/opentnl/tnl/exe/installer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4931/installer Log Message: Directory /cvsroot/opentnl/tnl/exe/installer added to the repository |
From: Mark F. <mar...@us...> - 2004-08-23 19:45:47
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12133/zap Modified Files: Makefile Log Message: Made Makefile work on linux Index: Makefile =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/Makefile,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Makefile 23 Aug 2004 19:32:44 -0000 1.16 --- Makefile 23 Aug 2004 19:45:36 -0000 1.17 *************** *** 53,57 **** teleporter.o\ voiceCodec.o\ ! ../master/masterInterface.o\ CFLAGS= --- 53,62 ---- teleporter.o\ voiceCodec.o\ ! gsm_encode.o\ ! gsm_decode.o\ ! gsm_state.o\ ! lpc10enc.o\ ! lpc10dec.o\ ! ../master/masterInterface.o CFLAGS= |
From: Mark F. <mar...@us...> - 2004-08-23 19:32:56
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8486/zap Modified Files: Makefile controlObjectConnection.cpp controlObjectConnection.h game.cpp Log Message: Updated linux makefile Added time creditor for player moves, so that cheating by clock manipulation won't work Index: controlObjectConnection.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/controlObjectConnection.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** controlObjectConnection.h 2 Jun 2004 21:01:58 -0000 1.5 --- controlObjectConnection.h 23 Aug 2004 19:32:44 -0000 1.6 *************** *** 47,50 **** --- 47,51 ---- enum { MaxPendingMoves = 63, + MaxMoveTimeCredit = 512, }; Vector<Move> pendingMoves; *************** *** 57,60 **** --- 58,62 ---- U32 firstMoveIndex; U32 highSendIndex[3]; + U32 mMoveTimeCredit; public: *************** *** 84,87 **** --- 86,95 ---- void packetReceived(PacketNotify *notify); void processMoveServer(Move *theMove); + void addToTimeCredit(U32 timeAmount) + { + mMoveTimeCredit += timeAmount; + if(mMoveTimeCredit > MaxMoveTimeCredit) + mMoveTimeCredit = MaxMoveTimeCredit; + } bool isDataToTransmit() { return true; } Index: Makefile =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/Makefile,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Makefile 1 Jul 2004 23:30:39 -0000 1.15 --- Makefile 23 Aug 2004 19:32:44 -0000 1.16 *************** *** 8,63 **** OBJECTS_ZAP=\ ! CTFGame.o\ ! game.o\ ! gameConnection.o\ ! controlObjectConnection.o\ ! engineeredObjects.o\ ! LoadoutZone.o\ ! footballGame.o\ ! flagItem.o\ ! gameItems.o\ ! gameLoader.o\ ! gameNetInterface.o\ ! gameObject.o\ ! gameObjectRender.o\ ! gameType.o\ ! gameWeapons.o\ ! goalZone.o\ ! gridDB.o\ ! huntersGame.o\ ! item.o\ ! loadoutSelect.o\ ! masterConnection.o\ ../master/masterInterface.o\ - moveObject.o\ - UI.o\ - UIEditor.o\ - UIInstructions.o\ - UIGame.o\ - UIMenus.o\ - UINameEntry.o\ - UIQueryServers.o\ - UICredits.o\ - projectile.o\ - quickChat.o\ - rabbitGame.o\ - retrieveGame.o\ - ship.o\ - sfx.o\ - soccerGame.o\ - SweptEllipsoid.o\ - sparkManager.o\ - teleporter.o\ - barrier.o\ - voiceCodec.o\ - lpc10dec.o\ - lpc10enc.o\ - gsm_decode.o\ - gsm_encode.o\ - gsm_state.o\ - input.o\ - linuxInput.o\ - main.o - CFLAGS= --- 8,57 ---- OBJECTS_ZAP=\ ! CTFGame.o\ ! LoadoutZone.o\ ! SweptEllipsoid.o\ ! UI.o\ ! UICredits.o\ ! UIEditor.o\ ! UIGame.o\ ! UIInstructions.o\ ! UIMenus.o\ ! UINameEntry.o\ ! UIQueryServers.o\ ! barrier.o\ ! controlObjectConnection.o\ ! engineeredObjects.o\ ! flagItem.o\ ! footballGame.o\ ! game.o\ ! gameConnection.o\ ! gameItems.o\ ! gameLoader.o\ ! gameNetInterface.o\ ! gameObject.o\ ! gameObjectRender.o\ ! gameType.o\ ! gameWeapons.o\ ! goalZone.o\ ! gridDB.o\ ! huntersGame.o\ ! input.o\ ! item.o\ ! linuxInput.o\ ! loadoutSelect.o\ ! main.o\ ! masterConnection.o\ ! moveObject.o\ ! projectile.o\ ! quickChat.o\ ! rabbitGame.o\ ! retrieveGame.o\ ! sfx.o\ ! ship.o\ ! soccerGame.o\ ! sparkManager.o\ ! teleporter.o\ ! voiceCodec.o\ ../master/masterInterface.o\ CFLAGS= Index: controlObjectConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/controlObjectConnection.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** controlObjectConnection.cpp 9 Jun 2004 01:10:47 -0000 1.11 --- controlObjectConnection.cpp 23 Aug 2004 19:32:44 -0000 1.12 *************** *** 39,42 **** --- 39,43 ---- mLastClientControlCRC = 0; firstMoveIndex = 1; + mMoveTimeCredit = 0; } *************** *** 159,164 **** // process the move, including crediting time to the client // and all that joy. ! if(controlObject.isValid() && !(controlObject->getObjectTypeMask() & DeletedType)) { controlObject->setCurrentMove(theMove); controlObject->idle(GameObject::ServerIdleControlFromClient); --- 160,168 ---- // process the move, including crediting time to the client // and all that joy. ! // The time crediting prevents clients from hacking speed cheats ! // that feed more moves to the server than are allowed. ! if(mMoveTimeCredit >= theMove.time && controlObject.isValid() && !(controlObject->getObjectTypeMask() & DeletedType)) { + mMoveTimeCredit -= theMove.time; controlObject->setCurrentMove(theMove); controlObject->idle(GameObject::ServerIdleControlFromClient); Index: game.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** game.cpp 6 Aug 2004 00:02:47 -0000 1.48 --- game.cpp 23 Aug 2004 19:32:44 -0000 1.49 *************** *** 339,342 **** --- 339,345 ---- mNetInterface->checkIncomingPackets(); Game::checkConnectionToMaster(timeDelta); + for(GameConnection *walk = GameConnection::getClientList(); walk ; walk = walk->getNextClient()) + walk->addToTimeCredit(timeDelta); + for(S32 i = 0; i < mGameObjects.size(); i++) { |
From: Mark F. <mar...@us...> - 2004-08-21 03:40:42
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29433/tnl Modified Files: tnlMethodDispatch.cpp tnlMethodDispatch.h Log Message: Updated VC 6.0 project file Updated tnlMethodDispatch for broken VC 6 inline assembly Index: tnlMethodDispatch.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlMethodDispatch.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** tnlMethodDispatch.cpp 19 Aug 2004 21:20:15 -0000 1.14 --- tnlMethodDispatch.cpp 21 Aug 2004 03:40:28 -0000 1.15 *************** *** 28,34 **** #include "tnlNetStringTable.h" namespace TNL { - void *gBasePtr = NULL; void *gThisPtr = NULL; void *gStackPtr = NULL; --- 28,35 ---- #include "tnlNetStringTable.h" + void *TNL_gBasePtr = NULL; + namespace TNL { void *gThisPtr = NULL; void *gStackPtr = NULL; *************** *** 233,237 **** bool floatInRegs = true; #else ! U8 *ptr = (U8 *) gBasePtr; ptr += 4; // get rid of the return address and saved base ptr. #endif --- 234,238 ---- bool floatInRegs = true; #else ! U8 *ptr = (U8 *) TNL_gBasePtr; ptr += 4; // get rid of the return address and saved base ptr. #endif Index: tnlMethodDispatch.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlMethodDispatch.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tnlMethodDispatch.h 19 Aug 2004 21:20:15 -0000 1.5 --- tnlMethodDispatch.h 21 Aug 2004 03:40:28 -0000 1.6 *************** *** 146,157 **** #if defined(TNL_SUPPORTS_VC_INLINE_X86_ASM) ! extern void *gBasePtr; ! #define SAVE_PARAMS __asm { lea eax, this }; __asm { mov TNL::gBasePtr, eax }; #elif defined(TNL_SUPPORTS_GCC_INLINE_X86_ASM ) ! extern void *gBasePtr; ! #define SAVE_PARAMS TNL::gBasePtr = (void *) ((U8 *) __builtin_frame_address(0) + 8); #elif defined(TNL_SUPPORTS_GCC_INLINE_PPC_ASM ) --- 146,164 ---- #if defined(TNL_SUPPORTS_VC_INLINE_X86_ASM) + }; ! // VC 6.0 has problems with the usage of a namespace reference inside an inline assembly block ! // so we close the namespace and add this as a global global. ! ! extern void *TNL_gBasePtr; ! namespace TNL { ! #define SAVE_PARAMS __asm { lea eax, this }; __asm { mov TNL_gBasePtr, eax }; #elif defined(TNL_SUPPORTS_GCC_INLINE_X86_ASM ) ! }; ! extern void *TNL_gBasePtr; ! namespace TNL { ! #define SAVE_PARAMS TNL_gBasePtr = (void *) ((U8 *) __builtin_frame_address(0) + 8); #elif defined(TNL_SUPPORTS_GCC_INLINE_PPC_ASM ) |
From: Mark F. <mar...@us...> - 2004-08-21 03:40:41
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29433/zap Modified Files: zap.dsp Log Message: Updated VC 6.0 project file Updated tnlMethodDispatch for broken VC 6 inline assembly Index: zap.dsp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/zap.dsp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** zap.dsp 1 Jun 2004 02:54:54 -0000 1.11 --- zap.dsp 21 Aug 2004 03:40:29 -0000 1.12 *************** *** 121,124 **** --- 121,140 ---- # Begin Source File + SOURCE=.\flagItem.cpp + # End Source File + # Begin Source File + + SOURCE=.\flagItem.h + # End Source File + # Begin Source File + + SOURCE=.\footballGame.cpp + # End Source File + # Begin Source File + + SOURCE=.\ftol.h + # End Source File + # Begin Source File + SOURCE=.\game.cpp # End Source File *************** *** 165,168 **** --- 181,192 ---- # Begin Source File + SOURCE=.\gameObjectRender.cpp + # End Source File + # Begin Source File + + SOURCE=.\gameObjectRender.h + # End Source File + # Begin Source File + SOURCE=.\gameType.cpp # End Source File *************** *** 181,184 **** --- 205,216 ---- # Begin Source File + SOURCE=.\goalZone.cpp + # End Source File + # Begin Source File + + SOURCE=.\goalZone.h + # End Source File + # Begin Source File + SOURCE=.\gridDB.cpp # End Source File *************** *** 213,216 **** --- 245,256 ---- # Begin Source File + SOURCE=.\input.cpp + # End Source File + # Begin Source File + + SOURCE=.\input.h + # End Source File + # Begin Source File + SOURCE=.\item.cpp # End Source File *************** *** 229,232 **** --- 269,276 ---- # Begin Source File + SOURCE=.\LoadoutZone.cpp + # End Source File + # Begin Source File + SOURCE=.\lpc10.h # End Source File *************** *** 257,260 **** --- 301,308 ---- # Begin Source File + SOURCE=.\move.h + # End Source File + # Begin Source File + SOURCE=.\moveObject.cpp # End Source File *************** *** 269,272 **** --- 317,324 ---- # Begin Source File + SOURCE=.\private.h + # End Source File + # Begin Source File + SOURCE=.\projectile.cpp # End Source File *************** *** 285,288 **** --- 337,352 ---- # Begin Source File + SOURCE=.\rabbitGame.cpp + # End Source File + # Begin Source File + + SOURCE=.\rabbitGame.h + # End Source File + # Begin Source File + + SOURCE=.\retrieveGame.cpp + # End Source File + # Begin Source File + SOURCE=.\sfx.cpp # End Source File *************** *** 309,312 **** --- 373,380 ---- # Begin Source File + SOURCE=.\soccerGame.h + # End Source File + # Begin Source File + SOURCE=.\sparkManager.cpp # End Source File *************** *** 333,336 **** --- 401,408 ---- # Begin Source File + SOURCE=.\timer.h + # End Source File + # Begin Source File + SOURCE=.\UI.cpp # End Source File *************** *** 365,368 **** --- 437,448 ---- # Begin Source File + SOURCE=.\UIInstructions.cpp + # End Source File + # Begin Source File + + SOURCE=.\UIInstructions.h + # End Source File + # Begin Source File + SOURCE=.\UIMenus.cpp # End Source File *************** *** 399,402 **** --- 479,486 ---- SOURCE=.\winJoystick.cpp # End Source File + # Begin Source File + + SOURCE=.\winmain.cpp + # End Source File # End Target # End Project |
From: Mark F. <mar...@us...> - 2004-08-20 23:16:30
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23252/zap Modified Files: game.h main.cpp Log Message: Added new Zone Control level Upped game version Index: main.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** main.cpp 6 Aug 2004 00:02:47 -0000 1.67 --- main.cpp 20 Aug 2004 23:16:07 -0000 1.68 *************** *** 75,78 **** --- 75,79 ---- "football3.txt " "football4.txt " + "football5.txt " "rabbit1.txt " "soccer1.txt " Index: game.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/game.h,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** game.h 6 Aug 2004 00:05:25 -0000 1.62 --- game.h 20 Aug 2004 23:16:07 -0000 1.63 *************** *** 234,238 **** extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.0 rc 12" }; --- 234,238 ---- extern void endGame(); ! #define ZAP_GAME_STRING "ZAP 1.4.1" }; |
From: Mark F. <mar...@us...> - 2004-08-20 23:16:17
|
Update of /cvsroot/opentnl/tnl/exe/levels In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23252/exe/levels Added Files: football5.txt Log Message: Added new Zone Control level Upped game version --- NEW FILE: football5.txt --- ZoneControlGameType 10 32 Team Blue 0 0 1 Team Red 1 0 0 Team Green 0 1 0 Team Yellow 1 1 0 LevelName "Home Turf" GridSize 300 GoalZone -1 -0.9 -5.9 -0.0999999 -5.9 -0.0999999 -5.1 -0.9 -5.1 LoadoutZone 0 -5.1 -8.4 -3.9 -8.4 -4.1 -8 -4.9 -8 FlagItem -1 0 0 Spawn 0 -4.7 -8.6 Spawn 0 -5.1 -8.8 Spawn 0 -4.5 -9 Spawn 0 -3.9 -8.8 Spawn 0 -4.3 -8.6 Spawn 0 -3.4 -9 Spawn 0 -3.9 -9.3 Spawn 0 -4.5 -9.3 Spawn 0 -5.1 -9.3 Spawn 0 -5.6 -9 BarrierMaker -5 -7.5 -4.8 -7.5 -4.7 -7.3 -4.3 -7.3 -4.2 -7.5 -4 -7.5 -3.5 -8.5 -3 -8.5 -3 -9.5 -6 -9.5 -6 -8.5 -5.5 -8.5 -5 -7.5 Teleporter -4.5 -7.7 0 -8 BarrierMaker -1.6 -5.4 -1.5 -5.5 -1.5 -6.5 -0.5 -7.5 -0.5 -8.5 1.5 -8.5 2.5 -9.5 4.5 -9.5 5 -9 5 -7.8 4.5 -7.3 4.5 -6.5 3.5 -5.5 3.5 -3.5 5.5 -1.5 GoalZone -1 3.1 -8.9 3.9 -8.9 3.9 -8.1 3.1 -8.1 BarrierMaker -1 -4.5 -0.3 -4.5 0.2 -4 BarrierMaker -0.5 -3.9 -0.5 -3.2 0.9 -3.2 BarrierMaker 1 -3.8 1.9 -4.7 BarrierMaker 0.6 -5 1.4 -4.2 BarrierMaker 0.1 -6.8 0.9 -6.8 1.3 -6.4 2.3 -6.4 2.9 -5.8 BarrierMaker 2.8 -8.5 2.8 -7.9 BarrierMaker 2.5 -7.2 3.2 -7.2 3.8 -7.8 3.9 -7.8 BarrierMaker 0.5 -7.5 1 -7.5 1.3 -7.8 1.9 -7.8 BarrierMaker 1.5 -5.5 1.8 -5.5 1.8 -5.8 BarrierMaker 1 -2.5 1.5 -2 2.2 -2 2.5 -1.7 3.4 -1.7 3.6 -1.9 3.6 -2.3 3.2 -2.7 2.8 -2.7 2.5 -2.4 1.6 -2.4 1.5 -2.5 1.5 -2.6 1.4 -2.7 1.1 -2.7 1 -2.6 1 -2.5 BarrierMaker -1.5 -2 -1 -2.5 0 -2.5 BarrierMaker 2.3 -4.2 1.8 -3.7 1.8 -3.4 1.9 -3.3 2.5 -3.3 2.9 -3.7 BarrierMaker 0.5 -1 1 -0.5 BarrierMaker -0.4 -1.7 -0.4 -1.8 -0.3 -1.9 0.3 -1.9 0.4 -1.8 0.4 -1.7 0.1 -1.4 -0.1 -1.4 -0.4 -1.7 Turret 0 0.2 -6.7 Turret 0 3.6 -9.4 BarrierMaker 4.4 -8.7 4.2 -8.7 4.1 -8.6 4.1 -8.3 ForceFieldProjector 0 0.1 -4.2 ForceFieldProjector 0 0.7 -7.4 LoadoutZone 0 -0.4 -3.7 0.4 -3.7 0.4 -3.3 -0.4 -3.3 GoalZone -1 5.9 -0.9 5.9 -0.0999999 5.1 -0.0999999 5.1 -0.9 LoadoutZone 1 8.4 -5.1 8.4 -3.9 8 -4.1 8 -4.9 Spawn 1 8.6 -4.7 Spawn 1 8.8 -5.1 Spawn 1 9 -4.5 Spawn 1 8.8 -3.9 Spawn 1 8.6 -4.3 Spawn 1 9 -3.4 Spawn 1 9.3 -3.9 Spawn 1 9.3 -4.5 Spawn 1 9.3 -5.1 Spawn 1 9 -5.6 BarrierMaker 7.5 -5 7.5 -4.8 7.3 -4.7 7.3 -4.3 7.5 -4.2 7.5 -4 8.5 -3.5 8.5 -3 9.5 -3 9.5 -6 8.5 -6 8.5 -5.5 7.5 -5 Teleporter 7.7 -4.5 8 -1.49012e-007 BarrierMaker 5.4 -1.6 5.5 -1.5 6.5 -1.5 7.5 -0.5 8.5 -0.5 8.5 1.5 9.5 2.5 9.5 4.5 9 5 7.8 5 7.3 4.5 6.5 4.5 5.5 3.5 3.5 3.5 1.5 5.5 1.5 5.6 GoalZone -1 8.9 3.1 8.9 3.9 8.1 3.9 8.1 3.1 BarrierMaker 4.5 -1 4.5 -0.3 4 0.2 BarrierMaker 3.9 -0.5 3.2 -0.5 3.2 0.9 BarrierMaker 3.8 1 4.7 1.9 BarrierMaker 5 0.6 4.2 1.4 BarrierMaker 6.8 0.1 6.8 0.9 6.4 1.3 6.4 2.3 5.8 2.9 BarrierMaker 8.5 2.8 7.9 2.8 BarrierMaker 7.2 2.5 7.2 3.2 7.8 3.8 7.8 3.9 BarrierMaker 7.5 0.5 7.5 1 7.8 1.3 7.8 1.9 BarrierMaker 5.5 1.5 5.5 1.8 5.8 1.8 BarrierMaker 2.5 1 2 1.5 2 2.2 1.7 2.5 1.7 3.4 1.9 3.6 2.3 3.6 2.7 3.2 2.7 2.8 2.4 2.5 2.4 1.6 2.5 1.5 2.6 1.5 2.7 1.4 2.7 1.1 2.6 1 2.5 1 BarrierMaker 2 -1.5 2.5 -1 2.5 5.96046e-008 BarrierMaker 4.2 2.3 3.7 1.8 3.4 1.8 3.3 1.9 3.3 2.5 3.7 2.9 BarrierMaker 1 0.5 0.5 1 BarrierMaker 1.7 -0.4 1.8 -0.4 1.9 -0.3 1.9 0.3 1.8 0.4 1.7 0.4 1.4 0.1 1.4 -0.1 1.7 -0.4 Turret 1 6.7 0.2 Turret 1 9.4 3.6 BarrierMaker 8.7 4.4 8.7 4.2 8.6 4.1 8.3 4.1 ForceFieldProjector 1 4.2 0.1 ForceFieldProjector 1 7.4 0.7 LoadoutZone 1 3.7 -0.4 3.7 0.4 3.3 0.4 3.3 -0.4 GoalZone -1 0.9 5.9 0.0999999 5.9 0.0999999 5.1 0.9 5.1 LoadoutZone 2 5.1 8.4 3.9 8.4 4.1 8 4.9 8 Spawn 2 4.7 8.6 Spawn 2 5.1 8.8 Spawn 2 4.5 9 Spawn 2 3.9 8.8 Spawn 2 4.3 8.6 Spawn 2 3.4 9 Spawn 2 3.9 9.3 Spawn 2 4.5 9.3 Spawn 2 5.1 9.3 Spawn 2 5.6 9 BarrierMaker 5 7.5 4.8 7.5 4.7 7.3 4.3 7.3 4.2 7.5 4 7.5 3.5 8.5 3 8.5 3 9.5 6 9.5 6 8.5 5.5 8.5 5 7.5 Teleporter 4.5 7.7 3.8743e-007 8 BarrierMaker 1.5 5.6 1.5 6.5 0.5 7.5 0.5 8.5 -1.5 8.5 -2.5 9.5 -4.5 9.5 -5 9 -5 7.8 -4.5 7.3 -4.5 6.5 -3.5 5.5 -3.5 3.5 -5.5 1.5 -5.6 1.5 GoalZone -1 -3.1 8.9 -3.9 8.9 -3.9 8.1 -3.1 8.1 BarrierMaker 1 4.5 0.3 4.5 -0.2 4 BarrierMaker 0.5 3.9 0.5 3.2 -0.9 3.2 BarrierMaker -1 3.8 -1.9 4.7 BarrierMaker -0.6 5 -1.4 4.2 BarrierMaker -0.1 6.8 -0.9 6.8 -1.3 6.4 -2.3 6.4 -2.9 5.8 BarrierMaker -2.8 8.5 -2.8 7.9 BarrierMaker -2.5 7.2 -3.2 7.2 -3.8 7.8 -3.9 7.8 BarrierMaker -0.500001 7.5 -1 7.5 -1.3 7.8 -1.9 7.8 BarrierMaker -1.5 5.5 -1.8 5.5 -1.8 5.8 BarrierMaker -1 2.5 -1.5 2 -2.2 2 -2.5 1.7 -3.4 1.7 -3.6 1.9 -3.6 2.3 -3.2 2.7 -2.8 2.7 -2.5 2.4 -1.6 2.4 -1.5 2.5 -1.5 2.6 -1.4 2.7 -1.1 2.7 -1 2.6 -1 2.5 BarrierMaker 1.5 2 1 2.5 -5.96046e-008 2.5 BarrierMaker -2.3 4.2 -1.8 3.7 -1.8 3.4 -1.9 3.3 -2.5 3.3 -2.9 3.7 BarrierMaker -0.5 1 -1 0.5 BarrierMaker 0.4 1.7 0.4 1.8 0.3 1.9 -0.3 1.9 -0.4 1.8 -0.4 1.7 -0.1 1.4 0.1 1.4 0.4 1.7 Turret 2 -0.2 6.7 Turret 2 -3.6 9.4 BarrierMaker -4.4 8.7 -4.2 8.7 -4.1 8.6 -4.1 8.3 ForceFieldProjector 2 -0.0999998 4.2 ForceFieldProjector 2 -0.7 7.4 LoadoutZone 2 0.4 3.7 -0.4 3.7 -0.4 3.3 0.4 3.3 GoalZone -1 -5.9 0.899999 -5.9 0.0999994 -5.1 0.1 -5.1 0.9 LoadoutZone 3 -8.4 5.1 -8.4 3.9 -8 4.1 -8 4.9 Spawn 3 -8.6 4.7 Spawn 3 -8.8 5.1 Spawn 3 -9 4.5 Spawn 3 -8.8 3.9 Spawn 3 -8.6 4.3 Spawn 3 -9 3.4 Spawn 3 -9.3 3.9 Spawn 3 -9.3 4.5 Spawn 3 -9.3 5.1 Spawn 3 -9 5.6 BarrierMaker -7.5 5 -7.5 4.8 -7.3 4.7 -7.3 4.3 -7.5 4.2 -7.5 4 -8.5 3.5 -8.5 3 -9.5 3 -9.5 6 -8.5 6 -8.5 5.5 -7.5 5 Teleporter -7.7 4.5 -8 1.19209e-007 BarrierMaker -5.6 1.5 -6.5 1.5 -7.5 0.5 -8.5 0.499999 -8.5 -1.5 -9.5 -2.5 -9.5 -4.5 -9 -5 -7.8 -5 -7.3 -4.5 -6.5 -4.5 -5.5 -3.5 -3.5 -3.5 -1.6 -5.4 GoalZone -1 -8.9 -3.1 -8.9 -3.9 -8.1 -3.9 -8.1 -3.1 BarrierMaker -4.5 1 -4.5 0.299999 -4 -0.2 BarrierMaker -3.9 0.5 -3.2 0.5 -3.2 -0.9 BarrierMaker -3.8 -1 -4.7 -1.9 BarrierMaker -5 -0.6 -4.2 -1.4 BarrierMaker -6.8 -0.1 -6.8 -0.9 -6.4 -1.3 -6.4 -2.3 -5.8 -2.9 BarrierMaker -8.5 -2.8 -7.9 -2.8 BarrierMaker -7.2 -2.5 -7.2 -3.2 -7.8 -3.8 -7.8 -3.9 BarrierMaker -7.5 -0.5 -7.5 -1 -7.8 -1.3 -7.8 -1.9 BarrierMaker -5.5 -1.5 -5.5 -1.8 -5.8 -1.8 BarrierMaker -2.5 -1 -2 -1.5 -2 -2.2 -1.7 -2.5 -1.7 -3.4 -1.9 -3.6 -2.3 -3.6 -2.7 -3.2 -2.7 -2.8 -2.4 -2.5 -2.4 -1.6 -2.5 -1.5 -2.6 -1.5 -2.7 -1.4 -2.7 -1.1 -2.6 -1 -2.5 -1 BarrierMaker -2 1.5 -2.5 1 -2.5 2.98023e-008 BarrierMaker -4.2 -2.3 -3.7 -1.8 -3.4 -1.8 -3.3 -1.9 -3.3 -2.5 -3.7 -2.9 BarrierMaker -1 -0.5 -0.5 -1 BarrierMaker -1.7 0.4 -1.8 0.4 -1.9 0.3 -1.9 -0.3 -1.8 -0.4 -1.7 -0.4 -1.4 -0.1 -1.4 0.1 -1.7 0.4 Turret 3 -6.7 -0.200001 Turret 3 -9.4 -3.6 BarrierMaker -8.7 -4.4 -8.7 -4.2 -8.6 -4.1 -8.3 -4.1 ForceFieldProjector 3 -4.2 -0.1 ForceFieldProjector 3 -7.4 -0.7 LoadoutZone 3 -3.7 0.4 -3.7 -0.4 -3.3 -0.4 -3.3 0.4 Turret -1 -1.3 0 Turret -1 1.3 0 Turret -1 0 -1.3 Turret -1 0 1.3 ForceFieldProjector -1 3.7 3.4 ForceFieldProjector -1 -3.4 3.7 ForceFieldProjector -1 -3.7 -3.4 ForceFieldProjector -1 3.4 -3.7 BarrierMaker 0.6 -0.2 0.6 0.2 BarrierMaker 0.2 0.6 -0.2 0.6 BarrierMaker -0.6 0.2 -0.6 -0.2 BarrierMaker -0.2 -0.6 0.2 -0.6 |
From: Mark F. <mar...@us...> - 2004-08-20 18:27:08
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27814/tnl Modified Files: bitStream.cpp platform.cpp tnlNetConnection.h Log Message: Fixed BitStream::writeSignedFloat bug Fixed constructor issues with gameWeapons and ProjectileInfo in Zap Fixed build on MinGW with heapchk Made NetConnection::TerminationReason public Index: platform.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/platform.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** platform.cpp 23 Jul 2004 23:08:45 -0000 1.6 --- platform.cpp 20 Aug 2004 18:26:58 -0000 1.7 *************** *** 175,179 **** --- 175,183 ---- bool Platform::checkHeap() { + #ifdef TNL_COMPILER_VISUALC return _heapchk() == _HEAPOK; + #else + return true; + #endif } Index: bitStream.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/bitStream.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** bitStream.cpp 11 Jun 2004 19:16:34 -0000 1.5 --- bitStream.cpp 20 Aug 2004 18:26:58 -0000 1.6 *************** *** 288,297 **** void BitStream::writeSignedFloat(F32 f, U8 bitCount) { ! writeSignedInt(S32(((f + 1) * .5f) * ((1 << bitCount) - 1)), bitCount); } F32 BitStream::readSignedFloat(U8 bitCount) { ! return readSignedInt(bitCount) * 2 / F32((1 << bitCount) - 1) - 1.0f; } --- 288,297 ---- void BitStream::writeSignedFloat(F32 f, U8 bitCount) { ! writeSignedInt(S32(f * ((1 << (bitCount - 1)) - 1)), bitCount); } F32 BitStream::readSignedFloat(U8 bitCount) { ! return readSignedInt(bitCount) / F32((1 << (bitCount - 1)) - 1); } Index: tnlNetConnection.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlNetConnection.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tnlNetConnection.h 20 Jul 2004 18:09:51 -0000 1.6 --- tnlNetConnection.h 20 Aug 2004 18:26:58 -0000 1.7 *************** *** 199,203 **** ~NetConnection(); - protected: enum TerminationReason { ReasonTimedOut, --- 199,202 ---- *************** *** 210,213 **** --- 209,214 ---- }; + protected: + virtual void onConnectTerminated(TerminationReason reason, const char *rejectionString); ///< Called when a pending connection is terminated virtual void onConnectionTerminated(TerminationReason, const char *errorDisconnectString); ///< Called when this established connection is terminated for any reason |
From: Mark F. <mar...@us...> - 2004-08-20 18:27:08
|
Update of /cvsroot/opentnl/tnl/zap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27814/zap Modified Files: UIGame.cpp barrier.h engineeredObjects.h gameWeapons.cpp gameWeapons.h projectile.cpp projectile.h Log Message: Fixed BitStream::writeSignedFloat bug Fixed constructor issues with gameWeapons and ProjectileInfo in Zap Fixed build on MinGW with heapchk Made NetConnection::TerminationReason public Index: gameWeapons.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameWeapons.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** gameWeapons.h 1 Jun 2004 22:37:41 -0000 1.3 --- gameWeapons.h 20 Aug 2004 18:26:58 -0000 1.4 *************** *** 54,57 **** --- 54,68 ---- struct ShipWeaponInfo { + ShipWeaponInfo(StringTableEntry _name, U32 _fireDelay, U32 _minEnergy, U32 _drainEnergy, U32 _projVelocity, U32 _projLiveTime, U32 _projectileType) + { + name = _name; + fireDelay = _fireDelay; + minEnergy = _minEnergy; + drainEnergy = _drainEnergy; + projVelocity = _projVelocity; + projLiveTime = _projLiveTime; + projectileType = _projectileType; + } + StringTableEntry name; // Display name of the weapon. U32 fireDelay; // Delay between shots. *************** *** 66,69 **** --- 77,119 ---- extern void createWeaponProjectiles(U32 weapon, Point &dir, Point &shooterPos, Point &shooterVel, F32 shooterRadius, GameObject *shooter); + enum { + NumSparkColors = 4, + }; + + enum ProjectileType + { + ProjectilePhaser, + ProjectileBounce, + ProjectileTriple, + ProjectileTurret, + ProjectileTypeCount, + }; + + struct ProjectileInfo + { + ProjectileInfo(F32 _damageAmount, Color _sparkColor1, Color _sparkColor2, Color _sparkColor3, Color _sparkColor4, Color _projColor1, Color _projColor2, F32 _scaleFactor, U32 _projectileSound, U32 _impactSound ) + { + damageAmount = _damageAmount; + sparkColors[0] = _sparkColor1; + sparkColors[1] = _sparkColor2; + sparkColors[2] = _sparkColor3; + sparkColors[3] = _sparkColor4; + projColors[0] = _projColor1; + projColors[1] = _projColor2; + scaleFactor = _scaleFactor; + projectileSound = _projectileSound; + impactSound = _impactSound; + } + + F32 damageAmount; + Color sparkColors[NumSparkColors]; + Color projColors[2]; + F32 scaleFactor; + U32 projectileSound; + U32 impactSound; + }; + + extern ProjectileInfo gProjInfo[ProjectileTypeCount]; + }; Index: UIGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/UIGame.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** UIGame.cpp 2 Aug 2004 18:11:53 -0000 1.45 --- UIGame.cpp 20 Aug 2004 18:26:58 -0000 1.46 *************** *** 52,57 **** mCurrentMode = PlayMode; mInScoreboardMode = false; mFPSVisible = false; ! mFrameIndex = 0; for(U32 i = 0; i < FPSAvgCount; i++) --- 52,60 ---- mCurrentMode = PlayMode; mInScoreboardMode = false; + #ifdef TNL_OS_XBOX + mFPSVisible = true; + #else mFPSVisible = false; ! #endif mFrameIndex = 0; for(U32 i = 0; i < FPSAvgCount; i++) *************** *** 146,150 **** for(U32 i = 0; i < FPSAvgCount; i++) sum += mIdleTimeDelta[i]; ! drawStringf(710, 10, 30, "%4.2f fps", (1000 * FPSAvgCount) / F32(sum)); } if(mCurrentMode == VChatMode) --- 149,156 ---- for(U32 i = 0; i < FPSAvgCount; i++) sum += mIdleTimeDelta[i]; ! drawStringf(canvasWidth - horizMargin - 170, vertMargin, 30, ! "%0.2g %0.2g %4.2f fps", mCurrentMove.right - mCurrentMove.left, ! mCurrentMove.down - mCurrentMove.up, ! (1000 * FPSAvgCount) / F32(sum)); } if(mCurrentMode == VChatMode) Index: projectile.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/projectile.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** projectile.cpp 1 Jul 2004 19:23:37 -0000 1.43 --- projectile.cpp 20 Aug 2004 18:26:58 -0000 1.44 *************** *** 25,28 **** --- 25,29 ---- //------------------------------------------------------------------------------------ + #include "gameWeapons.h" #include "projectile.h" #include "ship.h" *************** *** 31,35 **** #include "gameObject.h" #include "gameObjectRender.h" - #include "glutInclude.h" --- 32,35 ---- *************** *** 58,69 **** } - ProjectileInfo gProjInfo[Projectile::TypeCount] = { - { 0.21f, { Color(1,0,1), Color(1,1,1), Color(0,0,1), Color(1,0,0) }, { Color(1, 0, 0.5), Color(0.5, 0, 1) }, 1, SFXPhaserProjectile, SFXPhaserImpact }, - { 0.15f, { Color(1,1,0), Color(1,0,0), Color(1,0.5,0), Color(1,1,1) }, { Color(1, 1, 0), Color(1, 0, 0) }, 1.3, SFXBounceProjectile, SFXBounceImpact }, - { 0.14f, { Color(0,0,1), Color(0,1,0), Color(0,0.5,1), Color(0,1,0.5) }, { Color(0, 0.5, 1), Color(0, 1, 0.5) }, 0.7, SFXTripleProjectile, SFXTripleImpact }, - { 0.11f, { Color(0,1,1), Color(1,1,0), Color(0,1,0.5), Color(0.5,1,0) }, { Color(0.5, 1, 0), Color(0, 1, 0.5) }, 0.6, SFXTurretProjectile, SFXTurretImpact }, - }; - - U32 Projectile::packUpdate(GhostConnection *connection, U32 updateMask, BitStream *stream) { --- 58,61 ---- *************** *** 73,77 **** writeCompressedVelocity(velocity, CompressedVelocityMax, stream); ! stream->writeEnum(mType, TypeCount); S32 index = -1; --- 65,69 ---- writeCompressedVelocity(velocity, CompressedVelocityMax, stream); ! stream->writeEnum(mType, ProjectileTypeCount); S32 index = -1; *************** *** 95,99 **** readCompressedVelocity(velocity, CompressedVelocityMax, stream); ! mType = stream->readEnum(TypeCount); if(stream->readFlag()) --- 87,91 ---- readCompressedVelocity(velocity, CompressedVelocityMax, stream); ! mType = stream->readEnum(ProjectileTypeCount); if(stream->readFlag()) *************** *** 178,182 **** U32 typeMask = hitObject->getObjectTypeMask(); ! if(mType == Bounce && (typeMask & BarrierType)) bounce = true; else if(typeMask & ShipType) --- 170,174 ---- U32 typeMask = hitObject->getObjectTypeMask(); ! if(mType == ProjectileBounce && (typeMask & BarrierType)) bounce = true; else if(typeMask & ShipType) *************** *** 480,484 **** Color b(1,1,1); ! FXManager::emitExplosion(getRenderPos(), 0.5, gProjInfo[Projectile::Phaser].sparkColors, NumSparkColors); SFXObject::play(SFXMineExplode, getActualPos(), Point()); } --- 472,476 ---- Color b(1,1,1); ! FXManager::emitExplosion(getRenderPos(), 0.5, gProjInfo[ProjectilePhaser].sparkColors, NumSparkColors); SFXObject::play(SFXMineExplode, getActualPos(), Point()); } Index: barrier.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/barrier.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** barrier.h 20 May 2004 20:16:08 -0000 1.4 --- barrier.h 20 Aug 2004 18:26:58 -0000 1.5 *************** *** 68,71 **** --- 68,74 ---- void render(U32 layer); + /// returns a sorting key for the object. Barriers should sort behind other objects + S32 getRenderSortValue() { return -1; } + /// returns the collision polygon of this barrier, which is the boundary extruded from the start,end line segment. bool getCollisionPoly(Vector<Point> &polyPoints); Index: engineeredObjects.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/engineeredObjects.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** engineeredObjects.h 4 Aug 2004 18:25:27 -0000 1.13 --- engineeredObjects.h 20 Aug 2004 18:26:58 -0000 1.14 *************** *** 106,109 **** --- 106,110 ---- bool getCollisionPoly(Vector<Point> &polyPoints); void render(); + S32 getRenderSortValue() { return -1; } TNL_DECLARE_CLASS(ForceField); Index: gameWeapons.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/gameWeapons.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** gameWeapons.cpp 10 Jun 2004 17:51:06 -0000 1.10 --- gameWeapons.cpp 20 Aug 2004 18:26:58 -0000 1.11 *************** *** 38,47 **** ShipWeaponInfo gWeapons[] = { ! {StringTableEntry("Phaser"), 100, 500, 500, 600, 1000, Projectile::Phaser }, ! {StringTableEntry("Bouncer"), 100, 1800, 1800, 540, 1500, Projectile::Bounce }, ! {StringTableEntry("Triple"), 200, 2100, 2100, 550, 850, Projectile::Triple }, ! {StringTableEntry("Burst"), 700, 5000, 5000, 500, 1000, 0 }, ! {StringTableEntry("Mine"), 900, 65000, 65000, 500, 1000, 0 }, ! {StringTableEntry("Turret"), 0, 0, 0, 800, 800, Projectile::Turret }, }; --- 38,54 ---- ShipWeaponInfo gWeapons[] = { ! ShipWeaponInfo(StringTableEntry("Phaser"), 100, 500, 500, 600, 1000, ProjectilePhaser ), ! ShipWeaponInfo(StringTableEntry("Bouncer"), 100, 1800, 1800, 540, 1500, ProjectileBounce ), ! ShipWeaponInfo(StringTableEntry("Triple"), 200, 2100, 2100, 550, 850, ProjectileTriple ), ! ShipWeaponInfo(StringTableEntry("Burst"), 700, 5000, 5000, 500, 1000, 0 ), ! ShipWeaponInfo(StringTableEntry("Mine"), 900, 65000, 65000, 500, 1000, 0 ), ! ShipWeaponInfo(StringTableEntry("Turret"), 0, 0, 0, 800, 800, ProjectileTurret ), ! }; ! ! ProjectileInfo gProjInfo[ProjectileTypeCount] = { ! ProjectileInfo( .21f, Color(1,0,1), Color(1,1,1), Color(0,0,1), Color(1,0,0), Color(1, 0, 0.5), Color(0.5, 0, 1), 1, SFXPhaserProjectile, SFXPhaserImpact ), ! ProjectileInfo( 0.15f,Color(1,1,0), Color(1,0,0), Color(1,0.5,0), Color(1,1,1), Color(1, 1, 0), Color(1, 0, 0), 1.3, SFXBounceProjectile, SFXBounceImpact ), ! ProjectileInfo( .14f, Color(0,0,1), Color(0,1,0), Color(0,0.5,1), Color(0,1,0.5), Color(0, 0.5, 1), Color(0, 1, 0.5), 0.7, SFXTripleProjectile, SFXTripleImpact ), ! ProjectileInfo( .11f, Color(0,1,1), Color(1,1,0), Color(0,1,0.5), Color(0.5,1,0), Color(0.5, 1, 0), Color(0, 1, 0.5), 0.6, SFXTurretProjectile, SFXTurretImpact ), }; Index: projectile.h =================================================================== RCS file: /cvsroot/opentnl/tnl/zap/projectile.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** projectile.h 1 Jul 2004 19:23:37 -0000 1.15 --- projectile.h 20 Aug 2004 18:26:58 -0000 1.16 *************** *** 31,35 **** #include "gameObject.h" #include "item.h" ! namespace Zap { --- 31,35 ---- #include "gameObject.h" #include "item.h" ! #include "gameWeapons.h" namespace Zap { *************** *** 46,58 **** }; - enum ProjectileType - { - Phaser, - Bounce, - Triple, - Turret, - TypeCount, - }; - Point pos; Point velocity; --- 46,49 ---- *************** *** 63,67 **** SafePtr<GameObject> mShooter; ! Projectile(U32 type = Phaser, Point pos = Point(), Point vel = Point(), U32 liveTime = 0, GameObject *shooter = NULL); U32 packUpdate(GhostConnection *connection, U32 updateMask, BitStream *stream); --- 54,58 ---- SafePtr<GameObject> mShooter; ! Projectile(U32 type = ProjectilePhaser, Point pos = Point(), Point vel = Point(), U32 liveTime = 0, GameObject *shooter = NULL); U32 packUpdate(GhostConnection *connection, U32 updateMask, BitStream *stream); *************** *** 80,100 **** }; - - enum { - NumSparkColors = 4, - }; - - struct ProjectileInfo - { - F32 damageAmount; - Color sparkColors[NumSparkColors]; - Color projColors[2]; - F32 scaleFactor; - U32 projectileSound; - U32 impactSound; - }; - - extern ProjectileInfo gProjInfo[Projectile::TypeCount]; - class GrenadeProjectile : public Item { --- 71,74 ---- |
From: Mark F. <mar...@us...> - 2004-08-19 21:26:40
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26452/tnl Modified Files: tnl.overview.txt Log Message: Added a warning about using RTTI Index: tnl.overview.txt =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnl.overview.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tnl.overview.txt 20 Apr 2004 08:51:29 -0000 1.2 --- tnl.overview.txt 19 Aug 2004 21:26:32 -0000 1.3 *************** *** 504,507 **** --- 504,509 ---- Once the code is written, use your compiler to build simpletnltest, making sure to link in the tnl library, along with whatever network libraries your platform requires (wsock32.lib on Windows, for example). + Also, make sure Run-Time Type Checking is turned ON for your compiler or the program will not function correctly (option /GR in MSVC, for example). + To test the program, open up two console shells, and in the first, type: |
From: Mark F. <mar...@us...> - 2004-08-19 21:20:27
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25378/tnl Modified Files: tnlMethodDispatch.cpp tnlMethodDispatch.h tnlNetObject.h tnlRPC.h Log Message: Made TNLTest not using namespace TNL Fixed RPC parser code to accept TNL:: prefixes to RPC arguments Index: tnlRPC.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlRPC.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** tnlRPC.h 19 Aug 2004 20:51:57 -0000 1.8 --- tnlRPC.h 19 Aug 2004 21:20:15 -0000 1.9 *************** *** 190,194 **** #define TNL_IMPLEMENT_RPC(className, name, args, groupMask, guaranteeType, eventDirection, rpcVersion) \ extern TNL::MethodArgList RPC##className##name; \ ! class RPC_##className##_##name : public RPCEvent { \ public: \ void (FN_CDECL className::*mFuncPtr) args; \ --- 190,194 ---- #define TNL_IMPLEMENT_RPC(className, name, args, groupMask, guaranteeType, eventDirection, rpcVersion) \ extern TNL::MethodArgList RPC##className##name; \ ! class RPC_##className##_##name : public TNL::RPCEvent { \ public: \ void (FN_CDECL className::*mFuncPtr) args; \ *************** *** 203,207 **** void FN_CDECL className::name args { SAVE_PARAMS RPC_##className##_##name *theEvent = new RPC_##className##_##name; theEvent->marshallArguments(); postNetEvent(theEvent); } \ TNL::NetEvent * FN_CDECL className::name##_construct args { SAVE_PARAMS RPC_##className##_##name *theEvent = new RPC_##className##_##name; theEvent->marshallArguments(); return theEvent; } \ ! void FN_CDECL className::name##_test args { SAVE_PARAMS RPC_##className##_##name *ev = new RPC_##className##_##name; PacketStream ps; ev->marshallArguments(); ev->pack(this, &ps); ps.setBytePosition(0); ev->unpack(this, &ps); ev->process(this); } \ void FN_CDECL className::name##_remote args }; --- 203,207 ---- void FN_CDECL className::name args { SAVE_PARAMS RPC_##className##_##name *theEvent = new RPC_##className##_##name; theEvent->marshallArguments(); postNetEvent(theEvent); } \ TNL::NetEvent * FN_CDECL className::name##_construct args { SAVE_PARAMS RPC_##className##_##name *theEvent = new RPC_##className##_##name; theEvent->marshallArguments(); return theEvent; } \ ! void FN_CDECL className::name##_test args { SAVE_PARAMS RPC_##className##_##name *ev = new RPC_##className##_##name; TNL::PacketStream ps; ev->marshallArguments(); ev->pack(this, &ps); ps.setBytePosition(0); ev->unpack(this, &ps); ev->process(this); } \ void FN_CDECL className::name##_remote args }; Index: tnlMethodDispatch.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlMethodDispatch.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tnlMethodDispatch.cpp 20 May 2004 23:47:30 -0000 1.13 --- tnlMethodDispatch.cpp 19 Aug 2004 21:20:15 -0000 1.14 *************** *** 149,152 **** --- 149,162 ---- aptr += 13; } + else if(!strncmp(aptr, "const TNL::Vector<", 18)) + { + info.isVector = true; + aptr += 18; + } + + // strip off any TNL namespace stuff + if(!strncmp(aptr, "TNL::", 5)) + aptr += 5; + U32 len = 0; // grab the type off the arg list pointer: Index: tnlMethodDispatch.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlMethodDispatch.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tnlMethodDispatch.h 30 May 2004 21:31:19 -0000 1.4 --- tnlMethodDispatch.h 19 Aug 2004 21:20:15 -0000 1.5 *************** *** 148,157 **** extern void *gBasePtr; ! #define SAVE_PARAMS __asm { lea eax, this }; __asm { mov gBasePtr, eax }; #elif defined(TNL_SUPPORTS_GCC_INLINE_X86_ASM ) extern void *gBasePtr; ! #define SAVE_PARAMS gBasePtr = (void *) ((U8 *) __builtin_frame_address(0) + 8); #elif defined(TNL_SUPPORTS_GCC_INLINE_PPC_ASM ) --- 148,157 ---- extern void *gBasePtr; ! #define SAVE_PARAMS __asm { lea eax, this }; __asm { mov TNL::gBasePtr, eax }; #elif defined(TNL_SUPPORTS_GCC_INLINE_X86_ASM ) extern void *gBasePtr; ! #define SAVE_PARAMS TNL::gBasePtr = (void *) ((U8 *) __builtin_frame_address(0) + 8); #elif defined(TNL_SUPPORTS_GCC_INLINE_PPC_ASM ) *************** *** 181,185 **** "stfs f13, 80(r2) \n" \ "stw r1, 84(r2) \n" \ ! : : "r" (gRegisterSaves) : "r2" ); #else --- 181,185 ---- "stfs f13, 80(r2) \n" \ "stw r1, 84(r2) \n" \ ! : : "r" (TNL::gRegisterSaves) : "r2" ); #else Index: tnlNetObject.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlNetObject.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tnlNetObject.h 19 Aug 2004 20:51:57 -0000 1.7 --- tnlNetObject.h 19 Aug 2004 21:20:15 -0000 1.8 *************** *** 410,415 **** public: typedef void (FN_CDECL className::*RPCFuncPtr) args; \ RPCFuncPtr mFuncPtr; \ ! U32 pad; \ ! RPCEV_##className##_##name(NetObject *theObject = NULL) : TNL::NetObjectRPCEvent(theObject, &RPC##className##name, guaranteeType, eventDirection) \ { mFuncPtr = &className::name##_remote; } \ TNL_DECLARE_CLASS( RPCEV_##className##_##name ); \ --- 410,415 ---- public: typedef void (FN_CDECL className::*RPCFuncPtr) args; \ RPCFuncPtr mFuncPtr; \ ! TNL::U32 pad; \ ! RPCEV_##className##_##name(TNL::NetObject *theObject = NULL) : TNL::NetObjectRPCEvent(theObject, &RPC##className##name, guaranteeType, eventDirection) \ { mFuncPtr = &className::name##_remote; } \ TNL_DECLARE_CLASS( RPCEV_##className##_##name ); \ |
From: Mark F. <mar...@us...> - 2004-08-19 21:20:26
|
Update of /cvsroot/opentnl/tnl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25378/test Modified Files: server.cpp testGame.cpp testGame.h testGameRender.cpp testWindow.cpp Log Message: Made TNLTest not using namespace TNL Fixed RPC parser code to accept TNL:: prefixes to RPC arguments Index: testGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/test/testGame.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testGame.h 19 Aug 2004 20:24:51 -0000 1.4 --- testGame.h 19 Aug 2004 21:20:14 -0000 1.5 *************** *** 33,38 **** #include "../tnl/tnlRPC.h" - using namespace TNL; - /// TNL Graphical Test Application. /// --- 33,36 ---- *************** *** 60,65 **** struct Position { ! F32 x; ///< X position of the object, from 0 ... 1 ! F32 y; ///< Y position of the object, from 0 ... 1 }; --- 58,63 ---- struct Position { ! TNL::F32 x; ///< X position of the object, from 0 ... 1 ! TNL::F32 y; ///< Y position of the object, from 0 ... 1 }; *************** *** 69,80 **** /// Client users click on the game window, which generates an event to the server to /// move that client's player to the desired point. ! class Player : public NetObject { ! typedef NetObject Parent; public: Position startPos, endPos; ///< All players move along a line from startPos to endPos. Position renderPos; ///< Position at which to render the player - computed during update(). ! F32 t; ///< Parameter of how far the player is along the line from startPos to endPos. ! F32 tDelta; ///< Change in t per second (ie, velocity). TestGame *game; ///< The game object this player is associated with --- 67,78 ---- /// Client users click on the game window, which generates an event to the server to /// move that client's player to the desired point. ! class Player : public TNL::NetObject { ! typedef TNL::NetObject Parent; public: Position startPos, endPos; ///< All players move along a line from startPos to endPos. Position renderPos; ///< Position at which to render the player - computed during update(). ! TNL::F32 t; ///< Parameter of how far the player is along the line from startPos to endPos. ! TNL::F32 tDelta; ///< Change in t per second (ie, velocity). TestGame *game; ///< The game object this player is associated with *************** *** 106,118 **** /// that controls this Player instance. In the TNLTest program, all objects in a circle /// of radius 0.25 around the scope object are considered to be in scope. ! void performScopeQuery(GhostConnection *connection); /// packUpdate writes the Player's ghost update from the server to the client. /// This function takes advantage of the fact that the InitialMask is only ever set /// for the first update of the object to send once-only state to the client. ! U32 packUpdate(GhostConnection *connection, U32 updateMask, BitStream *stream); /// unpackUpdate reads the data the server wrote in packUpdate from the packet. ! void unpackUpdate(GhostConnection *connection, BitStream *stream); /// serverSetPosition is called on the server when it receives notice from a client --- 104,116 ---- /// that controls this Player instance. In the TNLTest program, all objects in a circle /// of radius 0.25 around the scope object are considered to be in scope. ! void performScopeQuery(TNL::GhostConnection *connection); /// packUpdate writes the Player's ghost update from the server to the client. /// This function takes advantage of the fact that the InitialMask is only ever set /// for the first update of the object to send once-only state to the client. ! TNL::U32 packUpdate(TNL::GhostConnection *connection, TNL::U32 updateMask, TNL::BitStream *stream); /// unpackUpdate reads the data the server wrote in packUpdate from the packet. ! void unpackUpdate(TNL::GhostConnection *connection, TNL::BitStream *stream); /// serverSetPosition is called on the server when it receives notice from a client *************** *** 120,129 **** /// setMaskBits(PositionMask) to notify the network system that this object has /// changed state. ! void serverSetPosition(Position startPos, Position endPos, F32 t, F32 tDelta); /// Move this object along its path. /// /// If it hits the end point, and it's an AI, it will generate a new destination. ! void update(F32 timeDelta); /// onGhostAvailable is called on the server when it knows that this Player has been --- 118,127 ---- /// setMaskBits(PositionMask) to notify the network system that this object has /// changed state. ! void serverSetPosition(Position startPos, Position endPos, TNL::F32 t, TNL::F32 tDelta); /// Move this object along its path. /// /// If it hits the end point, and it's an AI, it will generate a new destination. ! void update(TNL::F32 timeDelta); /// onGhostAvailable is called on the server when it knows that this Player has been *************** *** 132,136 **** /// NetObject subclasses by calling rpcPlayerIsInScope on the Player ghost on /// the specified connection. ! void onGhostAvailable(GhostConnection *theConnection); /// onGhostAdd is called for every NetObject on the client after the ghost has --- 130,134 ---- /// NetObject subclasses by calling rpcPlayerIsInScope on the Player ghost on /// the specified connection. ! void onGhostAvailable(TNL::GhostConnection *theConnection); /// onGhostAdd is called for every NetObject on the client after the ghost has *************** *** 138,142 **** /// false from this function would indicate than an error had occured, notifying the /// network system that the connection should be terminated. ! bool onGhostAdd(GhostConnection *theConnection); /// Adds this Player to the list of Player instances in the specified game. --- 136,140 ---- /// false from this function would indicate than an error had occured, notifying the /// network system that the connection should be terminated. ! bool onGhostAdd(TNL::GhostConnection *theConnection); /// Adds this Player to the list of Player instances in the specified game. *************** *** 150,154 **** /// usage of the Float<> template argument, in this case using 6 bits for each X and /// Y position. Float arguments to RPCs are between 0 and 1. ! TNL_DECLARE_RPC(rpcPlayerDidMove, (Float<6> x, Float<6> y)); /// rpcPlayerIsInScope is the RPC method called by onGhostAvailable to demonstrate --- 148,152 ---- /// usage of the Float<> template argument, in this case using 6 bits for each X and /// Y position. Float arguments to RPCs are between 0 and 1. ! TNL_DECLARE_RPC(rpcPlayerDidMove, (TNL::Float<6> x, TNL::Float<6> y)); /// rpcPlayerIsInScope is the RPC method called by onGhostAvailable to demonstrate *************** *** 156,160 **** /// macro to construct a NetEvent from the RPC invocation and then posts it only /// to the client for which the object just came into scope. ! TNL_DECLARE_RPC(rpcPlayerIsInScope, (Float<6> x, Float<6> y)); /// This macro invocation declares the Player class to be known --- 154,158 ---- /// macro to construct a NetEvent from the RPC invocation and then posts it only /// to the client for which the object just came into scope. ! TNL_DECLARE_RPC(rpcPlayerIsInScope, (TNL::Float<6> x, TNL::Float<6> y)); /// This macro invocation declares the Player class to be known *************** *** 168,174 **** /// for them or not. The "buildings" are represented by red rectangles on the /// playing field, and are constructed with random position and extents. ! class Building : public NetObject { ! typedef NetObject Parent; public: /// Mask bits used to determine what states are out of date for this --- 166,172 ---- /// for them or not. The "buildings" are represented by red rectangles on the /// playing field, and are constructed with random position and extents. ! class Building : public TNL::NetObject { ! typedef TNL::NetObject Parent; public: /// Mask bits used to determine what states are out of date for this *************** *** 190,194 **** /// client and its first unpackUpdate has been called. onGhostAdd adds /// the building to the client game. ! bool onGhostAdd(GhostConnection *theConnection); /// addToGame is a helper function called by onGhostAdd and on the server --- 188,192 ---- /// client and its first unpackUpdate has been called. onGhostAdd adds /// the building to the client game. ! bool onGhostAdd(TNL::GhostConnection *theConnection); /// addToGame is a helper function called by onGhostAdd and on the server *************** *** 200,207 **** /// mask bit state and never calls setMaskBits, this method will only be invoked when /// the ghost is being created on the client. ! U32 packUpdate(GhostConnection *connection, U32 updateMask, BitStream *stream); /// Reads the update information about the building from the specified packet BitStream. ! void unpackUpdate(GhostConnection *connection, BitStream *stream); /// This macro declares Building to be a part of the TNL network class management system. --- 198,205 ---- /// mask bit state and never calls setMaskBits, this method will only be invoked when /// the ghost is being created on the client. ! TNL::U32 packUpdate(TNL::GhostConnection *connection, TNL::U32 updateMask, TNL::BitStream *stream); /// Reads the update information about the building from the specified packet BitStream. ! void unpackUpdate(TNL::GhostConnection *connection, TNL::BitStream *stream); /// This macro declares Building to be a part of the TNL network class management system. *************** *** 219,225 **** /// TestConnection notifies the network interface that it should begin /// searching for a new server to join. ! class TestConnection : public GhostConnection { ! typedef GhostConnection Parent; public: --- 217,223 ---- /// TestConnection notifies the network interface that it should begin /// searching for a new server to join. ! class TestConnection : public TNL::GhostConnection { ! typedef TNL::GhostConnection Parent; public: *************** *** 229,233 **** /// The player object associated with this connection. ! SafePtr<Player> myPlayer; /// onConnectTerminated is called when the connection request to the server --- 227,231 ---- /// The player object associated with this connection. ! TNL::SafePtr<Player> myPlayer; /// onConnectTerminated is called when the connection request to the server *************** *** 235,239 **** /// When a TestConnection connect request to a server is terminated, the client's network interface /// is notified so it can begin searching for another server to connect to. ! void onConnectTerminated(NetConnection::TerminationReason reason, const char *rejectionString); /// onConnectionTerminated is called when an established connection is terminated, whether --- 233,237 ---- /// When a TestConnection connect request to a server is terminated, the client's network interface /// is notified so it can begin searching for another server to connect to. ! void onConnectTerminated(TNL::NetConnection::TerminationReason reason, const char *rejectionString); /// onConnectionTerminated is called when an established connection is terminated, whether *************** *** 241,245 **** /// When a TestConnection to a server is disconnected, the client's network interface /// is notified so it can begin searching for another server to connect to. ! void onConnectionTerminated(NetConnection::TerminationReason reason, const char *string); /// onConnectionEstablished is called on both ends of a connection when the connection is established. --- 239,243 ---- /// When a TestConnection to a server is disconnected, the client's network interface /// is notified so it can begin searching for another server to connect to. ! void onConnectionTerminated(TNL::NetConnection::TerminationReason reason, const char *string); /// onConnectionEstablished is called on both ends of a connection when the connection is established. *************** *** 254,258 **** /// Remote function that client calls to set the position of the player on the server. ! TNL_DECLARE_RPC(rpcSetPlayerPos, (F32 x, F32 y)); /// Enumeration constant used to specify the size field of Float<> parameters in the rpcGotPlayerPos method. --- 252,256 ---- /// Remote function that client calls to set the position of the player on the server. ! TNL_DECLARE_RPC(rpcSetPlayerPos, (TNL::F32 x, TNL::F32 y)); /// Enumeration constant used to specify the size field of Float<> parameters in the rpcGotPlayerPos method. *************** *** 265,269 **** /// that's possible using TNL's RPC. This RPC also sends bool and StringTableEntry data, /// as well as showing the use of the TNL_DECLARE_RPC_ENUM macro. ! TNL_DECLARE_RPC(rpcGotPlayerPos, (bool b1, bool b2, StringTableEntryRef string, Float<PlayerPosReplyBitSize> x, Float<PlayerPosReplyBitSize> y)); /// TNL_DECLARE_NETCONNECTION is used to declare that TestConnection is a valid connection class to the --- 263,267 ---- /// that's possible using TNL's RPC. This RPC also sends bool and StringTableEntry data, /// as well as showing the use of the TNL_DECLARE_RPC_ENUM macro. ! TNL_DECLARE_RPC(rpcGotPlayerPos, (bool b1, bool b2, TNL::StringTableEntryRef string, TNL::Float<PlayerPosReplyBitSize> x, TNL::Float<PlayerPosReplyBitSize> y)); /// TNL_DECLARE_NETCONNECTION is used to declare that TestConnection is a valid connection class to the *************** *** 282,288 **** /// When the connection or connection attempt to that server is terminated, the /// TestNetInterface resumes pinging for available TNLTest servers. ! class TestNetInterface : public NetInterface { ! typedef NetInterface Parent; public: /// Constants used in this NetInterface --- 280,286 ---- /// When the connection or connection attempt to that server is terminated, the /// TestNetInterface resumes pinging for available TNLTest servers. ! class TestNetInterface : public TNL::NetInterface { ! typedef TNL::NetInterface Parent; public: /// Constants used in this NetInterface *************** *** 294,302 **** bool pingingServers; ///< True if this is a client that is pinging for active servers. ! U32 lastPingTime; ///< The last platform time that a GamePingRequest was sent from this network interface. bool isServer; ///< True if this network interface is a server, false if it is a client. ! SafePtr<TestConnection> connectionToServer; ///< A safe pointer to the current connection to the server, if this is a client. ! Address pingAddress; ///< Network address to ping in searching for a server. This can be a specific host address or it can be a LAN broadcast address. TestGame *game; ///< The game object associated with this network interface. --- 292,300 ---- bool pingingServers; ///< True if this is a client that is pinging for active servers. ! TNL::U32 lastPingTime; ///< The last platform time that a GamePingRequest was sent from this network interface. bool isServer; ///< True if this network interface is a server, false if it is a client. ! TNL::SafePtr<TestConnection> connectionToServer; ///< A safe pointer to the current connection to the server, if this is a client. ! TNL::Address pingAddress; ///< Network address to ping in searching for a server. This can be a specific host address or it can be a LAN broadcast address. TestGame *game; ///< The game object associated with this network interface. *************** *** 304,312 **** /// The constructor initializes and binds the network interface, as well as sets /// parameters for the associated game and whether or not it is a server. ! TestNetInterface(TestGame *theGame, bool server, const Address &bindAddress, const Address &pingAddr); /// handleInfoPacket overrides the method in the NetInterface class to handle processing /// of the GamePingRequest and GamePingResponse packet types. ! void handleInfoPacket(const Address &address, U8 packetType, BitStream *stream); /// sendPing sends a GamePingRequest packet to pingAddress of this TestNetInterface. --- 302,310 ---- /// The constructor initializes and binds the network interface, as well as sets /// parameters for the associated game and whether or not it is a server. ! TestNetInterface(TestGame *theGame, bool server, const TNL::Address &bindAddress, const TNL::Address &pingAddr); /// handleInfoPacket overrides the method in the NetInterface class to handle processing /// of the GamePingRequest and GamePingResponse packet types. ! void handleInfoPacket(const TNL::Address &address, TNL::U8 packetType, TNL::BitStream *stream); /// sendPing sends a GamePingRequest packet to pingAddress of this TestNetInterface. *************** *** 324,334 **** class TestGame { public: ! Vector<Player *> players; ///< vector of player objects in the game ! Vector<Building *> buildings; ///< vector of buildings in the game bool isServer; ///< was this game created to be a server? TestNetInterface *myNetInterface; ///< network interface for this game ! U32 lastTime; ///< last time that tick() was called ! SafePtr<Player> serverPlayer; ///< the player that the server controls ! SafePtr<Player> clientPlayer; ///< the player that this client controls, if this game is a client /// Constructor for TestGame, determines whether this game will be a client --- 322,332 ---- class TestGame { public: ! TNL::Vector<Player *> players; ///< vector of player objects in the game ! TNL::Vector<Building *> buildings; ///< vector of buildings in the game bool isServer; ///< was this game created to be a server? TestNetInterface *myNetInterface; ///< network interface for this game ! TNL::U32 lastTime; ///< last time that tick() was called ! TNL::SafePtr<Player> serverPlayer; ///< the player that the server controls ! TNL::SafePtr<Player> clientPlayer; ///< the player that this client controls, if this game is a client /// Constructor for TestGame, determines whether this game will be a client *************** *** 337,341 **** /// populate the "world" with. TestGame also constructs an AsymmetricKey to /// demonstrate establishing secure connections with clients and servers. ! TestGame(bool server, const Address &bindAddress, const Address &pingAddress); /// Destroys a game, freeing all Player and Building objects associated with it. --- 335,339 ---- /// populate the "world" with. TestGame also constructs an AsymmetricKey to /// demonstrate establishing secure connections with clients and servers. ! TestGame(bool server, const TNL::Address &bindAddress, const TNL::Address &pingAddress); /// Destroys a game, freeing all Player and Building objects associated with it. Index: testGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/test/testGame.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** testGame.cpp 19 Aug 2004 20:24:51 -0000 1.7 --- testGame.cpp 19 Aug 2004 21:20:14 -0000 1.8 *************** *** 46,51 **** { // assign a random starting position for the player. ! startPos.x = Random::readF(); ! startPos.y = Random::readF(); endPos.x = startPos.x; endPos.y = startPos.y; --- 46,51 ---- { // assign a random starting position for the player. ! startPos.x = TNL::Random::readF(); ! startPos.y = TNL::Random::readF(); endPos.x = startPos.x; endPos.y = startPos.y; *************** *** 69,73 **** // remove the player from the list of players in the game. ! for( S32 i = 0; i < game->players.size(); i++) { if(game->players[i] == this) --- 69,73 ---- // remove the player from the list of players in the game. ! for( TNL::S32 i = 0; i < game->players.size(); i++) { if(game->players[i] == this) *************** *** 93,97 **** } ! bool Player::onGhostAdd(GhostConnection *theConnection) { addToGame(((TestNetInterface *) theConnection->getInterface())->game); --- 93,97 ---- } ! bool Player::onGhostAdd(TNL::GhostConnection *theConnection) { addToGame(((TestNetInterface *) theConnection->getInterface())->game); *************** *** 99,103 **** } ! void Player::performScopeQuery(GhostConnection *connection) { // find all the objects that are "in scope" - for the purposes --- 99,103 ---- } ! void Player::performScopeQuery(TNL::GhostConnection *connection) { // find all the objects that are "in scope" - for the purposes *************** *** 106,118 **** // 0.25 around the scope object, or a radius squared of 0.0625 ! for(S32 i = 0; i < game->buildings.size(); i++) connection->objectInScope(game->buildings[i]); ! for(S32 i = 0; i < game->players.size(); i++) { Position playerP = game->players[i]->renderPos; ! F32 dx = playerP.x - renderPos.x; ! F32 dy = playerP.y - renderPos.y; ! F32 distSquared = dx * dx + dy * dy; if(distSquared < 0.0625) connection->objectInScope(game->players[i]); --- 106,118 ---- // 0.25 around the scope object, or a radius squared of 0.0625 ! for(TNL::S32 i = 0; i < game->buildings.size(); i++) connection->objectInScope(game->buildings[i]); ! for(TNL::S32 i = 0; i < game->players.size(); i++) { Position playerP = game->players[i]->renderPos; ! TNL::F32 dx = playerP.x - renderPos.x; ! TNL::F32 dy = playerP.y - renderPos.y; ! TNL::F32 distSquared = dx * dx + dy * dy; if(distSquared < 0.0625) connection->objectInScope(game->players[i]); *************** *** 120,124 **** } ! U32 Player::packUpdate(GhostConnection *connection, U32 updateMask, BitStream *stream) { // if this is the initial update, write out some static --- 120,124 ---- } ! TNL::U32 Player::packUpdate(TNL::GhostConnection *connection, TNL::U32 updateMask, TNL::BitStream *stream) { // if this is the initial update, write out some static *************** *** 167,171 **** } ! void Player::unpackUpdate(GhostConnection *connection, BitStream *stream) { // see if the initial packet data was written: --- 167,171 ---- } ! void Player::unpackUpdate(TNL::GhostConnection *connection, TNL::BitStream *stream) { // see if the initial packet data was written: *************** *** 197,201 **** } ! void Player::serverSetPosition(Position inStartPos, Position inEndPos, F32 inT, F32 inTDelta) { // update the instance variables of the object --- 197,201 ---- } ! void Player::serverSetPosition(Position inStartPos, Position inEndPos, TNL::F32 inT, TNL::F32 inTDelta) { // update the instance variables of the object *************** *** 212,216 **** } ! void Player::update(F32 timeDelta) { t += tDelta * timeDelta; --- 212,216 ---- } ! void Player::update(TNL::F32 timeDelta) { t += tDelta * timeDelta; *************** *** 225,231 **** startPos = renderPos; t = 0; ! endPos.x = Random::readF(); ! endPos.y = Random::readF(); ! tDelta = 0.2f + Random::readF() * 0.1f; setMaskBits(PositionMask); // notify the network system that the network state has been updated } --- 225,231 ---- startPos = renderPos; t = 0; ! endPos.x = TNL::Random::readF(); ! endPos.y = TNL::Random::readF(); ! tDelta = 0.2f + TNL::Random::readF() * 0.1f; setMaskBits(PositionMask); // notify the network system that the network state has been updated } *************** *** 235,239 **** } ! void Player::onGhostAvailable(GhostConnection *theConnection) { // this function is called every time a ghost of this object is known --- 235,239 ---- } ! void Player::onGhostAvailable(TNL::GhostConnection *theConnection) { // this function is called every time a ghost of this object is known *************** *** 247,251 **** // the RPC macros create a RPCNAME_construct function that returns // a NetEvent that encapsulates the RPC. ! NetEvent *theRPCEvent = TNL_RPC_CONSTRUCT_NETEVENT(this, rpcPlayerIsInScope, (renderPos.x, renderPos.y)); // then we can just post the event to whatever connections we want to have --- 247,251 ---- // the RPC macros create a RPCNAME_construct function that returns // a NetEvent that encapsulates the RPC. ! TNL::NetEvent *theRPCEvent = TNL_RPC_CONSTRUCT_NETEVENT(this, rpcPlayerIsInScope, (renderPos.x, renderPos.y)); // then we can just post the event to whatever connections we want to have *************** *** 256,277 **** } ! TNL_IMPLEMENT_NETOBJECT_RPC(Player, rpcPlayerIsInScope, (Float<6> x, Float<6> y), ! NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhost, 0) { ! F32 fx = x, fy = y; ! logprintf("A player is now in scope at %g, %g", fx, fy); } TNL_IMPLEMENT_NETOBJECT_RPC(Player, rpcPlayerWillMove, (const char *testString), ! NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhostParent, 0) { ! logprintf("Expecting a player move from the connection: %s", testString); } ! TNL_IMPLEMENT_NETOBJECT_RPC(Player, rpcPlayerDidMove, (Float<6> x, Float<6> y), ! NetClassGroupGameMask, RPCGuaranteedOrdered, RPCToGhost, 0) { ! F32 fx = x, fy = y; ! logprintf("A player moved to %g, %g", fx, fy); } --- 256,277 ---- } ! TNL_IMPLEMENT_NETOBJECT_RPC(Player, rpcPlayerIsInScope, (TNL::Float<6> x, TNL::Float<6> y), ! TNL::NetClassGroupGameMask, TNL::RPCGuaranteedOrdered, TNL::RPCToGhost, 0) { ! TNL::F32 fx = x, fy = y; ! TNL::logprintf("A player is now in scope at %g, %g", fx, fy); } TNL_IMPLEMENT_NETOBJECT_RPC(Player, rpcPlayerWillMove, (const char *testString), ! TNL::NetClassGroupGameMask, TNL::RPCGuaranteedOrdered, TNL::RPCToGhostParent, 0) { ! TNL::logprintf("Expecting a player move from the connection: %s", testString); } ! TNL_IMPLEMENT_NETOBJECT_RPC(Player, rpcPlayerDidMove, (TNL::Float<6> x, TNL::Float<6> y), ! TNL::NetClassGroupGameMask, TNL::RPCGuaranteedOrdered, TNL::RPCToGhost, 0) { ! TNL::F32 fx = x, fy = y; ! TNL::logprintf("A player moved to %g, %g", fx, fy); } *************** *** 282,290 **** { // place the "building" in a random position on the screen ! upperLeft.x = Random::readF(); ! upperLeft.y = Random::readF(); ! lowerRight.x = upperLeft.x + Random::readF() * 0.1f + 0.025f; ! lowerRight.y = upperLeft.y + Random::readF() * 0.1f + 0.025f; game = NULL; --- 282,290 ---- { // place the "building" in a random position on the screen ! upperLeft.x = TNL::Random::readF(); ! upperLeft.y = TNL::Random::readF(); ! lowerRight.x = upperLeft.x + TNL::Random::readF() * 0.1f + 0.025f; ! lowerRight.y = upperLeft.y + TNL::Random::readF() * 0.1f + 0.025f; game = NULL; *************** *** 300,304 **** // remove the building from the list of buildings in the game. ! for( S32 i = 0; i < game->buildings.size(); i++) { if(game->buildings[i] == this) --- 300,304 ---- // remove the building from the list of buildings in the game. ! for( TNL::S32 i = 0; i < game->buildings.size(); i++) { if(game->buildings[i] == this) *************** *** 317,321 **** } ! bool Building::onGhostAdd(GhostConnection *theConnection) { addToGame(((TestNetInterface *) theConnection->getInterface())->game); --- 317,321 ---- } ! bool Building::onGhostAdd(TNL::GhostConnection *theConnection) { addToGame(((TestNetInterface *) theConnection->getInterface())->game); *************** *** 323,327 **** } ! U32 Building::packUpdate(GhostConnection *connection, U32 updateMask, BitStream *stream) { if(stream->writeFlag(updateMask & InitialMask)) --- 323,327 ---- } ! TNL::U32 Building::packUpdate(TNL::GhostConnection *connection, TNL::U32 updateMask, TNL::BitStream *stream) { if(stream->writeFlag(updateMask & InitialMask)) *************** *** 343,347 **** } ! void Building::unpackUpdate(GhostConnection *connection, BitStream *stream) { if(stream->readFlag()) --- 343,347 ---- } ! void Building::unpackUpdate(TNL::GhostConnection *connection, TNL::BitStream *stream) { if(stream->readFlag()) *************** *** 356,372 **** //--------------------------------------------------------------------------------- ! TNL_IMPLEMENT_NETCONNECTION(TestConnection, NetClassGroupGame, true); TNL_DECLARE_MEMBER_ENUM(TestConnection, PlayerPosReplyBitSize); ! TNL_IMPLEMENT_RPC(TestConnection, rpcGotPlayerPos, (bool b1, bool b2, StringTableEntryRef string, Float<TestConnection::PlayerPosReplyBitSize> x, Float<TestConnection::PlayerPosReplyBitSize> y), ! NetClassGroupGameMask, RPCGuaranteedOrdered, RPCDirAny, 0) { ! F32 xv = x, yv = y; ! logprintf("Server acknowledged position update - %d %d %s %g %g", b1, b2, string.getString(), xv, yv); } ! TNL_IMPLEMENT_RPC(TestConnection, rpcSetPlayerPos, (F32 x, F32 y), ! NetClassGroupGameMask, RPCGuaranteedOrdered, RPCDirClientToServer, 0) { Position newPosition; --- 356,372 ---- //--------------------------------------------------------------------------------- ! TNL_IMPLEMENT_NETCONNECTION(TestConnection, TNL::NetClassGroupGame, true); TNL_DECLARE_MEMBER_ENUM(TestConnection, PlayerPosReplyBitSize); ! TNL_IMPLEMENT_RPC(TestConnection, rpcGotPlayerPos, (bool b1, bool b2, TNL::StringTableEntryRef string, TNL::Float<TestConnection::PlayerPosReplyBitSize> x, TNL::Float<TestConnection::PlayerPosReplyBitSize> y), ! TNL::NetClassGroupGameMask, TNL::RPCGuaranteedOrdered, TNL::RPCDirAny, 0) { ! TNL::F32 xv = x, yv = y; ! TNL::logprintf("Server acknowledged position update - %d %d %s %g %g", b1, b2, string.getString(), xv, yv); } ! TNL_IMPLEMENT_RPC(TestConnection, rpcSetPlayerPos, (TNL::F32 x, TNL::F32 y), ! TNL::NetClassGroupGameMask, TNL::RPCGuaranteedOrdered, TNL::RPCDirClientToServer, 0) { Position newPosition; *************** *** 374,378 **** newPosition.y = y; ! logprintf("%s - received new position (%g, %g) from client", getNetAddressString(), newPosition.x, newPosition.y); --- 374,378 ---- newPosition.y = y; ! TNL::logprintf("%s - received new position (%g, %g) from client", getNetAddressString(), newPosition.x, newPosition.y); *************** *** 381,385 **** // send an RPC back the other way! ! StringTableEntry helloString("Hello World!!"); rpcGotPlayerPos(true, false, helloString, x, y); }; --- 381,385 ---- // send an RPC back the other way! ! TNL::StringTableEntry helloString("Hello World!!"); rpcGotPlayerPos(true, false, helloString, x, y); }; *************** *** 429,433 **** setGhostFrom(false); setGhostTo(true); ! logprintf("%s - connected to server.", getNetAddressString()); ((TestNetInterface *) getInterface())->connectionToServer = this; } --- 429,433 ---- setGhostFrom(false); setGhostTo(true); ! TNL::logprintf("%s - connected to server.", getNetAddressString()); ((TestNetInterface *) getInterface())->connectionToServer = this; } *************** *** 443,447 **** setGhostTo(false); activateGhosting(); ! logprintf("%s - client connected.", getNetAddressString()); } } --- 443,447 ---- setGhostTo(false); activateGhosting(); ! TNL::logprintf("%s - client connected.", getNetAddressString()); } } *************** *** 449,453 **** //--------------------------------------------------------------------------------- ! TestNetInterface::TestNetInterface(TestGame *theGame, bool server, const Address &bindAddress, const Address &pingAddr) : NetInterface(bindAddress) { game = theGame; --- 449,453 ---- //--------------------------------------------------------------------------------- ! TestNetInterface::TestNetInterface(TestGame *theGame, bool server, const TNL::Address &bindAddress, const TNL::Address &pingAddr) : NetInterface(bindAddress) { game = theGame; *************** *** 460,476 **** void TestNetInterface::sendPing() { ! PacketStream writeStream; // the ping packet right now just has one byte for packet type ! writeStream.write(U8(GamePingRequest)); writeStream.sendto(mSocket, pingAddress); ! logprintf("%s - sending ping.", pingAddress.toString()); } void TestNetInterface::tick() { ! U32 currentTime = Platform::getRealMilliseconds(); if(pingingServers && (lastPingTime + PingDelayTime < currentTime)) --- 460,476 ---- void TestNetInterface::sendPing() { ! TNL::PacketStream writeStream; // the ping packet right now just has one byte for packet type ! writeStream.write(TNL::U8(GamePingRequest)); writeStream.sendto(mSocket, pingAddress); ! TNL::logprintf("%s - sending ping.", pingAddress.toString()); } void TestNetInterface::tick() { ! TNL::U32 currentTime = TNL::Platform::getRealMilliseconds(); if(pingingServers && (lastPingTime + PingDelayTime < currentTime)) *************** *** 489,505 **** // and more. ! void TestNetInterface::handleInfoPacket(const Address &address, U8 packetType, BitStream *stream) { ! PacketStream writeStream; if(packetType == GamePingRequest && isServer) { ! logprintf("%s - received ping.", address.toString()); // we're a server, and we got a ping packet from a client, // so send back a GamePingResponse to let the client know it // has found a server. ! writeStream.write(U8(GamePingResponse)); writeStream.sendto(mSocket, address); ! logprintf("%s - sending ping response.", address.toString()); } else if(packetType == GamePingResponse && pingingServers) --- 489,505 ---- // and more. ! void TestNetInterface::handleInfoPacket(const TNL::Address &address, TNL::U8 packetType, TNL::BitStream *stream) { ! TNL::PacketStream writeStream; if(packetType == GamePingRequest && isServer) { ! TNL::logprintf("%s - received ping.", address.toString()); // we're a server, and we got a ping packet from a client, // so send back a GamePingResponse to let the client know it // has found a server. ! writeStream.write(TNL::U8(GamePingResponse)); writeStream.sendto(mSocket, address); ! TNL::logprintf("%s - sending ping response.", address.toString()); } else if(packetType == GamePingResponse && pingingServers) *************** *** 508,517 **** // pinging, and try to connect to the server. ! logprintf("%s - received ping response.", address.toString()); TestConnection *connection = new TestConnection; connection->connect(this, address); // connect to the server through the game's network interface ! logprintf("Connecting to server: %s", address.toString()); pingingServers = false; --- 508,517 ---- // pinging, and try to connect to the server. ! TNL::logprintf("%s - received ping response.", address.toString()); TestConnection *connection = new TestConnection; connection->connect(this, address); // connect to the server through the game's network interface ! TNL::logprintf("Connecting to server: %s", address.toString()); pingingServers = false; *************** *** 522,544 **** //--------------------------------------------------------------------------------- ! TestGame::TestGame(bool server, const Address &interfaceBindAddr, const Address &pingAddress) { isServer = server; myNetInterface = new TestNetInterface(this, isServer, interfaceBindAddr, pingAddress); ! AsymmetricKey *theKey = new AsymmetricKey(32); myNetInterface->setPrivateKey(theKey); myNetInterface->setRequiresKeyExchange(true); ! lastTime = Platform::getRealMilliseconds(); if(isServer) { // generate some buildings and AIs: ! for(S32 i = 0; i < 50; i ++) { Building *building = new Building; building->addToGame(this); } ! for(S32 i = 0; i < 15; i ++) { Player *aiPlayer = new Player(Player::PlayerTypeAI); --- 522,544 ---- //--------------------------------------------------------------------------------- ! TestGame::TestGame(bool server, const TNL::Address &interfaceBindAddr, const TNL::Address &pingAddress) { isServer = server; myNetInterface = new TestNetInterface(this, isServer, interfaceBindAddr, pingAddress); ! TNL::AsymmetricKey *theKey = new TNL::AsymmetricKey(32); myNetInterface->setPrivateKey(theKey); myNetInterface->setRequiresKeyExchange(true); ! lastTime = TNL::Platform::getRealMilliseconds(); if(isServer) { // generate some buildings and AIs: ! for(TNL::S32 i = 0; i < 50; i ++) { Building *building = new Building; building->addToGame(this); } ! for(TNL::S32 i = 0; i < 15; i ++) { Player *aiPlayer = new Player(Player::PlayerTypeAI); *************** *** 549,553 **** } ! logprintf("Created a %s...", (server ? "server" : "client")); } --- 549,553 ---- } ! TNL::logprintf("Created a %s...", (server ? "server" : "client")); } *************** *** 555,564 **** { delete myNetInterface; ! for(S32 i = 0; i < buildings.size(); i++) delete buildings[i]; ! for(S32 i = 0; i < players.size(); i++) delete players[i]; ! logprintf("Destroyed a %s...", (this->isServer ? "server" : "client")); } --- 555,564 ---- { delete myNetInterface; ! for(TNL::S32 i = 0; i < buildings.size(); i++) delete buildings[i]; ! for(TNL::S32 i = 0; i < players.size(); i++) delete players[i]; ! TNL::logprintf("Destroyed a %s...", (this->isServer ? "server" : "client")); } *************** *** 572,581 **** void TestGame::tick() { ! U32 currentTime = Platform::getRealMilliseconds(); if(currentTime == lastTime) return; ! F32 timeDelta = (currentTime - lastTime) / 1000.0f; ! for(S32 i = 0; i < players.size(); i++) players[i]->update(timeDelta); myNetInterface->tick(); --- 572,581 ---- void TestGame::tick() { ! TNL::U32 currentTime = TNL::Platform::getRealMilliseconds(); if(currentTime == lastTime) return; ! TNL::F32 timeDelta = (currentTime - lastTime) / 1000.0f; ! for(TNL::S32 i = 0; i < players.size(); i++) players[i]->update(timeDelta); myNetInterface->tick(); *************** *** 591,595 **** else if(!myNetInterface->connectionToServer.isNull()) { ! logprintf("posting new position (%g, %g) to server", newPosition.x, newPosition.y); if(!clientPlayer.isNull()) clientPlayer->rpcPlayerWillMove("Whee! Foo!"); --- 591,595 ---- else if(!myNetInterface->connectionToServer.isNull()) { ! TNL::logprintf("posting new position (%g, %g) to server", newPosition.x, newPosition.y); if(!clientPlayer.isNull()) clientPlayer->rpcPlayerWillMove("Whee! Foo!"); Index: testGameRender.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/test/testGameRender.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testGameRender.cpp 20 Apr 2004 04:27:18 -0000 1.1 --- testGameRender.cpp 19 Aug 2004 21:20:15 -0000 1.2 *************** *** 61,65 **** glBegin(GL_POLYGON); glColor4f(0.5f, 0.5f, 0.5f, 0.65f); ! for(F32 r = 0; r < 3.1415 * 2; r += 0.1f) { glVertex2f(p.x + 0.25f * cos(r), p.y + 0.25f * sin(r)); --- 61,65 ---- glBegin(GL_POLYGON); glColor4f(0.5f, 0.5f, 0.5f, 0.65f); ! for(TNL::F32 r = 0; r < 3.1415 * 2; r += 0.1f) { glVertex2f(p.x + 0.25f * cos(r), p.y + 0.25f * sin(r)); *************** *** 71,75 **** // then draw all the buildings. ! for(S32 i = 0; i < buildings.size(); i++) { Building *b = buildings[i]; --- 71,75 ---- // then draw all the buildings. ! for(TNL::S32 i = 0; i < buildings.size(); i++) { Building *b = buildings[i]; *************** *** 84,88 **** // last, draw all the players in the game. ! for(S32 i = 0; i < players.size(); i++) { Player *p = players[i]; --- 84,88 ---- // last, draw all the players in the game. ! for(TNL::S32 i = 0; i < players.size(); i++) { Player *p = players[i]; Index: server.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/test/server.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** server.cpp 20 May 2004 22:49:03 -0000 1.2 --- server.cpp 19 Aug 2004 21:20:14 -0000 1.3 *************** *** 32,35 **** --- 32,37 ---- #include "../tnl/tnlBitStream.h" + using namespace TNL; + //#define TNLTest_SERVER #define TNL_TEST_RPC Index: testWindow.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/test/testWindow.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testWindow.cpp 27 May 2004 22:41:16 -0000 1.2 --- testWindow.cpp 19 Aug 2004 21:20:15 -0000 1.3 *************** *** 44,48 **** // create a client, by default pinging the LAN broadcast on port 28999 ! clientGame = new TestGame(false,Address(IPProtocol, Address::Any, 0),Address(pingLocalHost ? localHostAddress : localBroadcastAddress)); serverGame = NULL; } --- 44,48 ---- // create a client, by default pinging the LAN broadcast on port 28999 ! clientGame = new TestGame(false,TNL::Address(TNL::IPProtocol, TNL::Address::Any, 0),TNL::Address(pingLocalHost ? localHostAddress : localBroadcastAddress)); serverGame = NULL; } *************** *** 55,59 **** clientGame = NULL; // create a server, listening on port 28999. ! serverGame = new TestGame(true,Address(IPProtocol,Address::Any, 28999),Address(localBroadcastAddress)); } --- 55,59 ---- clientGame = NULL; // create a server, listening on port 28999. ! serverGame = new TestGame(true,TNL::Address(TNL::IPProtocol,TNL::Address::Any, 28999),TNL::Address(localBroadcastAddress)); } *************** *** 65,70 **** // construct two local games, one client and one server, and have the client game ping the localhost // loopback address. ! clientGame = new TestGame(false,Address(IPProtocol, Address::Any, 0),Address(localHostAddress)); ! serverGame = new TestGame(true,Address(IPProtocol,Address::Any, 28999),Address(localBroadcastAddress)); // If the following line is commented out, the local games will create a normal (network) connection. --- 65,70 ---- // construct two local games, one client and one server, and have the client game ping the localhost // loopback address. ! clientGame = new TestGame(false,TNL::Address(TNL::IPProtocol, TNL::Address::Any, 0),TNL::Address(localHostAddress)); ! serverGame = new TestGame(true,TNL::Address(TNL::IPProtocol,TNL::Address::Any, 28999),TNL::Address(localBroadcastAddress)); // If the following line is commented out, the local games will create a normal (network) connection. *************** *** 97,102 **** { Position p; ! p.x = x / F32(gWindowWidth); ! p.y = y / F32(gWindowHeight); if(clientGame) --- 97,102 ---- { Position p; ! p.x = x / TNL::F32(gWindowWidth); ! p.y = y / TNL::F32(gWindowHeight); if(clientGame) *************** *** 147,151 **** #include <stdio.h> ! class StdoutLogConsumer : public LogConsumer { public: --- 147,151 ---- #include <stdio.h> ! class StdoutLogConsumer : public TNL::LogConsumer { public: |
From: Mark F. <mar...@us...> - 2004-08-19 20:52:06
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20406/tnl Modified Files: tnlNetObject.h tnlRPC.h Log Message: Added TNL:: namespace reference into RPC macros Index: tnlRPC.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlRPC.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tnlRPC.h 29 May 2004 19:16:09 -0000 1.7 --- tnlRPC.h 19 Aug 2004 20:51:57 -0000 1.8 *************** *** 194,198 **** void (FN_CDECL className::*mFuncPtr) args; \ TNL::U32 pad; \ ! RPC_##className##_##name() : RPCEvent(&RPC##className##name, guaranteeType, eventDirection) \ { mFuncPtr = &className::name##_remote; } \ TNL_DECLARE_CLASS( RPC_##className##_##name ); \ --- 194,198 ---- void (FN_CDECL className::*mFuncPtr) args; \ TNL::U32 pad; \ ! RPC_##className##_##name() : TNL::RPCEvent(&RPC##className##name, guaranteeType, eventDirection) \ { mFuncPtr = &className::name##_remote; } \ TNL_DECLARE_CLASS( RPC_##className##_##name ); \ Index: tnlNetObject.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlNetObject.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** tnlNetObject.h 19 Aug 2004 20:29:18 -0000 1.6 --- tnlNetObject.h 19 Aug 2004 20:51:57 -0000 1.7 *************** *** 415,419 **** TNL_DECLARE_CLASS( RPCEV_##className##_##name ); \ bool checkClassType(TNL::Object *theObject) { return dynamic_cast<className *>(theObject) != NULL; } \ ! void getFuncPtr(MethodPointer &p) { p.v1=*((U32 *) &mFuncPtr); p.v2 = *(((U32 *) &mFuncPtr) + 1); } }; \ TNL_IMPLEMENT_NETEVENT( RPCEV_##className##_##name, groupMask, rpcVersion ); \ TNL::MethodArgList RPC##className##name (#className, #args); \ --- 415,419 ---- TNL_DECLARE_CLASS( RPCEV_##className##_##name ); \ bool checkClassType(TNL::Object *theObject) { return dynamic_cast<className *>(theObject) != NULL; } \ ! void getFuncPtr(TNL::MethodPointer &p) { p.v1=*((TNL::U32 *) &mFuncPtr); p.v2 = *(((TNL::U32 *) &mFuncPtr) + 1); } }; \ TNL_IMPLEMENT_NETEVENT( RPCEV_##className##_##name, groupMask, rpcVersion ); \ TNL::MethodArgList RPC##className##name (#className, #args); \ |
From: Mark F. <mar...@us...> - 2004-08-19 20:29:26
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16150/tnl Modified Files: tnlNetObject.h Log Message: Fixed old comment in tnlNetObject.h Index: tnlNetObject.h =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/tnlNetObject.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tnlNetObject.h 24 Jun 2004 01:12:09 -0000 1.5 --- tnlNetObject.h 19 Aug 2004 20:29:18 -0000 1.6 *************** *** 127,131 **** /// /// @code ! /// U32 packUpdate(NetConnection *, U32 mask, BitStream *stream) /// { /// // check which states need to be updated, and write updates --- 127,131 ---- /// /// @code ! /// U32 packUpdate(GhostConnection *, U32 mask, BitStream *stream) /// { /// // check which states need to be updated, and write updates *************** *** 148,152 **** /// /// @code ! /// void unpackUpdate(NetConnection *, BitStream *stream) /// { /// // the unpackUpdate function must be symmetrical to packUpdate --- 148,152 ---- /// /// @code ! /// void unpackUpdate(GhostConnection *, BitStream *stream) /// { /// // the unpackUpdate function must be symmetrical to packUpdate |
From: Mark F. <mar...@us...> - 2004-08-19 20:25:03
|
Update of /cvsroot/opentnl/tnl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15513/test Modified Files: testGame.cpp testGame.h Log Message: Fixed TNL netConnection ping/encryption issues Index: testGame.h =================================================================== RCS file: /cvsroot/opentnl/tnl/test/testGame.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** testGame.h 16 May 2004 02:29:40 -0000 1.3 --- testGame.h 19 Aug 2004 20:24:51 -0000 1.4 *************** *** 248,251 **** --- 248,256 ---- void onConnectionEstablished(); + /// isDataToTransmit is called each time the connection is ready to send a packet. If + /// the NetConnection subclass has data to send it should return true. In the case of a simulation, + /// this should always return true. + bool isDataToTransmit(); + /// Remote function that client calls to set the position of the player on the server. TNL_DECLARE_RPC(rpcSetPlayerPos, (F32 x, F32 y)); Index: testGame.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/test/testGame.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** testGame.cpp 2 Jun 2004 21:01:57 -0000 1.6 --- testGame.cpp 19 Aug 2004 20:24:51 -0000 1.7 *************** *** 102,108 **** { // find all the objects that are "in scope" - for the purposes ! // of this test program, that is all objects in a circle of radius // 0.25 around the scope object, or a radius squared of 0.0625 for(S32 i = 0; i < game->players.size(); i++) { --- 102,112 ---- { // find all the objects that are "in scope" - for the purposes ! // of this test program, all buildings are considered to be in ! // scope always, as well as all "players" in a circle of radius // 0.25 around the scope object, or a radius squared of 0.0625 + for(S32 i = 0; i < game->buildings.size(); i++) + connection->objectInScope(game->buildings[i]); + for(S32 i = 0; i < game->players.size(); i++) { *************** *** 389,392 **** --- 393,402 ---- } + bool TestConnection::isDataToTransmit() + { + // we always want packets to be sent. + return true; + } + void TestConnection::onConnectTerminated(NetConnection::TerminationReason reason, const char *string) { *************** *** 408,412 **** // call the parent's onConnectionEstablished. // by default this will set the initiator to be a connection ! // to "server" and the non-initiator to be a connnection to "client" Parent::onConnectionEstablished(); --- 418,422 ---- // call the parent's onConnectionEstablished. // by default this will set the initiator to be a connection ! // to "server" and the non-initiator to be a connection to "client" Parent::onConnectionEstablished(); |
From: Mark F. <mar...@us...> - 2004-08-19 20:25:03
|
Update of /cvsroot/opentnl/tnl/tnl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15513/tnl Modified Files: netConnection.cpp Log Message: Fixed TNL netConnection ping/encryption issues Index: netConnection.cpp =================================================================== RCS file: /cvsroot/opentnl/tnl/tnl/netConnection.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** netConnection.cpp 3 Jul 2004 00:11:24 -0000 1.9 --- netConnection.cpp 19 Aug 2004 20:24:51 -0000 1.10 *************** *** 214,223 **** writePacket(bstream, note); TNLLogMessageV(LogNetConnection, ("NetConnection %s: END %s - %d bits", mNetAddress.toString(), getClassName(), bstream->getBitPosition() - start) ); ! ! if(!mSymmetricCipher.isNull()) ! { ! mSymmetricCipher->setupCounter(mLastSendSeq, mLastSeqRecvd, packetType, 0); ! bstream->hashAndEncrypt(MessageSignatureBytes, PacketHeaderByteSize, mSymmetricCipher); ! } } } --- 214,222 ---- writePacket(bstream, note); TNLLogMessageV(LogNetConnection, ("NetConnection %s: END %s - %d bits", mNetAddress.toString(), getClassName(), bstream->getBitPosition() - start) ); ! } ! if(!mSymmetricCipher.isNull()) ! { ! mSymmetricCipher->setupCounter(mLastSendSeq, mLastSeqRecvd, packetType, 0); ! bstream->hashAndEncrypt(MessageSignatureBytes, PacketHeaderByteSize, mSymmetricCipher); } } |