mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
- 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:
+10
-10
@@ -2170,25 +2170,25 @@ void SummaryOverrideCallback( GUI_BUTTON *btn, INT32 reason )
|
|||||||
void CalculateOverrideStatus()
|
void CalculateOverrideStatus()
|
||||||
{
|
{
|
||||||
GETFILESTRUCT FileInfo;
|
GETFILESTRUCT FileInfo;
|
||||||
UINT8 szFilename[40];
|
CHAR8 szFilename[40];
|
||||||
gfOverrideDirty = FALSE;
|
gfOverrideDirty = FALSE;
|
||||||
gfOverride = FALSE;
|
gfOverride = FALSE;
|
||||||
if( gfTempFile )
|
if( gfTempFile )
|
||||||
{
|
{
|
||||||
UINT8 *ptr;
|
CHAR8 *ptr;
|
||||||
sprintf( (char *)szFilename, "MAPS\\%S", gszTempFilename );
|
sprintf( szFilename, "MAPS\\%S", gszTempFilename );
|
||||||
if( strlen( szFilename ) == 5 )
|
if( strlen( szFilename ) == 5 )
|
||||||
strcat( szFilename, "test.dat" );
|
strcat( szFilename, "test.dat" );
|
||||||
ptr = (UINT8 *) strstr( szFilename, "." );
|
ptr = strstr( szFilename, "." );
|
||||||
if( !ptr )
|
if( !ptr )
|
||||||
strcat( szFilename, ".dat" );
|
strcat( szFilename, ".dat" );
|
||||||
else
|
else
|
||||||
sprintf( (char *)ptr, ".dat" );
|
sprintf( ptr, ".dat" );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sprintf( (char *)szFilename, "MAPS\\%S", gszFilename );
|
sprintf( szFilename, "MAPS\\%S", gszFilename );
|
||||||
swprintf( gszDisplayName, L"%S", &(szFilename[5]) );
|
swprintf( gszDisplayName, L"%S", &(szFilename[5]) );
|
||||||
if( GetFileFirst( (CHAR8 *)szFilename, &FileInfo) )
|
if( GetFileFirst( szFilename, &FileInfo) )
|
||||||
{
|
{
|
||||||
if( gfWorldLoaded )
|
if( gfWorldLoaded )
|
||||||
{
|
{
|
||||||
@@ -2459,7 +2459,7 @@ void WriteSectorSummaryUpdate( UINT8 *puiFilename, UINT8 ubLevel, SUMMARYFILE *p
|
|||||||
STRING512 DataDir;
|
STRING512 DataDir;
|
||||||
STRING512 ExecDir;
|
STRING512 ExecDir;
|
||||||
STRING512 Dir;
|
STRING512 Dir;
|
||||||
UINT8 *ptr;
|
CHAR8 *ptr;
|
||||||
INT8 x, y;
|
INT8 x, y;
|
||||||
|
|
||||||
// Snap: save current directory
|
// Snap: save current directory
|
||||||
@@ -2471,10 +2471,10 @@ void WriteSectorSummaryUpdate( UINT8 *puiFilename, UINT8 ubLevel, SUMMARYFILE *p
|
|||||||
if( !SetFileManCurrentDirectory( Dir ) )
|
if( !SetFileManCurrentDirectory( Dir ) )
|
||||||
AssertMsg( 0, "JA2\\DevInfo folder not found and should exist!");
|
AssertMsg( 0, "JA2\\DevInfo folder not found and should exist!");
|
||||||
|
|
||||||
ptr = (UINT8 *) strstr( puiFilename, ".dat" );
|
ptr = strstr( (CHAR8 *)puiFilename, ".dat" );
|
||||||
if( !ptr )
|
if( !ptr )
|
||||||
AssertMsg( 0, "Illegal sector summary filename.");
|
AssertMsg( 0, "Illegal sector summary filename.");
|
||||||
sprintf( (char *)ptr, ".sum" );
|
sprintf( ptr, ".sum" );
|
||||||
|
|
||||||
//write the summary information
|
//write the summary information
|
||||||
fp = fopen( (const char *)puiFilename, "wb" );
|
fp = fopen( (const char *)puiFilename, "wb" );
|
||||||
|
|||||||
+5
-9
@@ -11,13 +11,16 @@ extern HVSURFACE ghFrameBuffer;
|
|||||||
//Simply create videosurface, load image, and draw it to the screen.
|
//Simply create videosurface, load image, and draw it to the screen.
|
||||||
void InitJA2SplashScreen()
|
void InitJA2SplashScreen()
|
||||||
{
|
{
|
||||||
|
#ifdef ENGLISH
|
||||||
|
ClearMainMenu();
|
||||||
|
|
||||||
|
#else
|
||||||
UINT32 uiLogoID = 0;
|
UINT32 uiLogoID = 0;
|
||||||
HVSURFACE hVSurface; // unused jonathanl // lalien reenabled for international versions
|
HVSURFACE hVSurface; // unused jonathanl // lalien reenabled for international versions
|
||||||
VSURFACE_DESC VSurfaceDesc; //unused jonathanl // lalien reenabled for international versions
|
VSURFACE_DESC VSurfaceDesc; //unused jonathanl // lalien reenabled for international versions
|
||||||
|
#ifdef JA2TESTVERSION
|
||||||
INT32 i = 0;
|
INT32 i = 0;
|
||||||
|
|
||||||
#if !defined( ENGLISH ) && defined( JA2TESTVERSION )
|
|
||||||
|
|
||||||
memset( &VSurfaceDesc, 0, sizeof( VSURFACE_DESC ) );
|
memset( &VSurfaceDesc, 0, sizeof( VSURFACE_DESC ) );
|
||||||
VSurfaceDesc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE;
|
VSurfaceDesc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE;
|
||||||
sprintf( VSurfaceDesc.ImageFile, "LOADSCREENS\\Notification.sti" );
|
sprintf( VSurfaceDesc.ImageFile, "LOADSCREENS\\Notification.sti" );
|
||||||
@@ -44,11 +47,6 @@ void InitJA2SplashScreen()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENGLISH
|
|
||||||
ClearMainMenu();
|
|
||||||
#else
|
|
||||||
{
|
|
||||||
|
|
||||||
memset( &VSurfaceDesc, 0, sizeof( VSURFACE_DESC ) );
|
memset( &VSurfaceDesc, 0, sizeof( VSURFACE_DESC ) );
|
||||||
VSurfaceDesc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE;
|
VSurfaceDesc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE;
|
||||||
GetMLGFilename( VSurfaceDesc.ImageFile, MLG_SPLASH );
|
GetMLGFilename( VSurfaceDesc.ImageFile, MLG_SPLASH );
|
||||||
@@ -61,10 +59,8 @@ void InitJA2SplashScreen()
|
|||||||
GetVideoSurface( &hVSurface, uiLogoID );
|
GetVideoSurface( &hVSurface, uiLogoID );
|
||||||
BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, iScreenWidthOffset, iScreenHeightOffset, 0, NULL );
|
BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, iScreenWidthOffset, iScreenHeightOffset, 0, NULL );
|
||||||
DeleteVideoSurfaceFromIndex( uiLogoID );
|
DeleteVideoSurfaceFromIndex( uiLogoID );
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
InvalidateScreen();
|
InvalidateScreen();
|
||||||
RefreshScreen( NULL );
|
RefreshScreen( NULL );
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ HIMAGE CreateImage( SGPFILENAME ImageFile, UINT16 fContents )
|
|||||||
|
|
||||||
// Depending on extension of filename, use different image readers
|
// Depending on extension of filename, use different image readers
|
||||||
// Get extension
|
// Get extension
|
||||||
StrPtr = strstr( ImageFile, ExtensionSep );
|
StrPtr = strstr( (char *)ImageFile, (const char *)ExtensionSep );
|
||||||
|
|
||||||
if ( StrPtr == NULL )
|
if ( StrPtr == NULL )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -808,10 +808,10 @@ UINT16 CalcCompetence( MERCPROFILESTRUCT * pProfile )
|
|||||||
uiStats = ((2 * pProfile->bLifeMax) + pProfile->bStrength + pProfile->bAgility + pProfile->bDexterity + ((pProfile->bLeadership + pProfile->bWisdom) / 2)) / 3;
|
uiStats = ((2 * pProfile->bLifeMax) + pProfile->bStrength + pProfile->bAgility + pProfile->bDexterity + ((pProfile->bLeadership + pProfile->bWisdom) / 2)) / 3;
|
||||||
|
|
||||||
// marksmanship is very important, count it double
|
// marksmanship is very important, count it double
|
||||||
uiSkills = (UINT32) ((2 * (pow(pProfile->bMarksmanship, 3) / 10000)) +
|
uiSkills = (UINT32) ((2 * (pow((double)pProfile->bMarksmanship, 3) / 10000)) +
|
||||||
1.5 * (pow(pProfile->bMedical, 3) / 10000) +
|
1.5 * (pow((double)pProfile->bMedical, 3) / 10000) +
|
||||||
(pow(pProfile->bMechanical, 3) / 10000) +
|
(pow((double)pProfile->bMechanical, 3) / 10000) +
|
||||||
(pow(pProfile->bExplosive, 3) / 10000));
|
(pow((double)pProfile->bExplosive, 3) / 10000));
|
||||||
|
|
||||||
// action points
|
// action points
|
||||||
uiActionPoints = 5 + (((10 * pProfile->bExpLevel +
|
uiActionPoints = 5 + (((10 * pProfile->bExpLevel +
|
||||||
|
|||||||
@@ -132,22 +132,22 @@ BOOLEAN LoadShadeTable( HVOBJECT pObj, UINT32 uiTileTypeIndex )
|
|||||||
HWFILE hfile;
|
HWFILE hfile;
|
||||||
INT32 i;
|
INT32 i;
|
||||||
UINT32 uiNumBytesRead;
|
UINT32 uiNumBytesRead;
|
||||||
UINT8 ShadeFileName[ 100 ];
|
CHAR8 ShadeFileName[ 100 ];
|
||||||
UINT8 *ptr;
|
CHAR8 *ptr;
|
||||||
//ASSUMPTIONS:
|
//ASSUMPTIONS:
|
||||||
//We are assuming that the uiTileTypeIndex is referring to the correct file
|
//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
|
//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.
|
//and should be fixed. Also assumes that the directory is set to Data\ShadeTables.
|
||||||
strcpy( ShadeFileName, TileSurfaceFilenames[ uiTileTypeIndex ] );
|
strcpy( ShadeFileName, TileSurfaceFilenames[ uiTileTypeIndex ] );
|
||||||
ptr = (UINT8 *)strstr( ShadeFileName, "." );
|
ptr = strstr( ShadeFileName, "." );
|
||||||
if( !ptr )
|
if( !ptr )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
ptr++;
|
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 )
|
if( !hfile )
|
||||||
{ //File doesn't exist, so generate it
|
{ //File doesn't exist, so generate it
|
||||||
FileClose( hfile );
|
FileClose( hfile );
|
||||||
@@ -176,8 +176,8 @@ BOOLEAN SaveShadeTable( HVOBJECT pObj, UINT32 uiTileTypeIndex )
|
|||||||
HWFILE hfile;
|
HWFILE hfile;
|
||||||
INT32 i;
|
INT32 i;
|
||||||
UINT32 uiNumBytesWritten;
|
UINT32 uiNumBytesWritten;
|
||||||
UINT8 ShadeFileName[ 100 ];
|
CHAR8 ShadeFileName[ 100 ];
|
||||||
UINT8 *ptr;
|
CHAR8 *ptr;
|
||||||
#ifdef JA2TESTVERSION
|
#ifdef JA2TESTVERSION
|
||||||
uiNumTablesSaved++;
|
uiNumTablesSaved++;
|
||||||
#endif
|
#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
|
//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.
|
//and should be fixed. Also assumes that the directory is set to Data\ShadeTables.
|
||||||
strcpy( ShadeFileName, TileSurfaceFilenames[ uiTileTypeIndex ] );
|
strcpy( ShadeFileName, TileSurfaceFilenames[ uiTileTypeIndex ] );
|
||||||
ptr = (UINT8 *)strstr( ShadeFileName, "." );
|
ptr = strstr( ShadeFileName, "." );
|
||||||
if( !ptr )
|
if( !ptr )
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
ptr++;
|
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 )
|
if( !hfile )
|
||||||
{
|
{
|
||||||
FileClose( hfile );
|
FileClose( hfile );
|
||||||
|
|||||||
@@ -353,7 +353,7 @@ void CheckForAndDeleteTileCacheStructInfo( LEVELNODE *pNode, UINT16 usIndex )
|
|||||||
void GetRootName( INT8 * pDestStr, INT8 * pSrcStr )
|
void GetRootName( INT8 * pDestStr, INT8 * pSrcStr )
|
||||||
{
|
{
|
||||||
// Remove path and extension
|
// Remove path and extension
|
||||||
INT8 cTempFilename[ 120 ];
|
CHAR8 cTempFilename[ 120 ];
|
||||||
STR cEndOfName;
|
STR cEndOfName;
|
||||||
|
|
||||||
// Remove path
|
// Remove path
|
||||||
|
|||||||
Reference in New Issue
Block a user