Clean out some excess global defines.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3753 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2008-02-11 16:23:20 +00:00
parent 907f684f8a
commit 917187ca7d
9 changed files with 8 additions and 26 deletions

View File

@ -62,6 +62,7 @@
#include <physfs.h>
extern UDWORD selectedPlayer;
#define MAX_PLAYERS 8 /**< Maximum number of players in the game. */
/** Initialise the frame work library */
extern BOOL frameInitialise(

View File

@ -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;i<MaxNumberOfPlayers;i++)
for(i = 0; i < MAX_PLAYERS; i++)
{
memset(&NetPlay.players[i], 0, sizeof(PLAYER));
memset(&NetPlay.games[i], 0, sizeof(GAMESTRUCT));
}
//GAME_GUID = g;
NetPlay.bComms = TRUE;
NETstartLogging();
}

View File

@ -32,11 +32,8 @@
// Include this file in your game to add multiplayer facilities.
// Constants
#define MaxNumberOfPlayers 8 // max number of players in a game.
#define MaxMsgSize 8000 // max size of a message in bytes.
#define StringSize 64 // size of strings used.
#define ConnectionSize 255 // max size of a connection description.
#define MaxProtocols 12 // max number of returnable protocols.
#define MaxGames 12 // max number of concurrently playable games to allow.
#define SESSION_JOINDISABLED 1
@ -91,7 +88,7 @@ typedef struct {
// all the luvly Netplay info....
typedef struct {
GAMESTRUCT games[MaxGames]; // the collection of games
PLAYER players[MaxNumberOfPlayers]; // the array of players.
PLAYER players[MAX_PLAYERS]; // the array of players.
uint32_t playercount; // number of players in game.
uint32_t dpidPlayer; // ID of player created

View File

@ -26,16 +26,9 @@
#ifndef _deliverance_h
#define _deliverance_h
#define MAX_PLAYERS 8 /*Utterly arbitrary at the moment!! */
/* TC said I could do this - GJ */
#define MAX_NAME_SIZE 60
#define MAX_STR_SIZE 20
#define MAX_STR_LENGTH 256
//used to flag for some script code whilst work in progress
#define SCRIPTS
#endif

View File

@ -4338,9 +4338,7 @@ void intProcessDesign(UDWORD id)
/* save template if valid */
if (saveTemplate())
{
#ifdef SCRIPTS
eventFireCallbackTrigger((TRIGGER_TYPE)CALL_DROIDDESIGNED);
#endif
}
switch ( desCompMode )

View File

@ -553,7 +553,7 @@ static bool serializeNetPlay(PHYSFS_file* fileHandle, const NETPLAY* serializeNe
return false;
}
for (i = 0; i < MaxNumberOfPlayers; ++i)
for (i = 0; i < MAX_PLAYERS; ++i)
{
if (!serializePlayer(fileHandle, &serializeNetPlay->players[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);

View File

@ -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 */

View File

@ -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

View File

@ -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