diff mm7_2.cpp @ 945:0d96349d8c87

Restoring inlined methods
author Nomad
date Wed, 01 May 2013 14:09:49 +0200
parents 4dd4184d4248
children eb3bb0f2e1b9
line wrap: on
line diff
--- a/mm7_2.cpp	Wed May 01 13:54:46 2013 +0200
+++ b/mm7_2.cpp	Wed May 01 14:09:49 2013 +0200
@@ -290,7 +290,7 @@
   pDialogueWindow->Release();
   pDialogueWindow = GUIWindow::Create(0, 0, 640, 350, WINDOW_MainMenu, 0, 0);
   pBtn_ExitCancel = pDialogueWindow->CreateButton(471u, 445u, 169u, 35u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34],// "Cancel"
-                 (Texture *)(uExitCancelTextureId != -1 ? &pIcons_LOD->pTextures[uExitCancelTextureId] : 0), 0);
+                 pIcons_LOD->GetTexture(uExitCancelTextureId), 0);
   pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0);
   pDialogueWindow->CreateButton(480u, 160u, 140u, 30u, 1, 0, UIMSG_0, 0x53u, 0, "", 0);
   pDialogueWindow->_41D08F(1, 1, 0, 2);
@@ -433,7 +433,7 @@
     pDialogueWindow->pControlsTail = 0;
     pDialogueWindow->uNumControls = 0;
     pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79],
-                   (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0), 0);
+                   pIcons_LOD->GetTexture(uExitCancelTextureId), 0);
     pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x55u, 0, "", 0);
     pDialogueWindow->CreateButton(0x1E0u, 0xBEu, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x56u, 0, "", 0);
     pDialogueWindow->CreateButton(0x1E0u, 0xDCu, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x57u, 0, "", 0);
@@ -578,12 +578,8 @@
       pViewport->uViewportBR_Y - pViewport->uViewportTL_Y + 1,
       pRenderer->uTargetGMask | pRenderer->uTargetBMask);
 
-  auto pTex = (uTextureID_Leather != -1 ? &pIcons_LOD->pTextures[uTextureID_Leather] : nullptr);
-  pRenderer->_4A6A68(
-    8u,
-    352 - v0,
-    pTex,
-    (pTex ? pTex->uTextureHeight : 26) - v0);
+  auto pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
+  pRenderer->_4A6A68(8, 352 - v0, pTex, pTex->uTextureHeight - v0);
 
   pRenderer->DrawTextureIndexed(8u, 347 - v0, pTexture_591428);
   v1 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[575], pFontArrus, &window, 0xDu, 0);