Remove #ifdefs for USE_VFS

This commit is contained in:
Asdow
2023-10-08 16:45:06 +03:00
parent eca4086d30
commit 4b1de56b01
34 changed files with 9 additions and 1916 deletions
-6
View File
@@ -557,12 +557,6 @@ BOOLEAN LoadAllMapChangesFromMapTempFileAndApplyThem( )
{
ReSetSectorFlag( gWorldSectorX, gWorldSectorY, gbWorldSectorZ, SF_MAP_MODIFICATIONS_TEMP_FILE_EXISTS );
}
#ifndef USE_VFS
FileClose( hFile );
#else
// FileClose( hFile );
// file already deleted. can't close it anymore (handle is invalid)
#endif
//Free the memory used for the temp array
MemFree( pTempArrayOfMaps );
-31
View File
@@ -24,10 +24,6 @@ BOOLEAN gfForceBuildShadeTables = FALSE;
void DetermineRGBDistributionSettings()
{
#ifndef USE_VFS
STRING512 DataDir;
STRING512 ExecDir;
#endif
STRING512 ShadeTableDir;
UINT32 uiRBitMask, uiGBitMask, uiBBitMask;
UINT32 uiPrevRBitMask, uiPrevGBitMask, uiPrevBBitMask;
@@ -37,36 +33,9 @@ void DetermineRGBDistributionSettings()
BOOLEAN fCleanShadeTable = FALSE;
BOOLEAN fLoadedPrevRGBDist = FALSE;
#ifndef USE_VFS
// Snap: save current directory
GetFileManCurrentDirectory( DataDir );
//First, determine if we have a file saved. If not, then this is the first time, and
//all shade tables will have to be built and saved to disk. This can be time consuming, adding up to
//3-4 seconds to the time of a map load.
GetExecutableDirectory( ExecDir );
sprintf( ShadeTableDir, "%s\\%s", DataDir, SHADE_TABLE_DIR );
//Check to make sure we have a ShadeTable directory. If we don't create one!
if( !SetFileManCurrentDirectory( ShadeTableDir ) )
{
if( !MakeFileManDirectory( ShadeTableDir ) )
{
AssertMsg( 0, "ShadeTable directory doesn't exist, and couldn't create one!" );
}
if( !SetFileManCurrentDirectory( ShadeTableDir ) )
{
AssertMsg( 0, "Couldn't access the newly created ShadeTable directory." );
}
fSaveRGBDist = TRUE;
}
// directory existed or was created.
SetFileManCurrentDirectory( DataDir );
#else
// changing the current directory can screw up the VFS; don't do it
// the creation of the SHADE_TABLE_DIR directory is done by the VFS
sprintf( ShadeTableDir, "%s", SHADE_TABLE_DIR );
#endif
CHAR8 sRGBDist[50];
sprintf( sRGBDist, "%s\\%s", SHADE_TABLE_DIR, "RGBDist.dat");
-2
View File
@@ -138,7 +138,6 @@ void InitEngineTilesets( )
#endif
}
#ifdef USE_VFS
void ExportTilesets(vfs::Path const& filename)
{
UINT32 uiNumBytesRead = 0;
@@ -217,7 +216,6 @@ void ExportTilesets(vfs::Path const& filename)
xmlw.closeNode();
xmlw.writeToFile(filename);
}
#endif
void SetTilesetOneTerrainValues( )
{
-8
View File
@@ -2437,14 +2437,10 @@ BOOLEAN EvaluateWorld(STR8 pSector, UINT8 ubLevel)
if(ValidMapFileName(szFileName))
strcpy(szFilename, pSector);
sprintf(szDirFilename, "MAPS\\%s", szFilename);
#ifdef USE_VFS//dnl ch81 021213
if(guiCurrentScreen == LOADSAVE_SCREEN)
hfile = FileOpen(szDirFilename, FILE_ACCESS_READ, FALSE, gzProfileName);
else
hfile = FileOpen(szDirFilename, FILE_ACCESS_READ);
#else
hfile = FileOpen(szDirFilename, FILE_ACCESS_READ, FALSE);
#endif
if(!hfile)
return(FALSE);
uiFileSize = FileGetSize(hfile);
@@ -2851,7 +2847,6 @@ BOOLEAN LoadWorld(const STR8 puiFilename, FLOAT* pMajorMapVersion, UINT8* pMinor
else
sprintf(aFilename, "MAPS\\%s", puiFilename);
// Open file
#ifdef USE_VFS//dnl ch81 021213
#ifdef JA2EDITOR
if(guiCurrentScreen == LOADSAVE_SCREEN)
hfile = FileOpen(aFilename, FILE_ACCESS_READ, FALSE, gzProfileName);
@@ -2859,9 +2854,6 @@ BOOLEAN LoadWorld(const STR8 puiFilename, FLOAT* pMajorMapVersion, UINT8* pMinor
hfile = FileOpen(aFilename, FILE_ACCESS_READ);
#else
hfile = FileOpen(aFilename, FILE_ACCESS_READ);
#endif
#else
hfile = FileOpen(aFilename, FILE_ACCESS_READ, FALSE);
#endif
if(!hfile)
{