mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
*** Merged Code from Multiplayer Branch Revision 2960 ***
- Virtual File System (VFS) by birdflu. This is needed for Multiplayer and is also used for Single Player. Very neat system :-) - Multiplayer Version 1.1 + some additional features and bugfixes * INFO: If you compile a new EXE and want to test, be sure to also use the latest SVN GameDir files in your JA2 install directory * git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2961 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+41
-35
@@ -522,8 +522,9 @@ extern BOOLEAN gfLoadShadeTablesFromTextFile;
|
||||
void BuildTileShadeTables( )
|
||||
{
|
||||
HWFILE hfile;
|
||||
STRING512 DataDir;
|
||||
STRING512 ShadeTableDir;
|
||||
// BF
|
||||
//STRING512 DataDir;
|
||||
//STRING512 ShadeTableDir;
|
||||
UINT32 uiLoop;
|
||||
CHAR8 cRootFile[ 128 ];
|
||||
BOOLEAN fForceRebuildForSlot = FALSE;
|
||||
@@ -540,18 +541,22 @@ void BuildTileShadeTables( )
|
||||
uiStartTime = GetJA2Clock();
|
||||
#endif
|
||||
|
||||
|
||||
//Set the directory to the shadetable directory
|
||||
GetFileManCurrentDirectory( DataDir );
|
||||
sprintf( ShadeTableDir, "%s\\ShadeTables", DataDir );
|
||||
if( !SetFileManCurrentDirectory( ShadeTableDir ) )
|
||||
// BF : adjust filename, instead of changing current directory (doesn't make sence with a VFS)
|
||||
//////////////Set the directory to the shadetable directory
|
||||
////////////GetFileManCurrentDirectory( DataDir );
|
||||
////////////sprintf( ShadeTableDir, "%s\\ShadeTables", DataDir );
|
||||
////////////if( !SetFileManCurrentDirectory( ShadeTableDir ) )
|
||||
////////////{
|
||||
//////////// AssertMsg( 0, "Can't set the directory to Data\\ShadeTable. Kris' big problem!" );
|
||||
////////////}
|
||||
CHAR8 sIgnoreShadeTables[50];
|
||||
sprintf( sIgnoreShadeTables, "%s\\%s", "ShadeTables", "IgnoreShadeTables.txt");
|
||||
//hfile = FileOpen( sIgnoreShadeTables, FILE_ACCESS_READ, FALSE );
|
||||
//if( hfile )
|
||||
//{
|
||||
// FileClose( hfile );
|
||||
if(FileExists(sIgnoreShadeTables))
|
||||
{
|
||||
AssertMsg( 0, "Can't set the directory to Data\\ShadeTable. Kris' big problem!" );
|
||||
}
|
||||
hfile = FileOpen( "IgnoreShadeTables.txt", FILE_ACCESS_READ, FALSE );
|
||||
if( hfile )
|
||||
{
|
||||
FileClose( hfile );
|
||||
gfForceBuildShadeTables = TRUE;
|
||||
}
|
||||
else
|
||||
@@ -585,40 +590,41 @@ void BuildTileShadeTables( )
|
||||
if ( gTileSurfaceArray[ uiLoop ] != NULL )
|
||||
{
|
||||
// Don't Create shade tables if default were already used once!
|
||||
#ifdef JA2EDITOR
|
||||
if( gbNewTileSurfaceLoaded[ uiLoop ] || gfEditorForceShadeTableRebuild )
|
||||
#else
|
||||
if( gbNewTileSurfaceLoaded[ uiLoop ] )
|
||||
#endif
|
||||
{
|
||||
fForceRebuildForSlot = FALSE;
|
||||
#ifdef JA2EDITOR
|
||||
if( gbNewTileSurfaceLoaded[ uiLoop ] || gfEditorForceShadeTableRebuild )
|
||||
#else
|
||||
if( gbNewTileSurfaceLoaded[ uiLoop ] )
|
||||
#endif
|
||||
{
|
||||
fForceRebuildForSlot = FALSE;
|
||||
|
||||
GetRootName( cRootFile, TileSurfaceFilenames[ uiLoop ] );
|
||||
|
||||
if ( strcmp( cRootFile, "grass2" ) == 0 )
|
||||
{
|
||||
fForceRebuildForSlot = TRUE;
|
||||
}
|
||||
if ( strcmp( cRootFile, "grass2" ) == 0 )
|
||||
{
|
||||
fForceRebuildForSlot = TRUE;
|
||||
}
|
||||
|
||||
#ifdef JA2TESTVERSION
|
||||
uiNumImagesReloaded++;
|
||||
#endif
|
||||
RenderProgressBar( 0, uiLoop * 100 / NUMBEROFTILETYPES );
|
||||
CreateTilePaletteTables( gTileSurfaceArray[ uiLoop ]->vo, uiLoop, fForceRebuildForSlot );
|
||||
}
|
||||
#ifdef JA2TESTVERSION
|
||||
uiNumImagesReloaded++;
|
||||
#endif
|
||||
RenderProgressBar( 0, uiLoop * 100 / NUMBEROFTILETYPES );
|
||||
CreateTilePaletteTables( gTileSurfaceArray[ uiLoop ]->vo, uiLoop, fForceRebuildForSlot );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Restore the data directory once we are finished.
|
||||
SetFileManCurrentDirectory( DataDir );
|
||||
// BF : see above
|
||||
////Restore the data directory once we are finished.
|
||||
//SetFileManCurrentDirectory( DataDir );
|
||||
|
||||
ubLastRed = gpLightColors[0].peRed;
|
||||
ubLastGreen = gpLightColors[0].peGreen;
|
||||
ubLastBlue = gpLightColors[0].peBlue;
|
||||
|
||||
#ifdef JA2TESTVERSION
|
||||
uiBuildShadeTableTime = GetJA2Clock() - uiStartTime;
|
||||
#endif
|
||||
#ifdef JA2TESTVERSION
|
||||
uiBuildShadeTableTime = GetJA2Clock() - uiStartTime;
|
||||
#endif
|
||||
}
|
||||
|
||||
void DestroyTileShadeTables( )
|
||||
|
||||
Reference in New Issue
Block a user