diff --git a/Ja2/GameSettings.cpp b/Ja2/GameSettings.cpp index a5dc38231..a74e39766 100644 --- a/Ja2/GameSettings.cpp +++ b/Ja2/GameSettings.cpp @@ -8,7 +8,6 @@ #include "Options Screen.h" #include "Overhead.h" #include "GameVersion.h" - #include "LibraryDataBase.h" #include "DEBUG.H" #include "HelpScreen.h" #include "INIReader.h" @@ -101,12 +100,6 @@ void InitGameSettings(); BOOLEAN GetCdromLocationFromIniFile( STR pRootOfCdromDrive ); -extern BOOLEAN DoJA2FilesExistsOnDrive( CHAR8 *zCdLocation ); - -BOOLEAN GetCDromDriveLetter( STR8 pString ); -BOOLEAN IsDriveLetterACDromDrive( STR pDriveLetter ); -void CDromEjectionErrorMessageBoxCallBack( UINT8 bExitValue ); - // 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() @@ -4306,260 +4299,6 @@ void FreeGameExternalOptions() { } -BOOLEAN GetCDLocation( ) -{ - UINT32 uiStrngLength = 0; - CHAR8 zCdLocation[ SGPFILENAME_LEN ]; - UINT32 uiRetVal=0; - - //Do a crude check to make sure the GAME_INI_FILE file is the right on - - STRING512 ja2INIfile; - strcat(ja2INIfile, "..\\"); - strcat(ja2INIfile, GAME_INI_FILE); - - uiRetVal = GetPrivateProfileString( "Ja2 Settings","CD", "", zCdLocation, SGPFILENAME_LEN, ja2INIfile ); - if( uiRetVal == 0 || !IsDriveLetterACDromDrive( zCdLocation ) ) - { - // the user most likely doesnt have the file, or the user has messed with the file - // build a new one - - //First delete the old file - // Snap: don't clobber the INI file! - //FileDelete( GAME_INI_FILE ); - - //Get the location of the cdrom drive - if( GetCDromDriveLetter( zCdLocation ) ) - { - CHAR8 *pTemp; - - //if it succeeded - pTemp = strrchr( zCdLocation, ':' ); - pTemp[0] = '\0'; - } - else - { - //put in a default location - sprintf( zCdLocation, "c" ); - } - - //Now create a new file - WritePrivateProfileString( "Ja2 Settings", "CD", zCdLocation, ja2INIfile ); - - GetPrivateProfileString( "Ja2 Settings","CD", "", zCdLocation, SGPFILENAME_LEN, ja2INIfile ); - } - - uiStrngLength = strlen( zCdLocation ); - - //if the string length is less the 1 character, it is a drive letter - if( uiStrngLength == 1 ) - { - sprintf( gzCdDirectory, "%s:\\%s", zCdLocation, CD_ROOT_DIR ); - } - - //else it is most likely a network location - else if( uiStrngLength > 1 ) - { - sprintf( gzCdDirectory, "%s\\%s", zCdLocation, CD_ROOT_DIR ); - } - else - { - //no path was entered - gzCdDirectory[ 0 ] = '.'; - } - - return( TRUE ); -} - - - -BOOLEAN GetCDromDriveLetter( STR8 pString ) -{ - UINT32 uiSize=0; - UINT8 ubCnt=0; - CHAR8 zDriveLetters[512]; - CHAR8 zDriveLetter[16]; - UINT32 uiDriveType; - - uiSize = GetLogicalDriveStrings( 512, zDriveLetters ); - - for( ubCnt=0;ubCnt