82 changes: 41 additions & 41 deletions src/hci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ static std::vector<Vector2i> asJumpPos;
/* Function Prototypes */
static bool intUpdateObject(BASE_OBJECT *psObjects, BASE_OBJECT *psSelected, bool bForceStats);
/* Remove the object widgets from the widget screen */
void intRemoveObject(void);
static void intRemoveObjectNoAnim(void);
void intRemoveObject();
static void intRemoveObjectNoAnim();
/* Process the object widgets */
static void intProcessObject(UDWORD id);
/* Get the object refered to by a button ID on the object screen.
Expand Down Expand Up @@ -336,7 +336,7 @@ static bool intAddCommand(DROID *psSelected);
/* Start looking for a structure location */
static void intStartStructPosition(BASE_STATS *psStats);
/* Stop looking for a structure location */
static void intStopStructPosition(void);
static void intStopStructPosition();

static STRUCTURE *CurrentStruct = nullptr;
static SWORD CurrentStructType = 0;
Expand All @@ -346,9 +346,9 @@ static DROID_TYPE CurrentDroidType = DROID_ANY;
/******************Power Bar Stuff!**************/

/* Set the shadow for the PowerBar */
static void intRunPower(void);
static void intRunPower();

static void intRunStats(void);
static void intRunStats();

/*Deals with the RMB click for the stats screen */
static void intStatsRMBPressed(UDWORD id);
Expand All @@ -365,7 +365,7 @@ static void processProximityButtons(UDWORD id);
static DROID *intCheckForDroid(UDWORD droidType);
static STRUCTURE *intCheckForStructure(UDWORD structType);

static void intCheckReticuleButtons(void);
static void intCheckReticuleButtons();

// count the number of selected droids of a type
static SDWORD intNumSelectedDroids(UDWORD droidType);
Expand Down Expand Up @@ -491,7 +491,7 @@ void setReticuleBut(int ButId)
}

