bug fixes from Overhaul:

- Data type changes 
- Templates removed

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@871 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2007-05-09 13:16:37 +00:00
parent 61d6152ce5
commit 0530b53b9c
256 changed files with 2000 additions and 2228 deletions
+9 -11
View File
@@ -746,17 +746,17 @@ BOOLEAN CopyExternBackgroundRect( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 s
// to the video buffer.
//
//*****************************************************************************
UINT16 gprintfdirty(INT16 x, INT16 y, wchar_t * pFontString, ...)
UINT16 gprintfdirty(INT16 x, INT16 y, STR16 pFontString, ...)
{
va_list argptr;
wchar_t string[512];
CHAR16 string[512];
UINT16 uiStringLength, uiStringHeight;
INT32 iBack;
Assert(pFontString!=NULL);
va_start(argptr, pFontString); // Set up variable argument pointer
vswprintf(string, (wchar_t *)pFontString, argptr); // process gprintf string (get output str)
vswprintf(string, pFontString, argptr); // process gprintf string (get output str)
va_end(argptr);
if ( USE_WINFONTS( ) )
@@ -783,16 +783,16 @@ INT32 iBack;
return(uiStringLength);
}
UINT16 gprintfinvalidate(INT16 x, INT16 y, wchar_t * pFontString, ...)
UINT16 gprintfinvalidate(INT16 x, INT16 y, STR16 pFontString, ...)
{
va_list argptr;
wchar_t string[512];
CHAR16 string[512];
UINT16 uiStringLength, uiStringHeight;
Assert(pFontString!=NULL);
va_start(argptr, pFontString); // Set up variable argument pointer
vswprintf(string, (wchar_t *)pFontString, argptr); // process gprintf string (get output str)
vswprintf(string, pFontString, argptr); // process gprintf string (get output str)
va_end(argptr);
uiStringLength=StringPixLength(string, FontDefault);
@@ -805,18 +805,16 @@ UINT16 uiStringLength, uiStringHeight;
return(uiStringLength);
}
// explicit instantiating work around MSVC not supporting export templated functions/classes (jonathanl)
UINT16 gprintfRestore(INT16 x, INT16 y, wchar_t * pFontString, ...)
UINT16 gprintfRestore(INT16 x, INT16 y, STR16 pFontString, ...)
{
va_list argptr;
wchar_t string[512];
CHAR16 string[512];
UINT16 uiStringLength, uiStringHeight;
Assert(pFontString!=NULL);
va_start(argptr, pFontString); // Set up variable argument pointer
vswprintf(string, (wchar_t *)pFontString, argptr); // process gprintf string (get output str)
vswprintf(string, pFontString, argptr); // process gprintf string (get output str)
va_end(argptr);
uiStringLength=StringPixLength(string, FontDefault);
+5 -5
View File
@@ -61,7 +61,7 @@ typedef struct _VIDEO_OVERLAY
INT16 sY;
UINT8 ubFontBack;
UINT8 ubFontFore;
INT16 zText[ 200 ];
CHAR16 zText[ 200 ];
UINT32 uiDestBuff;
OVERLAY_CALLBACK BltCallback;
@@ -83,7 +83,7 @@ typedef struct
INT16 sY;
UINT8 ubFontBack;
UINT8 ubFontFore;
wchar_t pzText[ 200 ];
CHAR16 pzText[ 200 ];
OVERLAY_CALLBACK BltCallback;
} VIDEO_OVERLAY_DESC;
@@ -124,9 +124,9 @@ BOOLEAN EmptyBackgroundRects( void );
// GPRINTF DIRTY STUFF
UINT16 gprintfdirty(INT16 x, INT16 y, wchar_t * pFontString, ...);
UINT16 gprintfinvalidate(INT16 x, INT16 y, wchar_t * pFontString, ...);
UINT16 gprintfRestore(INT16 x, INT16 y, wchar_t * pFontString, ...);
UINT16 gprintfdirty(INT16 x, INT16 y, STR16 pFontString, ...);
UINT16 gprintfinvalidate(INT16 x, INT16 y, STR16 pFontString, ...);
UINT16 gprintfRestore(INT16 x, INT16 y, STR16 pFontString, ...);
// VIDEO OVERLAY STUFF
+1 -1
View File
@@ -440,7 +440,7 @@ void RenderTacticalPlacementGUI()
SOLDIERTYPE *pSoldier;
UINT32 uiDestPitchBYTES;
UINT16 usHatchColor;
wchar_t str[ 128 ];
CHAR16 str[ 128 ];
UINT8 *pDestBuf;
UINT8 ubColor;
+1 -1
View File
@@ -77,7 +77,7 @@ ANITILE *CreateAnimationTile( ANITILE_PARAMS *pAniParams )
{
if ( ( uiFlags & ANITILE_CACHEDTILE ) )
{
iCachedTile = GetCachedTile( (INT8 *)pAniParams->zCachedFile );
iCachedTile = GetCachedTile( pAniParams->zCachedFile );
if ( iCachedTile == -1 )
{
+9 -9
View File
@@ -74,7 +74,7 @@ BOOLEAN InitTileCache( )
sprintf( gpTileCacheStructInfo[ cnt ].Filename, "TILECACHE\\%s", FileInfo.zFileName );
// Get root name
GetRootName( (INT8 *)gpTileCacheStructInfo[ cnt ].zRootName, (INT8 *)gpTileCacheStructInfo[ cnt ].Filename );
GetRootName( gpTileCacheStructInfo[ cnt ].zRootName, gpTileCacheStructInfo[ cnt ].Filename );
// Load struc data....
gpTileCacheStructInfo[ cnt ].pStructureFileRef = LoadStructureFile( gpTileCacheStructInfo[ cnt ].Filename );
@@ -125,7 +125,7 @@ void DeleteTileCache( )
guiCurTileCacheSize = 0;
}
INT16 FindCacheStructDataIndex( INT8 * cFilename )
INT16 FindCacheStructDataIndex( STR8 cFilename )
{
UINT32 cnt;
@@ -140,7 +140,7 @@ INT16 FindCacheStructDataIndex( INT8 * cFilename )
return( -1 );
}
INT32 GetCachedTile( INT8 * cFilename )
INT32 GetCachedTile( const STR8 cFilename )
{
UINT32 cnt;
UINT32 ubLowestIndex = 0;
@@ -189,7 +189,7 @@ INT32 GetCachedTile( INT8 * cFilename )
if ( gpTileCache[ cnt ].pImagery == NULL )
{
// Insert here
gpTileCache[ cnt ].pImagery = LoadTileSurface( (char *)cFilename );
gpTileCache[ cnt ].pImagery = LoadTileSurface( cFilename );
if ( gpTileCache[ cnt ].pImagery == NULL )
{
@@ -200,9 +200,9 @@ INT32 GetCachedTile( INT8 * cFilename )
gpTileCache[ cnt ].sHits = 1;
// Get root name
GetRootName( (INT8 *)gpTileCache[ cnt ].zRootName, cFilename );
GetRootName( gpTileCache[ cnt ].zRootName, cFilename );
gpTileCache[ cnt ].sStructRefID = FindCacheStructDataIndex( (INT8 *)gpTileCache[ cnt ].zRootName );
gpTileCache[ cnt ].sStructRefID = FindCacheStructDataIndex( gpTileCache[ cnt ].zRootName );
// ATE: Add z-strip info
if ( gpTileCache[ cnt ].sStructRefID != -1 )
@@ -296,7 +296,7 @@ STRUCTURE_FILE_REF *GetCachedTileStructureRef( INT32 iIndex )
}
STRUCTURE_FILE_REF *GetCachedTileStructureRefFromFilename( INT8 *cFilename )
STRUCTURE_FILE_REF *GetCachedTileStructureRefFromFilename( const STR8 cFilename )
{
INT16 sStructDataIndex;
@@ -350,7 +350,7 @@ void CheckForAndDeleteTileCacheStructInfo( LEVELNODE *pNode, UINT16 usIndex )
}
}
void GetRootName( INT8 * pDestStr, INT8 * pSrcStr )
void GetRootName( STR8 pDestStr, const STR8 pSrcStr )
{
// Remove path and extension
CHAR8 cTempFilename[ 120 ];
@@ -370,7 +370,7 @@ void GetRootName( INT8 * pDestStr, INT8 * pSrcStr )
}
// Now remove extension...
cEndOfName = strchr( (char *)pDestStr, '.' );
cEndOfName = strchr( pDestStr, '.' );
if (cEndOfName != NULL)
{
*cEndOfName = '\0';
+3 -3
View File
@@ -34,18 +34,18 @@ BOOLEAN InitTileCache( );
void DeleteTileCache( );
INT32 GetCachedTile( INT8 *cFilename );
INT32 GetCachedTile( const STR8 cFilename );
BOOLEAN RemoveCachedTile( INT32 iCachedTile );
STRUCTURE_FILE_REF *GetCachedTileStructureRefFromFilename( INT8 *cFilename );
STRUCTURE_FILE_REF *GetCachedTileStructureRefFromFilename( const STR8 cFilename );
HVOBJECT GetCachedTileVideoObject( INT32 iIndex );
STRUCTURE_FILE_REF *GetCachedTileStructureRef( INT32 iIndex );
void CheckForAndAddTileCacheStructInfo( LEVELNODE *pNode, INT16 sGridNo, UINT16 usIndex, UINT16 usSubIndex );
void CheckForAndDeleteTileCacheStructInfo( LEVELNODE *pNode, UINT16 usIndex );
void GetRootName( INT8 *pDestStr, INT8 *pSrcStr );
void GetRootName( STR8 pDestStr, const STR8 pSrcStr );
// OF COURSE, FOR SPEED, WE EXPORT OUR ARRAY
+5 -5
View File
@@ -23,7 +23,7 @@ TILE_IMAGERY *gTileSurfaceArray[ NUMBEROFTILETYPES ];
UINT8 gbDefaultSurfaceUsed[ NUMBEROFTILETYPES ];
UINT8 gbSameAsDefaultSurfaceUsed[ NUMBEROFTILETYPES ];
TILE_IMAGERY *LoadTileSurface( char * cFilename )
TILE_IMAGERY *LoadTileSurface( STR8 cFilename )
{
// Add tile surface
PTILE_IMAGERY pTileSurf = NULL;
@@ -158,14 +158,14 @@ void DeleteTileSurface( PTILE_IMAGERY pTileSurf )
}
extern void GetRootName( INT8 *pDestStr, INT8 *pSrcStr );
extern void GetRootName( STR8 pDestStr, const STR8 pSrcStr );
void SetRaisedObjectFlag( char *cFilename, TILE_IMAGERY *pTileSurf )
void SetRaisedObjectFlag( STR8 cFilename, TILE_IMAGERY *pTileSurf )
{
INT32 cnt = 0;
CHAR8 cRootFile[ 128 ];
UINT8 ubRaisedObjectFiles[][80] =
CHAR8 ubRaisedObjectFiles[][80] =
{
"bones",
"bones2",
@@ -185,7 +185,7 @@ void SetRaisedObjectFlag( char *cFilename, TILE_IMAGERY *pTileSurf )
// set global value...
if ( ( pTileSurf->fType >= DEBRISWOOD && pTileSurf->fType <= DEBRISWEEDS ) || pTileSurf->fType == DEBRIS2MISC || pTileSurf->fType == ANOTHERDEBRIS )
{
GetRootName( (INT8 *)cRootFile, (INT8 *)cFilename );
GetRootName( cRootFile, cFilename );
while( ubRaisedObjectFiles[ cnt ][ 0 ] != '1' )
{
if ( _stricmp( ubRaisedObjectFiles[ cnt ], cRootFile ) == 0 )
+1 -1
View File
@@ -79,7 +79,7 @@ void InitEngineTilesets( )
FileRead( hfile, &(gTilesets[ cnt ].ubAmbientID), sizeof( UINT8 ), &uiNumBytesRead );
// Set into tileset
swprintf( (wchar_t *)gTilesets[ cnt ].zName, L"%S", zName );
swprintf( gTilesets[ cnt ].zName, L"%S", zName );
// Loop for files
for ( cnt2 = 0; cnt2 < uiNumFiles; cnt2++ )
+1 -1
View File
@@ -10,7 +10,7 @@ typedef void (*TILESET_CALLBACK)( void );
typedef struct
{
INT16 zName[ 32 ];
CHAR16 zName[ 32 ];
CHAR8 TileSurfaceFilenames[ NUMBEROFTILETYPES ][32];
UINT8 ubAmbientID;
TILESET_CALLBACK MovementCostFnc;
+4 -4
View File
@@ -14,7 +14,7 @@ struct
{
PARSE_STAGE curElement;
INT8 szCharData[MAX_CHAR_DATA_LENGTH+1];
CHAR8 szCharData[MAX_CHAR_DATA_LENGTH+1];
EXPLOSION_DATA expData;
UINT32 maxArraySize;
@@ -25,7 +25,7 @@ struct
typedef explosionDataParseData;
static void XMLCALL
explosionDataStartElementHandle(void *userData, const char *name, const char **atts)
explosionDataStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
{
explosionDataParseData * pData = (explosionDataParseData *)userData;
@@ -69,7 +69,7 @@ explosionDataStartElementHandle(void *userData, const char *name, const char **a
}
static void XMLCALL
explosionDataCharacterDataHandle(void *userData, const char *str, int len)
explosionDataCharacterDataHandle(void *userData, const XML_Char *str, int len)
{
explosionDataParseData * pData = (explosionDataParseData *)userData;
@@ -82,7 +82,7 @@ explosionDataCharacterDataHandle(void *userData, const char *str, int len)
static void XMLCALL
explosionDataEndElementHandle(void *userData, const char *name)
explosionDataEndElementHandle(void *userData, const XML_Char *name)
{
explosionDataParseData * pData = (explosionDataParseData *)userData;
+9 -9
View File
@@ -212,7 +212,7 @@ void LoadShadeTablesFromTextFile()
FILE *fp;
INT32 i, j;
INT32 num;
UINT8 str[10];
CHAR8 str[10];
if( gfLoadShadeTablesFromTextFile )
{
fp = fopen( "ShadeTables.txt", "r" );
@@ -224,7 +224,7 @@ void LoadShadeTablesFromTextFile()
for( j = 0; j < 3; j++ )
{
fscanf( fp, "%s", str );
sscanf( (const char *)str, "%d", &num );
sscanf( str, "%d", &num );
gusShadeLevels[i][j] = (UINT16)num;
}
}
@@ -2088,7 +2088,7 @@ INT16 iCountY, iCountX;
INT32 LightCreateOmni(UINT8 ubIntensity, INT16 iRadius)
{
INT32 iLight;
UINT8 usName[14];
CHAR8 usName[14];
iLight=LightGetFree();
if(iLight!=(-1))
@@ -2096,7 +2096,7 @@ UINT8 usName[14];
LightGenerateElliptical(iLight, ubIntensity, (INT16)(iRadius*DISTANCE_SCALE), (INT16)(iRadius*DISTANCE_SCALE));
}
sprintf((char *)usName, "LTO%d.LHT", iRadius);
sprintf(usName, "LTO%d.LHT", iRadius);
pLightNames[iLight]= (STR) MemAlloc(strlen(usName)+1);
strcpy(pLightNames[iLight], usName);
@@ -2112,7 +2112,7 @@ UINT8 usName[14];
INT32 LightCreateSquare(UINT8 ubIntensity, INT16 iRadius1, INT16 iRadius2)
{
INT32 iLight;
UINT8 usName[14];
CHAR8 usName[14];
iLight=LightGetFree();
if(iLight!=(-1))
@@ -2120,7 +2120,7 @@ UINT8 usName[14];
LightGenerateSquare(iLight, ubIntensity, (INT16)(iRadius1*DISTANCE_SCALE), (INT16)(iRadius2*DISTANCE_SCALE));
}
sprintf((char *)usName, "LTS%d-%d.LHT", iRadius1, iRadius2);
sprintf(usName, "LTS%d-%d.LHT", iRadius1, iRadius2);
pLightNames[iLight]= (STR) MemAlloc(strlen(usName)+1);
strcpy(pLightNames[iLight], usName);
@@ -2136,13 +2136,13 @@ UINT8 usName[14];
INT32 LightCreateElliptical(UINT8 ubIntensity, INT16 iRadius1, INT16 iRadius2)
{
INT32 iLight;
UINT8 usName[14];
CHAR8 usName[14];
iLight=LightGetFree();
if(iLight!=(-1))
LightGenerateElliptical(iLight, ubIntensity, (INT16)(iRadius1*DISTANCE_SCALE), (INT16)(iRadius2*DISTANCE_SCALE));
sprintf((char *) usName, "LTE%d-%d.LHT", iRadius1, iRadius2);
sprintf(usName, "LTE%d-%d.LHT", iRadius1, iRadius2);
pLightNames[iLight]= (STR) MemAlloc(strlen(usName)+1);
strcpy(pLightNames[iLight], usName);
@@ -3226,7 +3226,7 @@ INT32 iSprite;
LightSprites[iSprite].iOldY=WORLD_ROWS+1;
LightSprites[iSprite].uiLightType=uiLightType;
if((LightSprites[iSprite].iTemplate=LightLoadCachedTemplate((STR) pName))==(-1))
if((LightSprites[iSprite].iTemplate=LightLoadCachedTemplate( pName))==(-1))
return(-1);
LightSprites[iSprite].uiFlags|=LIGHT_SPR_ACTIVE;
+1 -1
View File
@@ -1356,7 +1356,7 @@ void RenderOverheadOverlays()
usLineColor = Get16BPPColor( FROMRGB( 255, 0, 0 ) );
}
PixelDraw( FALSE, sX, sY, usLineColor, (INT8 *)pDestBuf );
PixelDraw( FALSE, sX, sY, usLineColor, pDestBuf );
InvalidateRegion( sX, sY, (INT16)( sX + 1 ), (INT16)( sY + 1 ) );
+3 -3
View File
@@ -52,7 +52,7 @@
#include "Render Z.cpp"
///////////////////////////
extern INT8 gDebugStr[128];
extern CHAR8 gDebugStr[128];
extern BOOLEAN fLandLayerDirty = TRUE;
extern INT16 gsVIEWPORT_START_X;
@@ -4052,7 +4052,7 @@ BOOLEAN ApplyScrolling( INT16 sTempRenderCenterX, INT16 sTempRenderCenterY, BOOL
fOutBottom = TRUE;
}
sprintf( (char *)gDebugStr, "Angles: %d %d %d %d", (int)at1, (int)at2, (int)at3, (int)at4 );
sprintf( gDebugStr, "Angles: %d %d %d %d", (int)at1, (int)at2, (int)at3, (int)at4 );
if ( !fOutRight && !fOutLeft && !fOutTop && !fOutBottom )
{
@@ -4166,7 +4166,7 @@ BOOLEAN ApplyScrolling( INT16 sTempRenderCenterX, INT16 sTempRenderCenterY, BOOL
{
if ( !fCheckOnly )
{
sprintf( (char *)gDebugStr, "Center: %d %d ", (int)gsRenderCenterX, (int)gsRenderCenterY );
sprintf( gDebugStr, "Center: %d %d ", (int)gsRenderCenterX, (int)gsRenderCenterY );
//Makesure it's a multiple of 5
sMult = sTempRenderCenterX / CELL_X_SIZE;
+27 -27
View File
@@ -78,10 +78,10 @@
#ifdef JA2EDITOR
extern BOOLEAN gfErrorCatch;
extern UINT16 gzErrorCatchString[256];
extern CHAR16 gzErrorCatchString[256];
#endif
UINT8 gubFilename[200];
CHAR8 gubFilename[200];
// TEMP
BOOLEAN gfForceLoadPlayers = FALSE;
@@ -119,7 +119,7 @@ BOOLEAN IsRoofVisibleForWireframe( INT16 sMapPos );
INT8 IsHiddenTileMarkerThere( INT16 sGridNo );
extern void SetInterfaceHeightLevel( );
extern void GetRootName( INT8 *pDestStr, INT8 *pSrcStr );
extern void GetRootName( STR8 pDestStr, const STR8 pSrcStr );
void SaveMapLights( HWFILE hfile );
@@ -350,7 +350,7 @@ BOOLEAN LoadTileSurfaces( char ppTileSurfaceFilenames[][32], UINT8 ubTilesetID )
else
{
for (uiLoop = 0; uiLoop < NUMBEROFTILETYPES; uiLoop++)
strcpy( TileSurfaceFilenames[uiLoop], ppTileSurfaceFilenames[uiLoop] );//(char *)(ppTileSurfaceFilenames + (65 * uiLoop)) );
strcpy( TileSurfaceFilenames[uiLoop], ppTileSurfaceFilenames[uiLoop] );//(ppTileSurfaceFilenames + (65 * uiLoop)) );
}
@@ -430,7 +430,7 @@ BOOLEAN LoadTileSurfaces( char ppTileSurfaceFilenames[][32], UINT8 ubTilesetID )
// ATE: If here, don't load default surface if already loaded...
if ( !gbDefaultSurfaceUsed[ uiLoop ] )
{
strcpy( TileSurfaceFilenames[uiLoop], gTilesets[ TLS_GENERIC_1 ].TileSurfaceFilenames[uiLoop] );//(char *)(ppTileSurfaceFilenames + (65 * uiLoop)) );
strcpy( TileSurfaceFilenames[uiLoop], gTilesets[ TLS_GENERIC_1 ].TileSurfaceFilenames[uiLoop] );//(ppTileSurfaceFilenames + (65 * uiLoop)) );
if (AddTileSurface( gTilesets[ TLS_GENERIC_1 ].TileSurfaceFilenames[uiLoop], uiLoop, TLS_GENERIC_1, FALSE ) == FALSE)
{
DestroyTileSurfaces( );
@@ -449,7 +449,7 @@ BOOLEAN LoadTileSurfaces( char ppTileSurfaceFilenames[][32], UINT8 ubTilesetID )
return( TRUE );
}
BOOLEAN AddTileSurface( char * cFilename, UINT32 ubType, UINT8 ubTilesetID, BOOLEAN fGetFromRoot )
BOOLEAN AddTileSurface( STR8 cFilename, UINT32 ubType, UINT8 ubTilesetID, BOOLEAN fGetFromRoot )
{
// Add tile surface
PTILE_IMAGERY TileSurf;
@@ -581,7 +581,7 @@ void BuildTileShadeTables( )
{
fForceRebuildForSlot = FALSE;
GetRootName( (INT8 *)cRootFile, (INT8 *)TileSurfaceFilenames[ uiLoop ] );
GetRootName( cRootFile, TileSurfaceFilenames[ uiLoop ] );
if ( strcmp( cRootFile, "grass2" ) == 0 )
{
@@ -1621,7 +1621,7 @@ void CompileWorldMovementCosts( )
// SAVING CODE
BOOLEAN SaveWorld( UINT8 * puiFilename )
BOOLEAN SaveWorld( const STR8 puiFilename )
{
#ifdef JA2EDITOR
INT32 cnt;
@@ -2115,7 +2115,7 @@ BOOLEAN SaveWorld( UINT8 * puiFilename )
FileClose( hfile );
sprintf( (char *)gubFilename, (char *)puiFilename );
sprintf( gubFilename, puiFilename );
#endif //JA2EDITOR
return( TRUE );
@@ -2220,7 +2220,7 @@ void InitLoadedWorld( )
extern double MasterStart, MasterEnd;
extern BOOLEAN gfUpdatingNow;
BOOLEAN EvaluateWorld( UINT8 * pSector, UINT8 ubLevel )
BOOLEAN EvaluateWorld( STR8 pSector, UINT8 ubLevel )
{
FLOAT dMajorMapVersion;
SUMMARYFILE *pSummary;
@@ -2233,20 +2233,20 @@ BOOLEAN EvaluateWorld( UINT8 * pSector, UINT8 ubLevel )
INT32 cnt;
INT32 i;
INT32 iTilesetID;
wchar_t str[40];
CHAR16 str[40];
UINT8 bCounts[ WORLD_MAX ][8];
UINT8 ubCombine;
UINT8 szDirFilename[ 50 ];
UINT8 szFilename[ 40 ];
CHAR8 szDirFilename[ 50 ];
CHAR8 szFilename[ 40 ];
UINT8 ubMinorMapVersion;
//Make sure the file exists... if not, then return false
sprintf( (char *)szFilename, (char *)pSector );
sprintf( szFilename, pSector );
if( ubLevel % 4 )
{
UINT8 str[4];
sprintf( (char *)str, "_b%d", ubLevel % 4 );
CHAR8 str[4];
sprintf( str, "_b%d", ubLevel % 4 );
strcat( szFilename, str );
}
if( ubLevel >= 4 )
@@ -2254,17 +2254,17 @@ BOOLEAN EvaluateWorld( UINT8 * pSector, UINT8 ubLevel )
strcat( szFilename, "_a" );
}
strcat( szFilename, ".dat" );
sprintf( (char *)szDirFilename, "MAPS\\%s", szFilename );
sprintf( szDirFilename, "MAPS\\%s", szFilename );
if( gfMajorUpdate )
{
if( !LoadWorld( szFilename ) ) //error
return FALSE;
FileClearAttributes( (STR)szDirFilename );
FileClearAttributes( szDirFilename );
SaveWorld( szFilename );
}
hfile = FileOpen( (STR)szDirFilename, FILE_ACCESS_READ, FALSE );
hfile = FileOpen( szDirFilename, FILE_ACCESS_READ, FALSE );
if( !hfile )
return FALSE;
@@ -2622,7 +2622,7 @@ BOOLEAN EvaluateWorld( UINT8 * pSector, UINT8 ubLevel )
extern UINT8 GetCurrentSummaryVersion();
extern void LoadShadeTablesFromTextFile();
BOOLEAN LoadWorld( UINT8 * puiFilename )
BOOLEAN LoadWorld( const STR8 puiFilename )
{
HWFILE hfile;
FLOAT dMajorMapVersion;
@@ -3164,13 +3164,13 @@ BOOLEAN LoadWorld( UINT8 * puiFilename )
// SAVE FILENAME
strcpy( gzLastLoadedFile, puiFilename );
LoadRadarScreenBitmap( (CHAR8 *)puiFilename );
LoadRadarScreenBitmap( puiFilename );
RenderProgressBar( 0, 80 );
gfWorldLoaded = TRUE;
sprintf( (char *)gubFilename, (char *)puiFilename );
sprintf( gubFilename, puiFilename );
//Remove this rather large chunk of memory from the system now!
MemFree( pBufferHead );
@@ -3399,7 +3399,7 @@ void TrashWorld( void )
//gfBlitBattleSectorLocator = FALSE;
gfWorldLoaded = FALSE;
sprintf( (char *)gubFilename, "none" );
sprintf( gubFilename, "none" );
}
@@ -3966,14 +3966,14 @@ void ReloadTileset( UINT8 ubID )
giCurrentTilesetID = ubID;
// Save Map
SaveWorld( (UINT8 *)TEMP_FILE_FOR_TILESET_CHANGE );
SaveWorld( TEMP_FILE_FOR_TILESET_CHANGE );
//IMPORTANT: If this is not set, the LoadTileset() will assume that
//it is loading the same tileset and ignore it...
giCurrentTilesetID = iCurrTilesetID;
// Load Map with new tileset
LoadWorld( (UINT8 *)TEMP_FILE_FOR_TILESET_CHANGE );
LoadWorld( TEMP_FILE_FOR_TILESET_CHANGE );
// Delete file
sprintf( aFilename, "MAPS\\%s", TEMP_FILE_FOR_TILESET_CHANGE );
@@ -4056,7 +4056,7 @@ void LoadMapLights( INT8 **hBuffer )
UINT8 ubNumColors;
UINT16 usNumLights;
INT32 cnt;
INT8 str[30];
CHAR8 str[30];
UINT8 ubStrLen;
LIGHT_SPRITE TmpLight;
INT32 iLSprite;
@@ -4108,7 +4108,7 @@ void LoadMapLights( INT8 **hBuffer )
str[ ubStrLen ] = 0;
iLSprite = LightSpriteCreate( (STR)str, TmpLight.uiLightType );
iLSprite = LightSpriteCreate( str, TmpLight.uiLightType );
//if this fails, then we will ignore the light.
// ATE: Don't add ANY lights of mapscreen util is on
if( iLSprite != -1 && guiCurrentScreen != MAPUTILITY_SCREEN )
+2 -2
View File
@@ -261,8 +261,8 @@ void TrashWorld(void);
void TrashMapTile(INT16 MapTile);
BOOLEAN NewWorld( void );
BOOLEAN SaveWorld( UINT8 * puiFilename );
BOOLEAN LoadWorld( UINT8 *puiFilename );
BOOLEAN SaveWorld( const STR8 puiFilename );
BOOLEAN LoadWorld( const STR8 puiFilename );
void CompileWorldMovementCosts( );
void RecompileLocalMovementCosts( INT16 sCentreGridNo );