Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f48921a
Remove unused function declarations and commented out functions
Asdow Nov 23, 2025
b1df692
Remove duplicate includes
Asdow Nov 23, 2025
293ac39
Combine JA2UB ifdef includes
Asdow Nov 23, 2025
9a0c0eb
Remove unused includes
Asdow Nov 23, 2025
6a5b9f3
Formatting & whitespace
Asdow Nov 23, 2025
f0b82dc
Combine JA2UB includes with its function declaration ifdef
Asdow Nov 23, 2025
3b339d9
Remove commented out function
Asdow Nov 23, 2025
6c1563c
Remove commented out extern
Asdow Nov 23, 2025
14e5e0c
Fix typo
Asdow Nov 23, 2025
be5852f
Make functions static
Asdow Nov 23, 2025
1b8378f
Initialize variables
Asdow Nov 23, 2025
e66a19c
Remove transitive include
Asdow Nov 23, 2025
acb1736
Remove unused includes
Asdow Nov 23, 2025
599042c
Make function static
Asdow Nov 23, 2025
8ba8ec5
Fix function definition
Asdow Nov 23, 2025
0383343
Remove unused function declaration
Asdow Nov 23, 2025
1ca1c4a
Set functions static
Asdow Nov 23, 2025
8aa8649
Remove duplicate include
Asdow Nov 23, 2025
adcf8cc
Remove unused includes
Asdow Nov 23, 2025
268f8b9
Formatting
Asdow Nov 23, 2025
41a232c
Set functions static
Asdow Nov 23, 2025
12ece3d
Remove duplicate include
Asdow Nov 23, 2025
b556f9c
Remove unused includes
Asdow Nov 23, 2025
f7dcbfb
Formatting
Asdow Nov 23, 2025
fc1635b
Move includes to top of file
Asdow Nov 23, 2025
62b4c70
Set functions static
Asdow Nov 23, 2025
1099014
Remouve unused function declarations
Asdow Nov 23, 2025
fc3685f
Set functions static
Asdow Nov 23, 2025
0591194
Remove unused includes
Asdow Nov 23, 2025
92748bb
Set functions static
Asdow Nov 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
319 changes: 112 additions & 207 deletions Ja2/SaveLoadGame.cpp

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions Tactical/Item Types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
#include "DEBUG.H"
#include "Items.h"
#include "GameSettings.h"
#include "screenids.h"
#include "Action Items.h" // added by Flugente for the ACTION_ITEM_BLOW_UP value
#include "random.h" // added by Flugente
#include "message.h" // added by BOB for missing LBE info messages
#include "Overhead.h" // added by BOB for missing LBE info messages
#include "Map Screen Interface.h" // added by BOB for missing LBE info messages


Expand All @@ -27,7 +24,7 @@ extern UINT32 guiCurrentItemDescriptionScreen;
extern BOOLEAN fShowMapInventoryPool;
//extern BOOLEAN AutoPlaceObjectInInventoryStash( OBJECTTYPE *pItemPtr, INT32 sGridNo );

