diff --git a/Editor/Sector Summary.cpp b/Editor/Sector Summary.cpp index b8dddce8..5430b649 100644 --- a/Editor/Sector Summary.cpp +++ b/Editor/Sector Summary.cpp @@ -2170,25 +2170,25 @@ void SummaryOverrideCallback( GUI_BUTTON *btn, INT32 reason ) void CalculateOverrideStatus() { GETFILESTRUCT FileInfo; - UINT8 szFilename[40]; + CHAR8 szFilename[40]; gfOverrideDirty = FALSE; gfOverride = FALSE; if( gfTempFile ) { - UINT8 *ptr; - sprintf( (char *)szFilename, "MAPS\\%S", gszTempFilename ); + CHAR8 *ptr; + sprintf( szFilename, "MAPS\\%S", gszTempFilename ); if( strlen( szFilename ) == 5 ) strcat( szFilename, "test.dat" ); - ptr = (UINT8 *) strstr( szFilename, "." ); + ptr = strstr( szFilename, "." ); if( !ptr ) strcat( szFilename, ".dat" ); else - sprintf( (char *)ptr, ".dat" ); + sprintf( ptr, ".dat" ); } else - sprintf( (char *)szFilename, "MAPS\\%S", gszFilename ); + sprintf( szFilename, "MAPS\\%S", gszFilename ); swprintf( gszDisplayName, L"%S", &(szFilename[5]) ); - if( GetFileFirst( (CHAR8 *)szFilename, &FileInfo) ) + if( GetFileFirst( szFilename, &FileInfo) ) { if( gfWorldLoaded ) { @@ -2459,7 +2459,7 @@ void WriteSectorSummaryUpdate( UINT8 *puiFilename, UINT8 ubLevel, SUMMARYFILE *p STRING512 DataDir; STRING512 ExecDir; STRING512 Dir; - UINT8 *ptr; + CHAR8 *ptr; INT8 x, y; // Snap: save current directory @@ -2471,10 +2471,10 @@ void WriteSectorSummaryUpdate( UINT8 *puiFilename, UINT8 ubLevel, SUMMARYFILE *p if( !SetFileManCurrentDirectory( Dir ) ) AssertMsg( 0, "JA2\\DevInfo folder not found and should exist!"); - ptr = (UINT8 *) strstr( puiFilename, ".dat" ); + ptr = strstr( (CHAR8 *)puiFilename, ".dat" ); if( !ptr ) AssertMsg( 0, "Illegal sector summary filename."); - sprintf( (char *)ptr, ".sum" ); + sprintf( ptr, ".sum" ); //write the summary information fp = fopen( (const char *)puiFilename, "wb" ); diff --git a/JA2 Splash.cpp b/JA2 Splash.cpp index 6aec90d3..e6fec800 100644 --- a/JA2 Splash.cpp +++ b/JA2 Splash.cpp @@ -11,13 +11,16 @@ extern HVSURFACE ghFrameBuffer; //Simply create videosurface, load image, and draw it to the screen. void InitJA2SplashScreen() { +#ifdef ENGLISH + ClearMainMenu(); + +#else UINT32 uiLogoID = 0; HVSURFACE hVSurface; // unused jonathanl // lalien reenabled for international versions VSURFACE_DESC VSurfaceDesc; //unused jonathanl // lalien reenabled for international versions + #ifdef JA2TESTVERSION INT32 i = 0; -#if !defined( ENGLISH ) && defined( JA2TESTVERSION ) - memset( &VSurfaceDesc, 0, sizeof( VSURFACE_DESC ) ); VSurfaceDesc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE; sprintf( VSurfaceDesc.ImageFile, "LOADSCREENS\\Notification.sti" ); @@ -44,11 +47,6 @@ void InitJA2SplashScreen() } #endif - #ifdef ENGLISH - ClearMainMenu(); - #else - { - memset( &VSurfaceDesc, 0, sizeof( VSURFACE_DESC ) ); VSurfaceDesc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE; GetMLGFilename( VSurfaceDesc.ImageFile, MLG_SPLASH ); @@ -61,10 +59,8 @@ void InitJA2SplashScreen() GetVideoSurface( &hVSurface, uiLogoID ); BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, iScreenWidthOffset, iScreenHeightOffset, 0, NULL ); DeleteVideoSurfaceFromIndex( uiLogoID ); - } #endif - InvalidateScreen(); RefreshScreen( NULL ); diff --git a/Standard Gaming Platform/himage.cpp b/Standard Gaming Platform/himage.cpp index 562dacc0..149a6b47 100644 --- a/Standard Gaming Platform/himage.cpp +++ b/Standard Gaming Platform/himage.cpp @@ -54,7 +54,7 @@ HIMAGE CreateImage( SGPFILENAME ImageFile, UINT16 fContents ) // Depending on extension of filename, use different image readers // Get extension - StrPtr = strstr( ImageFile, ExtensionSep ); + StrPtr = strstr( (char *)ImageFile, (const char *)ExtensionSep ); if ( StrPtr == NULL ) { diff --git a/Tactical/Soldier Profile.cpp b/Tactical/Soldier Profile.cpp index 5aec06e5..8b5d8c0e 100644 --- a/Tactical/Soldier Profile.cpp +++ b/Tactical/Soldier Profile.cpp @@ -808,10 +808,10 @@ UINT16 CalcCompetence( MERCPROFILESTRUCT * pProfile ) uiStats = ((2 * pProfile->bLifeMax) + pProfile->bStrength + pProfile->bAgility + pProfile->bDexterity + ((pProfile->bLeadership + pProfile->bWisdom) / 2)) / 3; // marksmanship is very important, count it double - uiSkills = (UINT32) ((2 * (pow(pProfile->bMarksmanship, 3) / 10000)) + - 1.5 * (pow(pProfile->bMedical, 3) / 10000) + - (pow(pProfile->bMechanical, 3) / 10000) + - (pow(pProfile->bExplosive, 3) / 10000)); + uiSkills = (UINT32) ((2 * (pow((double)pProfile->bMarksmanship, 3) / 10000)) + + 1.5 * (pow((double)pProfile->bMedical, 3) / 10000) + + (pow((double)pProfile->bMechanical, 3) / 10000) + + (pow((double)pProfile->bExplosive, 3) / 10000)); // action points uiActionPoints = 5 + (((10 * pProfile->bExpLevel + diff --git a/TileEngine/Shade Table Util.cpp b/TileEngine/Shade Table Util.cpp index 1867a1d5..82094df8 100644 --- a/TileEngine/Shade Table Util.cpp +++ b/TileEngine/Shade Table Util.cpp @@ -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 ); diff --git a/TileEngine/Tile Cache.cpp b/TileEngine/Tile Cache.cpp index e7af8a7b..846faa4a 100644 --- a/TileEngine/Tile Cache.cpp +++ b/TileEngine/Tile Cache.cpp @@ -353,7 +353,7 @@ void CheckForAndDeleteTileCacheStructInfo( LEVELNODE *pNode, UINT16 usIndex ) void GetRootName( INT8 * pDestStr, INT8 * pSrcStr ) { // Remove path and extension - INT8 cTempFilename[ 120 ]; + CHAR8 cTempFilename[ 120 ]; STR cEndOfName; // Remove path