This commit is contained in:
Wanne
2006-10-04 12:24:10 +00:00
parent 0c0f6eafad
commit 4341409ded
22 changed files with 481 additions and 285 deletions
+2 -1
View File
@@ -258,6 +258,7 @@ void InitGameSettings()
gGameSettings.fOptions[ TOPTION_RAIN_SOUND ] = TRUE; gGameSettings.fOptions[ TOPTION_RAIN_SOUND ] = TRUE;
gGameSettings.fOptions[ TOPTION_ALLOW_CROWS ] = TRUE; gGameSettings.fOptions[ TOPTION_ALLOW_CROWS ] = TRUE;
gGameSettings.fOptions[ TOPTION_USE_RANDOM_PERSONALITY ] = FALSE; gGameSettings.fOptions[ TOPTION_USE_RANDOM_PERSONALITY ] = FALSE;
gGameSettings.fOptions[ TOPTION_USE_AUTO_SAVE ] = FALSE;
gGameSettings.ubSizeOfDisplayCover = 4; gGameSettings.ubSizeOfDisplayCover = 4;
gGameSettings.ubSizeOfLOS = 4; gGameSettings.ubSizeOfLOS = 4;
@@ -475,7 +476,7 @@ void LoadGameExternalOptions()
// WANNE: Auto save: Attention: The game always crashes after a "normal" savegame is loaded after loading an autosave // WANNE: Auto save: Attention: The game always crashes after a "normal" savegame is loaded after loading an autosave
// So for now USE_AUTO_SAVE is always false. // So for now USE_AUTO_SAVE is always false.
// The game crashes when removing mouse region that are not set // The game crashes when removing mouse region that are not set
gGameExternalOptions.gfUseAutoSave = iniReader.ReadBoolean("JA2 Gameplay Settings","USE_AUTO_SAVE",FALSE); //gGameExternalOptions.gfUseAutoSave = iniReader.ReadBoolean("JA2 Gameplay Settings","USE_AUTO_SAVE",FALSE);
// Militia settings // Militia settings
gGameExternalOptions.gfTrainVeteranMilitia = iniReader.ReadBoolean("JA2 Gameplay Settings","TRAIN_VETERAN_MILITIA",FALSE); gGameExternalOptions.gfTrainVeteranMilitia = iniReader.ReadBoolean("JA2 Gameplay Settings","TRAIN_VETERAN_MILITIA",FALSE);
+1
View File
@@ -52,6 +52,7 @@ enum
TOPTION_RAIN_SOUND, TOPTION_RAIN_SOUND,
TOPTION_ALLOW_CROWS, TOPTION_ALLOW_CROWS,
TOPTION_USE_RANDOM_PERSONALITY, TOPTION_USE_RANDOM_PERSONALITY,
TOPTION_USE_AUTO_SAVE,
NUM_GAME_OPTIONS, //Toggle up this will be able to be Toggled by the player NUM_GAME_OPTIONS, //Toggle up this will be able to be Toggled by the player
+3 -3
View File
@@ -13,7 +13,7 @@
#ifdef JA2BETAVERSION #ifdef JA2BETAVERSION
//BETA/TEST BUILD VERSION //BETA/TEST BUILD VERSION
INT16 zVersionLabel[256] = { L"Map Editor v1.13.579" }; INT16 zVersionLabel[256] = { L"Map Editor v1.13.590" };
#elif defined CRIPPLED_VERSION #elif defined CRIPPLED_VERSION
@@ -23,12 +23,12 @@ INT16 zVersionLabel[256] = { L"Beta v. 0.98" };
#else #else
//RELEASE BUILD VERSION //RELEASE BUILD VERSION
INT16 zVersionLabel[256] = { L"Release v1.13.579" }; INT16 zVersionLabel[256] = { L"Release v1.13.590" };
#endif #endif
INT8 czVersionNumber[16] = { "Build 06.09.29" }; INT8 czVersionNumber[16] = { "Build 06.10.04" };
INT16 zTrackingNumber[16] = { L"Z" }; INT16 zTrackingNumber[16] = { L"Z" };
BIN
View File
Binary file not shown.
+2 -2
View File
@@ -43,7 +43,7 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="libexpatMT.lib mss32.lib winmm.lib smackw32.lib fmodvc.lib" AdditionalDependencies="libexpatMT.lib mss32.lib winmm.lib smackw32.lib fmodvc.lib"
OutputFile="C:\Games\Jagged Alliance 2 v1.13\ja2_debug_v1.13.502_2006_09_01.exe" OutputFile="C:\Games\Jagged Alliance 2 DE\ja2_debug_v1.13.502_2006_09_01.exe"
LinkIncremental="2" LinkIncremental="2"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories=".\..\..\Standard Gaming Platform\" AdditionalLibraryDirectories=".\..\..\Standard Gaming Platform\"
@@ -546,7 +546,7 @@
<Tool <Tool
Name="VCLinkerTool" Name="VCLinkerTool"
AdditionalDependencies="libexpatMT.lib winmm.lib smackw32.lib mss32.lib fmodvc.lib" AdditionalDependencies="libexpatMT.lib winmm.lib smackw32.lib mss32.lib fmodvc.lib"
OutputFile="C:\Games\Jagged Alliance 2 v1.13\ja2_release_v1.13.502_2006_09_01.exe" OutputFile="C:\Games\Jagged Alliance 2 DE\ja2_release_v1.13.502_2006_09_01.exe"
LinkIncremental="1" LinkIncremental="1"
SuppressStartupBanner="TRUE" SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories=".\..\..\Standard Gaming Platform\" AdditionalLibraryDirectories=".\..\..\Standard Gaming Platform\"
+2 -2
View File
@@ -3,8 +3,8 @@
//ONLY ONE OF THESE CAN BE DEFINED AT A TIME! //ONLY ONE OF THESE CAN BE DEFINED AT A TIME!
#define ENGLISH //#define ENGLISH
//#define GERMAN #define GERMAN
//#define RUSSIAN //#define RUSSIAN
//#define DUTCH //#define DUTCH
//#define POLISH //#define POLISH
+14 -26
View File
@@ -3944,46 +3944,34 @@ void HandleIMPCharProfileResultsMessage( void)
if( ( gMercProfiles[ iCurrentIMPSlot ].bSkillTrait == ONROOF )||( gMercProfiles[ iCurrentIMPSlot ].bSkillTrait2 == ONROOF ) ) if( ( gMercProfiles[ iCurrentIMPSlot ].bSkillTrait == ONROOF )||( gMercProfiles[ iCurrentIMPSlot ].bSkillTrait2 == ONROOF ) )
{ {
// WANNE: No entry in the Impass.edt for rooftop, so add any static text here // WANNE: No entry in the Impass.edt for rooftop, so add any static text here
// read one record from email file // read one record from email file
//LoadEncryptedDataFromFile( "BINARYDATA\\Impass.edt", pString, MAIL_STRING_SIZE * ( IMP_SKILLS_SPECIAL_ONROOF ), MAIL_STRING_SIZE ); //LoadEncryptedDataFromFile( "BINARYDATA\\Impass.edt", pString, MAIL_STRING_SIZE * ( IMP_SKILLS_SPECIAL_ONROOF ), MAIL_STRING_SIZE );
#ifdef ENGLISH
wcscpy(pString, L"Rooftop Sniping: <No description yet>");
#endif
#ifdef RUSSIAN
wcscpy(pString, L"Rooftop Sniping: <No description yet>");
#endif
#ifdef GERMAN #ifdef GERMAN
wcscpy(pString, L"Dach-Treffer Bonus: <Noch keine Beschreibung vorhanden>"); wcscpy(pString, L"Dach-Treffer Bonus: <Noch keine Beschreibung vorhanden>");
#else
wcscpy(pString, L"Rooftop Sniping: <No description yet>");
#endif #endif
// add to list // add to list
AddEmailRecordToList( pString ); AddEmailRecordToList( pString );
} }
// camouflage // camouflage
if( ( gMercProfiles[ iCurrentIMPSlot ].bSkillTrait == CAMOUFLAGED )||( gMercProfiles[ iCurrentIMPSlot ].bSkillTrait2 == CAMOUFLAGED ) ) if( ( gMercProfiles[ iCurrentIMPSlot ].bSkillTrait == CAMOUFLAGED )||( gMercProfiles[ iCurrentIMPSlot ].bSkillTrait2 == CAMOUFLAGED ) )
{ {
// WANNE: No entry in the Impass.edt for camouflage, so add any static text here // WANNE: No entry in the Impass.edt for camouflage, so add any static text here
// read one record from email file // read one record from email file
//LoadEncryptedDataFromFile( "BINARYDATA\\Impass.edt", pString, MAIL_STRING_SIZE * ( IMP_SKILLS_SPECIAL_CAMOUFLAGED ), MAIL_STRING_SIZE ); //LoadEncryptedDataFromFile( "BINARYDATA\\Impass.edt", pString, MAIL_STRING_SIZE * ( IMP_SKILLS_SPECIAL_CAMOUFLAGED ), MAIL_STRING_SIZE );
#ifdef ENGLISH
wcscpy(pString, L"Camouflage: <No description yet>");
#endif
#ifdef RUSSIAN
wcscpy(pString, L"Camouflage: <No description yet>");
#endif
#ifdef GERMAN #ifdef GERMAN
wcscpy(pString, L"Getarnt: <Noch keine Beschreibung vorhanden>"); wcscpy(pString, L"Getarnt: <Noch keine Beschreibung vorhanden>");
#else
wcscpy(pString, L"Camouflage: <No description yet>");
#endif #endif
// add to list // add to list
AddEmailRecordToList( pString ); AddEmailRecordToList( pString );
} }
// now the physical // now the physical
+71 -65
View File
@@ -3748,79 +3748,83 @@ INT32 GetAvgStatOfCurrentTeamStat( INT32 iStat )
// run through active soldiers // run through active soldiers
for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ pSoldier->bTeam ].bLastID; cnt++,pTeamSoldier++) for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ pSoldier->bTeam ].bLastID; cnt++,pTeamSoldier++)
{ {
if(( pTeamSoldier->bActive)&&( pTeamSoldier->bLife > 0 ) && !AM_A_ROBOT( pTeamSoldier ) ) // Only count stats of merc (not vehicles)
{ if ( !( pTeamSoldier->uiStatusFlags & SOLDIER_VEHICLE ) )
switch( iStat ) {
{ if(( pTeamSoldier->bActive)&&( pTeamSoldier->bLife > 0 ) && !AM_A_ROBOT( pTeamSoldier ) )
case 0: {
// health switch( iStat )
{
case 0:
// health
//if this is a pow, dont count his stats //if this is a pow, dont count his stats
if( pTeamSoldier->bAssignment == ASSIGNMENT_POW ) if( pTeamSoldier->bAssignment == ASSIGNMENT_POW )
{ {
bNumberOfPows++; bNumberOfPows++;
continue; continue;
} }
iTotalStatValue += pTeamSoldier -> bLifeMax; iTotalStatValue += pTeamSoldier -> bLifeMax;
break; break;
case 1: case 1:
// agility // agility
iTotalStatValue +=pTeamSoldier -> bAgility; iTotalStatValue +=pTeamSoldier -> bAgility;
break; break;
case 2: case 2:
// dexterity // dexterity
iTotalStatValue += pTeamSoldier -> bDexterity; iTotalStatValue += pTeamSoldier -> bDexterity;
break;
case 3:
// strength
iTotalStatValue += pTeamSoldier -> bStrength;
break; break;
case 3: case 4:
// strength // leadership
iTotalStatValue += pTeamSoldier -> bStrength; iTotalStatValue += pTeamSoldier -> bLeadership;
break; break;
case 4: case 5:
// leadership // wisdom
iTotalStatValue += pTeamSoldier -> bLeadership;
iTotalStatValue += pTeamSoldier -> bWisdom;
break;
case 6:
// exper
iTotalStatValue += pTeamSoldier -> bExpLevel;
break; break;
case 5: case 7:
// wisdom //mrkmanship
iTotalStatValue += pTeamSoldier -> bWisdom; iTotalStatValue += pTeamSoldier -> bMarksmanship;
break;
case 6: break;
// exper case 8:
// mech
iTotalStatValue += pTeamSoldier -> bExpLevel;
iTotalStatValue += pTeamSoldier -> bMechanical;
break;
case 9:
// exp
iTotalStatValue += pTeamSoldier ->bExplosive;
break;
case 10:
// med
iTotalStatValue += pTeamSoldier -> bMedical;
break;
}
break; ubNumberOfMercsInCalculation++;
case 7: }
//mrkmanship }
iTotalStatValue += pTeamSoldier -> bMarksmanship;
break;
case 8:
// mech
iTotalStatValue += pTeamSoldier -> bMechanical;
break;
case 9:
// exp
iTotalStatValue += pTeamSoldier ->bExplosive;
break;
case 10:
// med
iTotalStatValue += pTeamSoldier -> bMedical;
break;
}
ubNumberOfMercsInCalculation++;
}
} }
@@ -3906,6 +3910,8 @@ INT32 GetAvgStatOfPastTeamStat( INT32 iStat )
pTeamSoldier = &( gMercProfiles[ cnt ] ); pTeamSoldier = &( gMercProfiles[ cnt ] );
switch( iStat ) switch( iStat )
{ {
case 0: case 0:
+1 -1
View File
@@ -1176,7 +1176,7 @@ UINT32 UIHandleEndTurn( UI_EVENT *pUIEvent )
// to an option setting. // to an option setting.
// So no more need to have a file AutoSave.pls in you ja2 root directory // So no more need to have a file AutoSave.pls in you ja2 root directory
//if( FileExists( "..\\AutoSave.pls" ) && CanGameBeSaved() ) //if( FileExists( "..\\AutoSave.pls" ) && CanGameBeSaved() )
if (gGameExternalOptions.gfUseAutoSave == TRUE && CanGameBeSaved() ) if (gGameSettings.fOptions[TOPTION_USE_AUTO_SAVE] == TRUE && CanGameBeSaved() )
{ {
//Save the game //Save the game
guiPreviousOptionScreen = guiCurrentScreen; guiPreviousOptionScreen = guiCurrentScreen;
+12
View File
@@ -130,7 +130,13 @@ ammoEndElementHandle(void *userData, const char *name)
{ {
for(int i=0;i<min((int)strlen(pData->szCharData),MAX_CHAR_DATA_LENGTH);i++) for(int i=0;i<min((int)strlen(pData->szCharData),MAX_CHAR_DATA_LENGTH);i++)
{ {
// WANNE: TODO with ReplaceGermanSpecificCharacters() Method
#ifdef GERMAN
temp = pData->szCharData[i]; temp = pData->szCharData[i];
#else
temp = pData->szCharData[i];
#endif
AmmoCaliber[pData->curIndex][i] = temp; AmmoCaliber[pData->curIndex][i] = temp;
} }
} }
@@ -143,7 +149,13 @@ ammoEndElementHandle(void *userData, const char *name)
{ {
for(int i=0;i<min((int)strlen(pData->szCharData),MAX_CHAR_DATA_LENGTH);i++) for(int i=0;i<min((int)strlen(pData->szCharData),MAX_CHAR_DATA_LENGTH);i++)
{ {
// WANNE: TODO with ReplaceGermanSpecificCharacters() Method
#ifdef GERMAN
temp = pData->szCharData[i]; temp = pData->szCharData[i];
#else
temp = pData->szCharData[i];
#endif
BobbyRayAmmoCaliber[pData->curIndex][i] = temp; BobbyRayAmmoCaliber[pData->curIndex][i] = temp;
} }
} }
+263 -184
View File
@@ -8,121 +8,100 @@
BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString ) BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString )
{ {
//HWFILE hFile; if (pNameString != NULL)
//UINT32 uiBytesRead;
//UINT16 i;
//UINT32 uiStartSeekAmount;
// DebugMsg(TOPIC_JA2, DBG_LEVEL_3,String("LoadItemInfo"));
for (int i=0;i<80;i++)
{ {
if ( i<(int)strlen(Item[ubIndex].szLongItemName )) for (int i=0;i<80;i++)
pNameString[i] = Item[ubIndex].szLongItemName [i]; {
else if ( i<(int)strlen(Item[ubIndex].szLongItemName ))
pNameString[i] ='\0'; {
pNameString[i] = Item[ubIndex].szLongItemName [i];
// WANNE: German specific characters
#ifdef GERMAN
switch( pNameString[ i ] )
{
// ü
case 65532: pNameString[i] = 252; break;
// Ü
case 65500: pNameString[i] = 220; break;
// ä
case 65508: pNameString[i] = 228; break;
// Ä
case 65476: pNameString[i] = 196; break;
// ö
case 65526: pNameString[i] = 246; break;
// Ö
case 65494: pNameString[i] = 214; break;
// ß
case 65503: pNameString[i] = 223; break;
}
#endif
#ifdef POLISH
switch( pNameString[ i ] )
{
case 260: pNameString[ i ] = 165; break;
case 262: pNameString[ i ] = 198; break;
case 280: pNameString[ i ] = 202; break;
case 321: pNameString[ i ] = 163; break;
case 323: pNameString[ i ] = 209; break;
case 211: pNameString[ i ] = 211; break;
case 346: pNameString[ i ] = 338; break;
case 379: pNameString[ i ] = 175; break;
case 377: pNameString[ i ] = 143; break;
case 261: pNameString[ i ] = 185; break;
case 263: pNameString[ i ] = 230; break;
case 281: pNameString[ i ] = 234; break;
case 322: pNameString[ i ] = 179; break;
case 324: pNameString[ i ] = 241; break;
case 243: pNameString[ i ] = 243; break;
case 347: pNameString[ i ] = 339; break;
case 380: pNameString[ i ] = 191; break;
case 378: pNameString[ i ] = 376; break;
}
#endif
}
else
{
pNameString[i] ='\0';
}
}
} }
if(pInfoString != NULL) if(pInfoString != NULL)
{ {
// WANNE: CHANGE THIS
for (int i=0;i<400;i++) for (int i=0;i<400;i++)
{ {
if ( i<(int)strlen(Item[ubIndex].szItemDesc )) if ( i<(int)strlen(Item[ubIndex].szItemDesc ))
pInfoString[i] = Item[ubIndex].szItemDesc [i];
else
pInfoString[i] ='\0';
}
}
/*
hFile = FileOpen(ITEMSTRINGFILENAME, FILE_ACCESS_READ, FALSE);
if ( !hFile )
{
return( FALSE );
}
// Get current mercs bio info
uiStartSeekAmount = ( ( SIZE_SHORT_ITEM_NAME + SIZE_ITEM_NAME + SIZE_ITEM_INFO) * ubIndex );
// Skip short names
uiStartSeekAmount += SIZE_SHORT_ITEM_NAME;
if ( FileSeek( hFile, uiStartSeekAmount, FILE_SEEK_FROM_START ) == FALSE )
{
FileClose(hFile);
return( FALSE );
}
if( !FileRead( hFile, pNameString, SIZE_ITEM_NAME, &uiBytesRead) )
{
FileClose(hFile);
return( FALSE );
}
DebugMsg(TOPIC_JA2, DBG_LEVEL_3,String("LoadItemInfo: pNameString file read = %s",pNameString));
// Decrement, by 1, any value > 32
for(i=0; (i<SIZE_ITEM_NAME) && (pNameString[i] != 0); i++ )
{
if( pNameString[i] > 33 )
pNameString[i] -= 1;
#ifdef POLISH
switch( pNameString[ i ] )
{ {
case 260: pNameString[ i ] = 165; break; pInfoString[i] = Item[ubIndex].szItemDesc [i];
case 262: pNameString[ i ] = 198; break;
case 280: pNameString[ i ] = 202; break;
case 321: pNameString[ i ] = 163; break;
case 323: pNameString[ i ] = 209; break;
case 211: pNameString[ i ] = 211; break;
case 346: pNameString[ i ] = 338; break; // WANNE: German specific characters
case 379: pNameString[ i ] = 175; break; #ifdef GERMAN
case 377: pNameString[ i ] = 143; break;
case 261: pNameString[ i ] = 185; break;
case 263: pNameString[ i ] = 230; break;
case 281: pNameString[ i ] = 234; break;
case 322: pNameString[ i ] = 179; break;
case 324: pNameString[ i ] = 241; break;
case 243: pNameString[ i ] = 243; break;
case 347: pNameString[ i ] = 339; break;
case 380: pNameString[ i ] = 191; break;
case 378: pNameString[ i ] = 376; break;
}
#endif
}
DebugMsg(TOPIC_JA2, DBG_LEVEL_3,String("LoadItemInfo: pNameString after decrement = %s",pNameString));
DebugMsg(TOPIC_JA2, DBG_LEVEL_3,String("LoadItemInfo: pNameString after decrement = %s",pNameString+1));
DebugMsg(TOPIC_JA2, DBG_LEVEL_3,String("LoadItemInfo: pNameString after decrement = %s",pNameString+2));
DebugMsg(TOPIC_JA2, DBG_LEVEL_3,String("LoadItemInfo: pNameString after decrement = %s",pNameString+3));
// condition added by Chris - so we can get the name without the item info
// when desired, by passing in a null pInfoString
if (pInfoString != NULL)
{
// Get the additional info
uiStartSeekAmount = ((SIZE_ITEM_NAME + SIZE_SHORT_ITEM_NAME + SIZE_ITEM_INFO) * ubIndex ) + SIZE_ITEM_NAME + SIZE_SHORT_ITEM_NAME;
if ( FileSeek( hFile, uiStartSeekAmount, FILE_SEEK_FROM_START ) == FALSE )
{
FileClose(hFile);
return( FALSE );
}
if( !FileRead( hFile, pInfoString, SIZE_ITEM_INFO, &uiBytesRead) )
{
FileClose(hFile);
return( FALSE );
}
// Decrement, by 1, any value > 32
for(i=0; (i<SIZE_ITEM_INFO) && (pInfoString[i] != 0); i++ )
{
if( pInfoString[i] > 33 )
pInfoString[i] -= 1;
#ifdef POLISH
switch( pInfoString[ i ] ) switch( pInfoString[ i ] )
{
// ü
case 65532: pInfoString[i] = 252; break;
// Ü
case 65500: pInfoString[i] = 220; break;
// ä
case 65508: pInfoString[i] = 228; break;
// Ä
case 65476: pInfoString[i] = 196; break;
// ö
case 65526: pInfoString[i] = 246; break;
// Ö
case 65494: pInfoString[i] = 214; break;
// ß
case 65503: pInfoString[i] = 223; break;
}
#endif
#ifdef POLISH
switch( pNameString[ i ] )
{ {
case 260: pInfoString[ i ] = 165; break; case 260: pInfoString[ i ] = 165; break;
case 262: pInfoString[ i ] = 198; break; case 262: pInfoString[ i ] = 198; break;
@@ -145,38 +124,146 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString )
case 380: pInfoString[ i ] = 191; break; case 380: pInfoString[ i ] = 191; break;
case 378: pInfoString[ i ] = 376; break; case 378: pInfoString[ i ] = 376; break;
} }
#endif #endif
}
else
{
pInfoString[i] ='\0';
}
} }
} }
FileClose(hFile);
*/
return(TRUE); return(TRUE);
} }
BOOLEAN LoadBRName(UINT16 ubIndex, STR16 pNameString ) BOOLEAN LoadBRName(UINT16 ubIndex, STR16 pNameString )
{ {
if (pNameString != NULL)
for (int i=0;i<80;i++)
{ {
if ( i<(int)strlen(Item[ubIndex].szBRName)) for (int i=0;i<80;i++)
pNameString[i] = Item[ubIndex].szBRName [i]; {
else if ( i<(int)strlen(Item[ubIndex].szBRName))
pNameString[i] ='\0'; {
} pNameString[i] = Item[ubIndex].szBRName [i];
// WANNE: German specific characters
#ifdef GERMAN
switch( pNameString[ i ] )
{
// ü
case 65532: pNameString[i] = 252; break;
// Ü
case 65500: pNameString[i] = 220; break;
// ä
case 65508: pNameString[i] = 228; break;
// Ä
case 65476: pNameString[i] = 196; break;
// ö
case 65526: pNameString[i] = 246; break;
// Ö
case 65494: pNameString[i] = 214; break;
// ß
case 65503: pNameString[i] = 223; break;
}
#endif
#ifdef POLISH
switch( pNameString[ i ] )
{
case 260: pNameString[ i ] = 165; break;
case 262: pNameString[ i ] = 198; break;
case 280: pNameString[ i ] = 202; break;
case 321: pNameString[ i ] = 163; break;
case 323: pNameString[ i ] = 209; break;
case 211: pNameString[ i ] = 211; break;
case 346: pNameString[ i ] = 338; break;
case 379: pNameString[ i ] = 175; break;
case 377: pNameString[ i ] = 143; break;
case 261: pNameString[ i ] = 185; break;
case 263: pNameString[ i ] = 230; break;
case 281: pNameString[ i ] = 234; break;
case 322: pNameString[ i ] = 179; break;
case 324: pNameString[ i ] = 241; break;
case 243: pNameString[ i ] = 243; break;
case 347: pNameString[ i ] = 339; break;
case 380: pNameString[ i ] = 191; break;
case 378: pNameString[ i ] = 376; break;
}
#endif
}
else
{
pNameString[i] ='\0';
}
}
}
return TRUE; return TRUE;
} }
BOOLEAN LoadBRDesc(UINT16 ubIndex, STR16 pDescString ) BOOLEAN LoadBRDesc(UINT16 ubIndex, STR16 pDescString )
{ {
if (pDescString != NULL)
for (int i=0;i<400;i++)
{ {
if ( i<(int)strlen(Item[ubIndex].szBRDesc)) for (int i=0;i<400;i++)
pDescString[i] = Item[ubIndex].szBRDesc [i]; {
else if ( i<(int)strlen(Item[ubIndex].szBRDesc))
pDescString[i] ='\0'; {
pDescString[i] = Item[ubIndex].szBRDesc [i];
// WANNE: German specific characters
#ifdef GERMAN
switch( pDescString[ i ] )
{
// ü
case 65532: pDescString[i] = 252; break;
// Ü
case 65500: pDescString[i] = 220; break;
// ä
case 65508: pDescString[i] = 228; break;
// Ä
case 65476: pDescString[i] = 196; break;
// ö
case 65526: pDescString[i] = 246; break;
// Ö
case 65494: pDescString[i] = 214; break;
// ß
case 65503: pDescString[i] = 223; break;
}
#endif
#ifdef POLISH
switch( pDescString[ i ] )
{
case 260: pDescString[ i ] = 165; break;
case 262: pDescString[ i ] = 198; break;
case 280: pDescString[ i ] = 202; break;
case 321: pDescString[ i ] = 163; break;
case 323: pDescString[ i ] = 209; break;
case 211: pDescString[ i ] = 211; break;
case 346: pDescString[ i ] = 338; break;
case 379: pDescString[ i ] = 175; break;
case 377: pDescString[ i ] = 143; break;
case 261: pDescString[ i ] = 185; break;
case 263: pDescString[ i ] = 230; break;
case 281: pDescString[ i ] = 234; break;
case 322: pDescString[ i ] = 179; break;
case 324: pDescString[ i ] = 241; break;
case 243: pDescString[ i ] = 243; break;
case 347: pDescString[ i ] = 339; break;
case 380: pDescString[ i ] = 191; break;
case 378: pDescString[ i ] = 376; break;
}
#endif
}
else
{
pDescString[i] ='\0';
}
}
} }
return TRUE; return TRUE;
@@ -184,77 +271,69 @@ BOOLEAN LoadBRDesc(UINT16 ubIndex, STR16 pDescString )
BOOLEAN LoadShortNameItemInfo(UINT16 ubIndex, STR16 pNameString ) BOOLEAN LoadShortNameItemInfo(UINT16 ubIndex, STR16 pNameString )
{ {
if(pNameString != NULL)
for (int i=0;i<80;i++)
{ {
if ( i<(int)strlen(Item[ubIndex].szItemName)) // WANNE:
pNameString[i] = Item[ubIndex].szItemName [i]; for (int i=0;i<80;i++)
else {
pNameString[i] ='\0'; if ( i<(int)strlen(Item[ubIndex].szItemName))
}
/*
HWFILE hFile;
// wchar_t DestString[ SIZE_MERC_BIO_INFO ];
UINT32 uiBytesRead;
UINT16 i;
UINT32 uiStartSeekAmount;
hFile = FileOpen(ITEMSTRINGFILENAME, FILE_ACCESS_READ, FALSE);
if ( !hFile )
{
return( FALSE );
}
// Get current mercs bio info
uiStartSeekAmount = ( ( SIZE_SHORT_ITEM_NAME + SIZE_ITEM_NAME + SIZE_ITEM_INFO ) * ubIndex );
if ( FileSeek( hFile, uiStartSeekAmount, FILE_SEEK_FROM_START ) == FALSE )
{
FileClose(hFile);
return( FALSE );
}
if( !FileRead( hFile, pNameString, SIZE_ITEM_NAME, &uiBytesRead) )
{
FileClose(hFile);
return( FALSE );
}
// Decrement, by 1, any value > 32
for(i=0; (i<SIZE_ITEM_NAME) && (pNameString[i] != 0); i++ )
{
if( pNameString[i] > 33 )
pNameString[i] -= 1;
#ifdef POLISH
switch( pNameString[ i ] )
{ {
case 260: pNameString[ i ] = 165; break; pNameString[i] = Item[ubIndex].szItemName [i];
case 262: pNameString[ i ] = 198; break;
case 280: pNameString[ i ] = 202; break;
case 321: pNameString[ i ] = 163; break;
case 323: pNameString[ i ] = 209; break;
case 211: pNameString[ i ] = 211; break;
case 346: pNameString[ i ] = 338; break; // WANNE: German specific characters
case 379: pNameString[ i ] = 175; break; #ifdef GERMAN
case 377: pNameString[ i ] = 143; break; switch( pNameString[ i ] )
case 261: pNameString[ i ] = 185; break; {
case 263: pNameString[ i ] = 230; break; // ü
case 281: pNameString[ i ] = 234; break; case 65532: pNameString[i] = 252; break;
// Ü
case 65500: pNameString[i] = 220; break;
// ä
case 65508: pNameString[i] = 228; break;
// Ä
case 65476: pNameString[i] = 196; break;
// ö
case 65526: pNameString[i] = 246; break;
// Ö
case 65494: pNameString[i] = 214; break;
// ß
case 65503: pNameString[i] = 223; break;
}
#endif
case 322: pNameString[ i ] = 179; break; #ifdef POLISH
case 324: pNameString[ i ] = 241; break; switch( pNameString[ i ] )
case 243: pNameString[ i ] = 243; break; {
case 347: pNameString[ i ] = 339; break; case 260: pNameString[ i ] = 165; break;
case 380: pNameString[ i ] = 191; break; case 262: pNameString[ i ] = 198; break;
case 378: pNameString[ i ] = 376; break; case 280: pNameString[ i ] = 202; break;
case 321: pNameString[ i ] = 163; break;
case 323: pNameString[ i ] = 209; break;
case 211: pNameString[ i ] = 211; break;
case 346: pNameString[ i ] = 338; break;
case 379: pNameString[ i ] = 175; break;
case 377: pNameString[ i ] = 143; break;
case 261: pNameString[ i ] = 185; break;
case 263: pNameString[ i ] = 230; break;
case 281: pNameString[ i ] = 234; break;
case 322: pNameString[ i ] = 179; break;
case 324: pNameString[ i ] = 241; break;
case 243: pNameString[ i ] = 243; break;
case 347: pNameString[ i ] = 339; break;
case 380: pNameString[ i ] = 191; break;
case 378: pNameString[ i ] = 376; break;
}
#endif
} }
#endif else
{
pNameString[i] ='\0';
}
}
} }
FileClose(hFile);
*/
return(TRUE); return(TRUE);
} }
+74
View File
@@ -23,6 +23,80 @@ extern BOOLEAN GetCDromDriveLetter( STR8 pString );
BOOLEAN PerformTimeLimitedCheck(); BOOLEAN PerformTimeLimitedCheck();
// WANNE:
/* Given a string, replaces all instances of "oldpiece" with "newpiece".
*
* Modified this routine to eliminate recursion and to avoid infinite
* expansion of string when newpiece contains oldpiece. --Byron
*/
char *Replace(char *string, char *oldpiece, char *newpiece) {
int str_index, newstr_index, oldpiece_index, end,
new_len, old_len, cpy_len;
char *c;
static char newstring[MAXLINE];
if ((c = (char *) strstr(string, oldpiece)) == NULL)
return string;
new_len = strlen(newpiece);
old_len = strlen(oldpiece);
end = strlen(string) - old_len;
oldpiece_index = c - string;
newstr_index = 0;
str_index = 0;
while(str_index <= end && c != NULL)
{
/* Copy characters from the left of matched pattern occurence */
cpy_len = oldpiece_index-str_index;
strncpy(newstring+newstr_index, string+str_index, cpy_len);
newstr_index += cpy_len;
str_index += cpy_len;
/* Copy replacement characters instead of matched pattern */
strcpy(newstring+newstr_index, newpiece);
newstr_index += new_len;
str_index += old_len;
/* Check for another pattern match */
if((c = (char *) strstr(string+str_index, oldpiece)) != NULL)
oldpiece_index = c - string;
}
/* Copy remaining characters from the right of last matched pattern */
strcpy(newstring+newstr_index, string+str_index);
return newstring;
}
// WANNE: Replaces german specific characters
char *ReplaceGermanSpecialCharacters(char *text)
{
// ä
text = Replace(text, "ä", "ä");
// Ä
text = Replace(text, "Ä", "Ä");
// ö
text = Replace(text, "ö", "ö");
// Ö
text = Replace(text, "Ö", "Ö");
// ü
text = Replace(text, "ü", "ü");
// Ü
text = Replace(text, "Ü", "Ü");
// ß
text = Replace(text, "ß", "ß");
return text;
}
//#define TIME_LIMITED_VERSION //#define TIME_LIMITED_VERSION
void FilenameForBPP(STR pFilename, STR pDestination) void FilenameForBPP(STR pFilename, STR pDestination)
+9
View File
@@ -7,6 +7,9 @@
#define GETPIXELDEPTH( ) ( gbPixelDepth ) #define GETPIXELDEPTH( ) ( gbPixelDepth )
// WANNE: Maximum number of characters in german description (German xml files)
#define MAXLINE 200
BOOLEAN CreateSGPPaletteFromCOLFile( SGPPaletteEntry *pPalette, SGPFILENAME ColFile ); BOOLEAN CreateSGPPaletteFromCOLFile( SGPPaletteEntry *pPalette, SGPFILENAME ColFile );
BOOLEAN DisplayPaletteRep( PaletteRepID aPalRep, UINT8 ubXPos, UINT8 ubYPos, UINT32 uiDestSurface ); BOOLEAN DisplayPaletteRep( PaletteRepID aPalRep, UINT8 ubXPos, UINT8 ubYPos, UINT32 uiDestSurface );
@@ -22,6 +25,12 @@ void HandleLimitedNumExecutions( );
BOOLEAN HandleJA2CDCheck( ); BOOLEAN HandleJA2CDCheck( );
BOOLEAN HandleJA2CDCheckTwo( ); BOOLEAN HandleJA2CDCheckTwo( );
// WANNE: This method replaces characters in a given text with new characters
char *Replace(char *string, char *oldpiece, char *newpiece);
// WANNE: This method calls the replace method and replaces all german specific characters
char *ReplaceGermanSpecialCharacters(char *text);
// Snap: integer division that rounds the result to the nearest integer // Snap: integer division that rounds the result to the nearest integer
template<class Integer> template<class Integer>
inline Integer idiv(Integer a, Integer b) inline Integer idiv(Integer a, Integer b)
+11
View File
@@ -42,6 +42,7 @@
#include "Debug Control.h" #include "Debug Control.h"
#include "expat.h" #include "expat.h"
#include "XML.h" #include "XML.h"
#include "utilities.h"
#endif #endif
struct struct
@@ -260,11 +261,20 @@ itemEndElementHandle(void *userData, const char *name)
pData->curArray[pData->curItem.uiIndex] = pData->curItem; //write the item into the table pData->curArray[pData->curItem.uiIndex] = pData->curItem; //write the item into the table
else if ( sizeof(pData->curItem.szItemName)>0 && localizedTextOnly ) else if ( sizeof(pData->curItem.szItemName)>0 && localizedTextOnly )
{ {
// WANNE: Replace specific characters (ö, ä, ...)
#ifdef GERMAN
strcpy((char *)pData->curArray[pData->curItem.uiIndex].szItemName, (char *)ReplaceGermanSpecialCharacters((char *)pData->curItem.szItemName));
strcpy((char *)pData->curArray[pData->curItem.uiIndex].szLongItemName, (char *)ReplaceGermanSpecialCharacters((char *)pData->curItem.szLongItemName));
strcpy((char *)pData->curArray[pData->curItem.uiIndex].szBRName, (char *)ReplaceGermanSpecialCharacters((char *)pData->curItem.szBRName));
strcpy((char *)pData->curArray[pData->curItem.uiIndex].szItemDesc, (char *)ReplaceGermanSpecialCharacters((char *)pData->curItem.szItemDesc));
strcpy((char *)pData->curArray[pData->curItem.uiIndex].szBRDesc, (char *)ReplaceGermanSpecialCharacters((char *)pData->curItem.szBRDesc));
#else
strcpy(pData->curArray[pData->curItem.uiIndex].szItemName,pData->curItem.szItemName); strcpy(pData->curArray[pData->curItem.uiIndex].szItemName,pData->curItem.szItemName);
strcpy(pData->curArray[pData->curItem.uiIndex].szLongItemName,pData->curItem.szLongItemName); strcpy(pData->curArray[pData->curItem.uiIndex].szLongItemName,pData->curItem.szLongItemName);
strcpy(pData->curArray[pData->curItem.uiIndex].szBRName,pData->curItem.szBRName); strcpy(pData->curArray[pData->curItem.uiIndex].szBRName,pData->curItem.szBRName);
strcpy(pData->curArray[pData->curItem.uiIndex].szItemDesc,pData->curItem.szItemDesc); strcpy(pData->curArray[pData->curItem.uiIndex].szItemDesc,pData->curItem.szItemDesc);
strcpy(pData->curArray[pData->curItem.uiIndex].szBRDesc,pData->curItem.szBRDesc); strcpy(pData->curArray[pData->curItem.uiIndex].szBRDesc,pData->curItem.szBRDesc);
#endif
} }
} }
} }
@@ -995,6 +1005,7 @@ BOOLEAN ReadInItemStats(STR fileName, BOOLEAN localizedVersion )
UINT32 uiBytesRead; UINT32 uiBytesRead;
UINT32 uiFSize; UINT32 uiFSize;
CHAR8 * lpcBuffer; CHAR8 * lpcBuffer;
XML_Parser parser = XML_ParserCreate(NULL); XML_Parser parser = XML_ParserCreate(NULL);
itemParseData pData; itemParseData pData;
+2 -1
View File
@@ -3461,6 +3461,7 @@ STR16 zOptionsToggleText[] =
L"Tracer effect for single shot", L"Tracer effect for single shot",
L"Rain noises", L"Rain noises",
L"Random I.M.P personality", L"Random I.M.P personality",
L"Auto save",
}; };
//This is the help text associated with the above toggles. //This is the help text associated with the above toggles.
@@ -3537,7 +3538,7 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, tracer effect will be shown for single shots.", L"When ON, tracer effect will be shown for single shots.",
L"When ON, you will hear rain noises when it is raining.", L"When ON, you will hear rain noises when it is raining.",
L"When ON, I.M.P characters will get random personality and attitude.", L"When ON, I.M.P characters will get random personality and attitude.",
L"When ON, game will be saved in tactical after each players turn.",
}; };
+2
View File
@@ -3464,6 +3464,7 @@ STR16 zOptionsToggleText[] =
L"Rain noises", L"Rain noises",
L"Allow crows", L"Allow crows",
L"Random I.M.P personality", L"Random I.M.P personality",
L"Auto save",
}; };
//This is the help text associated with the above toggles. //This is the help text associated with the above toggles.
@@ -3541,6 +3542,7 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, you will hear rain noises when it is raining.", L"When ON, you will hear rain noises when it is raining.",
L"When ON, the crows are present in game.", L"When ON, the crows are present in game.",
L"When ON, I.M.P characters will get random personality and attitude.", L"When ON, I.M.P characters will get random personality and attitude.",
L"When ON, game will be saved after each players turn.",
}; };
+2
View File
@@ -3450,6 +3450,7 @@ STR16 zOptionsToggleText[] =
L"Tracer effect for single shot", L"Tracer effect for single shot",
L"Rain noises", L"Rain noises",
L"Random I.M.P personality", L"Random I.M.P personality",
L"Auto save",
}; };
//This is the help text associated with the above toggles. //This is the help text associated with the above toggles.
@@ -3526,6 +3527,7 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, tracer effect will be shown for single shots.", L"When ON, tracer effect will be shown for single shots.",
L"When ON, you will hear rain noises when it is raining.", L"When ON, you will hear rain noises when it is raining.",
L"When ON, I.M.P characters will get random personality and attitude.", L"When ON, I.M.P characters will get random personality and attitude.",
L"When ON, game will be saved in tactical after each players turn.",
}; };
+2
View File
@@ -3270,6 +3270,7 @@ STR16 zOptionsToggleText[] =
L"Regengeräusche", L"Regengeräusche",
L"Krähen erlauben", L"Krähen erlauben",
L"Zufällige B.S.E Personalität", L"Zufällige B.S.E Personalität",
L"Automatisch speichern",
}; };
//This is the help text associated with the above toggles. //This is the help text associated with the above toggles.
@@ -3347,6 +3348,7 @@ STR16 zOptionsScreenHelpText[] =
L"Wenn diese Funktion aktiviert ist, werden Regengeräusche hörbar falls es regnet.", L"Wenn diese Funktion aktiviert ist, werden Regengeräusche hörbar falls es regnet.",
L"Wenn diese Funktion aktiviert ist, sind Krähen im Spiel vorhanden.", L"Wenn diese Funktion aktiviert ist, sind Krähen im Spiel vorhanden.",
L"Wenn diese Funktion aktiviert ist, erhalten B.S.E Charaktere zufällige Persönlichkeit und Einstellung.", L"Wenn diese Funktion aktiviert ist, erhalten B.S.E Charaktere zufällige Persönlichkeit und Einstellung.",
L"Wenn diese Funktion aktiviert ist, wird nach jeder Runde automatisch gespeichert.",
}; };
STR16 gzGIOScreenText[] = STR16 gzGIOScreenText[] =
+2
View File
@@ -3443,6 +3443,7 @@ STR16 zOptionsToggleText[] =
L"Tracer effect for single shot", L"Tracer effect for single shot",
L"Rain noises", L"Rain noises",
L"Random I.M.P personality", L"Random I.M.P personality",
L"Auto save",
}; };
//This is the help text associated with the above toggles. //This is the help text associated with the above toggles.
@@ -3519,6 +3520,7 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, tracer effect will be shown for single shots.", L"When ON, tracer effect will be shown for single shots.",
L"When ON, you will hear rain noises when it is raining.", L"When ON, you will hear rain noises when it is raining.",
L"When ON, I.M.P characters will get random personality and attitude.", L"When ON, I.M.P characters will get random personality and attitude.",
L"When ON, game will be saved in tactical after each players turn.",
}; };
+2
View File
@@ -3443,6 +3443,7 @@ STR16 zOptionsToggleText[] =
L"Tracer effect for single shot", L"Tracer effect for single shot",
L"Rain noises", L"Rain noises",
L"Random I.M.P personality", L"Random I.M.P personality",
L"Auto save",
}; };
//This is the help text associated with the above toggles. //This is the help text associated with the above toggles.
@@ -3519,6 +3520,7 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, tracer effect will be shown for single shots.", L"When ON, tracer effect will be shown for single shots.",
L"When ON, you will hear rain noises when it is raining.", L"When ON, you will hear rain noises when it is raining.",
L"When ON, I.M.P characters will get random personality and attitude.", L"When ON, I.M.P characters will get random personality and attitude.",
L"When ON, game will be saved in tactical after each players turn.",
}; };
+2
View File
@@ -3454,6 +3454,7 @@ STR16 zOptionsToggleText[] =
L"Rain noises", L"Rain noises",
L"Allow crows", L"Allow crows",
L"Random I.M.P personality", L"Random I.M.P personality",
L"Auto save",
}; };
//This is the help text associated with the above toggles. //This is the help text associated with the above toggles.
@@ -3531,6 +3532,7 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, you will hear rain noises when it is raining.", L"When ON, you will hear rain noises when it is raining.",
L"When ON, the crows are present in game.", L"When ON, the crows are present in game.",
L"When ON, I.M.P characters will get random personality and attitude.", L"When ON, I.M.P characters will get random personality and attitude.",
L"When ON, game will be saved in tactical after each players turn.",
}; };
+2
View File
@@ -265,9 +265,11 @@ UINT32 ErrorScreenHandle(void)
{ {
InputAtom InputEvent; InputAtom InputEvent;
static BOOLEAN fFirstTime = FALSE; static BOOLEAN fFirstTime = FALSE;
/*
#ifdef JA2BETAVERSION #ifdef JA2BETAVERSION
UINT16 str[256]; UINT16 str[256];
#endif #endif
*/
// For quick setting of new video stuff / to be changed // For quick setting of new video stuff / to be changed
StartFrameBufferRender( ); StartFrameBufferRender( );