Update of /cvsroot/opentnl/tnl/zap
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18710/zap
Modified Files:
HTFGame.cpp UIGame.cpp UIGame.h UIInstructions.cpp
UIInstructions.h UIMenus.cpp UIMenus.h footballGame.cpp game.h
gameType.cpp gameType.h main.cpp retrieveGame.cpp
Log Message:
More fixes for game type objective arrows
Removed HTF level
Added new retrieve level
changed zone-control 5 to be 3 team instead of 4
Added ALT-ENTER for video mode change
Added F1 in game for help
Index: main.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/main.cpp,v
retrieving revision 1.71
retrieving revision 1.72
diff -C2 -d -r1.71 -r1.72
*** main.cpp 29 Sep 2004 23:53:21 -0000 1.71
--- main.cpp 5 Oct 2004 23:41:59 -0000 1.72
***************
*** 70,74 ****
const char *gLevelList = "retrieve1.txt "
"retrieve2.txt "
! "htf1.txt "
"football1.txt "
"football2.txt "
--- 70,74 ----
const char *gLevelList = "retrieve1.txt "
"retrieve2.txt "
! "retrieve3.txt "
"football1.txt "
"football2.txt "
***************
*** 78,82 ****
"rabbit1.txt "
"soccer1.txt "
- "soccer2.txt "
"ctf1.txt "
"ctf2.txt "
--- 78,81 ----
***************
*** 154,158 ****
TNL_IMPLEMENT_JOURNAL_ENTRYPOINT(ZapJournal, key, (U8 key))
{
! if(UserInterface::current)
UserInterface::current->onKeyDown(key);
}
--- 153,160 ----
TNL_IMPLEMENT_JOURNAL_ENTRYPOINT(ZapJournal, key, (U8 key))
{
! // check for ALT-ENTER
! if(key == '\r' && (glutGetModifiers() & GLUT_ACTIVE_ALT))
! gOptionsMenuUserInterface.toggleFullscreen();
! else if(UserInterface::current)
UserInterface::current->onKeyDown(key);
}
Index: gameType.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/gameType.cpp,v
retrieving revision 1.61
retrieving revision 1.62
diff -C2 -d -r1.61 -r1.62
*** gameType.cpp 5 Oct 2004 00:16:34 -0000 1.61
--- gameType.cpp 5 Oct 2004 23:41:59 -0000 1.62
***************
*** 221,225 ****
}
! void GameType::renderObjectiveArrow(GameObject *target, Color c)
{
GameConnection *gc = gClientGame->getConnectionToServer();
--- 221,225 ----
}
! void GameType::renderObjectiveArrow(GameObject *target, Color c, F32 alphaMod)
{
GameConnection *gc = gClientGame->getConnectionToServer();
***************
*** 276,280 ****
arrowDir.normalize();
Point crossVec(arrowDir.y, -arrowDir.x);
! F32 alpha = (1 - gClientGame->getCommanderZoomFraction()) * 0.6;
if(!alpha)
return;
--- 276,280 ----
arrowDir.normalize();
Point crossVec(arrowDir.y, -arrowDir.x);
! F32 alpha = (1 - gClientGame->getCommanderZoomFraction()) * 0.6 * alphaMod;
if(!alpha)
return;
***************
*** 664,667 ****
--- 664,672 ----
}
+ Color GameType::getTeamColor(GameObject *theObject)
+ {
+ return getTeamColor(theObject->getTeam());
+ }
+
Color GameType::getShipColor(Ship *s)
{
Index: UIGame.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/UIGame.cpp,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** UIGame.cpp 1 Oct 2004 00:21:40 -0000 1.48
--- UIGame.cpp 5 Oct 2004 23:41:59 -0000 1.49
***************
*** 30,33 ****
--- 30,34 ----
#include "UIGame.h"
#include "UIMenus.h"
+ #include "UIInstructions.h"
#include "gameType.h"
#include "lpc10.h"
***************
*** 453,456 ****
--- 454,463 ----
}
+ void GameUserInterface::onSpecialKeyDown(U32 key)
+ {
+ if(key == GLUT_KEY_F1)
+ gInstructionsUserInterface.activate();
+ }
+
void GameUserInterface::onKeyDown(U32 key)
{
Index: UIMenus.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** UIMenus.h 2 Aug 2004 18:11:54 -0000 1.12
--- UIMenus.h 5 Oct 2004 23:41:59 -0000 1.13
***************
*** 96,99 ****
--- 96,100 ----
void setupMenus();
void onActivate();
+ void toggleFullscreen();
};
Index: HTFGame.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/HTFGame.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** HTFGame.cpp 5 Oct 2004 00:16:34 -0000 1.3
--- HTFGame.cpp 5 Oct 2004 23:41:59 -0000 1.4
***************
*** 257,260 ****
--- 257,262 ----
for(k = 0; k < mFlags.size(); k++)
{
+ if(!mFlags[k].isValid())
+ continue;
if(mFlags[k]->getZone() == mZones[j])
break;
Index: game.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/game.h,v
retrieving revision 1.67
retrieving revision 1.68
diff -C2 -d -r1.67 -r1.68
*** game.h 5 Oct 2004 00:16:34 -0000 1.67
--- game.h 5 Oct 2004 23:41:59 -0000 1.68
***************
*** 236,240 ****
extern void endGame();
! #define ZAP_GAME_STRING "ZAP 1.4.5"
};
--- 236,240 ----
extern void endGame();
! #define ZAP_GAME_STRING "ZAP 1.4.6"
};
Index: retrieveGame.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/retrieveGame.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** retrieveGame.cpp 5 Oct 2004 00:16:34 -0000 1.4
--- retrieveGame.cpp 5 Oct 2004 23:41:59 -0000 1.5
***************
*** 240,243 ****
--- 240,245 ----
for(k = 0; k < mFlags.size(); k++)
{
+ if(!mFlags[k].isValid())
+ continue;
if(mFlags[k]->getZone() == mZones[j])
break;
Index: UIInstructions.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/UIInstructions.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** UIInstructions.h 1 Jul 2004 19:23:36 -0000 1.3
--- UIInstructions.h 5 Oct 2004 23:41:59 -0000 1.4
***************
*** 46,49 ****
--- 46,50 ----
void onKeyDown(U32 key);
void onActivate();
+ void exitInstructions();
};
Index: footballGame.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/footballGame.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** footballGame.cpp 5 Oct 2004 00:16:34 -0000 1.13
--- footballGame.cpp 5 Oct 2004 23:41:59 -0000 1.14
***************
*** 41,45 ****
--- 41,59 ----
Vector<GoalZone*> mZones;
SafePtr<FlagItem> mFlag;
+ S32 mFlagTeam;
public:
+ ZoneControlGameType()
+ {
+ mFlagTeam = -1;
+ }
+
+ void onGhostAvailable(GhostConnection *theConnection)
+ {
+ Parent::onGhostAvailable(theConnection);
+ NetObject::setRPCDestConnection(theConnection);
+ s2cSetFlagTeam(mFlagTeam);
+ NetObject::setRPCDestConnection(NULL);
+ }
+
void shipTouchFlag(Ship *theShip, FlagItem *theFlag);
void flagDropped(Ship *theShip, FlagItem *theFlag);
***************
*** 56,59 ****
--- 70,74 ----
void performProxyScopeQuery(GameObject *scopeObject, GameConnection *connection);
+ TNL_DECLARE_RPC(s2cSetFlagTeam, (S32 newFlagTeam));
TNL_DECLARE_CLASS(ZoneControlGameType);
};
***************
*** 61,64 ****
--- 76,83 ----
TNL_IMPLEMENT_NETOBJECT(ZoneControlGameType);
+ GAMETYPE_RPC_S2C(ZoneControlGameType, s2cSetFlagTeam, (S32 flagTeam))
+ {
+ mFlagTeam = flagTeam;
+ }
void ZoneControlGameType::shipTouchFlag(Ship *theShip, FlagItem *theFlag)
***************
*** 76,83 ****
--- 95,105 ----
mClientList[i]->clientConnection->s2cDisplayMessageE(GameConnection::ColorNuclearGreen, SFXFlagSnatch, takeString, e);
theFlag->mountToShip(theShip);
+ mFlagTeam = theShip->getTeam();
+ s2cSetFlagTeam(mFlagTeam);
}
void ZoneControlGameType::flagDropped(Ship *theShip, FlagItem *theFlag)
{
+ s2cSetFlagTeam(-1);
static StringTableEntry dropString("%e0 dropped the flag!");
Vector<StringTableEntry> e;
***************
*** 150,153 ****
--- 172,177 ----
}
}
+ mFlagTeam = -1;
+ s2cSetFlagTeam(-1);
}
***************
*** 179,211 ****
return;
! if(mFlag.isValid() && mFlag->getMount() == u)
{
- // the ship has the flag, so render zones not controlled by his team
for(S32 i = 0; i < mZones.size(); i++)
! if(mZones[i]->getTeam() != u->getTeam())
! renderObjectiveArrow(mZones[i], getTeamColor(mZones[i]->getTeam()));
}
! else
{
if(mFlag.isValid())
{
if(!mFlag->isMounted())
! renderObjectiveArrow(mFlag, getTeamColor(mFlag->getTeam()));
else
{
Ship *mount = mFlag->getMount();
if(mount)
! renderObjectiveArrow(mount, getTeamColor(mount->getTeam()));
! }
! }
! for(S32 i = 0; i < mZones.size(); i++)
! {
! if(mZones[i]->didRecentlyChangeTeam() && mZones[i]->getTeam() != -1)
! {
! Color c = getTeamColor(mZones[i]->getTeam());
! if(mZones[i]->isFlashing())
! c *= 0.8;
! renderObjectiveArrow(mZones[i], c);
!
}
}
--- 203,237 ----
return;
! bool hasFlag = mFlag.isValid() && mFlag->getMount() == u;
!
! // first render all zones that are not yet taken by the flag holding team
! if(mFlagTeam != -1)
{
for(S32 i = 0; i < mZones.size(); i++)
! {
! if(mZones[i]->getTeam() != mFlagTeam)
! renderObjectiveArrow(mZones[i], getTeamColor(mZones[i]), hasFlag ? 1.0 : 0.4);
! else if(mZones[i]->didRecentlyChangeTeam() && mZones[i]->getTeam() != -1 && u->getTeam() != mFlagTeam)
! {
! // render a blinky arrow for a recently taken zone
! Color c = getTeamColor(mZones[i]);
! if(mZones[i]->isFlashing())
! c *= 0.7;
! renderObjectiveArrow(mZones[i], c);
! }
! }
!
}
! if(!hasFlag)
{
if(mFlag.isValid())
{
if(!mFlag->isMounted())
! renderObjectiveArrow(mFlag, getTeamColor(mFlag));
else
{
Ship *mount = mFlag->getMount();
if(mount)
! renderObjectiveArrow(mount, getTeamColor(mount));
}
}
Index: gameType.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/gameType.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** gameType.h 4 Oct 2004 19:23:59 -0000 1.35
--- gameType.h 5 Oct 2004 23:41:59 -0000 1.36
***************
*** 155,159 ****
virtual void renderInterfaceOverlay(bool scoreboardVisible);
! void renderObjectiveArrow(GameObject *target, Color c);
void renderTimeLeft();
--- 155,159 ----
virtual void renderInterfaceOverlay(bool scoreboardVisible);
! void renderObjectiveArrow(GameObject *target, Color c, F32 alphaMod = 1.0f);
void renderTimeLeft();
***************
*** 166,169 ****
--- 166,170 ----
virtual Color getShipColor(Ship *s);
Color getTeamColor(S32 team);
+ Color getTeamColor(GameObject *theObject);
// game type flag methods for CTF, Rabbit, Football
virtual void addFlag(FlagItem *theFlag) {}
Index: UIMenus.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/UIMenus.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** UIMenus.cpp 29 Sep 2004 23:53:21 -0000 1.25
--- UIMenus.cpp 5 Oct 2004 23:41:59 -0000 1.26
***************
*** 310,313 ****
--- 310,325 ----
}
+ void OptionsMenuUserInterface::toggleFullscreen()
+ {
+ if(fullscreen)
+ {
+ glutPositionWindow(100, 100);
+ glutReshapeWindow(800, 600);
+ }
+ else
+ glutFullScreen();
+ fullscreen = !fullscreen;
+ }
+
void OptionsMenuUserInterface::processSelection(U32 index)
{
***************
*** 318,329 ****
break;
case 1:
! if(fullscreen)
! {
! glutPositionWindow(100, 100);
! glutReshapeWindow(800, 600);
! }
! else
! glutFullScreen();
! fullscreen = !fullscreen;
break;
case 2:
--- 330,334 ----
break;
case 1:
! toggleFullscreen();
break;
case 2:
Index: UIGame.h
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/UIGame.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** UIGame.h 2 Aug 2004 18:11:53 -0000 1.16
--- UIGame.h 5 Oct 2004 23:41:59 -0000 1.17
***************
*** 144,147 ****
--- 144,148 ----
void onModifierKeyDown(U32 key);
void onModifierKeyUp(U32 key);
+ void onSpecialKeyDown(U32 key);
void onControllerButtonDown(U32 buttonIndex);
void onControllerButtonUp(U32 buttonIndex);
Index: UIInstructions.cpp
===================================================================
RCS file: /cvsroot/opentnl/tnl/zap/UIInstructions.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** UIInstructions.cpp 28 Sep 2004 18:45:25 -0000 1.8
--- UIInstructions.cpp 5 Oct 2004 23:41:59 -0000 1.9
***************
*** 412,415 ****
--- 412,423 ----
}
+ void InstructionsUserInterface::exitInstructions()
+ {
+ if(gClientGame->isConnectedToServer())
+ gGameUserInterface.activate();
+ else
+ gMainMenuUserInterface.activate();
+ }
+
void InstructionsUserInterface::onSpecialKeyDown(U32 key)
{
***************
*** 422,425 ****
--- 430,436 ----
nextPage();
break;
+ case GLUT_KEY_F1:
+ exitInstructions();
+ break;
}
}
***************
*** 434,441 ****
case '\r':
case 27:
! if(gClientGame->isConnectedToServer())
! gGameUserInterface.activate();
! else
! gMainMenuUserInterface.activate();
break;
}
--- 445,449 ----
case '\r':
case 27:
! exitInstructions();
break;
}
|