- second code patch from Brent Johnson (Nonomori), aimed at source compatibility with VS.NET 2005

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@520 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Lesh
2006-09-10 10:26:43 +00:00
parent 93204e907d
commit e449942dc2
6 changed files with 31 additions and 35 deletions
+10 -10
View File
@@ -132,22 +132,22 @@ BOOLEAN LoadShadeTable( HVOBJECT pObj, UINT32 uiTileTypeIndex )
HWFILE hfile;
INT32 i;
UINT32 uiNumBytesRead;
UINT8 ShadeFileName[ 100 ];
UINT8 *ptr;
CHAR8 ShadeFileName[ 100 ];
CHAR8 *ptr;
//ASSUMPTIONS:
//We are assuming that the uiTileTypeIndex is referring to the correct file
//stored in the TileSurfaceFilenames[]. If it isn't, then that is a huge problem
//and should be fixed. Also assumes that the directory is set to Data\ShadeTables.
strcpy( ShadeFileName, TileSurfaceFilenames[ uiTileTypeIndex ] );
ptr = (UINT8 *)strstr( ShadeFileName, "." );
ptr = strstr( ShadeFileName, "." );
if( !ptr )
{
return FALSE;
}
ptr++;
sprintf( (char *)ptr, "sha" );
sprintf( ptr, "sha" );
hfile = FileOpen( (STR)ShadeFileName, FILE_ACCESS_READ, FALSE );
hfile = FileOpen( ShadeFileName, FILE_ACCESS_READ, FALSE );
if( !hfile )
{ //File doesn't exist, so generate it
FileClose( hfile );
@@ -176,8 +176,8 @@ BOOLEAN SaveShadeTable( HVOBJECT pObj, UINT32 uiTileTypeIndex )
HWFILE hfile;
INT32 i;
UINT32 uiNumBytesWritten;
UINT8 ShadeFileName[ 100 ];
UINT8 *ptr;
CHAR8 ShadeFileName[ 100 ];
CHAR8 *ptr;
#ifdef JA2TESTVERSION
uiNumTablesSaved++;
#endif
@@ -186,15 +186,15 @@ BOOLEAN SaveShadeTable( HVOBJECT pObj, UINT32 uiTileTypeIndex )
//stored in the TileSurfaceFilenames[]. If it isn't, then that is a huge problem
//and should be fixed. Also assumes that the directory is set to Data\ShadeTables.
strcpy( ShadeFileName, TileSurfaceFilenames[ uiTileTypeIndex ] );
ptr = (UINT8 *)strstr( ShadeFileName, "." );
ptr = strstr( ShadeFileName, "." );
if( !ptr )
{
return FALSE;
}
ptr++;
sprintf( (char *) ptr, "sha" );
sprintf( ptr, "sha" );
hfile = FileOpen( (STR)ShadeFileName, FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE );
hfile = FileOpen( ShadeFileName, FILE_ACCESS_WRITE | FILE_CREATE_ALWAYS, FALSE );
if( !hfile )
{
FileClose( hfile );