bool checkObjectLBEIntegrity(OBJECTTYPE * object) {
static bool checkObjectLBEIntegrity(OBJECTTYPE * object) {
bool integrityCheck = TRUE;


Expand Down
8 changes: 3 additions & 5 deletions TileEngine/SaveLoadMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "worldman.h"
#include "strategicmap.h"
#include "Campaign Types.h"
#include "renderworld.h"
#include "Render Fun.h"
#include "fov.h"
#include "worlddef.h"
Expand All @@ -16,7 +15,6 @@
#include "GameSettings.h"
#include "Smell.h"

#include <vfs/Core/vfs.h>
//SB: make size of gpRevealedMap dependable from variable tactical map dimensions
#define NUM_REVEALED_BYTES (WORLD_MAX/8)

Expand Down Expand Up @@ -175,7 +173,7 @@ typedef std::map<ModifiedMapFile::Key, ModifiedMapFile, ltMMF> ModifiedMapFileSe
ModifiedMapFileSet g_mapFileSet;
BOOLEAN g_useSaveCache;

void ClearTempFileSets()
static void ClearTempFileSets()
{
//for (ModifiedMapFileSet::iterator itr = g_mapFileSet.begin(), end = g_mapFileSet.end(); itr != end; ++itr )
//{
Expand All @@ -195,7 +193,7 @@ BOOLEAN EnableModifiedFileSetCache(BOOLEAN value)
return previousValue;
}

bool TryGetModifiedMapFile( UINT32 uiType, INT16 sMapX, INT16 sMapY, INT8 bMapZ, ModifiedMapFile** ppMMF )
static bool TryGetModifiedMapFile( UINT32 uiType, INT16 sMapX, INT16 sMapY, INT8 bMapZ, ModifiedMapFile** ppMMF )
{
if (ppMMF == NULL)
return false;
Expand All @@ -211,7 +209,7 @@ bool TryGetModifiedMapFile( UINT32 uiType, INT16 sMapX, INT16 sMapY, INT8 bMapZ,
return true;
}

ModifiedMapFile& GetOrCreateModifiedMapFile(UINT32 uiType, INT16 sMapX, INT16 sMapY, INT8 bMapZ)
static ModifiedMapFile& GetOrCreateModifiedMapFile(UINT32 uiType, INT16 sMapX, INT16 sMapY, INT8 bMapZ)
{
ModifiedMapFile* pResult = NULL;
if ( TryGetModifiedMapFile(uiType, sMapX, sMapY, bMapZ, &pResult) )
Expand Down
8 changes: 4 additions & 4 deletions TileEngine/Tactical Placement GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void SelectNextUnplacedUnit();
BOOLEAN gfNorthValid, gfEastValid, gfSouthValid, gfWestValid;
BOOLEAN gfChangedEntrySide = FALSE;

void FindValidInsertionCode( UINT8 *pubStrategicInsertionCode )
static void FindValidInsertionCode( UINT8 *pubStrategicInsertionCode )
{
if( gMapInformation.sNorthGridNo == -1 &&
gMapInformation.sEastGridNo == -1 &&
Expand Down Expand Up @@ -202,7 +202,7 @@ void FindValidInsertionCode( UINT8 *pubStrategicInsertionCode )
}
}

void CheckForValidMapEdge( UINT8 *pubStrategicInsertionCode )
static void CheckForValidMapEdge( UINT8 *pubStrategicInsertionCode )
{
switch( *pubStrategicInsertionCode )
{
Expand Down Expand Up @@ -1464,7 +1464,7 @@ void RenderTacticalPlacementGUI()
}
}

void EnsureDoneButtonStatus()
static void EnsureDoneButtonStatus()
{
INT32 i;
//static BOOLEAN fInside = FALSE;
Expand Down Expand Up @@ -1783,7 +1783,7 @@ void KillTacticalPlacementGUI()
MemFree( gMercPlacement);
}

void ChooseRandomEdgepoints()
static void ChooseRandomEdgepoints()
{
INT32 i;
UINT8 lastValidICode = INSERTION_CODE_GRIDNO;
Expand Down
2 changes: 0 additions & 2 deletions TileEngine/renderworld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,6 @@ void RenderGridNoVisibleDebugInfo( INT16 sStartPointX_M, INT16 sStartPointY_M, I

void DeleteFromWorld( UINT16 usTileIndex, UINT32 uiRenderTiles, UINT16 usIndex );

void RenderHighlight( INT16 sMouseX_M, INT16 sMouseY_M, INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStartPointX_S, INT16 sStartPointY_S, INT16 sEndXS, INT16 sEndYS );
BOOLEAN CheckRenderCenter( INT16 sNewCenterX, INT16 sNewCenterY );

// Flugente: display a riot shield
static void ShowRiotShield( SOLDIERTYPE* pSoldier, UINT16 *pBuffer, UINT32 uiDestPitchBYTES, UINT16 *pZBuffer, UINT16 usZValue )
Expand Down
110 changes: 47 additions & 63 deletions TileEngine/structure.cpp
Original file line number Diff line number Diff line change
@@ -1,52 +1,39 @@
#include <string.h>
#include "types.h"
#include "WCheck.h"
#include "DEBUG.H"
#include "FileMan.h"
#include "MemMan.h"
#include "structure.h"
#include "tiledef.h"
#include "worlddef.h"
#include "worldman.h"

#include "Interface.h"

#include "Isometric Utils.h"
#include "Font.h"
#include "Font Control.h"
#include "LOS.h"

#include "lighting.h"
#include "Smell.h"
#include "SaveLoadMap.h"
#include "strategicmap.h"
#include "sgp_logger.h"

#include "Sys Globals.h" //for access to gfEditMode flag

//Kris:
#ifdef JA2EDITOR
#include "Editor Undo.h" //for access to AddToUndoList( iMapIndex )
#endif

#include "Explosion Control.h"
#include "Sound Control.h"

#include "Buildings.h"

#include "random.h"

#include "Tile Animation.h"
#include "Explosion Control.h" // added by Flugente

// anv: for ramming people with vehicles
#include "Soldier macros.h"
#include "Overhead.h"
#include "Soldier Functions.h"
#include "Animation Control.h"
#include "Soldier Ani.h"
#include "ASD.h" // added by Flugente
#include "renderworld.h" // added by Flugente for SetRenderFlags( RENDER_FLAG_FULL );
#include <string.h>
#include "types.h"
#include "WCheck.h"
#include "DEBUG.H"
#include "FileMan.h"
#include "MemMan.h"
#include "structure.h"
#include "tiledef.h"
#include "worlddef.h"
#include "worldman.h"
#include "Interface.h"
#include "Isometric Utils.h"
#include "Font.h"
#include "Font Control.h"
#include "Smell.h"
#include "SaveLoadMap.h"
#include "strategicmap.h"
#include "sgp_logger.h"
#include "Sys Globals.h" //for access to gfEditMode flag
//Kris:
#ifdef JA2EDITOR
#include "Editor Undo.h" //for access to AddToUndoList( iMapIndex )
#endif
#include "Explosion Control.h"
#include "Sound Control.h"
#include "Buildings.h"
#include "random.h"
#include "Tile Animation.h"
// anv: for ramming people with vehicles
#include "Soldier macros.h"
#include "Overhead.h"
#include "Animation Control.h"
#include "ASD.h" // added by Flugente
#include "renderworld.h" // added by Flugente for SetRenderFlags( RENDER_FLAG_FULL );
#include <vfs/Core/vfs.h>
#include "XML_StructureData.hpp"

#ifdef COUNT_PATHS
extern UINT32 guiSuccessfulPathChecks;
Expand Down Expand Up @@ -162,7 +149,7 @@ index 25, indestructable metal
};

// Function operating on a structure tile
UINT8 FilledTilePositions( DB_STRUCTURE_TILE * pTile )
static UINT8 FilledTilePositions( DB_STRUCTURE_TILE * pTile )
{
UINT8 ubFilled = 0, ubShapeValue;
INT8 bLoopX, bLoopY, bLoopZ;
Expand Down Expand Up @@ -267,7 +254,7 @@ BOOLEAN FreeStructureFile( STRUCTURE_FILE_REF * pStructureFile )
return( TRUE );
}

BOOLEAN LoadStructureData( STR szFileName, STRUCTURE_FILE_REF * pFileRef, UINT32 * puiStructureDataSize )
static BOOLEAN LoadStructureData( STR szFileName, STRUCTURE_FILE_REF * pFileRef, UINT32 * puiStructureDataSize )
//UINT8 **ppubStructureData, UINT32 * puiDataSize, STRUCTURE_FILE_HEADER * pHeader )
{
// Loads a structure file's data as a honking chunk o' memory
Expand Down Expand Up @@ -367,7 +354,7 @@ BOOLEAN LoadStructureData( STR szFileName, STRUCTURE_FILE_REF * pFileRef, UINT32
return( TRUE );
}

BOOLEAN CreateFileStructureArrays( STRUCTURE_FILE_REF * pFileRef, UINT32 uiDataSize )
static BOOLEAN CreateFileStructureArrays( STRUCTURE_FILE_REF * pFileRef, UINT32 uiDataSize )
{
// Based on a file chunk, creates all the dynamic arrays for the
// structure definitions contained within
Expand Down Expand Up @@ -438,11 +425,8 @@ BOOLEAN CreateFileStructureArrays( STRUCTURE_FILE_REF * pFileRef, UINT32 uiDataS
return( TRUE );
}

#include <vfs/Core/vfs_file_raii.h>
#include <vfs/Core/vfs.h>
#include "XML_StructureData.hpp"

void checkStructureValidity(STRUCTURE_FILE_REF *str1, STRUCTURE_FILE_REF* str2, UINT32 size1, UINT32 size2)
static void checkStructureValidity(STRUCTURE_FILE_REF *str1, STRUCTURE_FILE_REF* str2, UINT32 size1, UINT32 size2)
{
if(str1 == str2 && str1 == NULL)
{
Expand Down Expand Up @@ -579,7 +563,7 @@ STRUCTURE_FILE_REF * LoadStructureFile( STR szFileName )
//


STRUCTURE * CreateStructureFromDB( DB_STRUCTURE_REF * pDBStructureRef, UINT8 ubTileNum )
static STRUCTURE * CreateStructureFromDB( DB_STRUCTURE_REF * pDBStructureRef, UINT8 ubTileNum )
{
// Creates a STRUCTURE struct for one tile of a structure
STRUCTURE * pStructure;
Expand Down Expand Up @@ -632,7 +616,7 @@ STRUCTURE * CreateStructureFromDB( DB_STRUCTURE_REF * pDBStructureRef, UINT8 ubT

extern SoldierID gusTempDragBuildSoldierID;

BOOLEAN OkayToAddStructureToTile( INT32 sBaseGridNo, INT16 sCubeOffset, DB_STRUCTURE_REF * pDBStructureRef, UINT8 ubTileIndex, INT16 sExclusionID, BOOLEAN fAddingForReal = FALSE, SoldierID sSoldierID = NOBODY )
static BOOLEAN OkayToAddStructureToTile( INT32 sBaseGridNo, INT16 sCubeOffset, DB_STRUCTURE_REF * pDBStructureRef, UINT8 ubTileIndex, INT16 sExclusionID, BOOLEAN fAddingForReal = FALSE, SoldierID sSoldierID = NOBODY )
{
// Verifies whether a structure is blocked from being added to the map at a particular point
DB_STRUCTURE * pDBStructure;
Expand Down Expand Up @@ -1006,7 +990,7 @@ BOOLEAN OkayToAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_
return( InternalOkayToAddStructureToWorld( sBaseGridNo, bLevel, pDBStructureRef, sExclusionID, fAddingForReal, sSoldierID ) );
}

BOOLEAN AddStructureToTile( MAP_ELEMENT * pMapElement, STRUCTURE * pStructure, UINT16 usStructureID )
static BOOLEAN AddStructureToTile( MAP_ELEMENT * pMapElement, STRUCTURE * pStructure, UINT16 usStructureID )
{
// adds a STRUCTURE to a MAP_ELEMENT (adds part of a structure to a location on the map)
STRUCTURE * pStructureTail;
Expand All @@ -1033,7 +1017,7 @@ BOOLEAN AddStructureToTile( MAP_ELEMENT * pMapElement, STRUCTURE * pStructure, U
}


STRUCTURE * InternalAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, LEVELNODE * pLevelNode )
static STRUCTURE * InternalAddStructureToWorld( INT32 sBaseGridNo, INT8 bLevel, DB_STRUCTURE_REF * pDBStructureRef, LEVELNODE * pLevelNode )
{
// Adds a complete structure to the world at a location plus all other locations covered by the structure
INT32 sGridNo;
Expand Down Expand Up @@ -1335,7 +1319,7 @@ BOOLEAN DeleteStructureFromWorld( STRUCTURE * pStructure )
return( TRUE );
}

STRUCTURE * InternalSwapStructureForPartner( INT32 sGridNo, STRUCTURE * pStructure, BOOLEAN fFlipSwitches, BOOLEAN fStoreInMap )
static STRUCTURE * InternalSwapStructureForPartner( INT32 sGridNo, STRUCTURE * pStructure, BOOLEAN fFlipSwitches, BOOLEAN fStoreInMap )
{
// switch structure
LEVELNODE * pLevelNode;
Expand Down Expand Up @@ -2519,13 +2503,13 @@ BOOLEAN AddZStripInfoToVObject( HVOBJECT hVObject, STRUCTURE_FILE_REF * pStructu
return( TRUE );
}

BOOLEAN InitStructureDB( void )
static BOOLEAN InitStructureDB( void )
{
gusNextAvailableStructureID = FIRST_AVAILABLE_STRUCTURE_ID;
return( TRUE );
}

BOOLEAN FiniStructureDB( void )
static BOOLEAN FiniStructureDB( void )
{
gusNextAvailableStructureID = FIRST_AVAILABLE_STRUCTURE_ID;
return( TRUE );
Expand Down
Loading