Mercurial > mm7
changeset 1843:2e6d3cd052e0
some char* cast removal + adding const_casts where appropriate
author | Grumpy7 |
---|---|
date | Sun, 13 Oct 2013 07:18:03 +0200 |
parents | 175bf8da83d9 |
children | f3db8e8cbad5 b6252811663d 794f6ac640f4 |
files | Items.cpp NPC.cpp UI/UIGuilds.cpp UI/UIHouses.cpp UI/UIPopup.cpp UI/UIShops.cpp mm7_6.cpp |
diffstat | 7 files changed, 61 insertions(+), 61 deletions(-) [+] |
line wrap: on
line diff
--- a/Items.cpp Sun Oct 13 06:32:06 2013 +0200 +++ b/Items.cpp Sun Oct 13 07:18:03 2013 +0200 @@ -2824,7 +2824,7 @@ default: v30 = pGlobalTXT_LocalizationStrings[127]; //"No Text!" } - pShopOptions[dword_F8B1DC] = (char *)v30; + pShopOptions[dword_F8B1DC] = const_cast<char *>(v30); ++dword_F8B1DC; CreateButtonInColumn(i+1, v29); }
--- a/NPC.cpp Sun Oct 13 06:32:06 2013 +0200 +++ b/NPC.cpp Sun Oct 13 07:18:03 2013 +0200 @@ -1312,7 +1312,7 @@ { case 13: current_npc_text = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession].pJoinText;//(char *)*(&pNPCStats->field_13A64 + 5 * v2->uProfession); - current_npc_text = BuildDialogueString((char *)current_npc_text, uActiveCharacter - 1, 0, 0, 0, 0); + current_npc_text = BuildDialogueString(current_npc_text, uActiveCharacter - 1, 0, 0, 0, 0); NPCHireableDialogPrepare(); dialogue_show_profession_details = false; goto _return; @@ -1511,7 +1511,7 @@ dialogue_show_profession_details = false; uDialogueType = 13; current_npc_text = pNPCStats->pProfessions[pCurrentNPCInfo->uProfession - 1].pJoinText; - current_npc_text = BuildDialogueString((char *)current_npc_text, uActiveCharacter - 1, 0, 0, 0, 0); + current_npc_text = BuildDialogueString(current_npc_text, uActiveCharacter - 1, 0, 0, 0, 0); if ( uActiveCharacter ) pPlayers[uActiveCharacter]->PlaySound(SPEECH_NotEnoughGold, 0); ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2);
--- a/UI/UIGuilds.cpp Sun Oct 13 06:32:06 2013 +0200 +++ b/UI/UIGuilds.cpp Sun Oct 13 07:18:03 2013 +0200 @@ -233,7 +233,7 @@ { v15 = (ItemGen *)(&pParty->pPlayers[1].uExpressionTimeLength + 18 * (v13 + 12 * (int)window_SpeakInHouse->ptr_1C)); v17 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction( (ItemGen *)&pParty->pPlayers[1].uExpressionTimeLength + v13 + 12 * (int)window_SpeakInHouse->ptr_1C, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2); - v18 = BuildDialogueString((char *)pMerchantsBuyPhrases[v17], uActiveCharacter - 1, v15, (char *)window_SpeakInHouse->ptr_1C, 2, 0); + v18 = BuildDialogueString(pMerchantsBuyPhrases[v17], uActiveCharacter - 1, v15, (char *)window_SpeakInHouse->ptr_1C, 2, 0); pTextHeight = pFontArrus->CalcTextHeight(v18, &working_window, 0, 0); working_window.DrawTitleText(pFontArrus, 0, (174 - pTextHeight) / 2 + 138, pColorWhite, v18, 3); return;
--- a/UI/UIHouses.cpp Sun Oct 13 06:32:06 2013 +0200 +++ b/UI/UIHouses.cpp Sun Oct 13 07:18:03 2013 +0200 @@ -1654,10 +1654,10 @@ { pStringSum = 1; pTextHeight = 0; - pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[604];//Охота за вознаграждение + pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[604]);//Охота за вознаграждение if ( pParty->uFine > 0 ) { - pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[603];//Заплатить штраф + pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[603]);//Заплатить штраф pStringSum = 2; } for ( uint i = 0; i < pStringSum; ++i ) @@ -2158,11 +2158,11 @@ if ( HouseUI_CheckIfPlayerCanInteract() ) { pOptionsCount = 2; - pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[620];//Правила - pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[622];//Условия победы + pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[620]);//Правила + pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[622]);//Условия победы if ( pParty->HasItem(651) )//651 - Колода для игры в АркоМэйдж в Items.txt { - pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[621];//Играть + pShopOptions[2] = const_cast<char *>(pGlobalTXT_LocalizationStrings[621]);//Играть pOptionsCount = 3; } for ( i = 0; i < pOptionsCount; ++i ) @@ -2230,8 +2230,8 @@ pShopOptions[0] = pTmpBuf.data(); index = 0; } - pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[68];//"Пожертвовать" - pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[160];//"Обучиться навыкам" + pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[68]);//"Пожертвовать" + pShopOptions[2] = const_cast<char *>(pGlobalTXT_LocalizationStrings[160]);//"Обучиться навыкам" all_text_height = 0; if ( index < pDialogueWindow->pNumPresenceButton ) { @@ -2514,7 +2514,7 @@ { index = 0; pShopOptions[0] = pTmpBuf.data(); - pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[160];// "Learn Skills" + pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[160]);// "Learn Skills" if ( pDialogueWindow->pStartingPosActiveItem < pDialogueWindow->pStartingPosActiveItem + pDialogueWindow->pNumPresenceButton ) { for ( int i = pDialogueWindow->pStartingPosActiveItem;
--- a/UI/UIPopup.cpp Sun Oct 13 06:32:06 2013 +0200 +++ b/UI/UIPopup.cpp Sun Oct 13 07:18:03 2013 +0200 @@ -1289,7 +1289,7 @@ int v5; // esi@62 GUIButton *pButton; // esi@84 const char *pStr; // edi@85 - char *pHint; // edx@113 + const char *pHint; // edx@113 GUIWindow popup_window; // [sp+4h] [bp-74h]@32 struct tagPOINT Point; // [sp+60h] [bp-18h]@6 unsigned int pX; // [sp+70h] [bp-8h]@3 @@ -1555,7 +1555,7 @@ } if ( popup_window.Hint ) { - pHint = (char*)popup_window.Hint; + pHint = popup_window.Hint; popup_window.Hint = 0; popup_window.uFrameWidth = 384; popup_window.uFrameHeight = 256;
--- a/UI/UIShops.cpp Sun Oct 13 06:32:06 2013 +0200 +++ b/UI/UIShops.cpp Sun Oct 13 07:18:03 2013 +0200 @@ -44,10 +44,10 @@ { if ( HouseUI_CheckIfPlayerCanInteract() ) { - pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[134]; - pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[152]; - pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[159]; - pShopOptions[3] = (char *)pGlobalTXT_LocalizationStrings[160]; + pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[134]); + pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[152]); + pShopOptions[2] = const_cast<char *>(pGlobalTXT_LocalizationStrings[159]); + pShopOptions[3] = const_cast<char *>(pGlobalTXT_LocalizationStrings[160]); all_text_height = 0; for ( int i = 0; i < 4; ++i ) all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); @@ -104,7 +104,7 @@ item = &pParty->StandartItemsInShops[(int)window_SpeakInHouse->ptr_1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal() ) { - pText = BuildDialogueString((char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 2)], + pText = BuildDialogueString(pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 2)], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); } @@ -155,7 +155,7 @@ item = &pParty->SpecialItemsInShops[(int)window_SpeakInHouse->ptr_1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal() ) { - pText = BuildDialogueString((char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 2)], + pText = BuildDialogueString(pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 2)], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); } @@ -188,7 +188,7 @@ return; item = &pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1]; phrases_id = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 3); - pText = BuildDialogueString((char *)pMerchantsSellPhrases[phrases_id], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 3, 0); + pText = BuildDialogueString(pMerchantsSellPhrases[phrases_id], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 3, 0); dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); break; } @@ -210,7 +210,7 @@ if (!item->IsIdentified()) { phrases_id = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_WeaponShop, (int)window_SpeakInHouse->ptr_1C, 4); - pText = BuildDialogueString((char *)pMerchantsIdentifyPhrases[phrases_id], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); + pText = BuildDialogueString(pMerchantsIdentifyPhrases[phrases_id], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); } else @@ -237,7 +237,7 @@ return; item = &pPlayers[uActiveCharacter]->pInventoryItemList[pItemID - 1]; phrases_id = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 5); - pText = BuildDialogueString((char *)pMerchantsRepairPhrases[phrases_id], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); + pText = BuildDialogueString(pMerchantsRepairPhrases[phrases_id], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); return; } @@ -247,9 +247,9 @@ { draw_leather(); CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); - pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[200];//sell - pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[113];//identify - pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[179];//repair + pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[200]);//sell + pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[113]);//identify + pShopOptions[2] = const_cast<char *>(pGlobalTXT_LocalizationStrings[179]);//repair all_text_height = 0; for ( int i = 0; i < 3; ++i ) all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); @@ -369,10 +369,10 @@ { if ( !HouseUI_CheckIfPlayerCanInteract() ) return; - pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" - pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[152]; //"Buy Special" - pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[159]; //"Display Inventory" - pShopOptions[3] = (char *)pGlobalTXT_LocalizationStrings[160]; + pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[134]); //"Buy Standard" + pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[152]); //"Buy Special" + pShopOptions[2] = const_cast<char *>(pGlobalTXT_LocalizationStrings[159]); //"Display Inventory" + pShopOptions[3] = const_cast<char *>(pGlobalTXT_LocalizationStrings[160]); all_text_height = 0; for( int i = 0; i < 4; ++i ) all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); @@ -439,7 +439,7 @@ selected_item = &pParty->StandartItemsInShops[window_SpeakInHouse->par1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal()) { - pText = BuildDialogueString((char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 2)], + pText = BuildDialogueString(pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 2)], uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); } @@ -502,7 +502,7 @@ selected_item = &pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][(pRenderer->pActiveZBuffer[mouse.x + pSRZBufferLineOffsets[mouse.y]] & 0xFFFF) - 1]; if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal() ) { - pText = BuildDialogueString((char *)pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 2)], + pText = BuildDialogueString(pMerchantsBuyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 2)], uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); } @@ -522,9 +522,9 @@ { draw_leather(); CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); - pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[200]; //"Sell" - pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[113]; //"Identify" - pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[179]; //"Repair" + pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[200]); //"Sell" + pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[113]); //"Identify" + pShopOptions[2] = const_cast<char *>(pGlobalTXT_LocalizationStrings[179]); //"Repair" all_text_height = 0; for ( int i = 0; i < 3; ++i ) all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); @@ -563,7 +563,7 @@ if ( !pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v153) ) return; selected_item = &pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v153) - 1]; - pText = BuildDialogueString((char *)pMerchantsSellPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 3)], + pText = BuildDialogueString(pMerchantsSellPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, window_SpeakInHouse->par1C, 3)], uActiveCharacter - 1, selected_item, (char *) window_SpeakInHouse->par1C, 3, 0); dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); return; @@ -586,7 +586,7 @@ if (selected_item->IsIdentified()) pText = BuildDialogueString("%24", uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); else - pText = BuildDialogueString((char *)pMerchantsIdentifyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, + pText = BuildDialogueString(pMerchantsIdentifyPhrases[pPlayers[uActiveCharacter]->SelectPhrasesTransaction(selected_item, BuildingType_ArmorShop, (int)window_SpeakInHouse->ptr_1C, 4)], uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); return; @@ -612,7 +612,7 @@ selected_item = &pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v153) - 1]; phrases_id = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v153) - 1], BuildingType_ArmorShop, window_SpeakInHouse->par1C, 5); - pText = BuildDialogueString((char *)pMerchantsRepairPhrases[phrases_id], uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); + pText = BuildDialogueString(pMerchantsRepairPhrases[phrases_id], uActiveCharacter - 1, selected_item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); return; } @@ -715,10 +715,10 @@ { if ( HouseUI_CheckIfPlayerCanInteract() ) { - pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[134]; - pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[152]; - pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[159]; - pShopOptions[3] = (char *)pGlobalTXT_LocalizationStrings[160]; + pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[134]); + pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[152]); + pShopOptions[2] = const_cast<char *>(pGlobalTXT_LocalizationStrings[159]); + pShopOptions[3] = const_cast<char *>(pGlobalTXT_LocalizationStrings[160]); all_text_height = 0; for ( int i = 0; i < 4; ++i ) all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); @@ -817,7 +817,7 @@ if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal() ) { v71 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 2); - pText = BuildDialogueString((char *)pMerchantsBuyPhrases[v71], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); + pText = BuildDialogueString(pMerchantsBuyPhrases[v71], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); } else pText = BuildDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); @@ -905,7 +905,7 @@ if ( !GetAsyncKeyState(17) || !pPlayers[uActiveCharacter]->CanSteal() ) { v71 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 2); - pText = BuildDialogueString((char *)pMerchantsBuyPhrases[v71], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); + pText = BuildDialogueString(pMerchantsBuyPhrases[v71], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); } else pText = BuildDialogueString(pGlobalTXT_LocalizationStrings[181], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); @@ -931,7 +931,7 @@ return; v71 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&index) - 1], BuildingType_AlchemistShop, (int)window_SpeakInHouse->ptr_1C, 3); - pText = BuildDialogueString((char *)pMerchantsSellPhrases[v71], uActiveCharacter - 1, &pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&index) - 1], + pText = BuildDialogueString(pMerchantsSellPhrases[v71], uActiveCharacter - 1, &pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&index) - 1], (char *)window_SpeakInHouse->ptr_1C, 3, 0); dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(pText, &dialog_window, 0, 0)) / 2 + 138, TargetColor(0xFFu, 0xFFu, 0xFFu), pText, 3); return; @@ -966,8 +966,8 @@ { draw_leather(); CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); - pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[200]; - pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[113]; + pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[200]); + pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[113]); all_text_height = 0; for ( int i = 0; i < 2; ++i ) all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); @@ -1090,10 +1090,10 @@ { if ( !HouseUI_CheckIfPlayerCanInteract() ) return; - pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[134]; //"Buy Standard" - pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[152]; //"Buy Special" - pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[159]; //"Display Inventory" - pShopOptions[3] = (char *)pGlobalTXT_LocalizationStrings[160]; + pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[134]); //"Buy Standard" + pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[152]); //"Buy Special" + pShopOptions[2] = const_cast<char *>(pGlobalTXT_LocalizationStrings[159]); //"Display Inventory" + pShopOptions[3] = const_cast<char *>(pGlobalTXT_LocalizationStrings[160]); all_text_height = 0; for ( int i = 0; i < 4; ++i ) all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); @@ -1194,7 +1194,7 @@ else { v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2); - v30 = BuildDialogueString((char *)pMerchantsBuyPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); + v30 = BuildDialogueString(pMerchantsBuyPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); } dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138, TargetColor(255, 255, 255), v30, 3); return; @@ -1282,7 +1282,7 @@ else { v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 2); - v30 = BuildDialogueString((char *)pMerchantsBuyPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); + v30 = BuildDialogueString(pMerchantsBuyPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 2, 0); } dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138, TargetColor(255, 255, 255), v30, 3); return; @@ -1295,9 +1295,9 @@ { draw_leather(); CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true); - pShopOptions[0] = (char *)pGlobalTXT_LocalizationStrings[200];// "Sell" - pShopOptions[1] = (char *)pGlobalTXT_LocalizationStrings[113];// "Identify" - pShopOptions[2] = (char *)pGlobalTXT_LocalizationStrings[179];// "Repair" + pShopOptions[0] = const_cast<char *>(pGlobalTXT_LocalizationStrings[200]);// "Sell" + pShopOptions[1] = const_cast<char *>(pGlobalTXT_LocalizationStrings[113]);// "Identify" + pShopOptions[2] = const_cast<char *>(pGlobalTXT_LocalizationStrings[179]);// "Repair" all_text_height = 0; for ( uint i = 0; i < 3; ++i ) all_text_height += pFontArrus->CalcTextHeight(pShopOptions[i], &dialog_window, 0, 0); @@ -1336,7 +1336,7 @@ return; item = &pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117) - 1]; v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 3); - v30 = BuildDialogueString((char *)pMerchantsSellPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 3, 0); + v30 = BuildDialogueString(pMerchantsSellPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 3, 0); dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138, TargetColor(255, 255, 255), v30, 3); return; } @@ -1362,7 +1362,7 @@ return; } v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(item, BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 4); - v30 = BuildDialogueString((char *)pMerchantsIdentifyPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); + v30 = BuildDialogueString(pMerchantsIdentifyPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 4, 0); dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138, TargetColor(255, 255, 255), v30, 3); return; } @@ -1388,7 +1388,7 @@ item = &pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117) - 1]; v75 = pPlayers[uActiveCharacter]->SelectPhrasesTransaction(&pPlayers[uActiveCharacter]->pInventoryItemList[pPlayers[uActiveCharacter]->GetItemIDAtInventoryIndex((int *)&v117) - 1], BuildingType_MagicShop, (int)window_SpeakInHouse->ptr_1C, 5); - v30 = BuildDialogueString((char *)pMerchantsRepairPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); + v30 = BuildDialogueString(pMerchantsRepairPhrases[v75], uActiveCharacter - 1, item, (char *)window_SpeakInHouse->ptr_1C, 5, 0); dialog_window.DrawTitleText(pFontArrus, 0, (174 - pFontArrus->CalcTextHeight(v30, &dialog_window, 0, 0)) / 2 + 138, TargetColor(255, 255, 255), v30, 3); return; }
--- a/mm7_6.cpp Sun Oct 13 06:32:06 2013 +0200 +++ b/mm7_6.cpp Sun Oct 13 07:18:03 2013 +0200 @@ -101,9 +101,9 @@ Dst.uItemID = pActor->uCarriedItemID; v9 = pItemsTable->pItems[Dst.uItemID].pUnidentifiedName; if ( v14 ) - sprintfex(pTmpBuf2.data(), (char*)pGlobalTXT_LocalizationStrings[490], v14, v9); + sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[490], v14, v9); else - sprintfex(pTmpBuf2.data(), (char*)pGlobalTXT_LocalizationStrings[471], v9); + sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], v9); ShowStatusBarString(pTmpBuf2.data(), 2u); v4 = Dst.uItemID; v5 = Dst.uItemID;