/* Initialise the in game interface */
bool intInitialise(void)
bool intInitialise()
{
for (int i = 0; i < NUMRETBUTS; i++)
{
Expand Down Expand Up @@ -574,7 +574,7 @@ bool intInitialise(void)


//initialise all the previous obj - particularly useful for when go Off world!
void intResetPreviousObj(void)
void intResetPreviousObj()
{
//make sure stats screen doesn't think it should be up
StatsUp = false;
Expand All @@ -584,7 +584,7 @@ void intResetPreviousObj(void)


/* Shut down the in game interface */
void interfaceShutDown(void)
void interfaceShutDown()
{
delete psWScreen;
psWScreen = nullptr;
Expand Down Expand Up @@ -617,19 +617,19 @@ static bool IntRefreshPending = false;

// Set widget refresh pending flag.
//
void intRefreshScreen(void)
void intRefreshScreen()
{
IntRefreshPending = true;
}

bool intIsRefreshing(void)
bool intIsRefreshing()
{
return Refreshing;
}


// see if a delivery point is selected
static FLAG_POSITION *intFindSelectedDelivPoint(void)
static FLAG_POSITION *intFindSelectedDelivPoint()
{
FLAG_POSITION *psFlagPos;

Expand All @@ -647,7 +647,7 @@ static FLAG_POSITION *intFindSelectedDelivPoint(void)

// Refresh widgets once per game cycle if pending flag is set.
//
static void intDoScreenRefresh(void)
static void intDoScreenRefresh()
{
UWORD objMajor = 0, statMajor = 0;
FLAG_POSITION *psFlag;
Expand Down Expand Up @@ -1042,7 +1042,7 @@ void hciUpdate()
}

/* Run the widgets for the in game interface */
INT_RETVAL intRunWidgets(void)
INT_RETVAL intRunWidgets()
{
bool quitting = false;
UDWORD structX, structY, structX2, structY2;
Expand Down Expand Up @@ -1579,7 +1579,7 @@ INT_RETVAL intRunWidgets(void)
}

/* Set the shadow for the PowerBar */
static void intRunPower(void)
static void intRunPower()
{
UDWORD statID;
BASE_STATS *psStat;
Expand Down Expand Up @@ -1629,7 +1629,7 @@ static void intRunPower(void)


// Process stats screen.
static void intRunStats(void)
static void intRunStats()
{
BASE_OBJECT *psOwner;
STRUCTURE *psStruct;
Expand Down Expand Up @@ -2338,7 +2338,7 @@ static void intStartStructPosition(BASE_STATS *psStats)


/* Stop looking for a structure location */
static void intStopStructPosition(void)
static void intStopStructPosition()
{
/* Check there is still a struct position running */
if ((intMode == INT_OBJECT || intMode == INT_STAT) && objMode == IOBJ_BUILDSEL)
Expand All @@ -2351,7 +2351,7 @@ static void intStopStructPosition(void)


/* Display the widgets for the in game interface */
void intDisplayWidgets(void)
void intDisplayWidgets()
{
if (ReticuleUp && !bInTutorial)
{
Expand Down Expand Up @@ -2485,25 +2485,25 @@ void intBuildStarted(DROID *psDroid)
}

/* Are we in build select mode*/
bool intBuildSelectMode(void)
bool intBuildSelectMode()
{
return (objMode == IOBJ_BUILDSEL);
}

/* Are we in demolish select mode*/
bool intDemolishSelectMode(void)
bool intDemolishSelectMode()
{
return (objMode == IOBJ_DEMOLISHSEL);
}

//is the build interface up?
bool intBuildMode(void)
bool intBuildMode()
{
return (objMode == IOBJ_BUILD);
}

//Written to allow demolish order to be added to the queuing system
void intDemolishCancel(void)
void intDemolishCancel()
{
if (objMode == IOBJ_DEMOLISHSEL)
{
Expand All @@ -2513,7 +2513,7 @@ void intDemolishCancel(void)


//reorder the research facilities so that first built is first in the list
static void orderResearch(void)
static void orderResearch()
{
std::reverse(apsObjectList.begin(), apsObjectList.end()); // Why reverse this list, instead of sorting it?
}
Expand All @@ -2525,7 +2525,7 @@ static inline bool sortObjectByIdFunction(BASE_OBJECT *a, BASE_OBJECT *b)
}

// reorder the commanders
static void orderDroids(void)
static void orderDroids()
{
// bubble sort on the ID - first built will always be first in the list
std::sort(apsObjectList.begin(), apsObjectList.end(), sortObjectByIdFunction); // Why sort this list, instead of reversing it?
Expand All @@ -2549,14 +2549,14 @@ static inline bool sortFactoryByTypeFunction(BASE_OBJECT *a, BASE_OBJECT *b)

/*puts the selected players factories in order - Standard factories 1-5, then
cyborg factories 1-5 and then Vtol factories 1-5*/
static void orderFactories(void)
static void orderFactories()
{
std::sort(apsObjectList.begin(), apsObjectList.end(), sortFactoryByTypeFunction);
}


/** Order the objects in the bottom bar according to their type. */
static void orderObjectInterface(void)
static void orderObjectInterface()
{
if (apsObjectList.empty())
{
Expand Down Expand Up @@ -2674,7 +2674,7 @@ bool intAddReticule()
return true;
}

void intRemoveReticule(void)
void intRemoveReticule()
{
if (ReticuleUp == true)
{
Expand All @@ -2684,7 +2684,7 @@ void intRemoveReticule(void)
}

//toggles the Power Bar display on and off
void togglePowerBar(void)
void togglePowerBar()
{
//toggle the flag
powerBarUp = !powerBarUp;
Expand Down Expand Up @@ -3278,7 +3278,7 @@ static bool intUpdateObject(BASE_OBJECT *psObjects, BASE_OBJECT *psSelected, boo
}

/* Remove the build widgets from the widget screen */
void intRemoveObject(void)
void intRemoveObject()
{
widgDelete(psWScreen, IDOBJ_TABFORM);
widgDelete(psWScreen, IDOBJ_CLOSE);
Expand All @@ -3301,7 +3301,7 @@ void intRemoveObject(void)


/* Remove the build widgets from the widget screen */
static void intRemoveObjectNoAnim(void)
static void intRemoveObjectNoAnim()
{
widgDelete(psWScreen, IDOBJ_TABFORM);
widgDelete(psWScreen, IDOBJ_CLOSE);
Expand All @@ -3312,7 +3312,7 @@ static void intRemoveObjectNoAnim(void)


/* Remove the stats widgets from the widget screen */
void intRemoveStats(void)
void intRemoveStats()
{
widgDelete(psWScreen, IDSTAT_CLOSE);
widgDelete(psWScreen, IDSTAT_TABFORM);
Expand All @@ -3330,7 +3330,7 @@ void intRemoveStats(void)


/* Remove the stats widgets from the widget screen */
void intRemoveStatsNoAnim(void)
void intRemoveStatsNoAnim()
{
widgDelete(psWScreen, IDSTAT_CLOSE);
widgDelete(psWScreen, IDSTAT_TABFORM);
Expand Down Expand Up @@ -4251,7 +4251,7 @@ static void intObjStatRMBPressed(UDWORD id)


//sets up the Intelligence Screen as far as the interface is concerned
void addIntelScreen(void)
void addIntelScreen()
{
bool radOnScreen;

Expand Down Expand Up @@ -4296,7 +4296,7 @@ void addTransporterInterface(DROID *psSelected, bool onMission)
}

/*sets which list of structures to use for the interface*/
STRUCTURE *interfaceStructList(void)
STRUCTURE *interfaceStructList()
{
if (offWorldKeepLists)
{
Expand Down Expand Up @@ -4332,7 +4332,7 @@ void stopReticuleButtonFlash(UDWORD buttonID)
}

//displays the Power Bar
void intShowPowerBar(void)
void intShowPowerBar()
{
//if its not already on display
if (widgGetFromID(psWScreen, IDPOW_POWERBAR_T))
Expand All @@ -4342,7 +4342,7 @@ void intShowPowerBar(void)
}

//hides the power bar from the display - regardless of what player requested!
void forceHidePowerBar(void)
void forceHidePowerBar()
{
if (widgGetFromID(psWScreen, IDPOW_POWERBAR_T))
{
Expand Down Expand Up @@ -4518,7 +4518,7 @@ static SDWORD intNumSelectedDroids(UDWORD droidType)
// Check that each reticule button has the structure or droid required for it and
// enable/disable accordingly.
//
void intCheckReticuleButtons(void)
void intCheckReticuleButtons()
{
STRUCTURE *psStruct;
DROID *psDroid;
Expand Down Expand Up @@ -4734,7 +4734,7 @@ static STRUCTURE *intGotoNextStructureType(UDWORD structType)

// Find any structure. Returns NULL if none found.
//
STRUCTURE *intFindAStructure(void)
STRUCTURE *intFindAStructure()
{
STRUCTURE *Struct;

Expand Down Expand Up @@ -4837,7 +4837,7 @@ DROID *intGotoNextDroidType(DROID *CurrDroid, DROID_TYPE droidType, bool AllowGr
}

//access function for selected object in the interface
BASE_OBJECT *getCurrentSelected(void)
BASE_OBJECT *getCurrentSelected()
{
return psObjSelected;
}
Expand Down Expand Up @@ -4917,13 +4917,13 @@ void chatDialog(int mode)
}

// If chat dialog is up
bool isChatUp(void)
bool isChatUp()
{
return ChatDialogUp;
}

// Helper call to see if we have builder/research/... window up or not.
bool isSecondaryWindowUp(void)
bool isSecondaryWindowUp()
{
return SecondaryWindowUp;
}
80 changes: 40 additions & 40 deletions src/hci.h
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,13 @@ extern std::list<DROID_TEMPLATE> localTemplates; ///< Unsynchronised list,
extern iIMDShape *pNewDesignIMD;

/* Initialise the in game interface */
extern bool intInitialise(void);
bool intInitialise();

// Check of coordinate is in the build menu
extern bool CoordInBuild(int x, int y);
bool CoordInBuild(int x, int y);

/* Shut down the in game interface */
extern void interfaceShutDown(void);
void interfaceShutDown();

/* Return codes for the widget interface */
enum INT_RETVAL
Expand All @@ -275,10 +275,10 @@ enum INT_RETVAL
void hciUpdate();

/* Run the widgets for the in game interface */
extern INT_RETVAL intRunWidgets(void);
INT_RETVAL intRunWidgets();

/* Display the widgets for the in game interface */
extern void intDisplayWidgets(void);
void intDisplayWidgets();

/* Add the reticule widgets to the widget screen */
bool intAddReticule();
Expand All @@ -287,84 +287,84 @@ void intRemoveReticule();
void setReticuleStats(int ButId, QString tip, QString filename, QString filenameDown);

/* Set the map view point to the world coordinates x,y */
extern void intSetMapPos(UDWORD x, UDWORD y);
void intSetMapPos(UDWORD x, UDWORD y);

/* Set the map view point to the world coordinates x,y */
extern void intSetMapPos(UDWORD x, UDWORD y);
void intSetMapPos(UDWORD x, UDWORD y);

/* Tell the interface when an object is created
* - it may have to be added to a screen
*/
extern void intNewObj(BASE_OBJECT *psObj);
void intNewObj(BASE_OBJECT *psObj);

/* Tell the interface a construction droid has finished building */
extern void intBuildFinished(DROID *psDroid);
void intBuildFinished(DROID *psDroid);
/* Tell the interface a construction droid has started building*/
extern void intBuildStarted(DROID *psDroid);
void intBuildStarted(DROID *psDroid);
/* Tell the interface a research facility has completed a topic */
extern void intResearchFinished(STRUCTURE *psBuilding);
void intResearchFinished(STRUCTURE *psBuilding);
void intAlliedResearchChanged();
/* Tell the interface a factory has completed building ALL droids */
extern void intManufactureFinished(STRUCTURE *psBuilding);
extern void intUpdateManufacture(STRUCTURE *psBuilding);
void intManufactureFinished(STRUCTURE *psBuilding);
void intUpdateManufacture(STRUCTURE *psBuilding);

/* Sync the interface to an object */
extern void intObjectSelected(BASE_OBJECT *psObj);
void intObjectSelected(BASE_OBJECT *psObj);

// add the construction interface if a constructor droid is selected
extern void intConstructorSelected(DROID *psDroid);
extern bool intBuildSelectMode(void);
extern bool intDemolishSelectMode(void);
extern bool intBuildMode(void);
void intConstructorSelected(DROID *psDroid);
bool intBuildSelectMode();
bool intDemolishSelectMode();
bool intBuildMode();

// add the construction interface if a constructor droid is selected
/* add the construction interface if a constructor droid is selected */
void intCommanderSelected(DROID *psDroid);

//sets up the Intelligence Screen as far as the interface is concerned
extern void addIntelScreen(void);
void addIntelScreen();

/* Reset the widget screen to just the reticule */
extern void intResetScreen(bool NoAnim);
void intResetScreen(bool NoAnim);

/* Refresh icons on the interface, without disturbing the layout. i.e. smartreset*/
extern void intRefreshScreen(void);
void intRefreshScreen();

/* Remove the stats widgets from the widget screen */
extern void intRemoveStats(void);
void intRemoveStats();

/* Remove the stats widgets from the widget screen */
extern void intRemoveStatsNoAnim(void);
void intRemoveStatsNoAnim();

/*sets which list of structures to use for the interface*/
extern STRUCTURE *interfaceStructList(void);
STRUCTURE *interfaceStructList();

//sets up the Transporter Screen as far as the interface is concerned
extern void addTransporterInterface(DROID *psSelected, bool onMission);
void addTransporterInterface(DROID *psSelected, bool onMission);

/*causes a reticule button to start flashing*/
extern void flashReticuleButton(UDWORD buttonID);
void flashReticuleButton(UDWORD buttonID);

// stop a reticule button flashing
extern void stopReticuleButtonFlash(UDWORD buttonID);
void stopReticuleButtonFlash(UDWORD buttonID);

//toggles the Power Bar display on and off
void togglePowerBar();
void intShowPowerBar();
void intHidePowerBar();

//hides the power bar from the display - regardless of what player requested!
extern void forceHidePowerBar(void);
void forceHidePowerBar();

/* Add the Proximity message buttons */
extern bool intAddProximityButton(PROXIMITY_DISPLAY *psProxDisp, UDWORD inc);
bool intAddProximityButton(PROXIMITY_DISPLAY *psProxDisp, UDWORD inc);

/*Remove a Proximity Button - when the message is deleted*/
extern void intRemoveProximityButton(PROXIMITY_DISPLAY *psProxDisp);
void intRemoveProximityButton(PROXIMITY_DISPLAY *psProxDisp);

/* Allows us to fool the widgets with a keypress */
void setKeyButtonMapping(UDWORD val);

STRUCTURE *intFindAStructure(void);
STRUCTURE *intFindAStructure();
DROID *intGotoNextDroidType(DROID *CurrDroid, DROID_TYPE droidType, bool AllowGroup);

/// Returns the number of researches that selectedPlayer is not already researching, or 0 if there are no free laboratories.
Expand All @@ -375,23 +375,23 @@ int intGetResearchState();
void intNotifyResearchButton(int prevState);

// see if a reticule button is enabled
extern bool intCheckReticuleButEnabled(UDWORD id);
bool intCheckReticuleButEnabled(UDWORD id);

//access function for selected object in the interface
extern BASE_OBJECT *getCurrentSelected(void);
BASE_OBJECT *getCurrentSelected();

//initialise all the previous obj - particularly useful for when go Off world!
extern void intResetPreviousObj(void);
void intResetPreviousObj();

extern bool intIsRefreshing(void);
bool intIsRefreshing();

extern void intDemolishCancel(void);
void intDemolishCancel();

StateButton *makeObsoleteButton(WIDGET *parent); ///< Makes a button to toggle showing obsolete items.

extern void chatDialog(int mode);
extern bool isChatUp(void);
extern bool isSecondaryWindowUp(void);
void chatDialog(int mode);
bool isChatUp();
bool isSecondaryWindowUp();

void intOpenDebugMenu(OBJECT_TYPE id);

Expand Down
12 changes: 6 additions & 6 deletions src/ingameop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static bool addIGTextButton(UDWORD id, UWORD x, UWORD y, UWORD width, const char
return true;
}

static bool addQuitOptions(void)
static bool addQuitOptions()
{
// get rid of the old stuff.
delete widgGetFromID(psWScreen, INTINGAMEOP);
Expand Down Expand Up @@ -116,7 +116,7 @@ static bool addQuitOptions(void)
}


static bool addSlideOptions(void)
static bool addSlideOptions()
{
delete widgGetFromID(psWScreen, INTINGAMEOP); // get rid of the old stuff.

Expand Down Expand Up @@ -164,7 +164,7 @@ static bool addSlideOptions(void)

// ////////////////////////////////////////////////////////////////////////////

static bool _intAddInGameOptions(void)
static bool _intAddInGameOptions()
{
audio_StopAll();

Expand Down Expand Up @@ -235,7 +235,7 @@ static bool _intAddInGameOptions(void)
}


bool intAddInGameOptions(void)
bool intAddInGameOptions()
{
sliderEnableDrag(true);
return _intAddInGameOptions();
Expand All @@ -244,7 +244,7 @@ bool intAddInGameOptions(void)
//
// Quick hack to throw up a ingame 'popup' for when the host drops connection.
//
void intAddInGamePopup(void)
void intAddInGamePopup()
{
//clear out any mission widgets - timers etc that may be on the screen
clearMissionWidgets();
Expand Down Expand Up @@ -304,7 +304,7 @@ void intAddInGamePopup(void)

// ////////////////////////////////////////////////////////////////////////////

static void ProcessOptionFinished(void)
static void ProcessOptionFinished()
{
intMode = INT_NORMAL;

Expand Down
12 changes: 6 additions & 6 deletions src/ingameop.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
#define __INCLUDED_SRC_INGAMEOP_H__

// functions
extern bool intAddInGameOptions(void);
extern bool intCloseInGameOptions(bool bPutUpLoadSave, bool bResetMissionWidgets);
extern void intCloseInGameOptionsNoAnim(bool bResetMissionWidgets);
extern bool intRunInGameOptions(void);
extern void intProcessInGameOptions(UDWORD);
extern void intAddInGamePopup(void);
bool intAddInGameOptions();
bool intCloseInGameOptions(bool bPutUpLoadSave, bool bResetMissionWidgets);
void intCloseInGameOptionsNoAnim(bool bResetMissionWidgets);
bool intRunInGameOptions();
void intProcessInGameOptions(UDWORD);
void intAddInGamePopup();

// status bools.
extern bool InGameOpUp;
Expand Down
24 changes: 12 additions & 12 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ static wzSearchPath *searchPathRegistry = nullptr;
// any globals and statics to there default values each time the game
// or frontend restarts.
//
static bool InitialiseGlobals(void)
static bool InitialiseGlobals()
{
frontendInitVars(); // Initialise frontend globals and statics.
statsInitVars();
Expand Down Expand Up @@ -680,7 +680,7 @@ bool buildMapList()
// ////////////////////////////////////////////////////////////////////////////
// Called once on program startup.
//
bool systemInitialise(void)
bool systemInitialise()
{
if (!widgInitialise())
{
Expand Down Expand Up @@ -734,7 +734,7 @@ bool systemInitialise(void)
// ////////////////////////////////////////////////////////////////////////////
// Called once at program shutdown.
//
void systemShutdown(void)
void systemShutdown()
{
pie_ShutdownRadar();
clearLoadedMods();
Expand Down Expand Up @@ -856,7 +856,7 @@ bool frontendInitialise(const char *ResourceFile)
}


bool frontendShutdown(void)
bool frontendShutdown()
{
debug(LOG_WZ, "== Shuting down frontend ==");

Expand Down Expand Up @@ -896,7 +896,7 @@ bool frontendShutdown(void)



bool stageOneInitialise(void)
bool stageOneInitialise()
{
debug(LOG_WZ, "== stageOneInitalise ==");
wzSceneEnd("Main menu loop");
Expand Down Expand Up @@ -981,7 +981,7 @@ bool stageOneInitialise(void)
/******************************************************************************/
/* Shutdown after data is released */

bool stageOneShutDown(void)
bool stageOneShutDown()
{
debug(LOG_WZ, "== stageOneShutDown ==");

Expand Down Expand Up @@ -1045,7 +1045,7 @@ bool stageOneShutDown(void)
// ////////////////////////////////////////////////////////////////////////////
// Initialise after the base data is loaded but before final level data is loaded

bool stageTwoInitialise(void)
bool stageTwoInitialise()
{
int i;

Expand Down Expand Up @@ -1131,7 +1131,7 @@ bool stageTwoInitialise(void)
// ////////////////////////////////////////////////////////////////////////////
// Free up after level specific data has been released but before base data is released
//
bool stageTwoShutDown(void)
bool stageTwoShutDown()
{
debug(LOG_WZ, "== stageTwoShutDown ==");

Expand Down Expand Up @@ -1173,7 +1173,7 @@ bool stageTwoShutDown(void)
return true;
}

bool stageThreeInitialise(void)
bool stageThreeInitialise()
{
STRUCTURE *psStr;
UDWORD i;
Expand Down Expand Up @@ -1283,7 +1283,7 @@ bool stageThreeInitialise(void)
/*****************************************************************************/
/* Shutdown before any data is released */

bool stageThreeShutDown(void)
bool stageThreeShutDown()
{
debug(LOG_WZ, "== stageThreeShutDown ==");

Expand Down Expand Up @@ -1340,7 +1340,7 @@ bool stageThreeShutDown(void)
}

// Reset the game between campaigns
bool campaignReset(void)
bool campaignReset()
{
debug(LOG_MAIN, "campaignReset");
gwShutDown();
Expand All @@ -1354,7 +1354,7 @@ bool campaignReset(void)
}

// Reset the game when loading a save game
bool saveGameReset(void)
bool saveGameReset()
{
debug(LOG_MAIN, "saveGameReset");

Expand Down
26 changes: 13 additions & 13 deletions src/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ struct IMAGEFILE;
#define FILE_LOAD_BUFFER_SIZE (1024*1024*4)
extern char fileLoadBuffer[];

extern bool systemInitialise(void);
extern void systemShutdown(void);
extern bool frontendInitialise(const char *ResourceFile);
extern bool frontendShutdown(void);
extern bool stageOneInitialise(void);
extern bool stageOneShutDown(void);
extern bool stageTwoInitialise(void);
extern bool stageTwoShutDown(void);
extern bool stageThreeInitialise(void);
extern bool stageThreeShutDown(void);
bool systemInitialise();
void systemShutdown();
bool frontendInitialise(const char *ResourceFile);
bool frontendShutdown();
bool stageOneInitialise();
bool stageOneShutDown();
bool stageTwoInitialise();
bool stageTwoShutDown();
bool stageThreeInitialise();
bool stageThreeShutDown();

// Reset the game between campaigns
extern bool campaignReset(void);
bool campaignReset();
// Reset the game when loading a save game
extern bool saveGameReset(void);
bool saveGameReset();

struct wzSearchPath
{
Expand All @@ -59,7 +59,7 @@ enum searchPathMode { mod_clean, mod_campaign, mod_multiplay, mod_override };
void registerSearchPath(const char path[], unsigned int priority);
bool rebuildSearchPath(searchPathMode mode, bool force, const char *current_map = NULL);

bool buildMapList(void);
bool buildMapList();
bool CheckForMod(char *theMap);

bool loadLevFile(const char *filename, searchPathMode datadir, bool ignoreWrf, char const *realFileName);
Expand Down
2 changes: 1 addition & 1 deletion src/intdisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ void intDisplayEditBox(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset)

// Initialise all the surfaces,graphics etc. used by the interface.
//
void intInitialiseGraphics(void)
void intInitialiseGraphics()
{
// Initialise any bitmaps used by the interface.
imageInitBitmaps();
Expand Down
12 changes: 6 additions & 6 deletions src/intdisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ struct ImdObject
void SetFormAudioIDs(int OpenID, int CloseID);

// Initialise interface graphics.
void intInitialiseGraphics(void);
void intInitialiseGraphics();

// callback to update the command droid size label
void intUpdateCommandSize(WIDGET *psWidget, W_CONTEXT *psContext);
Expand All @@ -112,9 +112,9 @@ void intUpdateProgressBar(WIDGET *psWidget, W_CONTEXT *psContext);

void intUpdateQuantity(WIDGET *psWidget, W_CONTEXT *psContext);
//callback to display the factory number
extern void intAddFactoryInc(WIDGET *psWidget, W_CONTEXT *psContext);
void intAddFactoryInc(WIDGET *psWidget, W_CONTEXT *psContext);
//callback to display the production quantity number for a template
extern void intAddProdQuantity(WIDGET *psWidget, W_CONTEXT *psContext);
void intAddProdQuantity(WIDGET *psWidget, W_CONTEXT *psContext);

void intDisplayPowerBar(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset);

Expand Down Expand Up @@ -267,7 +267,7 @@ void intDisplayStatsBar(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset);
void intDisplayDesignPowerBar(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset);

// Widget callback function to play an audio track.
extern void WidgetAudioCallback(int AudioID);
void WidgetAudioCallback(int AudioID);

//void intDisplayTransportButton(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset);
class IntTransportButton : public IntFancyButton
Expand All @@ -287,12 +287,12 @@ class IntTransportButton : public IntFancyButton
};

/*draws blips on radar to represent Proximity Display*/
extern void drawRadarBlips(int radarX, int radarY, float pixSizeH, float pixSizeV, const glm::mat4 &modelViewProjection);
void drawRadarBlips(int radarX, int radarY, float pixSizeH, float pixSizeV, const glm::mat4 &modelViewProjection);

/*Displays the proximity messages blips over the world*/
void intDisplayProximityBlips(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset);

extern void intUpdateQuantitySlider(WIDGET *psWidget, W_CONTEXT *psContext);
void intUpdateQuantitySlider(WIDGET *psWidget, W_CONTEXT *psContext);

void intDisplayResSubGroup(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset);

Expand Down
16 changes: 8 additions & 8 deletions src/intelmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ MESSAGE *psCurrentMsg = nullptr;


/* Add the Intelligence Map widgets to the widget screen */
bool intAddIntelMap(void)
bool intAddIntelMap()
{
bool Animate = true;

Expand Down Expand Up @@ -808,7 +808,7 @@ void intIntelButtonPressed(bool proxMsg, UDWORD id)
}


static void intCleanUpIntelMap(void)
static void intCleanUpIntelMap()
{
MESSAGE *psMessage, *psNext;

Expand Down Expand Up @@ -845,7 +845,7 @@ static void intCleanUpIntelMap(void)


/* Remove the Intelligence Map widgets from the screen */
void intRemoveIntelMap(void)
void intRemoveIntelMap()
{
//remove 3dView if still there
WIDGET *Widg = widgGetFromID(psWScreen, IDINTMAP_MSGVIEW);
Expand All @@ -872,7 +872,7 @@ void intRemoveIntelMap(void)
}

/* Remove the Intelligence Map widgets from the screen */
void intRemoveIntelMapNoAnim(void)
void intRemoveIntelMapNoAnim()
{
WIDGET *Widg;

Expand Down Expand Up @@ -1162,7 +1162,7 @@ void addVideoText(SEQ_DISPLAY *psSeqDisplay, UDWORD sequence)
}

/*sets psCurrentMsg for the Intelligence screen*/
void setCurrentMsg(void)
void setCurrentMsg()
{
MESSAGE *psMsg, *psLastMsg;

Expand All @@ -1179,7 +1179,7 @@ void setCurrentMsg(void)
}

/*sets which states need to be paused when the intelligence screen is up*/
void setIntelligencePauseState(void)
void setIntelligencePauseState()
{
if (!bMultiPlayer)
{
Expand All @@ -1199,7 +1199,7 @@ void setIntelligencePauseState(void)
}

/*resets the pause states */
void resetIntelligencePauseState(void)
void resetIntelligencePauseState()
{
if (!bMultiPlayer)
{
Expand Down Expand Up @@ -1237,7 +1237,7 @@ void displayImmediateMessage(MESSAGE *psMessage)


// return whether a message is immediate
bool messageIsImmediate(void)
bool messageIsImmediate()
{
return immediateMessage;
}
Expand Down
38 changes: 13 additions & 25 deletions src/intelmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,48 +40,36 @@
extern MESSAGE *psCurrentMsg;

/* Add the Intelligence Map widgets to the widget screen */
//extern bool intAddIntelMap(bool playCurrent);
extern bool intAddIntelMap(void);
bool intAddIntelMap();
/*Add the 3D world view for the current message */
extern bool intAddMessageView(MESSAGE *psMessage);
bool intAddMessageView(MESSAGE *psMessage);
/* Remove the Message View from the Intelligence screen */
extern void intRemoveMessageView(bool animated);
void intRemoveMessageView(bool animated);

/* Process return codes from the Intelligence Map */
extern void intProcessIntelMap(UDWORD id);
/* Process return code from the Message View for Tutorial Mode*/
//extern void intProcessMessageView(UDWORD id);

/* rotate the view so looking directly down if forward = true or
back to previous view if forward = false */
//extern void intelMapView(bool forward);
void intProcessIntelMap(UDWORD id);

/* Remove the Intelligence Map widgets from the screen */
extern void intRemoveIntelMap(void);
void intRemoveIntelMap();

/* Remove the Intelligence Map widgets from the screen without animation*/
extern void intRemoveIntelMapNoAnim(void);

//initialise the text display stats for the current message
//extern void initTextDisplay(MESSAGE *psMessage, UDWORD fontID, UWORD fontColour);

/* scroll the text message from left to right - aka tickertape messages */
//extern void scrollMessage(char *pText, UDWORD startX, UDWORD endX, UDWORD y, UDWORD gap);
void intRemoveIntelMapNoAnim();

/*sets psCurrentMsg for the Intelligence screen*/
extern void setCurrentMsg(void);
void setCurrentMsg();

/*sets which states need to be paused when the intelligence screen is up*/
extern void setIntelligencePauseState(void);
void setIntelligencePauseState();
/*resets the pause states */
extern void resetIntelligencePauseState(void);
void resetIntelligencePauseState();

// tell the intelligence screen to play this message immediately
extern void displayImmediateMessage(MESSAGE *psMessage);
void displayImmediateMessage(MESSAGE *psMessage);

// return whether a message is immediate
extern bool messageIsImmediate(void);
bool messageIsImmediate();

/*sets the flag*/
extern void setMessageImmediate(bool state);
void setMessageImmediate(bool state);

#endif // __INCLUDED_SRC_INTELMAP_H__
2 changes: 1 addition & 1 deletion src/intimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ IMAGEFRAME FrameRadar =

// Read bitmaps used by the interface.
//
bool imageInitBitmaps(void)
bool imageInitBitmaps()
{
IntImages = (IMAGEFILE *)resGetData("IMG", "intfac.img");

Expand Down
2 changes: 1 addition & 1 deletion src/intimage.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class IntListTabWidget : public ListTabWidget

extern IMAGEFILE *IntImages; //< All the 2d graphics for the user interface.

bool imageInitBitmaps(void);
bool imageInitBitmaps();

/** Draws a transparent window. */
void RenderWindowFrame(FRAMETYPE frame, uint32_t x, uint32_t y, uint32_t Width, uint32_t Heig, const glm::mat4 &modelViewProjection = glm::mat4());
Expand Down
16 changes: 8 additions & 8 deletions src/intorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ bool OrderUp = false;
// Build a list of currently selected droids.
// Returns true if droids were selected.
//
static bool BuildSelectedDroidList(void)
static bool BuildSelectedDroidList()
{
DROID *psDroid;

Expand All @@ -361,7 +361,7 @@ static bool BuildSelectedDroidList(void)

// Build a list of orders available for the selected group of droids.
//
static std::vector<AVORDER> buildDroidOrderList(void)
static std::vector<AVORDER> buildDroidOrderList()
{
std::set<AVORDER> orders;

Expand Down Expand Up @@ -782,7 +782,7 @@ bool intAddOrder(BASE_OBJECT *psObj)
// Any droids that die now get set to NULL - John.
// No droids being selected no longer removes the screen,
// this lets the screen work with command droids - John.
void intRunOrder(void)
void intRunOrder()
{
// Check to see if there all dead or unselected.
for (unsigned i = 0; i < SelectedDroids.size(); i++)
Expand Down Expand Up @@ -989,7 +989,7 @@ void intProcessOrder(UDWORD id)


// check whether the order list has changed
static bool CheckObjectOrderList(void)
static bool CheckObjectOrderList()
{
std::vector<AVORDER> NewAvailableOrders;

Expand All @@ -1006,7 +1006,7 @@ static bool CheckObjectOrderList(void)
return NewAvailableOrders == AvailableOrders;
}

static bool intRefreshOrderButtons(void)
static bool intRefreshOrderButtons()
{
SECONDARY_STATE State;
UWORD OrdIndex;
Expand Down Expand Up @@ -1060,7 +1060,7 @@ static bool intRefreshOrderButtons(void)

// Call to refresh the Order screen, ie when a droids boards it.
//
bool intRefreshOrder(void)
bool intRefreshOrder()
{
// Is the Order screen up?
if ((intMode == INT_ORDER) &&
Expand Down Expand Up @@ -1104,7 +1104,7 @@ bool intRefreshOrder(void)

// Remove the droids order screen with animation.
//
void intRemoveOrder(void)
void intRemoveOrder()
{
widgDelete(psWScreen, IDORDER_CLOSE);

Expand All @@ -1122,7 +1122,7 @@ void intRemoveOrder(void)

// Remove the droids order screen without animation.
//
void intRemoveOrderNoAnim(void)
void intRemoveOrderNoAnim()
{
widgDelete(psWScreen, IDORDER_CLOSE);
widgDelete(psWScreen, IDORDER_FORM);
Expand Down
8 changes: 4 additions & 4 deletions src/intorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
extern bool OrderUp;

bool intAddOrder(BASE_OBJECT *psObj); // create and open order form
void intRunOrder(void);
void intRunOrder();
void intProcessOrder(UDWORD id);
void intRemoveOrder(void);
void intRemoveOrderNoAnim(void);
bool intRefreshOrder(void);
void intRemoveOrder();
void intRemoveOrderNoAnim();
bool intRefreshOrder();

//new function added to bring up the RMB order form for Factories as well as droids
void intAddFactoryOrder(STRUCTURE *psStructure);
Expand Down
286 changes: 143 additions & 143 deletions src/keybind.cpp

Large diffs are not rendered by default.

387 changes: 194 additions & 193 deletions src/keybind.h

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/keyedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ static bool pushedKeyCombo(KEY_CODE subkey)
}

// ////////////////////////////////////////////////////////////////////////////
static KEY_CODE scanKeyBoardForBinding(void)
static KEY_CODE scanKeyBoardForBinding()
{
UDWORD i;
for (i = 0; i < KEY_MAXSCAN; i++)
Expand All @@ -180,7 +180,7 @@ static KEY_CODE scanKeyBoardForBinding(void)
}

// ////////////////////////////////////////////////////////////////////////////
bool runKeyMapEditor(void)
bool runKeyMapEditor()
{
WidgetTriggers const &triggers = widgRunScreen(psWScreen);
unsigned id = triggers.empty() ? 0 : triggers.front().widget->id; // Just use first click here, since the next click could be on another menu.
Expand Down Expand Up @@ -357,7 +357,7 @@ bool startKeyMapEditor(bool first)
// ////////////////////////////////////////////////////////////////////////////
// save current keymaps to registry
// FIXME: Use the endian-safe physfs functions.
bool saveKeyMap(void)
bool saveKeyMap()
{
KEY_MAPPING *psMapping;
SDWORD count;
Expand Down Expand Up @@ -426,7 +426,7 @@ bool saveKeyMap(void)

// ////////////////////////////////////////////////////////////////////////////
// load keymaps from registry.
bool loadKeyMap(void)
bool loadKeyMap()
{
KEY_STATUS status;
KEY_CODE metaCode;
Expand Down
6 changes: 3 additions & 3 deletions src/keyedit.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
#ifndef __INCLUDED_SRC_KEYEDIT_H__
#define __INCLUDED_SRC_KEYEDIT_H__

bool runKeyMapEditor(void);
bool runKeyMapEditor();
bool startKeyMapEditor(bool first);
bool saveKeyMap(void);
bool loadKeyMap(void);
bool saveKeyMap();
bool loadKeyMap();

#endif // __INCLUDED_SRC_KEYEDIT_H__
24 changes: 11 additions & 13 deletions src/keymap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,12 @@ UDWORD numActiveMappings;
static KEY_CODE lastMetaKey, lastSubKey;
static bool bKeyProcessing = true;

static void kf_NOOP(void) {}
static void kf_NOOP() {}

// ----------------------------------------------------------------------------------
// Adding a mapped function ? add a save pointer! Thank AlexL.
// don't bugger around with the order either. new ones go at the end! DEBUG in debug section..

//typedef void (*_keymapsave)(void);
_keymapsave keyMapSaveTable[] =
{
kf_ChooseManufacture,
Expand Down Expand Up @@ -480,8 +479,7 @@ void keyInitMappings(bool bForceDefaults)
// ----------------------------------------------------------------------------------
/* Adds a new mapping to the list */
//bool keyAddMapping(KEY_CODE metaCode, KEY_CODE subCode, KEY_ACTION action,void *function, char *name)
KEY_MAPPING *keyAddMapping(KEY_STATUS status, KEY_CODE metaCode, KEY_CODE subCode, KEY_ACTION action,
void (*pKeyMapFunc)(void), const char *name)
KEY_MAPPING *keyAddMapping(KEY_STATUS status, KEY_CODE metaCode, KEY_CODE subCode, KEY_ACTION action, void (*pKeyMapFunc)(), const char *name)
{
KEY_MAPPING *newMapping;

Expand Down Expand Up @@ -576,7 +574,7 @@ KEY_MAPPING *keyFindMapping(KEY_CODE metaCode, KEY_CODE subCode)

// ----------------------------------------------------------------------------------
/* clears the mappings list and frees the memory */
void keyClearMappings(void)
void keyClearMappings()
{
while (keyMappings)
{
Expand Down Expand Up @@ -645,15 +643,15 @@ bool keyRemoveMappingPt(KEY_MAPPING *psToRemove)

// ----------------------------------------------------------------------------------
/* Just returns how many are active */
UDWORD getNumMappings(void)
UDWORD getNumMappings()
{
return (numActiveMappings);
}


// ----------------------------------------------------------------------------------
/* Allows _new_ mappings to be made at runtime */
static bool checkQwertyKeys(void)
static bool checkQwertyKeys()
{
KEY_CODE qKey;
UDWORD tableEntry;
Expand Down Expand Up @@ -896,7 +894,7 @@ static void keyShowMapping(KEY_MAPPING *psMapping)

// ----------------------------------------------------------------------------------
// this function isn't really module static - should be removed - debug only
void keyShowMappings(void)
void keyShowMappings()
{
KEY_MAPPING *psMapping;

Expand All @@ -908,14 +906,14 @@ void keyShowMappings(void)

// ----------------------------------------------------------------------------------
/* Returns the key code of the last sub key pressed - allows called functions to have a simple stack */
KEY_CODE getLastSubKey(void)
KEY_CODE getLastSubKey()
{
return (lastSubKey);
}

// ----------------------------------------------------------------------------------
/* Returns the key code of the last meta key pressed - allows called functions to have a simple stack */
KEY_CODE getLastMetaKey(void)
KEY_CODE getLastMetaKey()
{
return (lastMetaKey);
}
Expand All @@ -929,7 +927,7 @@ void keyEnableProcessing(bool val)

// ----------------------------------------------------------------------------------
/* Sets all mappings to be inactive */
void keyAllMappingsInactive(void)
void keyAllMappingsInactive()
{
KEY_MAPPING *psMapping;

Expand All @@ -940,7 +938,7 @@ void keyAllMappingsInactive(void)
}

// ----------------------------------------------------------------------------------
void keyAllMappingsActive(void)
void keyAllMappingsActive()
{
KEY_MAPPING *psMapping;

Expand Down Expand Up @@ -972,7 +970,7 @@ static const KEY_CODE qwertyCodes[26] =
};

/* Returns the key code of the first ascii key that its finds has been PRESSED */
KEY_CODE getQwertyKey(void)
KEY_CODE getQwertyKey()
{
unsigned i;

Expand Down
63 changes: 29 additions & 34 deletions src/keymap.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#include "lib/framework/input.h"


enum KEY_ACTION
{
KEYMAP_DOWN,
Expand All @@ -42,7 +41,7 @@ enum KEY_STATUS

struct KEY_MAPPING
{
void (*function)(void);
void (*function)();
bool active;
KEY_STATUS status;
UDWORD lastCalled;
Expand All @@ -54,47 +53,43 @@ struct KEY_MAPPING
KEY_MAPPING *psNext;
};

extern KEY_MAPPING *keyAddMapping(KEY_STATUS status, KEY_CODE metaCode, KEY_CODE subcode,
KEY_ACTION action, void (*pKeyMapFunc)(void), const char *name);
extern bool keyRemoveMapping(KEY_CODE metaCode, KEY_CODE subCode);
extern KEY_MAPPING *keyGetMappingFromFunction(void *function);
extern bool keyRemoveMappingPt(KEY_MAPPING *psToRemove);
extern KEY_MAPPING *keyFindMapping(KEY_CODE metaCode, KEY_CODE subCode);
extern void keyClearMappings(void);
extern void keyProcessMappings(bool bExclude);
extern void keyInitMappings(bool bForceDefaults);
extern UDWORD getNumMappings(void);
extern KEY_CODE getLastSubKey(void);
extern KEY_CODE getLastMetaKey(void);
extern KEY_MAPPING *getLastMapping(void);
extern void keyEnableProcessing(bool val);
extern void keyStatusAllInactive(void);
extern void keyAllMappingsInactive(void);
extern void keyAllMappingsActive(void);
extern void keySetMappingStatus(KEY_MAPPING *psMapping, bool state);
KEY_MAPPING *keyAddMapping(KEY_STATUS status, KEY_CODE metaCode, KEY_CODE subcode, KEY_ACTION action, void (*pKeyMapFunc)(), const char *name);
bool keyRemoveMapping(KEY_CODE metaCode, KEY_CODE subCode);
KEY_MAPPING *keyGetMappingFromFunction(void *function);
bool keyRemoveMappingPt(KEY_MAPPING *psToRemove);
KEY_MAPPING *keyFindMapping(KEY_CODE metaCode, KEY_CODE subCode);
void keyClearMappings();
void keyProcessMappings(bool bExclude);
void keyInitMappings(bool bForceDefaults);
UDWORD getNumMappings();
KEY_CODE getLastSubKey();
KEY_CODE getLastMetaKey();
KEY_MAPPING *getLastMapping();
void keyEnableProcessing(bool val);
void keyStatusAllInactive();
void keyAllMappingsInactive();
void keyAllMappingsActive();
void keySetMappingStatus(KEY_MAPPING *psMapping, bool state);
void processDebugMappings(unsigned player, bool val);
bool getDebugMappingStatus();
bool getWantedDebugMappingStatus(unsigned player);
std::string getWantedDebugMappingStatuses(bool val);
extern bool keyReAssignMappingName(char *pName, KEY_CODE newMetaCode, KEY_CODE newSubCode);

extern bool keyReAssignMapping(KEY_CODE origMetaCode, KEY_CODE origSubCode,
KEY_CODE newMetaCode, KEY_CODE newSubCode);
extern KEY_MAPPING *getKeyMapFromName(char *pName);
bool keyReAssignMappingName(char *pName, KEY_CODE newMetaCode, KEY_CODE newSubCode);

bool keyReAssignMapping(KEY_CODE origMetaCode, KEY_CODE origSubCode, KEY_CODE newMetaCode, KEY_CODE newSubCode);
KEY_MAPPING *getKeyMapFromName(char *pName);

extern KEY_CODE getQwertyKey(void);
KEY_CODE getQwertyKey();

extern UDWORD getMarkerX(KEY_CODE code);
extern UDWORD getMarkerY(KEY_CODE code);
extern SDWORD getMarkerSpin(KEY_CODE code);
UDWORD getMarkerX(KEY_CODE code);
UDWORD getMarkerY(KEY_CODE code);
SDWORD getMarkerSpin(KEY_CODE code);

// for keymap editor.
typedef void (*_keymapsave)(void);
extern _keymapsave keyMapSaveTable[];
extern KEY_MAPPING *keyMappings;
typedef void (*_keymapsave)();
extern _keymapsave keyMapSaveTable[];
extern KEY_MAPPING *keyMappings;

//remove this one below
extern void keyShowMappings(void);
void keyShowMappings();

#endif // __INCLUDED_SRC_KEYMAP_H__
2 changes: 1 addition & 1 deletion src/levelint.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ extern char *pLevToken;
extern LEVEL_TYPE levVal;

// error report function for the level parser
extern void lev_error(const char *msg);
void lev_error(const char *msg);

#endif // __INCLUDED_SRC_LEVELINT_H__
20 changes: 10 additions & 10 deletions src/levels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@
#include "qtscript.h"
#include "wrappers.h"

extern int lev_get_lineno(void);
extern char *lev_get_text(void);
extern int lev_lex(void);
extern int lev_get_lineno();
extern char *lev_get_text();
extern int lev_lex();
extern void lev_set_extra(YY_EXTRA_TYPE user_defined);
extern int lev_lex_destroy(void);
extern int lev_lex_destroy();

// block ID number start for the current level data (as opposed to a dataset)
#define CURRENT_DATAID LEVEL_MAXFILES
Expand Down Expand Up @@ -97,7 +97,7 @@ enum LEVELPARSER_STATE


// initialise the level system
bool levInitialise(void)
bool levInitialise()
{
psLevels.clear();
psBaseData = nullptr;
Expand All @@ -106,13 +106,13 @@ bool levInitialise(void)
return true;
}

SDWORD getLevelLoadType(void)
SDWORD getLevelLoadType()
{
return levelLoadType;
}

// shutdown the level system
void levShutDown(void)
void levShutDown()
{
for (auto toDelete : psLevels)
{
Expand Down Expand Up @@ -482,7 +482,7 @@ bool levParse(const char *buffer, size_t size, searchPathMode datadir, bool igno


// free the data for the current mission
bool levReleaseMissionData(void)
bool levReleaseMissionData()
{
// release old data if any was loaded
if (psCurrLevel != nullptr)
Expand Down Expand Up @@ -516,7 +516,7 @@ bool levReleaseMissionData(void)


// free the currently loaded dataset
bool levReleaseAll(void)
bool levReleaseAll()
{
// clear out old effect data first
initEffectsSystem();
Expand Down Expand Up @@ -606,7 +606,7 @@ static bool levLoadSingleWRF(const char *name)
}


char *getLevelName(void)
char *getLevelName()
{
return (currentLevelName);
}
Expand Down
14 changes: 7 additions & 7 deletions src/levels.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ LEVEL_LIST enumerateMultiMaps(int camToUse, int numPlayers);
bool levParse(const char *buffer, size_t size, searchPathMode datadir, bool ignoreWrf, char const *realFileName);

// shutdown the level system
extern void levShutDown(void);
void levShutDown();

extern bool levInitialise(void);
bool levInitialise();

// load up the data for a level
bool levLoadData(char const *name, Sha256 const *hash, char *pSaveName, GAME_TYPE saveType);
Expand All @@ -94,16 +94,16 @@ Sha256 levGetFileHash(LEVEL_DATASET *level);
Sha256 levGetMapNameHash(char const *name);

// free the currently loaded dataset
extern bool levReleaseAll(void);
bool levReleaseAll();

// free the data for the current mission
extern bool levReleaseMissionData(void);
bool levReleaseMissionData();

//get the type of level currently being loaded of GTYPE type
extern SDWORD getLevelLoadType(void);
SDWORD getLevelLoadType();

extern char *getLevelName(void);
char *getLevelName();

extern void levTest(void);
void levTest();

#endif // __INCLUDED_SRC_LEVELS_H__
8 changes: 4 additions & 4 deletions src/loadsave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ static const char *sExt = ".gam";

// ////////////////////////////////////////////////////////////////////////////
// return whether the save screen was displayed in the mission results screen
bool saveInMissionRes(void)
bool saveInMissionRes()
{
return bLoadSaveMode == SAVE_MISSIONEND;
}

// ////////////////////////////////////////////////////////////////////////////
// return whether the save screen was displayed in the middle of a mission
bool saveMidMission(void)
bool saveMidMission()
{
return bLoadSaveMode == SAVE_INGAME_MISSION;
}
Expand Down Expand Up @@ -319,7 +319,7 @@ bool addLoadSave(LOADSAVE_MODE savemode, const char *title)
}

// ////////////////////////////////////////////////////////////////////////////
bool closeLoadSave(void)
bool closeLoadSave()
{
bLoadSaveUp = false;

Expand Down Expand Up @@ -554,7 +554,7 @@ bool runLoadSave(bool bResetMissionWidgets)

// ////////////////////////////////////////////////////////////////////////////
// should be done when drawing the other widgets.
bool displayLoadSave(void)
bool displayLoadSave()
{
widgDisplayScreen(psRequestScreen); // display widgets.
return true;
Expand Down
19 changes: 9 additions & 10 deletions src/loadsave.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,21 @@ extern bool bRequestLoad;
*/
/***************************************************************************/

extern void drawBlueBox(UDWORD x, UDWORD y, UDWORD w, UDWORD h);
void drawBlueBox(UDWORD x, UDWORD y, UDWORD w, UDWORD h);

extern bool addLoadSave(LOADSAVE_MODE mode, const char *title);
extern bool closeLoadSave(void);
extern bool runLoadSave(bool bResetMissionWidgets);
extern bool displayLoadSave(void);
bool addLoadSave(LOADSAVE_MODE mode, const char *title);
bool closeLoadSave();
bool runLoadSave(bool bResetMissionWidgets);
bool displayLoadSave();

extern void removeWildcards(char *pStr);
void removeWildcards(char *pStr);

// return whether the save screen was displayed in the mission results screen
bool saveInMissionRes(void);
bool saveInMissionRes();

// return whether the save screen was displayed in the middle of a mission
bool saveMidMission(void);
bool saveMidMission();


extern void deleteSaveGame(char *saveGameName);
void deleteSaveGame(char *saveGameName);

#endif // __INCLUDED_SRC_LOADSAVE_H__
28 changes: 14 additions & 14 deletions src/loop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
#include <numeric>


static void fireWaitingCallbacks(void);
static void fireWaitingCallbacks();

/*
* Global variables
Expand Down Expand Up @@ -665,7 +665,7 @@ static void gameStateUpdate()
}

/* The main game loop */
GAMECODE gameLoop(void)
GAMECODE gameLoop()
{
static uint32_t lastFlushTime = 0;

Expand Down Expand Up @@ -723,7 +723,7 @@ GAMECODE gameLoop(void)
}

/* The video playback loop */
void videoLoop(void)
void videoLoop()
{
bool videoFinished;

Expand Down Expand Up @@ -766,7 +766,7 @@ void videoLoop(void)
}


void loop_SetVideoPlaybackMode(void)
void loop_SetVideoPlaybackMode()
{
videoMode += 1;
paused = true;
Expand All @@ -780,7 +780,7 @@ void loop_SetVideoPlaybackMode(void)
}


void loop_ClearVideoPlaybackMode(void)
void loop_ClearVideoPlaybackMode()
{
videoMode -= 1;
paused = false;
Expand All @@ -793,17 +793,17 @@ void loop_ClearVideoPlaybackMode(void)
}


SDWORD loop_GetVideoMode(void)
SDWORD loop_GetVideoMode()
{
return videoMode;
}

bool loop_GetVideoStatus(void)
bool loop_GetVideoStatus()
{
return video;
}

bool gamePaused(void)
bool gamePaused()
{
return paused;
}
Expand All @@ -813,23 +813,23 @@ void setGamePauseStatus(bool val)
paused = val;
}

bool gameUpdatePaused(void)
bool gameUpdatePaused()
{
return pauseState.gameUpdatePause;
}
bool audioPaused(void)
bool audioPaused()
{
return pauseState.audioPause;
}
bool scriptPaused(void)
bool scriptPaused()
{
return pauseState.scriptPause;
}
bool scrollPaused(void)
bool scrollPaused()
{
return pauseState.scrollPause;
}
bool consolePaused(void)
bool consolePaused()
{
return pauseState.consolePause;
}
Expand Down Expand Up @@ -906,7 +906,7 @@ void incNumConstructorDroids(UDWORD player)
}

/* Fire waiting beacon messages which we couldn't run before */
static void fireWaitingCallbacks(void)
static void fireWaitingCallbacks()
{
bool bOK = true;

Expand Down
50 changes: 25 additions & 25 deletions src/loop.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,38 +57,38 @@ extern unsigned int loopPieCount;
extern unsigned int loopPolyCount;
extern unsigned int loopStateChanges;

extern GAMECODE gameLoop(void);
extern void videoLoop(void);
extern void loop_SetVideoPlaybackMode(void);
extern void loop_ClearVideoPlaybackMode(void);
extern bool loop_GetVideoStatus(void);
extern SDWORD loop_GetVideoMode(void);
extern bool gamePaused(void);
extern void setGamePauseStatus(bool val);
extern void loopFastExit(void);
GAMECODE gameLoop();
void videoLoop();
void loop_SetVideoPlaybackMode();
void loop_ClearVideoPlaybackMode();
bool loop_GetVideoStatus();
SDWORD loop_GetVideoMode();
bool gamePaused();
void setGamePauseStatus(bool val);
void loopFastExit();

extern bool gameUpdatePaused(void);
extern bool audioPaused(void);
extern bool scriptPaused(void);
extern bool scrollPaused(void);
extern bool consolePaused(void);
bool gameUpdatePaused();
bool audioPaused();
bool scriptPaused();
bool scrollPaused();
bool consolePaused();

extern void setGameUpdatePause(bool state);
extern void setAudioPause(bool state);
extern void setScriptPause(bool state);
extern void setScrollPause(bool state);
extern void setConsolePause(bool state);
void setGameUpdatePause(bool state);
void setAudioPause(bool state);
void setScriptPause(bool state);
void setScrollPause(bool state);
void setConsolePause(bool state);
//set all the pause states to the state value
extern void setAllPauseStates(bool state);
void setAllPauseStates(bool state);

// Number of units in the current list.
extern UDWORD getNumDroids(UDWORD player);
UDWORD getNumDroids(UDWORD player);
// Number of units on transporters.
extern UDWORD getNumTransporterDroids(UDWORD player);
UDWORD getNumTransporterDroids(UDWORD player);
// Number of units in the mission list.
extern UDWORD getNumMissionDroids(UDWORD player);
UDWORD getNumCommandDroids(UDWORD player);
UDWORD getNumConstructorDroids(UDWORD player);
UDWORD getNumMissionDroids(UDWORD player);
UDWORD getNumCommandDroids(UDWORD player);
UDWORD getNumConstructorDroids(UDWORD player);
// increase the droid counts - used by update factory to keep the counts in sync
void incNumDroids(UDWORD player);
void incNumCommandDroids(UDWORD player);
Expand Down
24 changes: 12 additions & 12 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ static void getPlatformUserDir(char *const tmpstr, size_t const size)
}


static void initialize_ConfigDir(void)
static void initialize_ConfigDir()
{
char tmpstr[PATH_MAX] = { '\0' };

Expand Down Expand Up @@ -330,7 +330,7 @@ static void initialize_PhysicsFS(const char *argv_0)
}
}

static void check_Physfs(void)
static void check_Physfs()
{
const PHYSFS_ArchiveInfo **i;
bool zipfound = false;
Expand Down Expand Up @@ -384,7 +384,7 @@ static void check_Physfs(void)
*
* \sa rebuildSearchPath
*/
static void scanDataDirs(void)
static void scanDataDirs()
{
char tmpstr[PATH_MAX], prefix[PATH_MAX];
char *separator;
Expand Down Expand Up @@ -526,7 +526,7 @@ static void make_dir(char *dest, const char *dirname, const char *subdir)
* Preparations before entering the title (mainmenu) loop
* Would start the timer in an event based mainloop
*/
static void startTitleLoop(void)
static void startTitleLoop()
{
SetGameMode(GS_TITLE_SCREEN);

Expand All @@ -544,7 +544,7 @@ static void startTitleLoop(void)
* Shutdown/cleanup after the title (mainmenu) loop
* Would stop the timer
*/
static void stopTitleLoop(void)
static void stopTitleLoop()
{
if (!frontendShutdown())
{
Expand All @@ -558,7 +558,7 @@ static void stopTitleLoop(void)
* Preparations before entering the game loop
* Would start the timer in an event based mainloop
*/
static void startGameLoop(void)
static void startGameLoop()
{
SetGameMode(GS_NORMAL);

Expand Down Expand Up @@ -597,7 +597,7 @@ static void startGameLoop(void)
* Shutdown/cleanup after the game loop
* Would stop the timer
*/
static void stopGameLoop(void)
static void stopGameLoop()
{
if (gameLoopStatus != GAMECODE_NEWLEVEL)
{
Expand Down Expand Up @@ -629,7 +629,7 @@ static void stopGameLoop(void)
* Load a savegame and start into the game loop
* Game data should be initialised afterwards, so that startGameLoop is not necessary anymore.
*/
static bool initSaveGameLoad(void)
static bool initSaveGameLoad()
{
// NOTE: always setGameMode correctly before *any* loading routines!
SetGameMode(GS_NORMAL);
Expand Down Expand Up @@ -669,7 +669,7 @@ static bool initSaveGameLoad(void)
/*!
* Run the code inside the gameloop
*/
static void runGameLoop(void)
static void runGameLoop()
{
gameLoopStatus = gameLoop();
switch (gameLoopStatus)
Expand Down Expand Up @@ -706,7 +706,7 @@ static void runGameLoop(void)
/*!
* Run the code inside the titleloop
*/
static void runTitleLoop(void)
static void runTitleLoop()
{
switch (titleLoop())
{
Expand Down Expand Up @@ -757,7 +757,7 @@ static void runTitleLoop(void)
* The mainloop.
* Fetches events, executes appropriate code
*/
void mainLoop(void)
void mainLoop()
{
frameUpdate(); // General housekeeping

Expand Down Expand Up @@ -1119,7 +1119,7 @@ int realmain(int argc, char *argv[])
/*!
* Get the mode the game is currently in
*/
GS_GAMEMODE GetGameMode(void)
GS_GAMEMODE GetGameMode()
{
return gameStatus;
}
Expand Down
7 changes: 4 additions & 3 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ enum GS_GAMEMODE
//flag to indicate when initialisation is complete
extern bool gameInitialised;
extern bool customDebugfile;
extern GS_GAMEMODE GetGameMode(void) WZ_DECL_PURE;
extern void SetGameMode(GS_GAMEMODE status);
extern void mainLoop(void);

GS_GAMEMODE GetGameMode() WZ_DECL_PURE;
void SetGameMode(GS_GAMEMODE status);
void mainLoop();

extern char SaveGamePath[PATH_MAX];
extern char datadir[PATH_MAX];
Expand Down
8 changes: 4 additions & 4 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ static void init_tileNames(int type)
// This is the main loading routine to get all the map's parameters set.
// Once it figures out what tileset we need, we then parse the files for that tileset.
// Currently, we only support 3 tilesets. Arizona, Urban, and Rockie
static bool mapLoadGroundTypes(void)
static bool mapLoadGroundTypes()
{
char *pFileData = nullptr;
char tilename[MAX_STR_LENGTH] = {'\0'};
Expand Down Expand Up @@ -628,7 +628,7 @@ static bool hasDecals(int i, int j)
}
// mapSetGroundTypes()
// Sets the ground type to be a decal or not
static bool mapSetGroundTypes(void)
static bool mapSetGroundTypes()
{
int i, j;

Expand Down Expand Up @@ -663,7 +663,7 @@ static bool isWaterVertex(int x, int y)
&& terrainType(mapTile(x, y - 1)) == TER_WATER && terrainType(mapTile(x - 1, y - 1)) == TER_WATER;
}

static void generateRiverbed(void)
static void generateRiverbed()
{
MersenneTwister mt(12345); // 12345 = random seed.
int maxIdx = 1, idx[MAP_MAXWIDTH][MAP_MAXHEIGHT];
Expand Down Expand Up @@ -1014,7 +1014,7 @@ bool mapSave(char **ppFileData, UDWORD *pFileSize)
}

/* Shutdown the map module */
bool mapShutdown(void)
bool mapShutdown()
{
int x;

Expand Down
24 changes: 12 additions & 12 deletions src/map.h
Original file line number Diff line number Diff line change
Expand Up @@ -411,13 +411,13 @@ static inline void clip_world_offmap(int *worldX, int *worldY)
#define map_round(coord) ((coord) & (TILE_UNITS - 1))

/* Shutdown the map module */
extern bool mapShutdown(void);
bool mapShutdown();

/* Load the map data */
extern bool mapLoad(char *filename, bool preview);
bool mapLoad(char *filename, bool preview);

/* Save the map data */
extern bool mapSave(char **ppFileData, UDWORD *pFileSize);
bool mapSave(char **ppFileData, UDWORD *pFileSize);

/** Return a pointer to the tile structure at x,y in map coordinates */
static inline WZ_DECL_PURE MAPTILE *mapTile(int32_t x, int32_t y)
Expand Down Expand Up @@ -530,7 +530,7 @@ bool map_Intersect(int *Cx, int *Cy, int *Vx, int *Vy, int *Sx, int *Sy);
unsigned map_LineIntersect(Vector3i src, Vector3i dst, unsigned tMax);

/// The max height of the terrain and water at the specified world coordinates
extern int32_t map_Height(int x, int y);
int32_t map_Height(int x, int y);

static inline int32_t map_Height(Vector2i const &v)
{
Expand All @@ -544,18 +544,18 @@ bool mapObjIsAboveGround(const SIMPLE_OBJECT *psObj);
in tile coords */
void getTileMaxMin(int x, int y, int *pMax, int *pMin);

extern bool readVisibilityData(const char *fileName);
extern bool writeVisibilityData(const char *fileName);
bool readVisibilityData(const char *fileName);
bool writeVisibilityData(const char *fileName);

//scroll min and max values
extern SDWORD scrollMinX, scrollMaxX, scrollMinY, scrollMaxY;
extern SDWORD scrollMinX, scrollMaxX, scrollMinY, scrollMaxY;

void mapFloodFillContinents(void);
void mapFloodFillContinents();

extern void mapTest(void);
void mapTest();

void tileSetFire(int32_t x, int32_t y, uint32_t duration);
extern bool fireOnLocation(unsigned int x, unsigned int y);
bool fireOnLocation(unsigned int x, unsigned int y);

/**
* Transitive sensor check for tile. Has to be here rather than
Expand All @@ -566,7 +566,7 @@ WZ_DECL_ALWAYS_INLINE static inline bool hasSensorOnTile(MAPTILE *psTile, unsign
return ((player == selectedPlayer && godMode) || (alliancebits[selectedPlayer] & (satuplinkbits | psTile->sensorBits)));
}

void mapInit(void);
void mapUpdate(void);
void mapInit();
void mapUpdate();

#endif // __INCLUDED_SRC_MAP_H__
8 changes: 4 additions & 4 deletions src/mapgrid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static PointTree::Filter *gridFiltersUnseen;
static PointTree::Filter *gridFiltersDroidsByPlayer;

// initialise the grid system
bool gridInitialise(void)
bool gridInitialise()
{
ASSERT(gridPointTree == nullptr, "gridInitialise already called, without calling gridShutDown.");
gridPointTree = new PointTree;
Expand All @@ -48,7 +48,7 @@ bool gridInitialise(void)
}

// reset the grid system
void gridReset(void)
void gridReset()
{
gridPointTree->clear();

Expand Down Expand Up @@ -82,7 +82,7 @@ void gridReset(void)
}

// shutdown the grid system
void gridShutDown(void)
void gridShutDown()
{
delete gridPointTree;
gridPointTree = nullptr;
Expand Down Expand Up @@ -200,7 +200,7 @@ GridList const &gridStartIterateUnseen(int32_t x, int32_t y, uint32_t radius, in
return gridStartIterateFiltered(x, y, radius, &gridFiltersUnseen[player], ConditionUnseen(player));
}

BASE_OBJECT **gridIterateDup(void)
BASE_OBJECT **gridIterateDup()
{
size_t bytes = gridPointTree->lastQueryResults.size() * sizeof(void *);
BASE_OBJECT **ret = (BASE_OBJECT **)malloc(bytes);
Expand Down
8 changes: 3 additions & 5 deletions src/mapgrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,18 @@
#ifndef __INCLUDED_SRC_MAPGRID_H__
#define __INCLUDED_SRC_MAPGRID_H__


typedef std::vector<BASE_OBJECT *> GridList;
typedef GridList::const_iterator GridIterator;


// initialise the grid system
extern bool gridInitialise(void);
bool gridInitialise();

// shutdown the grid system
extern void gridShutDown(void);
void gridShutDown();

// Reset the grid system. Called once per update.
// Resets seenThisTick[] to false.
extern void gridReset(void);
void gridReset();

/// Find all objects within radius.
GridList const &gridStartIterate(int32_t x, int32_t y, uint32_t radius);
Expand Down
10 changes: 5 additions & 5 deletions src/mechanics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "structure.h"

/* Shutdown the mechanics system */
bool mechanicsShutdown(void)
bool mechanicsShutdown()
{
BASE_OBJECT *psObj, *psNext;

Expand Down Expand Up @@ -76,7 +76,7 @@ bool allocComponentList(COMPONENT_TYPE type, SDWORD number)
}

// release all the component lists
void freeComponentLists(void)
void freeComponentLists()
{
UDWORD inc;

Expand Down Expand Up @@ -127,7 +127,7 @@ void freeComponentLists(void)
}

//allocate the space for the Players' structure lists
bool allocStructLists(void)
bool allocStructLists()
{
SDWORD inc, stat;

Expand All @@ -152,7 +152,7 @@ bool allocStructLists(void)


// release the structure lists
void freeStructureLists(void)
void freeStructureLists()
{
UDWORD inc;

Expand All @@ -169,7 +169,7 @@ void freeStructureLists(void)


//TEST FUNCTION - MAKE EVERYTHING AVAILABLE
void makeAllAvailable(void)
void makeAllAvailable()
{
UDWORD comp, i;

Expand Down
10 changes: 5 additions & 5 deletions src/mechanics.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@
#include "statsdef.h"

/* Shutdown the mechanics system */
bool mechanicsShutdown(void);
bool mechanicsShutdown();

// Allocate the list for a component
bool allocComponentList(COMPONENT_TYPE type, SDWORD number);

// release all the component lists
void freeComponentLists(void);
void freeComponentLists();

//allocate the space for the Players' structure lists
bool allocStructLists(void);
bool allocStructLists();

// release the structure lists
void freeStructureLists(void);
void freeStructureLists();

//TEST FUNCTION - MAKE EVERYTHING AVAILABLE
void makeAllAvailable(void);
void makeAllAvailable();

#endif // __INCLUDED_SRC_MECHANICS_H__
12 changes: 6 additions & 6 deletions src/message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ static inline void releaseAllMessages(MESSAGE *list[])
}
}

bool messageInitVars(void)
bool messageInitVars()
{
int i;

Expand All @@ -250,7 +250,7 @@ bool messageInitVars(void)
}

//allocates the viewdata heap
bool initViewData(void)
bool initViewData()
{
return true;
}
Expand Down Expand Up @@ -395,14 +395,14 @@ void removeMessage(MESSAGE *psDel, UDWORD player)
}

/* Remove all Messages*/
void freeMessages(void)
void freeMessages()
{
releaseAllProxDisp();
releaseAllMessages(apsMessages);
}

/* removes all the proximity displays */
void releaseAllProxDisp(void)
void releaseAllProxDisp()
{
UDWORD player;
PROXIMITY_DISPLAY *psCurr, *psNext;
Expand All @@ -422,7 +422,7 @@ void releaseAllProxDisp(void)
}

/* Initialise the message heaps */
bool initMessage(void)
bool initMessage()
{
//set up the imd used for proximity messages
pProximityMsgIMD = modelGet("arrow.pie");
Expand Down Expand Up @@ -759,7 +759,7 @@ VIEWDATA *getViewData(const char *pName)
}

/* Release the message heaps */
bool messageShutdown(void)
bool messageShutdown()
{
freeMessages();
return true;
Expand Down
12 changes: 6 additions & 6 deletions src/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ extern iIMDShape *pProximityMsgIMD;
extern PROXIMITY_DISPLAY *apsProxDisp[MAX_PLAYERS];

/** Allocates the viewdata heap. */
bool initViewData(void);
bool initViewData();

/** Initialise the message heaps. */
bool initMessage(void);
bool initMessage();

/** Release the message heaps. */
bool messageShutdown(void);
bool messageShutdown();

/** Add a message to the list. */
MESSAGE *addMessage(MESSAGE_TYPE msgType, bool proxPos, UDWORD player);
Expand All @@ -57,10 +57,10 @@ MESSAGE *addBeaconMessage(MESSAGE_TYPE msgType, bool proxPos, UDWORD player);
void removeMessage(MESSAGE *psDel, UDWORD player);

/** Remove all Messages. */
void freeMessages(void);
void freeMessages();

/** Removes all the proximity displays. */
void releaseAllProxDisp(void);
void releaseAllProxDisp();

/** Load the view data for the messages from the file exported from the world editor. */
const char *loadViewData(const char *pViewMsgData, UDWORD bufferSize);
Expand All @@ -79,6 +79,6 @@ MESSAGE *findMessage(MSG_VIEWDATA *pViewdata, MESSAGE_TYPE type, UDWORD player);
/** 'Displays' a proximity display. */
void displayProximityMessage(PROXIMITY_DISPLAY *psProxDisp);

bool messageInitVars(void);
bool messageInitVars();

#endif // __INCLUDED_SRC_MESSAGE_H__
6 changes: 3 additions & 3 deletions src/miscimd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ static MISC_IMD miscImds[] =

// -------------------------------------------------------------------------------
// Load up all the imds into an array
static bool multiLoadMiscImds(void)
static bool multiLoadMiscImds()
{
UDWORD i = 0;
bool bMoreToProcess = true;
Expand Down Expand Up @@ -128,7 +128,7 @@ iIMDShape *getImdFromIndex(UDWORD index)
// -------------------------------------------------------------------------------

// -------------------------------------------------------------------------------
iIMDShape *getRandomDebrisImd(void)
iIMDShape *getRandomDebrisImd()
{
iIMDShape *DebrisIMD;

Expand All @@ -155,7 +155,7 @@ static bool initMiscImd(unsigned i, unsigned n, const char *nameFormat, unsigned
return true;
}

bool initMiscImds(void)
bool initMiscImds()
{
/* Do the new loading system */
multiLoadMiscImds();
Expand Down
7 changes: 3 additions & 4 deletions src/miscimd.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#include "structuredef.h"
#include "messagedef.h"

extern bool initMiscImds(void);
extern iIMDShape *getImdFromIndex(UDWORD index);
extern iIMDShape *getRandomDebrisImd(void);
bool initMiscImds();
iIMDShape *getImdFromIndex(UDWORD index);
iIMDShape *getRandomDebrisImd();

#define MAX_DEBRIS 5
#define MAX_WRECKAGE 5
Expand Down Expand Up @@ -76,7 +76,6 @@ struct MISC_IMD
const char *pName;
};


enum
{
MI_EXPLOSION_SMALL,
Expand Down
154 changes: 77 additions & 77 deletions src/mission.cpp

Large diffs are not rendered by default.

122 changes: 61 additions & 61 deletions src/mission.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,44 +43,44 @@ extern DROID *apsLimboDroids[MAX_PLAYERS];

/** Return positions for vtols. */
extern Vector2i asVTOLReturnPos[MAX_PLAYERS];

extern bool Cheated;
extern void initMission(void);
extern bool missionShutDown(void);
extern void missionDestroyObjects(void);

void initMission();
bool missionShutDown();
void missionDestroyObjects();

/** This is called everytime the game is quit. */
extern void releaseMission(void);
void releaseMission();

/** On the PC - sets the countdown played flag. */
extern void setMissionCountDown(void);
void setMissionCountDown();

extern bool startMission(LEVEL_TYPE missionType, char *pGame);
extern void endMission(void);
bool startMission(LEVEL_TYPE missionType, char *pGame);
void endMission();

/** Initialise the mission stuff for a save game. */
extern bool startMissionSave(SDWORD missionType);
bool startMissionSave(SDWORD missionType);

/** Sets up the game to start a new mission. */
extern bool setUpMission(UDWORD type);
bool setUpMission(UDWORD type);

/** This causes the new mission data to be loaded up. */
extern void launchMission(void);
void launchMission();

/** The update routine for all droids left back at home base. Only interested in Transporters at present. */
extern void missionDroidUpdate(DROID *psDroid);
void missionDroidUpdate(DROID *psDroid);

extern bool missionIsOffworld(void);
extern bool missionCanReEnforce(void);
extern bool missionForReInforcements(void);
bool missionIsOffworld();
bool missionCanReEnforce();
bool missionForReInforcements();

/** Returns true if the mission is a Limbo Expand mission. */
extern bool missionLimboExpand(void);
bool missionLimboExpand();

/** This is called mid Limbo mission via the script. */
extern void resetLimboMission(void);
void resetLimboMission();

extern void swapMissionPointers(void);
void swapMissionPointers();

// mission results.
#define IDTIMER_FORM 11000
Expand All @@ -99,108 +99,108 @@ extern void swapMissionPointers(void);
// status of the mission result screens.
extern bool MissionResUp;

extern void intRemoveMissionResult(void);
extern void intRemoveMissionResultNoAnim(void);
extern void intProcessMissionResult(UDWORD id);
extern void intRunMissionResult(void);
void intRemoveMissionResult();
void intRemoveMissionResultNoAnim();
void intProcessMissionResult(UDWORD id);
void intRunMissionResult();

void unloadTransporter(DROID *psTransporter, UDWORD x, UDWORD y, bool goingHome);

extern void unloadTransporter(DROID *psTransporter, UDWORD x, UDWORD y,
bool goingHome);
/** Sets the appropriate pause states for when the interface is up but the game needs to be paused. */
extern void setMissionPauseState(void);
void setMissionPauseState();

/** Resets the pause states. */
extern void resetMissionPauseState(void);
void resetMissionPauseState();

/** Returns the x coord for where the Transporter can land. */
extern UWORD getLandingX(SDWORD iPlayer);
UWORD getLandingX(SDWORD iPlayer);

/** Returns the y coord for where the Transporter can land. */
extern UWORD getLandingY(SDWORD iPlayer);
UWORD getLandingY(SDWORD iPlayer);

/** Checks that the timer has been set and that a Transporter exists before adding the timer button. */
extern void addTransporterTimerInterface(void);
void addTransporterTimerInterface();

extern void intRemoveTransporterTimer(void);
void intRemoveTransporterTimer();

/** Update routine for mission details. */
extern void missionTimerUpdate(void);
void missionTimerUpdate();

/** Checks the time has been set and then adds the timer if not already on the display. */
extern void addMissionTimerInterface(void);
void addMissionTimerInterface();

extern void intRemoveMissionTimer(void);
void intRemoveMissionTimer();

//access functions for bPlayCountDown flag
extern void setPlayCountDown(UBYTE set);
extern bool getPlayCountDown(void);
void setPlayCountDown(UBYTE set);
bool getPlayCountDown();

/** Checks the x,y passed in are not within the boundary of the Landing Zone x and y in tile coords. */
extern bool withinLandingZone(UDWORD x, UDWORD y);
bool withinLandingZone(UDWORD x, UDWORD y);

//sets the coords for the Transporter to land
extern LANDING_ZONE *getLandingZone(SDWORD i);
LANDING_ZONE *getLandingZone(SDWORD i);

/** Initialises all the nogo areas to 0. */
extern void initNoGoAreas(void);
void initNoGoAreas();

/** Sets the coords for a no go area. */
extern void setNoGoArea(UBYTE x1, UBYTE y1, UBYTE x2, UBYTE y2, UBYTE area);
void setNoGoArea(UBYTE x1, UBYTE y1, UBYTE x2, UBYTE y2, UBYTE area);

/** Fly in transporters at start of level. */
extern void missionFlyTransportersIn(SDWORD iPlayer, bool bTrackTransporter);
void missionFlyTransportersIn(SDWORD iPlayer, bool bTrackTransporter);

/** Move transporter offworld. */
extern void missionMoveTransporterOffWorld(DROID *psTransporter);
void missionMoveTransporterOffWorld(DROID *psTransporter);

/** Pick nearest map edge to point. */
extern void missionGetNearestCorner(UWORD iX, UWORD iY, UWORD *piOffX, UWORD *piOffY);
void missionGetNearestCorner(UWORD iX, UWORD iY, UWORD *piOffX, UWORD *piOffY);

extern void missionSetReinforcementTime(UDWORD iTime);
extern UDWORD missionGetReinforcementTime(void);
void missionSetReinforcementTime(UDWORD iTime);
UDWORD missionGetReinforcementTime();

/** Builds a droid back at the home base whilst on a mission - stored in a list made available to the transporter interface. */
extern DROID *buildMissionDroid(DROID_TEMPLATE *psTempl, UDWORD x, UDWORD y, UDWORD player);
DROID *buildMissionDroid(DROID_TEMPLATE *psTempl, UDWORD x, UDWORD y, UDWORD player);

/** This is just a very big number - bigger than a map width/height could ever be! */
#define INVALID_XY (512 * 127)

extern void missionSetTransporterEntry(SDWORD iPlayer, SDWORD iEntryTileX, SDWORD iEntryTileY);
extern void missionSetTransporterExit(SDWORD iPlayer, SDWORD iExitTileX, SDWORD iExitTileY);
extern void missionGetTransporterEntry(SDWORD iPlayer, UWORD *iX, UWORD *iY);
extern void missionGetTransporterExit(SDWORD iPlayer, UDWORD *iX, UDWORD *iY);
void missionSetTransporterEntry(SDWORD iPlayer, SDWORD iEntryTileX, SDWORD iEntryTileY);
void missionSetTransporterExit(SDWORD iPlayer, SDWORD iExitTileX, SDWORD iExitTileY);
void missionGetTransporterEntry(SDWORD iPlayer, UWORD *iX, UWORD *iY);
void missionGetTransporterExit(SDWORD iPlayer, UDWORD *iX, UDWORD *iY);

//access functions for droidsToSafety flag
extern void setDroidsToSafetyFlag(bool set);
extern bool getDroidsToSafetyFlag(void);
void setDroidsToSafetyFlag(bool set);
bool getDroidsToSafetyFlag();

/** Checks to see if the player has any droids (except Transporters left). */
extern bool missionDroidsRemaining(UDWORD player);
bool missionDroidsRemaining(UDWORD player);

/**
* Called when a Transporter gets to the edge of the world and the droids are being flown to safety.
* The droids inside the Transporter are placed into the mission list for later use.
*/
extern void moveDroidsToSafety(DROID *psTransporter);
void moveDroidsToSafety(DROID *psTransporter);

/** Called when ESC is pressed. */
extern void clearMissionWidgets(void);
void clearMissionWidgets();

/** Resets if return to game after an ESC. */
extern void resetMissionWidgets(void);
void resetMissionWidgets();

extern UDWORD getCampaignNumber(void);
extern void setCampaignNumber(UDWORD number);
extern bool intAddMissionResult(bool result, bool bPlaySuccess);
UDWORD getCampaignNumber();
void setCampaignNumber(UDWORD number);
bool intAddMissionResult(bool result, bool bPlaySuccess);

/** Reset the vtol landing pos. */
void resetVTOLLandingPos(void);
void resetVTOLLandingPos();

/** This is called via a script function to place the Limbo droids once the mission has started. */
extern void placeLimboDroids(void);
void placeLimboDroids();

/** bCheating = true == start of cheat, bCheating = false == end of cheat. */
extern void setMissionCheatTime(bool bCheating);
void setMissionCheatTime(bool bCheating);


#define MISSIONRES_X 20 // pos & size of box.
Expand Down
4 changes: 2 additions & 2 deletions src/modding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ void removeSubdirs(const char *basedir, const char *subdir)
PHYSFS_freeList(subdirlist);
}

void printSearchPath(void)
void printSearchPath()
{
debug(LOG_WZ, "Search paths:");
char **searchPath = PHYSFS_getSearchPath();
Expand All @@ -170,7 +170,7 @@ void setOverrideMods(char *modlist)
use_override_mods = true;
}

void clearOverrideMods(void)
void clearOverrideMods()
{
override_mods.clear();
override_mod_list.clear();
Expand Down
20 changes: 10 additions & 10 deletions src/move.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,37 @@
#include "fpath.h"

/* Set a target location for a droid to move to - returns a bool based on if there is a path to the destination (true if there is a path)*/
extern bool moveDroidTo(DROID *psDroid, UDWORD x, UDWORD y, FPATH_MOVETYPE moveType = FMT_MOVE);
bool moveDroidTo(DROID *psDroid, UDWORD x, UDWORD y, FPATH_MOVETYPE moveType = FMT_MOVE);

/* Set a target location for a droid to move to - returns a bool based on if there is a path to the destination (true if there is a path)*/
// the droid will not join a formation when it gets to the location
extern bool moveDroidToNoFormation(DROID *psDroid, UDWORD x, UDWORD y, FPATH_MOVETYPE moveType = FMT_MOVE);
bool moveDroidToNoFormation(DROID *psDroid, UDWORD x, UDWORD y, FPATH_MOVETYPE moveType = FMT_MOVE);

// move a droid directly to a location (used by vtols only)
extern void moveDroidToDirect(DROID *psDroid, UDWORD x, UDWORD y);
void moveDroidToDirect(DROID *psDroid, UDWORD x, UDWORD y);

// Get a droid to turn towards a locaton
extern void moveTurnDroid(DROID *psDroid, UDWORD x, UDWORD y);
void moveTurnDroid(DROID *psDroid, UDWORD x, UDWORD y);

/* Stop a droid */
extern void moveStopDroid(DROID *psDroid);
void moveStopDroid(DROID *psDroid);

/*Stops a droid dead in its tracks - doesn't allow for any little skidding bits*/
extern void moveReallyStopDroid(DROID *psDroid);
void moveReallyStopDroid(DROID *psDroid);

/* Get a droid to do a frame's worth of moving */
extern void moveUpdateDroid(DROID *psDroid);
void moveUpdateDroid(DROID *psDroid);

SDWORD moveCalcDroidSpeed(DROID *psDroid);

/* Frame update for the movement of a tracked droid */
extern void moveUpdateTracked(DROID *psDroid);
void moveUpdateTracked(DROID *psDroid);

/* update body and turret to local slope */
extern void updateDroidOrientation(DROID *psDroid);
void updateDroidOrientation(DROID *psDroid);

/* audio callback used to kill movement sounds */
extern bool moveCheckDroidMovingAndVisible(void *psObj);
bool moveCheckDroidMovingAndVisible(void *psObj);

// set a vtol to be hovering in the air
void moveMakeVtolHover(DROID *psDroid);
Expand Down
2 changes: 1 addition & 1 deletion src/multigifts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ bool pickupArtefact(int toPlayer, int fromPlayer)
}

/* Ally team members with each other */
void createTeamAlliances(void)
void createTeamAlliances()
{
int i, j;

Expand Down
24 changes: 12 additions & 12 deletions src/multigifts.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,23 @@
#ifndef __INCLUDED_SRC_MULTIGIFTS_H__
#define __INCLUDED_SRC_MULTIGIFTS_H__

extern void requestAlliance(uint8_t from, uint8_t to, bool prop, bool allowAudio);
extern void breakAlliance(uint8_t p1, uint8_t p2, bool prop, bool allowAudio);
extern void formAlliance(uint8_t p1, uint8_t p2, bool prop, bool allowAudio, bool allowNotification);
extern void sendAlliance(uint8_t from, uint8_t to, uint8_t state, int32_t value);
extern bool recvAlliance(NETQUEUE queue, bool allowAudio); // Was declared in multirecv.h, too.
extern void createTeamAlliances(void);
void requestAlliance(uint8_t from, uint8_t to, bool prop, bool allowAudio);
void breakAlliance(uint8_t p1, uint8_t p2, bool prop, bool allowAudio);
void formAlliance(uint8_t p1, uint8_t p2, bool prop, bool allowAudio, bool allowNotification);
void sendAlliance(uint8_t from, uint8_t to, uint8_t state, int32_t value);
bool recvAlliance(NETQUEUE queue, bool allowAudio); // Was declared in multirecv.h, too.
void createTeamAlliances();

extern bool sendGift(uint8_t type, uint8_t to);
extern bool recvGift(NETQUEUE queue);
bool sendGift(uint8_t type, uint8_t to);
bool recvGift(NETQUEUE queue);

extern void technologyGiveAway(const STRUCTURE *pS);
extern void recvMultiPlayerFeature(NETQUEUE queue);
extern void sendMultiPlayerFeature(uint32_t ref, uint32_t x, uint32_t y, uint32_t id);
void technologyGiveAway(const STRUCTURE *pS);
void recvMultiPlayerFeature(NETQUEUE queue);
void sendMultiPlayerFeature(uint32_t ref, uint32_t x, uint32_t y, uint32_t id);

bool pickupArtefact(int toPlayer, int fromPlayer);
void giftPower(uint8_t from, uint8_t to, uint32_t amount, bool send);
extern void giftRadar(uint8_t from, uint8_t to, bool send);
void giftRadar(uint8_t from, uint8_t to, bool send);

#define RADAR_GIFT 1
#define DROID_GIFT 2
Expand Down
68 changes: 34 additions & 34 deletions src/multiint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,33 +178,33 @@ static void displayMultiEditBox(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset
static Image getFrontHighlightImage(Image image);

// find games
static void addGames(void);
static void removeGames(void);
static void addGames();
static void removeGames();

// password form functions
static void hidePasswordForm(void);
static void showPasswordForm(void);
static void hidePasswordForm();
static void showPasswordForm();

// Game option functions
static void addGameOptions();
static void addChatBox(bool preserveOldChat = false);
static void addConsoleBox(void);
static void disableMultiButs(void);
static void addConsoleBox();
static void disableMultiButs();
static void processMultiopWidgets(UDWORD);
static void SendFireUp(void);
static void SendFireUp();

static void decideWRF(void);
static void decideWRF();

static void closeColourChooser(void);
static void closeTeamChooser(void);
static void closePositionChooser(void);
static void closeAiChooser(void);
static void closeDifficultyChooser(void);
static void closeColourChooser();
static void closeTeamChooser();
static void closePositionChooser();
static void closeAiChooser();
static void closeDifficultyChooser();
static bool SendColourRequest(UBYTE player, UBYTE col);
static bool SendPositionRequest(UBYTE player, UBYTE chosenPlayer);
static bool safeToUseColour(UDWORD player, UDWORD col);
static bool changeReadyStatus(UBYTE player, bool bReady);
static void stopJoining(void);
static void stopJoining();
static int difficultyIcon(int difficulty);
// ////////////////////////////////////////////////////////////////////////////
// map previews..
Expand Down Expand Up @@ -695,7 +695,7 @@ void readAIs()
}

//sets sWRFILE form game.map
static void decideWRF(void)
static void decideWRF()
{
// try and load it from the maps directory first,
sstrcpy(aLevelName, MultiCustomMapsPath);
Expand All @@ -714,7 +714,7 @@ static void decideWRF(void)
// ////////////////////////////////////////////////////////////////////////////
// Connection Options Screen.

static bool OptionsInet(void) //internet options
static bool OptionsInet() //internet options
{
psConScreen = new W_SCREEN;

Expand Down Expand Up @@ -774,7 +774,7 @@ static bool OptionsInet(void) //internet options

// ////////////////////////////////////////////////////////////////////////////
// Draw the connections screen.
bool startConnectionScreen(void)
bool startConnectionScreen()
{
addBackdrop(); //background
addTopForm(); // logo
Expand All @@ -798,7 +798,7 @@ bool startConnectionScreen(void)
return true;
}

void runConnectionScreen(void)
void runConnectionScreen()
{
static char addr[128];

Expand Down Expand Up @@ -863,7 +863,7 @@ void runConnectionScreen(void)

// ////////////////////////////////////////////////////////////////////////
// Lobby error reading
LOBBY_ERROR_TYPES getLobbyError(void)
LOBBY_ERROR_TYPES getLobbyError()
{
return LobbyError;
}
Expand Down Expand Up @@ -952,7 +952,7 @@ bool joinGame(const char *host, uint32_t port)
// ////////////////////////////////////////////////////////////////////////////
// Game Chooser Screen.

static void addGames(void)
static void addGames()
{
int i, gcount = 0, added = 0;
static const char *wrongVersionTip = _("Your version of Warzone is incompatible with this game.");
Expand Down Expand Up @@ -1140,7 +1140,7 @@ static void addGames(void)
displayConsoleMessages();
}

static void removeGames(void)
static void removeGames()
{
int i;
for (i = 0; i < MaxGames; i++)
Expand All @@ -1150,7 +1150,7 @@ static void removeGames(void)
widgDelete(psWScreen, FRONTEND_NOGAMESAVAILABLE);
}

void runGameFind(void)
void runGameFind()
{
static UDWORD lastupdate = 0;
static char game_password[StringSize];
Expand Down Expand Up @@ -1259,7 +1259,7 @@ void runGameFind(void)
}

// This is what starts the lobby screen
void startGameFind(void)
void startGameFind()
{
addBackdrop(); //background image

Expand Down Expand Up @@ -1334,7 +1334,7 @@ void startGameFind(void)
EnablePasswordPrompt = false;
}

static void hidePasswordForm(void)
static void hidePasswordForm()
{
EnablePasswordPrompt = false;

Expand All @@ -1361,7 +1361,7 @@ static void hidePasswordForm(void)
addGames();
}

static void showPasswordForm(void)
static void showPasswordForm()
{
W_CONTEXT sContext;
EnablePasswordPrompt = true;
Expand Down Expand Up @@ -1937,7 +1937,7 @@ static void addColourChooser(UDWORD player)
colourChooserUp = player;
}

static void closeColourChooser(void)
static void closeColourChooser()
{
colourChooserUp = -1;
widgDelete(psWScreen, MULTIOP_COLCHOOSER_FORM);
Expand Down Expand Up @@ -2324,7 +2324,7 @@ static void addTeamChooser(UDWORD player)
/*
* Closes Team Chooser dialog box, if there was any open
*/
static void closeTeamChooser(void)
static void closeTeamChooser()
{
teamChooserUp = -1;
widgDelete(psWScreen, MULTIOP_TEAMCHOOSER_FORM); //only once!
Expand Down Expand Up @@ -2567,7 +2567,7 @@ void addPlayerBox(bool players)
/*
* Notify all players of host launching the game
*/
static void SendFireUp(void)
static void SendFireUp()
{
uint32_t randomSeed = rand(); // Pick a random random seed for the synchronised random number generator.

Expand Down Expand Up @@ -2649,7 +2649,7 @@ static void addChatBox(bool preserveOldChat)
return;
}

static void addConsoleBox(void)
static void addConsoleBox()
{
if (widgGetFromID(psWScreen, FRONTEND_TOPFORM))
{
Expand Down Expand Up @@ -2681,7 +2681,7 @@ static void addConsoleBox(void)
}

// ////////////////////////////////////////////////////////////////////////////
static void disableMultiButs(void)
static void disableMultiButs()
{

// edit box icons.
Expand All @@ -2701,7 +2701,7 @@ static void disableMultiButs(void)
}

////////////////////////////////////////////////////////////////////////////
static void stopJoining(void)
static void stopJoining()
{
dwSelectedGame = 0;
reloadMPConfig(); // reload own settings
Expand Down Expand Up @@ -3296,7 +3296,7 @@ static void processMultiopWidgets(UDWORD id)
}

/* Start a multiplayer or skirmish game */
void startMultiplayerGame(void)
void startMultiplayerGame()
{
if (!bHosted)
{
Expand Down Expand Up @@ -3351,7 +3351,7 @@ void startMultiplayerGame(void)
// ////////////////////////////////////////////////////////////////////////////
// Net message handling

void frontendMultiMessages(void)
void frontendMultiMessages()
{
NETQUEUE queue;
uint8_t type;
Expand Down Expand Up @@ -3584,7 +3584,7 @@ void frontendMultiMessages(void)
}
}

void runMultiOptions(void)
void runMultiOptions()
{
static UDWORD lastrefresh = 0;
char oldGameMap[128];
Expand Down
28 changes: 14 additions & 14 deletions src/multiint.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,30 +95,30 @@ const char *getAIName(int player); ///< only run this -after- readAIs() is calle
int matchAIbyName(const char *name); ///< only run this -after- readAIs() is called
int getNextAIAssignment(const char *name);

extern LOBBY_ERROR_TYPES getLobbyError(void);
extern void setLobbyError(LOBBY_ERROR_TYPES error_type);
LOBBY_ERROR_TYPES getLobbyError();
void setLobbyError(LOBBY_ERROR_TYPES error_type);

extern void runConnectionScreen(void);
extern bool startConnectionScreen(void);
extern void intProcessConnection(UDWORD id);
void runConnectionScreen();
bool startConnectionScreen();
void intProcessConnection(UDWORD id);

extern void runGameFind(void);
extern void startGameFind(void);
void runGameFind();
void startGameFind();

void updateLimitFlags(void);
void updateLimitFlags();

extern void runMultiOptions(void);
extern bool startMultiOptions(bool bReenter);
extern void frontendMultiMessages(void);
void runMultiOptions();
bool startMultiOptions(bool bReenter);
void frontendMultiMessages();

bool addMultiBut(W_SCREEN *screen, UDWORD formid, UDWORD id, UDWORD x, UDWORD y, UDWORD width, UDWORD height, const char *tipres, UDWORD norm, UDWORD down, UDWORD hi, unsigned tc = MAX_PLAYERS);
bool changeColour(unsigned player, int col, bool isHost);
extern char sPlayer[128];

extern char sPlayer[128];
extern bool bHosted;

void kickPlayer(uint32_t player_id, const char *reason, LOBBY_ERROR_TYPES type);
void addPlayerBox(bool); // players (mid) box
void kickPlayer(uint32_t player_id, const char *reason, LOBBY_ERROR_TYPES type);
void addPlayerBox(bool); // players (mid) box
void loadMapPreview(bool hideInterface);


Expand Down
4 changes: 2 additions & 2 deletions src/multijoin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ bool MultiPlayerJoin(UDWORD playerIndex)
return true;
}

bool sendDataCheck(void)
bool sendDataCheck()
{
int i = 0;

Expand Down Expand Up @@ -475,7 +475,7 @@ void setupNewPlayer(UDWORD player)

// While not the perfect place for this, it has to do when a HOST joins (hosts) game
// unfortunatly, we don't get the message until after the setup is done.
void ShowMOTD(void)
void ShowMOTD()
{
char buf[250] = { '\0' };
// when HOST joins the game, show server MOTD message first
Expand Down
20 changes: 9 additions & 11 deletions src/multijoin.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,15 @@

#include "droiddef.h"

extern bool intDisplayMultiJoiningStatus(UBYTE joinCount);
bool intDisplayMultiJoiningStatus(UBYTE joinCount);
void recvPlayerLeft(NETQUEUE queue);
extern bool MultiPlayerLeave(UDWORD playerIndex); // A player has left the game.
extern bool MultiPlayerJoin(UDWORD playerIndex); // A Player has joined the game.
extern void setupNewPlayer(UDWORD player); // stuff to do when player joins.
extern void clearPlayer(UDWORD player, bool quietly); // wipe a player off the face of the earth.
//extern bool ProcessDroidOrders (void);
//extern UDWORD arenaPlayersReceived;

extern void ShowMOTD(void);
extern bool recvDataCheck(NETQUEUE queue);
extern bool sendDataCheck(void);
bool MultiPlayerLeave(UDWORD playerIndex); // A player has left the game.
bool MultiPlayerJoin(UDWORD playerIndex); // A Player has joined the game.
void setupNewPlayer(UDWORD player); // stuff to do when player joins.
void clearPlayer(UDWORD player, bool quietly); // wipe a player off the face of the earth.

void ShowMOTD();
bool recvDataCheck(NETQUEUE queue);
bool sendDataCheck();

#endif // __INCLUDED_SRC_MULTIJOIN_H__
10 changes: 5 additions & 5 deletions src/multilimit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
static void displayStructureBar(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset);

// ////////////////////////////////////////////////////////////////////////////
static inline void freeLimitSet(void)
static inline void freeLimitSet()
{
// Free the old set if required
if (ingame.numStructureLimits)
Expand All @@ -90,7 +90,7 @@ static inline void freeLimitSet(void)
}

// ////////////////////////////////////////////////////////////////////////////
bool startLimitScreen(void)
bool startLimitScreen()
{
addBackdrop();//background

Expand Down Expand Up @@ -181,7 +181,7 @@ bool startLimitScreen(void)

// ////////////////////////////////////////////////////////////////////////////

void runLimitScreen(void)
void runLimitScreen()
{
frontendMultiMessages(); // network stuff.

Expand Down Expand Up @@ -244,7 +244,7 @@ void runLimitScreen(void)
}

// ////////////////////////////////////////////////////////////////////////////
void createLimitSet(void)
void createLimitSet()
{
UDWORD i, numchanges = 0, bufSize, idx = 0;
MULTISTRUCTLIMITS *pEntry;
Expand Down Expand Up @@ -296,7 +296,7 @@ void createLimitSet(void)
}

// ////////////////////////////////////////////////////////////////////////////
void applyLimitSet(void)
void applyLimitSet()
{
MULTISTRUCTLIMITS *pEntry = ingame.pStructureLimits;

Expand Down
8 changes: 4 additions & 4 deletions src/multilimit.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
#ifndef __INCLUDED_MULTILIMIT_H__
#define __INCLUDED_MULTILIMIT_H__

extern bool startLimitScreen(void);
extern void runLimitScreen(void);
extern void applyLimitSet(void);
extern void createLimitSet(void);
bool startLimitScreen();
void runLimitScreen();
void applyLimitSet();
void createLimitSet();

#endif //__cplusplus //__INCLUDED_MULTILIMIT_H__
10 changes: 5 additions & 5 deletions src/multimenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ void addMultiRequest(const char *searchDir, const char *fileExtension, UDWORD mo
}
}

static void closeMultiRequester(void)
static void closeMultiRequester()
{
multiRequestUp = false;
resetReadyStatus(false);
Expand Down Expand Up @@ -996,7 +996,7 @@ static void addMultiPlayer(UDWORD player, UDWORD pos)
}
}

bool intAddMultiMenu(void)
bool intAddMultiMenu()
{
UDWORD i;

Expand Down Expand Up @@ -1055,7 +1055,7 @@ bool intAddMultiMenu(void)
}

// ////////////////////////////////////////////////////////////////////////////
void intCloseMultiMenuNoAnim(void)
void intCloseMultiMenuNoAnim()
{
widgDelete(psWScreen, MULTIMENU_FORM);
if (!MultiMenuUp)
Expand All @@ -1071,7 +1071,7 @@ void intCloseMultiMenuNoAnim(void)


// ////////////////////////////////////////////////////////////////////////////
bool intCloseMultiMenu(void)
bool intCloseMultiMenu()
{
if (!MultiMenuUp)
{
Expand All @@ -1095,7 +1095,7 @@ bool intCloseMultiMenu(void)

// ////////////////////////////////////////////////////////////////////////////
// In Game Options house keeping stuff.
bool intRunMultiMenu(void)
bool intRunMultiMenu()
{
return true;
}
Expand Down
14 changes: 8 additions & 6 deletions src/multimenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@

// requester
void addMultiRequest(const char *searchDir, const char *fileExtension, UDWORD id, UBYTE mapCam, UBYTE numPlayers, std::string const &searchString = std::string());
extern bool multiRequestUp;

extern bool multiRequestUp;
extern W_SCREEN *psRScreen; // requester stuff.

bool runMultiRequester(UDWORD id, UDWORD *mode, QString *chosen, LEVEL_DATASET **chosenValue, bool *isHoverPreview);
void displayRequestOption(WIDGET *psWidget, UDWORD xOffset, UDWORD yOffset);

// multimenu
extern void intProcessMultiMenu(UDWORD id);
extern bool intRunMultiMenu(void);
extern bool intCloseMultiMenu(void);
extern void intCloseMultiMenuNoAnim(void);
extern bool intAddMultiMenu(void);
void intProcessMultiMenu(UDWORD id);
bool intRunMultiMenu();
bool intCloseMultiMenu();
void intCloseMultiMenuNoAnim();
bool intAddMultiMenu();

extern bool MultiMenuUp;

Expand Down
12 changes: 6 additions & 6 deletions src/multiopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ bool hostCampaign(char *sGame, char *sPlayer)
// ////////////////////////////////////////////////////////////////////////////
// Tell the host we are leaving the game 'nicely', (we wanted to) and not
// because we have some kind of error. (dropped or disconnected)
bool sendLeavingMsg(void)
bool sendLeavingMsg()
{
debug(LOG_NET, "We are leaving 'nicely'");
NETbeginEncode(NETnetQueue(NET_HOST_ONLY), NET_PLAYER_LEAVING);
Expand All @@ -385,7 +385,7 @@ bool sendLeavingMsg(void)

// ////////////////////////////////////////////////////////////////////////////
// called in Init.c to shutdown the whole netgame gubbins.
bool multiShutdown(void)
bool multiShutdown()
{
// shut down netplay lib.
debug(LOG_MAIN, "shutting down networking");
Expand All @@ -403,7 +403,7 @@ bool multiShutdown(void)
}

// ////////////////////////////////////////////////////////////////////////////
static bool gameInit(void)
static bool gameInit()
{
UDWORD player;

Expand Down Expand Up @@ -448,7 +448,7 @@ static bool gameInit(void)

// ////////////////////////////////////////////////////////////////////////////
// say hi to everyone else....
void playerResponding(void)
void playerResponding()
{
ingame.startTime = gameTime;
ingame.localJoiningInProgress = false; // No longer joining.
Expand All @@ -465,7 +465,7 @@ void playerResponding(void)

// ////////////////////////////////////////////////////////////////////////////
//called when the game finally gets fired up.
bool multiGameInit(void)
bool multiGameInit()
{
UDWORD player;

Expand All @@ -482,7 +482,7 @@ bool multiGameInit(void)

////////////////////////////////
// at the end of every game.
bool multiGameShutdown(void)
bool multiGameShutdown()
{
PLAYERSTATS st;
uint32_t time;
Expand Down
Loading