From 917187ca7dc0549ef24cdd6f627770866afa0569 Mon Sep 17 00:00:00 2001 From: Per Inge Mathisen Date: Mon, 11 Feb 2008 16:23:20 +0000 Subject: [PATCH] Clean out some excess global defines. git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3753 4a71c877-e1ca-e34f-864e-861f7616d084 --- lib/framework/frame.h | 1 + lib/netplay/netplay.c | 6 ++---- lib/netplay/netplay.h | 5 +---- src/deliverance.h | 7 ------- src/design.c | 2 -- src/game.c | 6 +++--- src/loop.c | 2 -- src/research.c | 2 -- src/structure.c | 3 +-- 9 files changed, 8 insertions(+), 26 deletions(-) diff --git a/lib/framework/frame.h b/lib/framework/frame.h index 7afe27503..8134b0814 100644 --- a/lib/framework/frame.h +++ b/lib/framework/frame.h @@ -62,6 +62,7 @@ #include extern UDWORD selectedPlayer; +#define MAX_PLAYERS 8 /**< Maximum number of players in the game. */ /** Initialise the frame work library */ extern BOOL frameInitialise( diff --git a/lib/netplay/netplay.c b/lib/netplay/netplay.c index ce2276e9e..50ab3fc2e 100644 --- a/lib/netplay/netplay.c +++ b/lib/netplay/netplay.c @@ -315,7 +315,7 @@ UDWORD NETplayerInfo(void) return 1; } - memset(NetPlay.players, 0, (sizeof(PLAYER)*MaxNumberOfPlayers)); // reset player info + memset(NetPlay.players, 0, sizeof(PLAYER) * MAX_PLAYERS); // reset player info for (i = 0; i < MAX_CONNECTED_PLAYERS; ++i) { @@ -511,13 +511,11 @@ BOOL NETinit(BOOL bFirstCall) NetPlay.bHost = 0; NetPlay.bComms = TRUE; - for(i=0;iplayers[i])) return false; @@ -579,7 +579,7 @@ static bool deserializeNetPlay(PHYSFS_file* fileHandle, NETPLAY* serializeNetPla return false; } - for (i = 0; i < MaxNumberOfPlayers; ++i) + for (i = 0; i < MAX_PLAYERS; ++i) { if (!deserializePlayer(fileHandle, &serializeNetPlay->players[i])) return false; @@ -3985,7 +3985,7 @@ static void endian_SaveGameV(SAVE_GAME* psSaveGame, UDWORD version) endian_sdword(&psSaveGame->sNetPlay.games[i].desc.dwUser3); endian_sdword(&psSaveGame->sNetPlay.games[i].desc.dwUser4); } - for(i = 0; i < MaxNumberOfPlayers; i++) + for(i = 0; i < MAX_PLAYERS; i++) endian_udword(&psSaveGame->sNetPlay.players[i].dpid); endian_udword(&psSaveGame->sNetPlay.playercount); endian_udword(&psSaveGame->sNetPlay.dpidPlayer); diff --git a/src/loop.c b/src/loop.c index 9b714ca27..5c004570e 100644 --- a/src/loop.c +++ b/src/loop.c @@ -182,7 +182,6 @@ GAMECODE gameLoop(void) { if (!scriptPaused()) { -#ifdef SCRIPTS /* Update the event system */ if (!bInTutorial) { @@ -192,7 +191,6 @@ GAMECODE gameLoop(void) { eventProcessTriggers(gameTime2/SCR_TICKRATE); } -#endif } /* Run the in game interface and see if it grabbed any mouse clicks */ diff --git a/src/research.c b/src/research.c index 6cadaddbc..482813b13 100644 --- a/src/research.c +++ b/src/research.c @@ -1871,7 +1871,6 @@ void researchResult(UDWORD researchIndex, UBYTE player, BOOL bDisplay, } } -#ifdef SCRIPTS if ((bMultiPlayer || player == selectedPlayer) && bDisplay) { psCBLastResearch = pResearch; @@ -1882,7 +1881,6 @@ void researchResult(UDWORD researchIndex, UBYTE player, BOOL bDisplay, CBResFacilityOwner = -1; psCBLastResearch = NULL; } -#endif #ifdef DEBUG /*this just checks that there are not more than 32 weapons now available for diff --git a/src/structure.c b/src/structure.c index f4fb347f1..d3ed578c5 100644 --- a/src/structure.c +++ b/src/structure.c @@ -2714,12 +2714,11 @@ static BOOL structPlaceDroid(STRUCTURE *psStructure, DROID_TEMPLATE *psTempl, { assignFactoryCommandDroid(psStructure, psNewDroid); } -#ifdef SCRIPTS if ( psNewDroid->player == selectedPlayer ) { eventFireCallbackTrigger((TRIGGER_TYPE)CALL_DROIDBUILT); } -#endif + return TRUE; } else