diff --git a/GameSettings.cpp b/GameSettings.cpp index 1d8a4e06..f508b874 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -258,6 +258,7 @@ void InitGameSettings() gGameSettings.fOptions[ TOPTION_RAIN_SOUND ] = TRUE; gGameSettings.fOptions[ TOPTION_ALLOW_CROWS ] = TRUE; gGameSettings.fOptions[ TOPTION_USE_RANDOM_PERSONALITY ] = FALSE; + gGameSettings.fOptions[ TOPTION_USE_AUTO_SAVE ] = FALSE; gGameSettings.ubSizeOfDisplayCover = 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 // So for now USE_AUTO_SAVE is always false. // 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 gGameExternalOptions.gfTrainVeteranMilitia = iniReader.ReadBoolean("JA2 Gameplay Settings","TRAIN_VETERAN_MILITIA",FALSE); diff --git a/GameSettings.h b/GameSettings.h index f286bbd5..a256063e 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -52,6 +52,7 @@ enum TOPTION_RAIN_SOUND, TOPTION_ALLOW_CROWS, TOPTION_USE_RANDOM_PERSONALITY, + TOPTION_USE_AUTO_SAVE, NUM_GAME_OPTIONS, //Toggle up this will be able to be Toggled by the player diff --git a/GameVersion.cpp b/GameVersion.cpp index 936cabcc..b58dfec7 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -13,7 +13,7 @@ #ifdef JA2BETAVERSION //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 @@ -23,12 +23,12 @@ INT16 zVersionLabel[256] = { L"Beta v. 0.98" }; #else //RELEASE BUILD VERSION - INT16 zVersionLabel[256] = { L"Release v1.13.579" }; + INT16 zVersionLabel[256] = { L"Release v1.13.590" }; #endif -INT8 czVersionNumber[16] = { "Build 06.09.29" }; +INT8 czVersionNumber[16] = { "Build 06.10.04" }; INT16 zTrackingNumber[16] = { L"Z" }; diff --git a/JA2.suo b/JA2.suo index d8d18fe9..43805c9b 100644 Binary files a/JA2.suo and b/JA2.suo differ diff --git a/JA2.vcproj b/JA2.vcproj index 23db1d90..25a035d4 100644 --- a/JA2.vcproj +++ b/JA2.vcproj @@ -43,7 +43,7 @@ "); - #endif - - #ifdef RUSSIAN - wcscpy(pString, L"Rooftop Sniping: "); - #endif - #ifdef GERMAN - wcscpy(pString, L"Dach-Treffer Bonus: "); + wcscpy(pString, L"Dach-Treffer Bonus: "); + #else + wcscpy(pString, L"Rooftop Sniping: "); #endif - // add to list - AddEmailRecordToList( pString ); + // add to list + AddEmailRecordToList( pString ); } // camouflage if( ( gMercProfiles[ iCurrentIMPSlot ].bSkillTrait == CAMOUFLAGED )||( gMercProfiles[ iCurrentIMPSlot ].bSkillTrait2 == CAMOUFLAGED ) ) { // WANNE: No entry in the Impass.edt for camouflage, so add any static text here - // read one record from email file - //LoadEncryptedDataFromFile( "BINARYDATA\\Impass.edt", pString, MAIL_STRING_SIZE * ( IMP_SKILLS_SPECIAL_CAMOUFLAGED ), MAIL_STRING_SIZE ); + // read one record from email file + //LoadEncryptedDataFromFile( "BINARYDATA\\Impass.edt", pString, MAIL_STRING_SIZE * ( IMP_SKILLS_SPECIAL_CAMOUFLAGED ), MAIL_STRING_SIZE ); - #ifdef ENGLISH - wcscpy(pString, L"Camouflage: "); - #endif - - #ifdef RUSSIAN - wcscpy(pString, L"Camouflage: "); - #endif - #ifdef GERMAN - wcscpy(pString, L"Getarnt: "); + wcscpy(pString, L"Getarnt: "); + #else + wcscpy(pString, L"Camouflage: "); #endif - // add to list - AddEmailRecordToList( pString ); + // add to list + AddEmailRecordToList( pString ); } // now the physical diff --git a/Laptop/personnel.cpp b/Laptop/personnel.cpp index cc49e2c5..b498915c 100644 --- a/Laptop/personnel.cpp +++ b/Laptop/personnel.cpp @@ -3748,79 +3748,83 @@ INT32 GetAvgStatOfCurrentTeamStat( INT32 iStat ) // run through active soldiers for ( pTeamSoldier = MercPtrs[ cnt ]; cnt <= gTacticalStatus.Team[ pSoldier->bTeam ].bLastID; cnt++,pTeamSoldier++) { - if(( pTeamSoldier->bActive)&&( pTeamSoldier->bLife > 0 ) && !AM_A_ROBOT( pTeamSoldier ) ) - { - switch( iStat ) - { - case 0: - // health + // Only count stats of merc (not vehicles) + if ( !( pTeamSoldier->uiStatusFlags & SOLDIER_VEHICLE ) ) + { + if(( pTeamSoldier->bActive)&&( pTeamSoldier->bLife > 0 ) && !AM_A_ROBOT( pTeamSoldier ) ) + { + switch( iStat ) + { + case 0: + // health - //if this is a pow, dont count his stats - if( pTeamSoldier->bAssignment == ASSIGNMENT_POW ) - { - bNumberOfPows++; - continue; - } + //if this is a pow, dont count his stats + if( pTeamSoldier->bAssignment == ASSIGNMENT_POW ) + { + bNumberOfPows++; + continue; + } - iTotalStatValue += pTeamSoldier -> bLifeMax; - - break; - case 1: - // agility - iTotalStatValue +=pTeamSoldier -> bAgility; + iTotalStatValue += pTeamSoldier -> bLifeMax; + + break; + case 1: + // agility + iTotalStatValue +=pTeamSoldier -> bAgility; - break; - case 2: - // dexterity - iTotalStatValue += pTeamSoldier -> bDexterity; + break; + case 2: + // dexterity + iTotalStatValue += pTeamSoldier -> bDexterity; + + break; + case 3: + // strength + iTotalStatValue += pTeamSoldier -> bStrength; break; - case 3: - // strength - iTotalStatValue += pTeamSoldier -> bStrength; + case 4: + // leadership + iTotalStatValue += pTeamSoldier -> bLeadership; - break; - case 4: - // leadership - iTotalStatValue += pTeamSoldier -> bLeadership; + break; + case 5: + // wisdom + + iTotalStatValue += pTeamSoldier -> bWisdom; + break; + case 6: + // exper + + iTotalStatValue += pTeamSoldier -> bExpLevel; - break; - case 5: - // wisdom - - iTotalStatValue += pTeamSoldier -> bWisdom; - break; - case 6: - // exper - - iTotalStatValue += pTeamSoldier -> bExpLevel; + break; + 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; + } - break; - 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++; - } + ubNumberOfMercsInCalculation++; + } + } } @@ -3906,6 +3910,8 @@ INT32 GetAvgStatOfPastTeamStat( INT32 iStat ) pTeamSoldier = &( gMercProfiles[ cnt ] ); + + switch( iStat ) { case 0: diff --git a/Tactical/Handle UI.cpp b/Tactical/Handle UI.cpp index a7d1da6d..d3848950 100644 --- a/Tactical/Handle UI.cpp +++ b/Tactical/Handle UI.cpp @@ -1176,7 +1176,7 @@ UINT32 UIHandleEndTurn( UI_EVENT *pUIEvent ) // to an option setting. // So no more need to have a file AutoSave.pls in you ja2 root directory //if( FileExists( "..\\AutoSave.pls" ) && CanGameBeSaved() ) - if (gGameExternalOptions.gfUseAutoSave == TRUE && CanGameBeSaved() ) + if (gGameSettings.fOptions[TOPTION_USE_AUTO_SAVE] == TRUE && CanGameBeSaved() ) { //Save the game guiPreviousOptionScreen = guiCurrentScreen; diff --git a/Tactical/XML_AmmoStrings.cpp b/Tactical/XML_AmmoStrings.cpp index 9f40e913..291db791 100644 --- a/Tactical/XML_AmmoStrings.cpp +++ b/Tactical/XML_AmmoStrings.cpp @@ -130,7 +130,13 @@ ammoEndElementHandle(void *userData, const char *name) { for(int i=0;iszCharData),MAX_CHAR_DATA_LENGTH);i++) { + // WANNE: TODO with ReplaceGermanSpecificCharacters() Method + #ifdef GERMAN temp = pData->szCharData[i]; + #else + temp = pData->szCharData[i]; + #endif + AmmoCaliber[pData->curIndex][i] = temp; } } @@ -143,7 +149,13 @@ ammoEndElementHandle(void *userData, const char *name) { for(int i=0;iszCharData),MAX_CHAR_DATA_LENGTH);i++) { + // WANNE: TODO with ReplaceGermanSpecificCharacters() Method + #ifdef GERMAN temp = pData->szCharData[i]; + #else + temp = pData->szCharData[i]; + #endif + BobbyRayAmmoCaliber[pData->curIndex][i] = temp; } } diff --git a/Utils/Text Utils.cpp b/Utils/Text Utils.cpp index 726c77ea..394d93a6 100644 --- a/Utils/Text Utils.cpp +++ b/Utils/Text Utils.cpp @@ -8,121 +8,100 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString ) { - //HWFILE hFile; - //UINT32 uiBytesRead; - //UINT16 i; - //UINT32 uiStartSeekAmount; - -// DebugMsg(TOPIC_JA2, DBG_LEVEL_3,String("LoadItemInfo")); - - for (int i=0;i<80;i++) + if (pNameString != NULL) { - if ( i<(int)strlen(Item[ubIndex].szLongItemName )) - pNameString[i] = Item[ubIndex].szLongItemName [i]; - else - pNameString[i] ='\0'; + for (int i=0;i<80;i++) + { + if ( i<(int)strlen(Item[ubIndex].szLongItemName )) + { + 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) { + // WANNE: CHANGE THIS for (int i=0;i<400;i++) { 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 33 ) - pNameString[i] -= 1; - #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; + pInfoString[i] = Item[ubIndex].szItemDesc [i]; - 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 - } - - 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 33 ) - pInfoString[i] -= 1; - #ifdef POLISH + // WANNE: German specific characters + #ifdef GERMAN 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 262: pInfoString[ i ] = 198; break; @@ -145,38 +124,146 @@ BOOLEAN LoadItemInfo(UINT16 ubIndex, STR16 pNameString, STR16 pInfoString ) case 380: pInfoString[ i ] = 191; break; case 378: pInfoString[ i ] = 376; break; } - #endif + #endif + } + else + { + pInfoString[i] ='\0'; + } } } - FileClose(hFile); -*/ return(TRUE); } BOOLEAN LoadBRName(UINT16 ubIndex, STR16 pNameString ) { - - for (int i=0;i<80;i++) + if (pNameString != NULL) { - if ( i<(int)strlen(Item[ubIndex].szBRName)) - pNameString[i] = Item[ubIndex].szBRName [i]; - else - pNameString[i] ='\0'; - } + for (int i=0;i<80;i++) + { + if ( i<(int)strlen(Item[ubIndex].szBRName)) + { + 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; } BOOLEAN LoadBRDesc(UINT16 ubIndex, STR16 pDescString ) { - - for (int i=0;i<400;i++) + if (pDescString != NULL) { - if ( i<(int)strlen(Item[ubIndex].szBRDesc)) - pDescString[i] = Item[ubIndex].szBRDesc [i]; - else - pDescString[i] ='\0'; + for (int i=0;i<400;i++) + { + if ( i<(int)strlen(Item[ubIndex].szBRDesc)) + { + 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; @@ -184,77 +271,69 @@ BOOLEAN LoadBRDesc(UINT16 ubIndex, STR16 pDescString ) BOOLEAN LoadShortNameItemInfo(UINT16 ubIndex, STR16 pNameString ) { - - for (int i=0;i<80;i++) + if(pNameString != NULL) { - if ( i<(int)strlen(Item[ubIndex].szItemName)) - pNameString[i] = Item[ubIndex].szItemName [i]; - else - pNameString[i] ='\0'; - } -/* - 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 33 ) - pNameString[i] -= 1; - #ifdef POLISH - switch( pNameString[ i ] ) + // WANNE: + for (int i=0;i<80;i++) + { + if ( i<(int)strlen(Item[ubIndex].szItemName)) { - 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; + pNameString[i] = Item[ubIndex].szItemName [i]; - 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; + // 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 - 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; + #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 } - #endif + else + { + pNameString[i] ='\0'; + } + } } - FileClose(hFile); - */ return(TRUE); } diff --git a/Utils/Utilities.cpp b/Utils/Utilities.cpp index 8a722e0c..df0a9a3c 100644 --- a/Utils/Utilities.cpp +++ b/Utils/Utilities.cpp @@ -23,6 +23,80 @@ extern BOOLEAN GetCDromDriveLetter( STR8 pString ); 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 void FilenameForBPP(STR pFilename, STR pDestination) diff --git a/Utils/Utilities.h b/Utils/Utilities.h index 8a46ecca..8146eb79 100644 --- a/Utils/Utilities.h +++ b/Utils/Utilities.h @@ -7,6 +7,9 @@ #define GETPIXELDEPTH( ) ( gbPixelDepth ) +// WANNE: Maximum number of characters in german description (German xml files) +#define MAXLINE 200 + BOOLEAN CreateSGPPaletteFromCOLFile( SGPPaletteEntry *pPalette, SGPFILENAME ColFile ); BOOLEAN DisplayPaletteRep( PaletteRepID aPalRep, UINT8 ubXPos, UINT8 ubYPos, UINT32 uiDestSurface ); @@ -22,6 +25,12 @@ void HandleLimitedNumExecutions( ); BOOLEAN HandleJA2CDCheck( ); 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 template inline Integer idiv(Integer a, Integer b) diff --git a/Utils/XML_Items.cpp b/Utils/XML_Items.cpp index ea453b07..63e32844 100644 --- a/Utils/XML_Items.cpp +++ b/Utils/XML_Items.cpp @@ -42,6 +42,7 @@ #include "Debug Control.h" #include "expat.h" #include "XML.h" + #include "utilities.h" #endif struct @@ -260,11 +261,20 @@ itemEndElementHandle(void *userData, const char *name) pData->curArray[pData->curItem.uiIndex] = pData->curItem; //write the item into the table 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].szLongItemName,pData->curItem.szLongItemName); 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].szBRDesc,pData->curItem.szBRDesc); + #endif } } } @@ -995,6 +1005,7 @@ BOOLEAN ReadInItemStats(STR fileName, BOOLEAN localizedVersion ) UINT32 uiBytesRead; UINT32 uiFSize; CHAR8 * lpcBuffer; + XML_Parser parser = XML_ParserCreate(NULL); itemParseData pData; diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp index 2acf55a7..ed438eba 100644 --- a/Utils/_DutchText.cpp +++ b/Utils/_DutchText.cpp @@ -3461,6 +3461,7 @@ STR16 zOptionsToggleText[] = L"Tracer effect for single shot", L"Rain noises", L"Random I.M.P personality", + L"Auto save", }; //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, 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, game will be saved in tactical after each players turn.", }; diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp index a2c263af..2bc6771c 100644 --- a/Utils/_EnglishText.cpp +++ b/Utils/_EnglishText.cpp @@ -3464,6 +3464,7 @@ STR16 zOptionsToggleText[] = L"Rain noises", L"Allow crows", L"Random I.M.P personality", + L"Auto save", }; //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, the crows are present in game.", L"When ON, I.M.P characters will get random personality and attitude.", + L"When ON, game will be saved after each players turn.", }; diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp index 805ada5b..95aa1dba 100644 --- a/Utils/_FrenchText.cpp +++ b/Utils/_FrenchText.cpp @@ -3450,6 +3450,7 @@ STR16 zOptionsToggleText[] = L"Tracer effect for single shot", L"Rain noises", L"Random I.M.P personality", + L"Auto save", }; //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, 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, game will be saved in tactical after each players turn.", }; diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp index 0621f704..778e8351 100644 --- a/Utils/_GermanText.cpp +++ b/Utils/_GermanText.cpp @@ -3270,6 +3270,7 @@ STR16 zOptionsToggleText[] = L"Regengeräusche", L"Krähen erlauben", L"Zufällige B.S.E Personalität", + L"Automatisch speichern", }; //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, 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, wird nach jeder Runde automatisch gespeichert.", }; STR16 gzGIOScreenText[] = diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp index 9544d763..8fdd6495 100644 --- a/Utils/_ItalianText.cpp +++ b/Utils/_ItalianText.cpp @@ -3443,6 +3443,7 @@ STR16 zOptionsToggleText[] = L"Tracer effect for single shot", L"Rain noises", L"Random I.M.P personality", + L"Auto save", }; //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, 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, game will be saved in tactical after each players turn.", }; diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp index af27e8de..ae83f804 100644 --- a/Utils/_PolishText.cpp +++ b/Utils/_PolishText.cpp @@ -3443,6 +3443,7 @@ STR16 zOptionsToggleText[] = L"Tracer effect for single shot", L"Rain noises", L"Random I.M.P personality", + L"Auto save", }; //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, 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, game will be saved in tactical after each players turn.", }; diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp index a4f991fe..98121867 100644 --- a/Utils/_RussianText.cpp +++ b/Utils/_RussianText.cpp @@ -3454,6 +3454,7 @@ STR16 zOptionsToggleText[] = L"Rain noises", L"Allow crows", L"Random I.M.P personality", + L"Auto save", }; //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, the crows are present in game.", 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.", }; diff --git a/jascreens.cpp b/jascreens.cpp index 9400ac81..e90acbee 100644 --- a/jascreens.cpp +++ b/jascreens.cpp @@ -265,9 +265,11 @@ UINT32 ErrorScreenHandle(void) { InputAtom InputEvent; static BOOLEAN fFirstTime = FALSE; +/* #ifdef JA2BETAVERSION UINT16 str[256]; #endif +*/ // For quick setting of new video stuff / to be changed StartFrameBufferRender( );