cleanup: remove more old CDrom cruft from the code

now that the CDromEjectionErrorMessageBoxCallBack is no longer referenced
This commit is contained in:
Marco Antonio J. Costa
2026-07-24 04:54:29 -03:00
committed by majcosta
parent d9836f806e
commit 1054012acd
11 changed files with 0 additions and 1415 deletions
-19
View File
@@ -92,14 +92,11 @@ CTH_CONSTANTS gGameCTHConstants; // HEADROCK HAM 4: CTH constants
MOD_SETTINGS gModSettings; //DBrot: mod specific settings
ITEM_SETTINGS gItemSettings; // silversurfer: item property modifiers
extern SGPFILENAME gCheckFilenames[];
extern CHAR8 gzErrorMsg[256];
extern INT16 APBPConstants[TOTAL_APBP_VALUES];
void InitGameSettings();
BOOLEAN GetCdromLocationFromIniFile( STR pRootOfCdromDrive );
// these wrappers have the benefit that changing the location of the variable (gameinitoptionscreen/ini/ingame options) doesn't require huge changes throughout the code
// additionally, turning off a feature (for UB, for MP...) can be done here without additional checks in the code
bool UsingNewInventorySystem()
@@ -4299,22 +4296,6 @@ void FreeGameExternalOptions()
{
}
void CDromEjectionErrorMessageBoxCallBack( UINT8 bExitValue )
{
if( bExitValue == MSG_BOX_RETURN_OK )
{
SetOptionsPreviousScreen(GAME_SCREEN);
//if we are in a game, save the game
if( gTacticalStatus.fHasAGameBeenStarted )
{
SaveGame( SAVE__ERROR_NUM, pMessageStrings[ MSG_CDROM_SAVE ] );
}
//quit the game
gfProgramIsRunning = FALSE;
}
}
void DisplayGameSettings( )
{
//Display the version number
-2
View File
@@ -2806,8 +2806,6 @@ void InitFeatureFlags();
BOOLEAN SaveFeatureFlags();
BOOLEAN LoadFeatureFlags();
BOOLEAN GetCDLocation( );
void DisplayGameSettings( );
BOOLEAN MeanwhileSceneSeen( UINT8 ubMeanwhile );
-1
View File
@@ -70,7 +70,6 @@
extern INT16 APBPConstants[TOTAL_APBP_VALUES] = {0};
extern INT16 gubMaxActionPoints[TOTALBODYTYPES];//MAXBODYTYPES = 28... JUST GETTING IT TO WORK NOW. GOTTHARD 7/2/08
extern BOOLEAN GetCDromDriveLetter( STR8 pString );
// The InitializeGame function is responsible for setting up all data and Gaming Engine
// tasks which will run the game
-2
View File
@@ -259,8 +259,6 @@ static VideoFileNames_t s_VFN;
INT8 gbIntroScreenMode=-1;
extern void CDromEjectionErrorMessageBoxCallBack( UINT8 bExitValue );
void GetIntroScreenUserInput();
BOOLEAN EnterIntroScreen();
void RenderIntroScreen();
-12
View File
@@ -13,8 +13,6 @@
#include "Sys Globals.h"
extern BOOLEAN GetCDromDriveLetter( STR8 pString );
BOOLEAN PerformTimeLimitedCheck();
// WANNE: Given a string, replaces all instances of "oldpiece" with "newpiece"
@@ -332,16 +330,6 @@ void HandleLimitedNumExecutions( )
}
SGPFILENAME gCheckFilenames[] =
{
"DATA\\INTRO.SLF",
"DATA\\LOADSCREENS.SLF",
"DATA\\MAPS.SLF",
"DATA\\NPC_SPEECH.SLF",
"DATA\\SPEECH.SLF",
};
UINT32 gCheckFileMinSizes[] =
{
68000000,
-1
View File
@@ -2,7 +2,6 @@ set(i18nSrc
"${CMAKE_CURRENT_SOURCE_DIR}/language.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/LanguageStrings.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/LocalizedStrings.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Ja2 Libs.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/ExportStrings.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/ImportStrings.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Multi Language Graphic Utils.cpp"
-32
View File
@@ -1,32 +0,0 @@
#include "LibraryDataBase.h"
LibraryInitHeader gGameLibaries[ ] =
{
//Library Name Can be Init at start
// on cd
{ "Data.slf", FALSE, TRUE },
{ "Editor.slf", FALSE, FALSE },
{ "Ambient.slf", FALSE, TRUE },
{ "Anims.slf", FALSE, TRUE },
{ "BattleSnds.slf", FALSE, TRUE },
{ "BigItems.slf", FALSE, TRUE },
{ "BinaryData.slf", FALSE, TRUE },
{ "Cursors.slf", FALSE, TRUE },
{ "Faces.slf", FALSE, TRUE },
{ "Fonts.slf", FALSE, TRUE },
{ "Interface.slf", FALSE, TRUE },
{ "Laptop.slf", FALSE, TRUE },
{ "Maps.slf", TRUE, TRUE },
{ "MercEdt.slf", FALSE, TRUE },
{ "Music.slf", TRUE, TRUE },
{ "Npc_Speech.slf", TRUE, TRUE },
{ "NpcData.slf", FALSE, TRUE },
{ "RadarMaps.slf", FALSE, TRUE },
{ "Sounds.slf", FALSE, TRUE },
{ "Speech.slf", TRUE, TRUE },
// { "TileCache.slf", FALSE, TRUE },
{ "TileSets.slf", TRUE, TRUE },
{ "LoadScreens.slf", TRUE, TRUE },
{ "Intro.slf", TRUE, TRUE },
};
-37
View File
@@ -1,37 +0,0 @@
#ifndef _JA2_LIBS_H_
#define _JA2_LIBS_H_
//enums used for accessing the libraries
enum
{
LIBRARY_DATA,
LIBRARY_EDITOR,
LIBRARY_AMBIENT,
LIBRARY_ANIMS,
LIBRARY_BATTLESNDS,
LIBRARY_BIGITEMS,
LIBRARY_BINARY_DATA,
LIBRARY_CURSORS,
LIBRARY_FACES,
LIBRARY_FONTS,
LIBRARY_INTERFACE,
LIBRARY_LAPTOP,
LIBRARY_MAPS,
LIBRARY_MERCEDT,
LIBRARY_MUSIC,
LIBRARY_NPC_SPEECH,
LIBRARY_NPC_DATA,
LIBRARY_RADAR_MAPS,
LIBRARY_SOUNDS,
LIBRARY_SPEECH,
// LIBRARY_TILE_CACHE,
LIBRARY_TILESETS,
LIBRARY_LOADSCREENS,
LIBRARY_INTRO,
NUMBER_OF_LIBRARIES
};
#endif
-1
View File
@@ -14,7 +14,6 @@ set(sgpSrc
"${CMAKE_CURRENT_SOURCE_DIR}/himage.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/impTGA.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/input.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/LibraryDataBase.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/line.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/MemMan.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/mousesystem.cpp"
File diff suppressed because it is too large Load Diff
-208
View File
@@ -1,208 +0,0 @@
#ifndef _LIBRARY_DATABASE_H
#define _LIBRARY_DATABASE_H
#include "types.h"
#include "windows.h"
#include "FileMan.h"
#define FILENAME_SIZE 256
//#define FILENAME_SIZE 40 + PATH_SIZE
#define PATH_SIZE 80
#define NUM_FILES_TO_ADD_AT_A_TIME 20
#define INITIAL_NUM_HANDLES 20
#define REAL_FILE_LIBRARY_ID 1022
#define DB_BITS_FOR_LIBRARY 10
#define DB_BITS_FOR_FILE_ID 22
#define DB_EXTRACT_LIBRARY( exp ) ( exp >> DB_BITS_FOR_FILE_ID )
#define DB_EXTRACT_FILE_ID( exp ) ( exp & 0x3FFFFF )
#define DB_ADD_LIBRARY_ID( exp ) ( exp << DB_BITS_FOR_FILE_ID )
#define DB_ADD_FILE_ID( exp ) ( exp & 0xC00000 )
typedef UINT32 HWFILE;
typedef struct
{
CHAR8 sLibraryName[ FILENAME_SIZE ]; // The name of the library file on the disk
BOOLEAN fOnCDrom; // A flag specifying if its a cdrom library ( not implemented yet )
BOOLEAN fInitOnStart; // Flag specifying if the library is to Initialized at the begining of the game
} LibraryInitHeader;
#include "Ja2 Libs.h"
extern LibraryInitHeader gGameLibaries[];
extern CHAR8 gzCdDirectory[ SGPFILENAME_LEN ];
#define REAL_LIBRARY_FILE "RealFiles.slf"
typedef struct
{
UINT32 uiFileID; // id of the file ( they start at 1 )
HANDLE hRealFileHandle; // if the file is a Real File, this its handle
} RealFileOpenStruct;
typedef struct
{
STR pFileName;
UINT32 uiFileLength;
UINT32 uiFileOffset;
} FileHeaderStruct;
typedef struct
{
UINT32 uiFileID; // id of the file ( they start at 1 )
UINT32 uiFilePosInFile; // current position in the file
UINT32 uiActualPositionInLibrary; // Current File pointer position in actuall library
FileHeaderStruct *pFileHeader;
} FileOpenStruct;
typedef struct
{
STR sLibraryPath;
HANDLE hLibraryHandle;
UINT16 usNumberOfEntries;
BOOLEAN fLibraryOpen;
// BOOLEAN fAnotherFileAlreadyOpenedLibrary; //this variable is set when a file is opened from the library and reset when the file is close. No 2 files can have access to the library at 1 time.
UINT32 uiIdOfOtherFileAlreadyOpenedLibrary; //this variable is set when a file is opened from the library and reset when the file is close. No 2 files can have access to the library at 1 time.
INT32 iNumFilesOpen;
INT32 iSizeOfOpenFileArray;
FileHeaderStruct *pFileHeader;
FileOpenStruct *pOpenFiles;
//
// Temp: Total memory used for each library ( all memory allocated
//
#ifdef JA2TESTVERSION
UINT32 uiTotalMemoryAllocatedForLibrary;
#endif
} LibraryHeaderStruct;
typedef struct
{
INT32 iNumFilesOpen;
INT32 iSizeOfOpenFileArray;
RealFileOpenStruct *pRealFilesOpen;
} RealFileHeaderStruct;
typedef struct
{
STR sManagerName;
LibraryHeaderStruct *pLibraries;
UINT16 usNumberOfLibraries;
BOOLEAN fInitialized;
RealFileHeaderStruct RealFiles;
} DatabaseManagerHeaderStruct;
//typedef UINT32 HLIBFILE;
//*************************************************************************
//
// NOTE! The following structs are also used by the datalib98 utility
//
//*************************************************************************
#define FILE_OK 0
#define FILE_DELETED 0xff
#define FILE_OLD 1
#define FILE_DOESNT_EXIST 0xfe
typedef struct
{
CHAR8 sLibName[ FILENAME_SIZE ];
CHAR8 sPathToLibrary[ FILENAME_SIZE ];
INT32 iEntries;
INT32 iUsed;
UINT16 iSort;
UINT16 iVersion;
BOOLEAN fContainsSubDirectories;
INT32 iReserved;
} LIBHEADER;
typedef struct
{
CHAR8 sFileName[ FILENAME_SIZE ];
UINT32 uiOffset;
UINT32 uiLength;
UINT8 ubState;
UINT8 ubReserved;
FILETIME sFileTime;
UINT16 usReserved2;
} DIRENTRY;
#ifdef __cplusplus
extern "C" {
#endif
//The FileDatabaseHeader
extern DatabaseManagerHeaderStruct gFileDataBase;
//Function Prototypes
BOOLEAN CheckForLibraryExistence( STR pLibraryName );
BOOLEAN InitializeLibrary( STR pLibraryName, LibraryHeaderStruct *pLibheader, BOOLEAN fCanBeOnCDrom );
BOOLEAN InitializeFileDatabase( );
BOOLEAN ReopenCDLibraries(void);
BOOLEAN ShutDownFileDatabase( );
BOOLEAN CheckIfFileExistInLibrary( STR pFileName );
INT16 GetLibraryIDFromFileName( STR pFileName );
HWFILE OpenFileFromLibrary( STR pName );
HWFILE CreateRealFileHandle( HANDLE hFile );
BOOLEAN CloseLibraryFile( INT16 sLibraryID, UINT32 uiFileID );
BOOLEAN GetLibraryAndFileIDFromLibraryFileHandle( HWFILE hlibFile, INT16 *pLibraryID, UINT32 *pFileNum );
BOOLEAN LoadDataFromLibrary( INT16 sLibraryID, UINT32 uiFileIndex, PTR pData, UINT32 uiBytesToRead, UINT32 *pBytesRead );
BOOLEAN LibraryFileSeek( INT16 sLibraryID, UINT32 uiFileNum, UINT32 uiDistance, UINT8 uiHowToSeek );
//used to open and close libraries during the game
BOOLEAN CloseLibrary( INT16 sLibraryID );
BOOLEAN OpenLibrary( INT16 sLibraryID );
BOOLEAN IsLibraryOpened( INT16 sLibraryID );
BOOLEAN GetLibraryFileTime( INT16 sLibraryID, UINT32 uiFileNum, SGP_FILETIME *pLastWriteTime );
#ifdef __cplusplus
}
#endif
#endif