Remove unused autosave and filetime functions

This commit is contained in:
Asdow
2023-10-21 15:38:31 +03:00
parent eff1ccfe63
commit c07f3f460b
4 changed files with 0 additions and 161 deletions
-63
View File
@@ -9961,69 +9961,6 @@ void UpdateMercMercContractInfo()
}
}
INT8 GetNumberForAutoSave( BOOLEAN fLatestAutoSave )
{
CHAR zFileName1[MAX_PATH];
CHAR zFileName2[MAX_PATH];
HWFILE hFile;
BOOLEAN fFile1Exist, fFile2Exist;
SGP_FILETIME CreationTime1, LastAccessedTime1, LastWriteTime1;
SGP_FILETIME CreationTime2, LastAccessedTime2, LastWriteTime2;
fFile1Exist = FALSE;
fFile2Exist = FALSE;
//The name of the file
sprintf( zFileName1, "%s\\Auto%02d.%S", gSaveDir, 0, pMessageStrings[ MSG_SAVEEXTENSION ] );
sprintf( zFileName2, "%s\\Auto%02d.%S", gSaveDir, 1, pMessageStrings[ MSG_SAVEEXTENSION ] );
if( FileExists( zFileName1 ) )
{
hFile = FileOpen( zFileName1, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
GetFileManFileTime( hFile, &CreationTime1, &LastAccessedTime1, &LastWriteTime1 );
FileClose( hFile );
fFile1Exist = TRUE;
}
if( FileExists( zFileName2 ) )
{
hFile = FileOpen( zFileName2, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
GetFileManFileTime( hFile, &CreationTime2, &LastAccessedTime2, &LastWriteTime2 );
FileClose( hFile );
fFile2Exist = TRUE;
}
if( !fFile1Exist && !fFile2Exist )
return( -1 );
else if( fFile1Exist && !fFile2Exist )
{
if( fLatestAutoSave )
return( 0 );
else
return( -1 );
}
else if( !fFile1Exist && fFile2Exist )
{
if( fLatestAutoSave )
return( 1 );
else
return( -1 );
}
else
{
if( CompareSGPFileTimes( &LastWriteTime1, &LastWriteTime2 ) > 0 )
return( 0 );
else
return( 1 );
}
}
void HandleOldBobbyRMailOrders()
{
-1
View File
@@ -99,7 +99,6 @@ void GetBestPossibleSectorXYZValues( INT16 *psSectorX, INT16 *psSectorY, INT8 *p
extern UINT32 guiLastSaveGameNum; // The end turn auto save number (0 = Auto00.sav, 1 = Auto01.sav)
INT8 GetNumberForAutoSave( BOOLEAN fLatestAutoSave );
/*CHRISL: This function is designed to allow reading the save game file one field at a time. We currently save structures by saving a block of memory,
but variables are stored in memory so that they fit neatly into a WORD resulting in the program automatically adding some padding. This padding is saved
-82
View File
@@ -911,76 +911,6 @@ void GetFileClose( GETFILESTRUCT *pGFStruct )
}
//Additions by Kris Morness
BOOLEAN FileSetAttributes( STR strFilename, UINT32 uiNewAttribs )
{
UINT32 uiFileAttrib = 0;
if( uiNewAttribs & FILE_ATTRIBUTES_ARCHIVE )
uiFileAttrib |= FILE_ATTRIBUTE_ARCHIVE;
if( uiNewAttribs & FILE_ATTRIBUTES_HIDDEN )
uiFileAttrib |= FILE_ATTRIBUTE_HIDDEN;
if( uiNewAttribs & FILE_ATTRIBUTES_NORMAL )
uiFileAttrib |= FILE_ATTRIBUTE_NORMAL;
if( uiNewAttribs & FILE_ATTRIBUTES_OFFLINE )
uiFileAttrib |= FILE_ATTRIBUTE_OFFLINE;
if( uiNewAttribs & FILE_ATTRIBUTES_READONLY )
uiFileAttrib |= FILE_ATTRIBUTE_READONLY;
if( uiNewAttribs & FILE_ATTRIBUTES_SYSTEM )
uiFileAttrib |= FILE_ATTRIBUTE_SYSTEM;
if( uiNewAttribs & FILE_ATTRIBUTES_TEMPORARY )
uiFileAttrib |= FILE_ATTRIBUTE_TEMPORARY;
return SetFileAttributes( strFilename, uiFileAttrib );
}
UINT32 FileGetAttributes( STR strFilename )
{
UINT32 uiAttribs = 0;
UINT32 uiFileAttrib = 0;
uiAttribs = GetFileAttributes( strFilename );
if( uiAttribs == 0xFFFFFFFF )
return( uiAttribs );
if( uiAttribs & FILE_ATTRIBUTE_ARCHIVE )
uiFileAttrib |= FILE_ATTRIBUTES_ARCHIVE;
if( uiAttribs & FILE_ATTRIBUTE_HIDDEN )
uiFileAttrib |= FILE_ATTRIBUTES_HIDDEN;
if( uiAttribs & FILE_ATTRIBUTE_NORMAL )
uiFileAttrib |= FILE_ATTRIBUTES_NORMAL;
if( uiAttribs & FILE_ATTRIBUTE_OFFLINE )
uiFileAttrib |= FILE_ATTRIBUTES_OFFLINE;
if( uiAttribs & FILE_ATTRIBUTE_READONLY )
uiFileAttrib |= FILE_ATTRIBUTES_READONLY;
if( uiAttribs & FILE_ATTRIBUTE_SYSTEM )
uiFileAttrib |= FILE_ATTRIBUTES_SYSTEM;
if( uiAttribs & FILE_ATTRIBUTE_TEMPORARY )
uiFileAttrib |= FILE_ATTRIBUTES_TEMPORARY;
if( uiAttribs & FILE_ATTRIBUTE_DIRECTORY )
uiFileAttrib |= FILE_ATTRIBUTES_DIRECTORY;
return( uiFileAttrib );
}
//returns true if at end of file, else false
BOOLEAN FileCheckEndOfFile( HWFILE hFile )
{
@@ -1011,18 +941,6 @@ BOOLEAN FileCheckEndOfFile( HWFILE hFile )
}
BOOLEAN GetFileManFileTime( HWFILE hFile, SGP_FILETIME *pCreationTime, SGP_FILETIME *pLastAccessedTime, SGP_FILETIME *pLastWriteTime )
{
return( FALSE );
}
INT32 CompareSGPFileTimes( SGP_FILETIME *pFirstFileTime, SGP_FILETIME *pSecondFileTime )
{
return( CompareFileTime( pFirstFileTime, pSecondFileTime ) );
}
UINT32 FileSize(STR strFilename)
{
vfs::IBaseFile *pFile = getVFS()->getFile(vfs::Path(strFilename));
-15
View File
@@ -145,24 +145,9 @@ BOOLEAN GetFileFirst( CHAR8 * pSpec, GETFILESTRUCT *pGFStruct );
BOOLEAN GetFileNext( GETFILESTRUCT *pGFStruct );
void GetFileClose( GETFILESTRUCT *pGFStruct );
//Added by Kris Morness
BOOLEAN FileSetAttributes( STR filename, UINT32 uiNewAttribs );
UINT32 FileGetAttributes( STR filename );
//returns true if at end of file, else false
BOOLEAN FileCheckEndOfFile( HWFILE hFile );
BOOLEAN GetFileManFileTime( HWFILE hFile, SGP_FILETIME *pCreationTime, SGP_FILETIME *pLastAccessedTime, SGP_FILETIME *pLastWriteTime );
// CompareSGPFileTimes() returns...
// -1 if the First file time is less than second file time. ( first file is older )
// 0 First file time is equal to second file time.
// +1 First file time is greater than second file time ( first file is newer ).
INT32 CompareSGPFileTimes( SGP_FILETIME *pFirstFileTime, SGP_FILETIME *pSecondFileTime );
// One call comparison of file times, allowing for a certain leeway in cases where
// files times may be slightly different due to SourceSafe of copying
BOOLEAN FileIsOlderThanFile(CHAR8 *pcFileName1, CHAR8 *pcFileName2, UINT32 ulNumSeconds);