mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
Remove unused functions
GetFreeSpaceOnHardDriveWhereGameIsRunningFrom() GetFreeSpaceOnHardDrive() FileReadLine() <- non VFS version DoesUserHaveEnoughHardDriveSpace()
This commit is contained in:
@@ -9683,21 +9683,6 @@ BOOLEAN SaveMeanwhileDefsFromSaveGameFile( HWFILE hFile )
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
BOOLEAN DoesUserHaveEnoughHardDriveSpace()
|
||||
{
|
||||
UINT32 uiBytesFree=0;
|
||||
|
||||
uiBytesFree = GetFreeSpaceOnHardDriveWhereGameIsRunningFrom( );
|
||||
|
||||
//check to see if there is enough hard drive space
|
||||
if( uiBytesFree < REQUIRED_FREE_SPACE )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
|
||||
void InitShutDownMapTempFileTest( BOOLEAN fInit, STR pNameOfFile, UINT8 ubSaveGameID )
|
||||
|
||||
@@ -93,8 +93,6 @@ BOOLEAN CopySavedSoldierInfoToNewSoldier( SOLDIERTYPE *pDestSourceInfo, SOLDIERT
|
||||
BOOLEAN SaveFilesToSavedGame( STR pSrcFileName, HWFILE hFile );
|
||||
BOOLEAN LoadFilesFromSavedGame( STR pSrcFileName, HWFILE hFile );
|
||||
|
||||
BOOLEAN DoesUserHaveEnoughHardDriveSpace();
|
||||
|
||||
void GetBestPossibleSectorXYZValues( INT16 *psSectorX, INT16 *psSectorY, INT8 *pbSectorZ );
|
||||
|
||||
|
||||
|
||||
@@ -470,22 +470,6 @@ BOOLEAN FileReadLine( HWFILE hFile, std::string* pDest )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOLEAN FileReadLine( HWFILE hFile, STR8 pDest, UINT32 uiDestSize, UINT32 *puiBytesRead )
|
||||
{
|
||||
std::string sBuffer;
|
||||
BOOLEAN result = (pDest != NULL) && FileReadLine( hFile, &sBuffer );
|
||||
if ( result )
|
||||
{
|
||||
if ( puiBytesRead )
|
||||
*puiBytesRead = sBuffer.length();
|
||||
|
||||
UINT32 uiCountToCopy = min( sBuffer.length(), uiDestSize - 1 );
|
||||
sBuffer.copy( pDest, uiCountToCopy );
|
||||
pDest[uiCountToCopy] = '\0'; // method copy() does not put a null-terminator
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
//
|
||||
// FileWrite
|
||||
@@ -952,55 +936,6 @@ UINT32 FileSize(STR strFilename)
|
||||
}
|
||||
|
||||
|
||||
UINT32 GetFreeSpaceOnHardDriveWhereGameIsRunningFrom( )
|
||||
{
|
||||
STRING512 zExecDir;
|
||||
STRING512 zDrive;
|
||||
STRING512 zDir;
|
||||
STRING512 zFileName;
|
||||
STRING512 zExt;
|
||||
|
||||
UINT32 uiFreeSpace = 0;
|
||||
|
||||
GetExecutableDirectory( zExecDir );
|
||||
|
||||
//get the drive letter from the exec dir
|
||||
_splitpath( zExecDir, zDrive, zDir, zFileName, zExt);
|
||||
|
||||
sprintf( zDrive, "%s\\", zDrive );
|
||||
|
||||
uiFreeSpace = GetFreeSpaceOnHardDrive( zDrive );
|
||||
|
||||
return( uiFreeSpace );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
UINT32 GetFreeSpaceOnHardDrive( STR pzDriveLetter )
|
||||
{
|
||||
UINT32 uiBytesFree=0;
|
||||
|
||||
UINT32 uiSectorsPerCluster=0;
|
||||
UINT32 uiBytesPerSector=0;
|
||||
UINT32 uiNumberOfFreeClusters=0;
|
||||
UINT32 uiTotalNumberOfClusters=0;
|
||||
|
||||
if( !GetDiskFreeSpace( pzDriveLetter, (LPDWORD) &uiSectorsPerCluster, (LPDWORD) &uiBytesPerSector,
|
||||
(LPDWORD) &uiNumberOfFreeClusters, (LPDWORD) &uiTotalNumberOfClusters ) )
|
||||
{
|
||||
UINT32 uiLastError = GetLastError();
|
||||
char zString[1024];
|
||||
FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM, 0, uiLastError, 0, zString, 1024, NULL);
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
uiBytesFree = uiBytesPerSector * uiNumberOfFreeClusters * uiSectorsPerCluster;
|
||||
|
||||
return( uiBytesFree );
|
||||
}
|
||||
|
||||
// Flugente: simple wrapper to check whether an audio file in mp3/ogg/wav format exists
|
||||
BOOLEAN SoundFileExists( STR strFilename, STR zFoundFilename )
|
||||
{
|
||||
|
||||
@@ -113,7 +113,6 @@ extern void FileClose( HWFILE );
|
||||
|
||||
extern BOOLEAN FileRead( HWFILE hFile, PTR pDest, UINT32 uiBytesToRead, UINT32 *puiBytesRead );
|
||||
extern BOOLEAN FileReadLine( HWFILE hFile, std::string* pDest );
|
||||
extern BOOLEAN FileReadLine( HWFILE hFile, STR8 pDest, UINT32 uiDestSize, UINT32 *puiBytesRead );
|
||||
extern BOOLEAN FileWrite( HWFILE hFile, PTR pDest, UINT32 uiBytesToWrite, UINT32 *puiBytesWritten );
|
||||
extern BOOLEAN FileLoad( STR filename, PTR pDest, UINT32 uiBytesToRead, UINT32 *puiBytesRead );
|
||||
|
||||
@@ -148,12 +147,6 @@ void GetFileClose( GETFILESTRUCT *pGFStruct );
|
||||
//returns true if at end of file, else false
|
||||
BOOLEAN FileCheckEndOfFile( HWFILE hFile );
|
||||
|
||||
//Gets the amount of free space on the hard drive that the main executeablt is runnning from
|
||||
UINT32 GetFreeSpaceOnHardDriveWhereGameIsRunningFrom( );
|
||||
|
||||
//Gets the free hard drive space from the drive letter passed in. It has to be the root dir. ( eg. c:\ )
|
||||
UINT32 GetFreeSpaceOnHardDrive( STR pzDriveLetter );
|
||||
|
||||
// Flugente: simple wrapper to check whether an audio file in mp3/ogg/wav format exists
|
||||
BOOLEAN SoundFileExists( STR strFilename, STR zFoundFilename );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user