Fix: usBackGround is now UINT16 (was UINT8) to accommodate more than 255 backgrounds.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6513 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2013-10-19 20:45:05 +00:00
parent ac0e14beca
commit a71f8745ab
12 changed files with 64 additions and 63 deletions
+9 -9
View File
@@ -15,9 +15,9 @@
#ifdef JA2EDITOR #ifdef JA2EDITOR
#ifdef JA2UB #ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.6484 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.6513 (Development Build)" };
#else #else
CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.6484 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.6513 (Development Build)" };
#endif #endif
// ------------------------------ // ------------------------------
@@ -27,11 +27,11 @@
//DEBUG BUILD VERSION //DEBUG BUILD VERSION
#ifdef JA2UB #ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.6484 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.6513 (Development Build)" };
#elif defined (JA113DEMO) #elif defined (JA113DEMO)
CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.6484 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.6513 (Development Build)" };
#else #else
CHAR16 zVersionLabel[256] = { L"Debug: v1.13.6484 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Debug: v1.13.6513 (Development Build)" };
#endif #endif
#elif defined CRIPPLED_VERSION #elif defined CRIPPLED_VERSION
@@ -46,16 +46,16 @@
//RELEASE BUILD VERSION //RELEASE BUILD VERSION
#ifdef JA2UB #ifdef JA2UB
CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.6484 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.6513 (Development Build)" };
#elif defined (JA113DEMO) #elif defined (JA113DEMO)
CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.6484 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.6513 (Development Build)" };
#else #else
CHAR16 zVersionLabel[256] = { L"Release v1.13.6484 (Development Build)" }; CHAR16 zVersionLabel[256] = { L"Release v1.13.6513 (Development Build)" };
#endif #endif
#endif #endif
CHAR8 czVersionNumber[16] = { "Build 13.10.13" }; //YY.MM.DD CHAR8 czVersionNumber[16] = { "Build 13.10.19" }; //YY.MM.DD
CHAR16 zTrackingNumber[16] = { L"Z" }; CHAR16 zTrackingNumber[16] = { L"Z" };
// SAVE_GAME_VERSION is defined in header, change it there // SAVE_GAME_VERSION is defined in header, change it there
+2 -1
View File
@@ -21,6 +21,7 @@ extern CHAR16 zTrackingNumber[16];
// Keeps track of the saved game version. Increment the saved game version whenever // Keeps track of the saved game version. Increment the saved game version whenever
// you will invalidate the saved game file // you will invalidate the saved game file
#define BACKGROUNDS_FIX_UINT8 146 // Flugente: had to change usBackground-vars from UINT8 to UINT16
#define BACKGROUNDS 145 // Flugente: background feature #define BACKGROUNDS 145 // Flugente: background feature
#define NO_VEHICLE_SAVE 144 // Flugente: vehicle data isn't saved anymore, as it has long been externalised #define NO_VEHICLE_SAVE 144 // Flugente: vehicle data isn't saved anymore, as it has long been externalised
#define SOLDIER_PROFILES 143 // Flugente: profiles for enemy and militia (possibly any non-NPC/RPC character) #define SOLDIER_PROFILES 143 // Flugente: profiles for enemy and militia (possibly any non-NPC/RPC character)
@@ -64,7 +65,7 @@ extern CHAR16 zTrackingNumber[16];
#define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes #define AP100_SAVEGAME_DATATYPE_CHANGE 105 // Before this, we didn't have the 100AP structure changes
#define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system #define NIV_SAVEGAME_DATATYPE_CHANGE 102 // Before this, we used the old structure system
#define SAVE_GAME_VERSION BACKGROUNDS #define SAVE_GAME_VERSION BACKGROUNDS_FIX_UINT8
//#define RUSSIANGOLD //#define RUSSIANGOLD
#ifdef __cplusplus #ifdef __cplusplus
+1 -1
View File
@@ -79,7 +79,7 @@ INT32 iPersonality = 0;
INT32 iAttitude = 0; INT32 iAttitude = 0;
// Flugente: background // Flugente: background
UINT8 usBackground = 0; UINT16 usBackground = 0;
// Flugente: sexism, racism etc. // Flugente: sexism, racism etc.
INT8 bRace = 0; INT8 bRace = 0;
+1 -1
View File
@@ -47,7 +47,7 @@ extern INT32 iPersonality;
extern INT32 iAttitude; extern INT32 iAttitude;
// Flugente: background // Flugente: background
extern UINT8 usBackground; extern UINT16 usBackground;
// Flugente: sexism, racism etc. // Flugente: sexism, racism etc.
extern INT8 bRace; extern INT8 bRace;
+31 -41
View File
@@ -98,7 +98,7 @@ void BtnIMPBackgroundAnswerCallback(GUI_BUTTON *btn,INT32 reason);
void BtnIMPBackgroundFinishCallback(GUI_BUTTON *btn,INT32 reason); void BtnIMPBackgroundFinishCallback(GUI_BUTTON *btn,INT32 reason);
void AddIMPBackgroundButtons(); void AddIMPBackgroundButtons();
void HandleBackgroundButtonStates( ); void HandleBackgroundButtonStates( );
void HandleIMPBackgroundAnswers( UINT32 uiSkillPressed ); void HandleIMPBackgroundAnswers( UINT16 uiSkillPressed );
void IMPBackgroundDisplaySkills(); void IMPBackgroundDisplaySkills();
BOOLEAN CameBackToBackgroundPageButNotFinished(); BOOLEAN CameBackToBackgroundPageButNotFinished();
@@ -109,7 +109,7 @@ void BtnIMPBackgroundNextCallback(GUI_BUTTON *btn,INT32 reason);
void BtnIMPBackgroundPreviousCallback(GUI_BUTTON *btn,INT32 reason); void BtnIMPBackgroundPreviousCallback(GUI_BUTTON *btn,INT32 reason);
void UpdateDisplaySkills( BOOLEAN fIncrease ); void UpdateDisplaySkills( BOOLEAN fIncrease );
UINT8 GetDisplaySkill( UINT8 aNr ); UINT16 GetDisplaySkill( UINT16 aNr );
void ResetDisplaySkills(); void ResetDisplaySkills();
//ppp //ppp
@@ -123,8 +123,6 @@ void ResetDisplaySkills();
void EnterIMPBackground( void ) void EnterIMPBackground( void )
{ {
UINT8 ubCnt;
VOBJECT_DESC VObjectDesc; VOBJECT_DESC VObjectDesc;
//add the skill trait buttons //add the skill trait buttons
@@ -152,7 +150,7 @@ void EnterIMPBackground( void )
//if we are not DONE and are just reviewing //if we are not DONE and are just reviewing
if( iCurrentProfileMode != IMP__FINISH ) if( iCurrentProfileMode != IMP__FINISH )
{ {
for (ubCnt = 0; ubCnt<IMP_BACKGROUND_DISPLAYED_CHOICES; ubCnt++ ) for (UINT16 ubCnt = 0; ubCnt<IMP_BACKGROUND_DISPLAYED_CHOICES; ++ubCnt )
{ {
gfBackgroundQuestions[ ubCnt ] = FALSE; gfBackgroundQuestions[ ubCnt ] = FALSE;
} }
@@ -164,7 +162,7 @@ void EnterIMPBackground( void )
// add regions for help texts // add regions for help texts
UINT16 usPosY = IMP_BACKGROUND_COLUMN_START_Y + 8; UINT16 usPosY = IMP_BACKGROUND_COLUMN_START_Y + 8;
for( ubCnt=0; ubCnt<IMP_BACKGROUND_DISPLAYED_CHOICES; ++ubCnt ) for( UINT16 ubCnt=0; ubCnt<IMP_BACKGROUND_DISPLAYED_CHOICES; ++ubCnt )
{ {
MSYS_DefineRegion( &gMR_BackgroundHelpTextRegions[ubCnt], ( IMP_BACKGROUND_COLUMN_START_X + 62 ), ( usPosY ), MSYS_DefineRegion( &gMR_BackgroundHelpTextRegions[ubCnt], ( IMP_BACKGROUND_COLUMN_START_X + 62 ), ( usPosY ),
(IMP_BACKGROUND_COLUMN_START_X + 218), ( usPosY + 17), MSYS_PRIORITY_HIGH, (IMP_BACKGROUND_COLUMN_START_X + 218), ( usPosY + 17), MSYS_PRIORITY_HIGH,
@@ -197,7 +195,7 @@ void ExitIMPBackground( void )
DestroyIMPBackgroundButtons( ); DestroyIMPBackgroundButtons( );
//remove the skill buttons //remove the skill buttons
for(INT32 iCnt = 0; iCnt < IMP_BACKGROUND_DISPLAYED_CHOICES; iCnt++) for(UINT16 iCnt = 0; iCnt < IMP_BACKGROUND_DISPLAYED_CHOICES; iCnt++)
{ {
//if there is a button allocated //if there is a button allocated
if( giIMPBackgroundAnswerButton[iCnt] != -1 ) if( giIMPBackgroundAnswerButton[iCnt] != -1 )
@@ -227,7 +225,6 @@ void HandleIMPBackground( void )
void AddIMPBackgroundButtons() void AddIMPBackgroundButtons()
{ {
INT32 iCnt = 0;
UINT16 usPosX, usPosY; UINT16 usPosX, usPosY;
// next button // next button
@@ -254,7 +251,7 @@ void AddIMPBackgroundButtons()
usPosX = IMP_BACKGROUND_COLUMN_START_X; usPosX = IMP_BACKGROUND_COLUMN_START_X;
usPosY = IMP_BACKGROUND_COLUMN_START_Y; usPosY = IMP_BACKGROUND_COLUMN_START_Y;
for(iCnt = 0; iCnt < IMP_BACKGROUND_DISPLAYED_CHOICES; ++iCnt) for(UINT16 iCnt = 0; iCnt < IMP_BACKGROUND_DISPLAYED_CHOICES; ++iCnt)
{ {
//reset //reset
giIMPBackgroundAnswerButton[iCnt] = -1; giIMPBackgroundAnswerButton[iCnt] = -1;
@@ -299,16 +296,14 @@ void BtnIMPBackgroundAnswerCallback(GUI_BUTTON *btn,INT32 reason)
if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN ) if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
{ {
INT32 iBackground = MSYS_GetBtnUserData( btn, 0 ); UINT16 usBackground = (UINT16)(MSYS_GetBtnUserData( btn, 0 ));
HandleIMPBackgroundAnswers( iBackground ); HandleIMPBackgroundAnswers( usBackground );
} }
} }
void HandleIMPBackgroundAnswers( UINT32 uiSkillPressed ) void HandleIMPBackgroundAnswers( UINT16 uiSkillPressed )
{ {
UINT32 uiCnt;
//if we are DONE and are just reviewing //if we are DONE and are just reviewing
if( iCurrentProfileMode == IMP__FINISH ) if( iCurrentProfileMode == IMP__FINISH )
{ {
@@ -323,7 +318,7 @@ void HandleIMPBackgroundAnswers( UINT32 uiSkillPressed )
} }
//reset all other buttons //reset all other buttons
for( uiCnt=0; uiCnt<IMP_BACKGROUND_DISPLAYED_CHOICES; ++uiCnt ) for( UINT16 uiCnt=0; uiCnt<IMP_BACKGROUND_DISPLAYED_CHOICES; ++uiCnt )
{ {
gfBackgroundQuestions[ uiCnt ] = FALSE; gfBackgroundQuestions[ uiCnt ] = FALSE;
} }
@@ -352,9 +347,7 @@ void HandleIMPBackgroundAnswers( UINT32 uiSkillPressed )
void HandleBackgroundButtonStates( ) void HandleBackgroundButtonStates( )
{ {
UINT32 uiCnt; for( UINT16 uiCnt=0; uiCnt<IMP_BACKGROUND_DISPLAYED_CHOICES; ++uiCnt )
for( uiCnt=0; uiCnt<IMP_BACKGROUND_DISPLAYED_CHOICES; ++uiCnt )
{ {
//if the skill is selected ( ie depressed ) //if the skill is selected ( ie depressed )
if( gfBackgroundQuestions[ uiCnt ] ) if( gfBackgroundQuestions[ uiCnt ] )
@@ -370,7 +363,6 @@ void HandleBackgroundButtonStates( )
void IMPBackgroundDisplaySkills() void IMPBackgroundDisplaySkills()
{ {
UINT32 uiCnt;
UINT16 usPosX, usPosY; UINT16 usPosX, usPosY;
UINT16 usBoxPosX, usBoxPosY; UINT16 usBoxPosX, usBoxPosY;
HVOBJECT hImageHandle; HVOBJECT hImageHandle;
@@ -384,9 +376,9 @@ void IMPBackgroundDisplaySkills()
usPosX = IMP_BACKGROUND_COLUMN_START_X + IMP_BACKGROUND__TEXT_OFFSET_X; usPosX = IMP_BACKGROUND_COLUMN_START_X + IMP_BACKGROUND__TEXT_OFFSET_X;
usPosY = IMP_BACKGROUND_COLUMN_START_Y + IMP_BACKGROUND__TEXT_OFFSET_Y; usPosY = IMP_BACKGROUND_COLUMN_START_Y + IMP_BACKGROUND__TEXT_OFFSET_Y;
for( uiCnt=0; uiCnt<IMP_BACKGROUND_DISPLAYED_CHOICES; ++uiCnt ) for( UINT16 uiCnt=0; uiCnt<IMP_BACKGROUND_DISPLAYED_CHOICES; ++uiCnt )
{ {
UINT8 background = GetDisplaySkill( uiCnt ); UINT16 background = GetDisplaySkill( uiCnt );
usBoxPosX = usPosX - IMP_BACKGROUND__GREY_BOX_OFFSET_X; usBoxPosX = usPosX - IMP_BACKGROUND__GREY_BOX_OFFSET_X;
usBoxPosY = usPosY - IMP_BACKGROUND__GREY_BOX_OFFSET_Y; usBoxPosY = usPosY - IMP_BACKGROUND__GREY_BOX_OFFSET_Y;
@@ -471,7 +463,7 @@ BOOLEAN CameBackToBackgroundPageButNotFinished()
} }
} }
void AssignBackgroundHelpText( UINT8 ubNumber, MOUSE_REGION* pMouseregion ) void AssignBackgroundHelpText( UINT16 ubNumber, MOUSE_REGION* pMouseregion )
{ {
CHAR16 apStr[ 4500 ]; CHAR16 apStr[ 4500 ];
CHAR16 atStr[ 260 ]; CHAR16 atStr[ 260 ];
@@ -522,17 +514,17 @@ void AssignBackgroundHelpText( UINT8 ubNumber, MOUSE_REGION* pMouseregion )
} }
UINT8 displayedskills[IMP_BACKGROUND_DISPLAYED_CHOICES]; UINT16 displayedskills[IMP_BACKGROUND_DISPLAYED_CHOICES];
UINT8 gBackgroundFirstItem = 0; UINT16 gBackgroundFirstItem = 0;
UINT8 gBackgroundLastItem = 0; UINT16 gBackgroundLastItem = 0;
void UpdateDisplaySkills( BOOLEAN fIncrease ) void UpdateDisplaySkills( BOOLEAN fIncrease )
{ {
// fill a helper array with all viable choices // fill a helper array with all viable choices
UINT8 tmparray[NUM_BACKGROUND]; UINT16 tmparray[NUM_BACKGROUND];
UINT8 arraycounter = 0; UINT16 arraycounter = 0;
UINT8 found = 0; UINT16 found = 0;
for (UINT8 ubCnt = 0; ubCnt<num_found_background + 1; ++ubCnt ) for (UINT16 ubCnt = 0; ubCnt<num_found_background + 1; ++ubCnt )
{ {
if ( IsBackGroundAllowed(ubCnt) ) if ( IsBackGroundAllowed(ubCnt) )
{ {
@@ -541,7 +533,7 @@ void UpdateDisplaySkills( BOOLEAN fIncrease )
} }
} }
UINT8 firstitem, lastitem; UINT16 firstitem, lastitem;
// select the range from which we rebuild our array // select the range from which we rebuild our array
if ( fIncrease ) if ( fIncrease )
{ {
@@ -557,8 +549,8 @@ void UpdateDisplaySkills( BOOLEAN fIncrease )
lastitem = min(found , firstitem + IMP_BACKGROUND_DISPLAYED_CHOICES - 1); lastitem = min(found , firstitem + IMP_BACKGROUND_DISPLAYED_CHOICES - 1);
} }
UINT8 i = 0; UINT16 i = 0;
for (UINT8 ubCnt = firstitem; ubCnt<lastitem; ++ubCnt ) for (UINT16 ubCnt = firstitem; ubCnt<lastitem; ++ubCnt )
{ {
displayedskills[ i++ ] = tmparray[ ubCnt ]; displayedskills[ i++ ] = tmparray[ ubCnt ];
} }
@@ -567,7 +559,7 @@ void UpdateDisplaySkills( BOOLEAN fIncrease )
gBackgroundLastItem = lastitem; gBackgroundLastItem = lastitem;
} }
UINT8 GetDisplaySkill( UINT8 aNr ) UINT16 GetDisplaySkill( UINT16 aNr )
{ {
if ( aNr >= IMP_BACKGROUND_DISPLAYED_CHOICES ) if ( aNr >= IMP_BACKGROUND_DISPLAYED_CHOICES )
return 0; return 0;
@@ -577,7 +569,7 @@ UINT8 GetDisplaySkill( UINT8 aNr )
void ResetDisplaySkills() void ResetDisplaySkills()
{ {
for (UINT8 ubCnt = 0; ubCnt<IMP_BACKGROUND_DISPLAYED_CHOICES; ++ubCnt ) for (UINT16 ubCnt = 0; ubCnt<IMP_BACKGROUND_DISPLAYED_CHOICES; ++ubCnt )
displayedskills[ ubCnt ] = 0; displayedskills[ ubCnt ] = 0;
gBackgroundFirstItem = 0; gBackgroundFirstItem = 0;
@@ -588,7 +580,7 @@ void ResetDisplaySkills()
extern INT32 SkillsList[ ATTITUDE_LIST_SIZE ]; extern INT32 SkillsList[ ATTITUDE_LIST_SIZE ];
BOOLEAN IsBackGroundAllowed( UINT8 ubNumber ) BOOLEAN IsBackGroundAllowed( UINT16 ubNumber )
{ {
if ( !ubNumber ) if ( !ubNumber )
return FALSE; return FALSE;
@@ -733,7 +725,6 @@ void DestroyIMPBackgroundButtons( void )
void BtnIMPBackgroundNextCallback(GUI_BUTTON *btn,INT32 reason) void BtnIMPBackgroundNextCallback(GUI_BUTTON *btn,INT32 reason)
{ {
// btn callback for IMP attrbite begin button // btn callback for IMP attrbite begin button
if (!(btn->uiFlags & BUTTON_ENABLED)) if (!(btn->uiFlags & BUTTON_ENABLED))
return; return;
@@ -746,7 +737,7 @@ void BtnIMPBackgroundNextCallback(GUI_BUTTON *btn,INT32 reason)
{ {
if (btn->uiFlags & BUTTON_CLICKED_ON) if (btn->uiFlags & BUTTON_CLICKED_ON)
{ {
btn->uiFlags&=~(BUTTON_CLICKED_ON); btn->uiFlags&=~(BUTTON_CLICKED_ON);
// next picture!! // next picture!!
UpdateDisplaySkills( TRUE ); UpdateDisplaySkills( TRUE );
@@ -754,7 +745,7 @@ void BtnIMPBackgroundNextCallback(GUI_BUTTON *btn,INT32 reason)
gfIMPBackground_Redraw = TRUE; gfIMPBackground_Redraw = TRUE;
//reset all other buttons //reset all other buttons
for( UINT8 uiCnt=0; uiCnt<IMP_BACKGROUND_DISPLAYED_CHOICES; ++uiCnt ) for( UINT16 uiCnt=0; uiCnt<IMP_BACKGROUND_DISPLAYED_CHOICES; ++uiCnt )
{ {
gfBackgroundQuestions[ uiCnt ] = FALSE; gfBackgroundQuestions[ uiCnt ] = FALSE;
} }
@@ -769,7 +760,6 @@ void BtnIMPBackgroundNextCallback(GUI_BUTTON *btn,INT32 reason)
void BtnIMPBackgroundPreviousCallback(GUI_BUTTON *btn,INT32 reason) void BtnIMPBackgroundPreviousCallback(GUI_BUTTON *btn,INT32 reason)
{ {
// btn callback for IMP attrbite begin button // btn callback for IMP attrbite begin button
if (!(btn->uiFlags & BUTTON_ENABLED)) if (!(btn->uiFlags & BUTTON_ENABLED))
return; return;
@@ -782,7 +772,7 @@ void BtnIMPBackgroundPreviousCallback(GUI_BUTTON *btn,INT32 reason)
{ {
if (btn->uiFlags & BUTTON_CLICKED_ON) if (btn->uiFlags & BUTTON_CLICKED_ON)
{ {
btn->uiFlags&=~(BUTTON_CLICKED_ON); btn->uiFlags&=~(BUTTON_CLICKED_ON);
// previous picture, please!!! // previous picture, please!!!
UpdateDisplaySkills( FALSE ); UpdateDisplaySkills( FALSE );
@@ -790,7 +780,7 @@ void BtnIMPBackgroundPreviousCallback(GUI_BUTTON *btn,INT32 reason)
gfIMPBackground_Redraw = TRUE; gfIMPBackground_Redraw = TRUE;
//reset all other buttons //reset all other buttons
for( UINT8 uiCnt=0; uiCnt<IMP_BACKGROUND_DISPLAYED_CHOICES; ++uiCnt ) for( UINT16 uiCnt=0; uiCnt<IMP_BACKGROUND_DISPLAYED_CHOICES; ++uiCnt )
{ {
gfBackgroundQuestions[ uiCnt ] = FALSE; gfBackgroundQuestions[ uiCnt ] = FALSE;
} }
+2 -2
View File
@@ -9,8 +9,8 @@ void RenderIMPBackground( void );
void ExitIMPBackground( void ); void ExitIMPBackground( void );
void HandleIMPBackground( void ); void HandleIMPBackground( void );
BOOLEAN IsBackGroundAllowed( UINT8 ubNumber ); BOOLEAN IsBackGroundAllowed( UINT16 ubNumber );
void AssignBackgroundHelpText( UINT8 ubNumber, MOUSE_REGION* pMouseregion ); void AssignBackgroundHelpText( UINT16 ubNumber, MOUSE_REGION* pMouseregion );
#endif #endif
+1 -1
View File
@@ -174,7 +174,7 @@ void CreateACharacterFromPlayerEnteredStats( void )
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].bAttitude = ( INT8 )iAttitude; gMercProfiles[ LaptopSaveInfo.iIMPIndex ].bAttitude = ( INT8 )iAttitude;
// Flugente: background // Flugente: background
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].usBackground = ( INT8 )usBackground; gMercProfiles[ LaptopSaveInfo.iIMPIndex ].usBackground = usBackground;
// Flugente: sexism, racsim etc. // Flugente: sexism, racsim etc.
gMercProfiles[ LaptopSaveInfo.iIMPIndex ].bRace = ( INT8 )bRace; gMercProfiles[ LaptopSaveInfo.iIMPIndex ].bRace = ( INT8 )bRace;
+13 -3
View File
@@ -1496,9 +1496,19 @@ BOOLEAN MERCPROFILESTRUCT::Load(HWFILE hFile, bool forceLoadOldVersion, bool for
// Flugente: backgrounds // Flugente: backgrounds
if(guiCurrentSaveGameVersion >= BACKGROUNDS) if(guiCurrentSaveGameVersion >= BACKGROUNDS)
{ {
if ( !FileRead( hFile, &this->usBackground, sizeof(UINT8), &uiNumBytesRead ) ) if(guiCurrentSaveGameVersion >= BACKGROUNDS_FIX_UINT8)
{ {
return(FALSE); if ( !FileRead( hFile, &this->usBackground, sizeof(UINT16), &uiNumBytesRead ) )
{
return(FALSE);
}
}
else
{
if ( !FileRead( hFile, &this->usBackground, sizeof(UINT8), &uiNumBytesRead ) )
{
return(FALSE);
}
} }
} }
} }
@@ -1581,7 +1591,7 @@ BOOLEAN MERCPROFILESTRUCT::Save(HWFILE hFile)
} }
// Flugente: background // Flugente: background
if ( !FileWrite( hFile, &this->usBackground, sizeof(UINT8), &uiNumBytesWritten ) ) if ( !FileWrite( hFile, &this->usBackground, sizeof(UINT16), &uiNumBytesWritten ) )
{ {
return(FALSE); return(FALSE);
} }
+1 -1
View File
@@ -1513,7 +1513,7 @@ void MERCPROFILESTRUCT::initialize()
clearInventory(); clearInventory();
// SANDRO - added this // SANDRO - added this
memset( &records, 0, sizeof(STRUCT_Records) ); memset( &records, 0, sizeof(STRUCT_Records) );
memset( &usBackground, 0, sizeof(UINT8) ); memset( &usBackground, 0, sizeof(UINT16) );
} }
// Initialize the soldier. // Initialize the soldier.
+1 -1
View File
@@ -418,7 +418,7 @@ typedef struct
INT8 bTownAttachment; INT8 bTownAttachment;
// Flugente: backgrounds // Flugente: backgrounds
UINT8 usBackground; UINT16 usBackground;
} TEMPPROFILETYPE; } TEMPPROFILETYPE;
+1 -1
View File
@@ -1085,7 +1085,7 @@ profileEndElementHandle(void *userData, const XML_Char *name)
else if(strcmp(name, "usBackground") == 0) else if(strcmp(name, "usBackground") == 0)
{ {
pData->curElement = ELEMENT; pData->curElement = ELEMENT;
pData->curProfile.usBackground = (UINT8) atol(pData->szCharData); pData->curProfile.usBackground = (UINT16) atol(pData->szCharData);
} }
+1 -1
View File
@@ -936,7 +936,7 @@ public:
STRUCT_Records records; STRUCT_Records records;
// Flugente: background // Flugente: background
UINT8 usBackground; UINT16 usBackground;
}; // MERCPROFILESTRUCT; }; // MERCPROFILESTRUCT;