diff GUI/GUIWindow.cpp @ 2574:dd36326a9994

More texture refactoring GetLeather -> DrawTextureCustomHeight
author a.parshin
date Mon, 07 Mar 2016 03:48:40 +0200
parents 0c67be4ec900
children a76d408c5132
line wrap: on
line diff
--- a/GUI/GUIWindow.cpp	Sat Mar 05 16:25:53 2016 +0200
+++ b/GUI/GUIWindow.cpp	Mon Mar 07 03:48:40 2016 +0200
@@ -76,17 +76,32 @@
 
 Image *ui_exit_cancel_button_background = nullptr;
 Image *game_ui_right_panel_frame = nullptr;
-unsigned int uExitCancelTextureId;
+Image *dialogue_ui_x_ok_u = nullptr;
+Image *dialogue_ui_x_x_u = nullptr;
+
+Image *ui_buttdesc2 = nullptr;
+Image *ui_buttyes2 = nullptr;
+
+Image *ui_btn_npc_right = nullptr;
+Image *ui_btn_npc_left = nullptr;
+
+Image *ui_ar_dn_dn = nullptr;
+Image *ui_ar_dn_up = nullptr;
+Image *ui_ar_up_dn = nullptr;
+Image *ui_ar_up_up = nullptr;
 
 
 
+Image *ui_leather_mm6 = nullptr;
+Image *ui_leather_mm7 = nullptr;
+
 
 GUIWindow_Inventory_CastSpell::GUIWindow_Inventory_CastSpell(unsigned int x, unsigned int y, unsigned int width, unsigned int height, int button, const char *hint) :
     GUIWindow(x, y, width, height, button, hint)
 {
     pMouse->SetCursorBitmap("MICON2");
     pBtn_ExitCancel = CreateButton(392, 318, 75, 33, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34],//Отмена
-        pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);
+        ui_buttdesc2, nullptr);
     ShowStatusBarString(pGlobalTXT_LocalizationStrings[39], 2); // Choose target / Выбрать цель
     ++pIcons_LOD->uTexturePacksCount;
     current_character_screen_window = WINDOW_CharacterWindow_Inventory;
@@ -100,7 +115,7 @@
 {
     current_screen_type = SCREEN_HOUSE;
     pBtn_ExitCancel = CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[80], // Quit building / Выйти из здания
-        pIcons_LOD->GetTexture(uExitCancelTextureId), 0);
+        ui_exit_cancel_button_background, 0);
     for (int v26 = 0; v26 < uNumDialogueNPCPortraits; ++v26)
     {
         char *v29, *v30;
@@ -135,7 +150,7 @@
     prev_screen_type = current_screen_type;
     current_screen_type = SCREEN_NPC_DIALOGUE;
     pBtn_ExitCancel = CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], //"Exit"
-        pIcons_LOD->GetTexture(uExitCancelTextureId), 0);
+        ui_exit_cancel_button_background, 0);
     if (par1C != 1)
     {
         int num_menu_buttons = 0;
@@ -406,9 +421,13 @@
     if (!dword_591084)
         pDialogueNPCPortraits[0]->Release();
     uNumDialogueNPCPortraits = 0;
-    pTexture_Dialogue_Background->Release();
 
-    pIcons_LOD->SyncLoadedFilesCount();
+    if (game_ui_dialogue_background)
+    {
+        game_ui_dialogue_background->Release();
+        game_ui_dialogue_background = nullptr;
+    }
+
     current_screen_type = prev_screen_type;
 
     GUIWindow::Release();
@@ -432,10 +451,13 @@
     for (int i = 0; i < uNumDialogueNPCPortraits; ++i)
         pDialogueNPCPortraits[i]->Release();
     uNumDialogueNPCPortraits = 0;
-    pTexture_Dialogue_Background->Release();
 
-    pIcons_LOD->SyncLoadedFilesCount();
-    pIcons_LOD->RemoveTexturesPackFromTextureList();
+    if (game_ui_dialogue_background)
+    {
+        game_ui_dialogue_background->Release();
+        game_ui_dialogue_background = nullptr;
+    }
+
     dword_5C35D4 = 0;
     if (bFlipOnExit)
     {
@@ -572,49 +594,7 @@
     current_window.DrawTitleText(pFontLucida, 0, (signed int)(v16 - pFontLucida->CalcTextHeight(this->Hint, &current_window, 0, 0)) / 2 - 14, 0, this->Hint, 3);
 }
 
-//----- (00411B59) --------------------------------------------------------
-void LoadThumbnailLloydTexture(unsigned int uSlot, unsigned int uPlayer)
-{
-  //unsigned int v2; // esi@1
-  //unsigned int v3; // edi@1
-  FILE *v4; // ebx@1
-  FILE *v5; // eax@2
-  //char pContainerName[64]; // [sp+Ch] [bp-44h]@1
-  //unsigned int v7; // [sp+4Ch] [bp-4h]@1
 
-  if (pSavegameThumbnails[uSlot])
-  {
-      pSavegameThumbnails[uSlot]->Release();
-      pSavegameThumbnails[uSlot] = nullptr;
-  }
-
-
-  wchar_t filename[1024];
-  swprintf(filename, L"data\\lloyd%d%d.pcx", uPlayer, uSlot + 1);
-  pSavegameThumbnails[uSlot] = assets->GetImage_PCXFromFile(filename);
-
-  if (!pSavegameThumbnails[uSlot])
-  {
-      swprintf(filename, L"lloyd%d%d.pcx", uPlayer, uSlot + 1);
-      pSavegameThumbnails[uSlot] = assets->GetImage_PCXFromNewLOD(filename);
-  }
-  /*sprintf(pContainerName, "data\\lloyd%d%d.pcx", uPlayer, uSlot + 1);
-  v4 = fopen(pContainerName, "rb");
-  if ( v4 )
-  {
-    pSavegameThumbnails[uSlot].LoadFromFILE(v4, 0, 1);
-    fclose(v4);
-  }
-  else
-  {
-    sprintf(pContainerName, "lloyd%d%d.pcx", uPlayer, uSlot + 1);
-    v5 = pNew_LOD->FindContainer(pContainerName, 1);
-    if ( v5 )
-      pSavegameThumbnails[uSlot].LoadFromFILE(v5, 0, 0);
-    else
-      *((int *)&pSavegameThumbnails.data()->pPixels + 10 * uSlot) = 0;
-  }*/
-}
 
 
 //----- (004B3157) --------------------------------------------------------
@@ -642,8 +622,8 @@
   pWindow.uFrameZ -= 18;
   pWhiteColor = Color16(0xFFu, 0xFFu, 0xFFu);
   pColor2 = Color16(0x15u, 0x99u, 0xE9u);
-  pRenderer->DrawTextureTransparentColorKey(0x1DDu, 0, pTexture_Dialogue_Background);
-  pRenderer->DrawTextureAlphaNew(468, 0, game_ui_right_panel_frame);
+  pRenderer->DrawTextureNew(477/640.0f, 0, game_ui_dialogue_background);
+  pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_right_panel_frame);
   if ( pDialogueNPCCount != uNumDialogueNPCPortraits || !uHouse_ExitPic )
   {
     pDialogWindow.uFrameWidth = 130;
@@ -668,8 +648,8 @@
       JailDialog();
       if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic )
       {
-        pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
-        pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
+        pRenderer->DrawTextureAlphaNew(556/640.0f, 451/480.0f, dialogue_ui_x_x_u);
+        pRenderer->DrawTextureAlphaNew(476/640.0f, 451/480.0f, dialogue_ui_x_ok_u);
       }
       else
         pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background);
@@ -681,8 +661,11 @@
       pDialogWindow.uFrameZ = 457;
       pTextHeight = pFontArrus->CalcTextHeight(current_npc_text, &pDialogWindow, 13, 0);
       v6 = pTextHeight + 7;
-      pRenderer->GetLeather(8, 352 - (pTextHeight + 7), &pIcons_LOD->pTextures[uTextureID_Leather], 
-          pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - (pTextHeight + 7));
+      pRenderer->DrawTextureCustomHeight(
+          8/640.0f,
+          (352 - (pTextHeight + 7))/480.0f,
+          ui_leather_mm7,
+          pTextHeight + 7);
       pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - v6)/480.0f, _591428_endcap);
       v7 = FitTextInAWindow(current_npc_text, pFontArrus, &pDialogWindow, 0xDu, 0);
       window_SpeakInHouse->DrawText(pFontArrus, 13, 354 - v6, 0, v7, 0, 0, 0);
@@ -691,8 +674,8 @@
     {
       if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic )
       {
-        pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
-        pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
+        pRenderer->DrawTextureAlphaNew(556/640.0f, 451/480.0f, dialogue_ui_x_x_u);
+        pRenderer->DrawTextureAlphaNew(476/640.0f, 451/480.0f, dialogue_ui_x_ok_u);
       }
       else
           pRenderer->DrawTextureAlphaNew(471 / 640.0f, 445 / 480.0f, ui_exit_cancel_button_background);
@@ -700,8 +683,8 @@
     }
     for ( v8 = 0; v8 < uNumDialogueNPCPortraits; ++v8 )
     {
-      pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8] - 4,
-                                    pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]);
+      pRenderer->DrawTextureAlphaNew((pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8] - 4)/640.0f,
+                                    (pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] - 4)/480.0f, game_ui_evtnpc);
       pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8],
                                     pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8], pDialogueNPCPortraits[v8]);
       if ( uNumDialogueNPCPortraits < 4 )
@@ -728,26 +711,26 @@
     }
       if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic )
       {
-        pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
-        pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
+        pRenderer->DrawTextureAlphaNew(556/640.0f, 451/480.0f, dialogue_ui_x_x_u);
+        pRenderer->DrawTextureAlphaNew(476/640.0f, 451/480.0f, dialogue_ui_x_ok_u);
       }
       else
           pRenderer->DrawTextureAlphaNew(471 / 640.0f, 445 / 480.0f, ui_exit_cancel_button_background);
       return;
   }
   v4 = (char *)pDialogueNPCCount - 1;
-  pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]);
+  pRenderer->DrawTextureAlphaNew((pNPCPortraits_x[0][0] - 4)/640.0f, (pNPCPortraits_y[0][0] - 4)/480.0f, game_ui_evtnpc);
   pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[(signed int)v4]);
   if ( current_screen_type == SCREEN_E )
   {
     CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
     if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic )
     {
-      pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
-      pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
+      pRenderer->DrawTextureAlphaNew(556/640.0f, 451/480.0f, dialogue_ui_x_x_u);
+      pRenderer->DrawTextureAlphaNew(476/640.0f, 451/480.0f, dialogue_ui_x_ok_u);
     }
     else
-        pRenderer->DrawTextureAlphaNew(471 / 640.0f, 445 / 480.0f, ui_exit_cancel_button_background);
+        pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background);
     return;
   }
   if ( v4 || !dword_591080 )//на изумрудном острове заходит на корабле пока не выполнены квесты
@@ -816,11 +799,11 @@
   }
   if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic )
   {
-    pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
-    pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
+    pRenderer->DrawTextureAlphaNew(556/640.0f, 451/480.0f, dialogue_ui_x_x_u);
+    pRenderer->DrawTextureAlphaNew(476/640.0f, 451/480.0f, dialogue_ui_x_ok_u);
   }
   else
-      pRenderer->DrawTextureAlphaNew(471 / 640.0f, 445 / 480.0f, ui_exit_cancel_button_background);
+      pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background);
 }
 
 //----- (004B1854) --------------------------------------------------------
@@ -1163,7 +1146,7 @@
 
 //----- (0041D12F) --------------------------------------------------------
 GUIButton *GUIWindow::CreateButton(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, 
-	int a6, int a7, UIMessageType msg, unsigned int msg_param, unsigned __int8 uHotkey, const char *pName, Texture *pTextures, ...)
+	int a6, int a7, UIMessageType msg, unsigned int msg_param, unsigned __int8 uHotkey, const char *pName, Image *pTextures, ...)
 {
   GUIButton *pButton; // esi@1
 //  unsigned int v13; // eax@1
@@ -1171,13 +1154,17 @@
 //  unsigned int v15; // eax@4
   unsigned int TextureNum=0; // ebx@4
 //  unsigned int v17; // eax@4
-//  Texture *v18; // eax@4
-//  Texture **v19; // ecx@5
-//  Texture **v20; // edx@5
+//  Texture_MM7 *v18; // eax@4
+//  Texture_MM7 **v19; // ecx@5
+//  Texture_MM7 **v20; // edx@5
 //  GUIButton *v21; // eax@7
   va_list texturs_ptr;
 
   pButton = (GUIButton *)malloc(0xBC);
+
+  for (unsigned int i = 0; i < 5; ++i)
+      pButton->pTextures[i] = nullptr;
+
   pButton->pParent = this;
   pButton->uWidth = uWidth;
   pButton->uHeight = uHeight;
@@ -1197,13 +1184,20 @@
   pButton->uHotkey = uHotkey;
   //strlen(pName);
   strcpy(pButton->pButtonName, pName);
+
+
+
   va_start(texturs_ptr, pName);
-  while  (NULL!=(pTextures=va_arg(texturs_ptr, Texture *)))
+  do
   {
-	pButton->pTextures[TextureNum]=pTextures;
-	++TextureNum;	
-  }
+      pTextures = va_arg(texturs_ptr, Image *);
+      pButton->pTextures[TextureNum] = pTextures;
+      ++TextureNum;
+  } while (pTextures);
   va_end(texturs_ptr);
+
+
+
   pButton->uNumTextures = TextureNum;
   if ( this->pControlsTail )
     this->pControlsTail->pNext = pButton;
@@ -1306,7 +1300,7 @@
   ContractSelectText(pEventCode);
   pDialogueWindow->Release();
   pDialogueWindow = new GUIWindow(0, 0, window->GetWidth(), 350, pEventCode, 0);
-  pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape,                    0, 0, pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uExitCancelTextureId), 0); // Cancel
+  pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape,                    0, 0, pGlobalTXT_LocalizationStrings[34], ui_exit_cancel_button_background, 0); // Cancel
                     pDialogueWindow->CreateButton(  0,   0,   0,  0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0);
                     pDialogueWindow->CreateButton(480, 160, 140, 30, 1, 0, UIMSG_ClickNPCTopic,             82, 0, pGlobalTXT_LocalizationStrings[122], 0);
   pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2);
@@ -1328,7 +1322,7 @@
 // -----------------------------------
 // 004156F0 GUI_UpdateWindows --- part
     auto pButton = (GUIButton *)ptr_1C;
-    pRenderer->DrawTextureTransparentColorKey(uFrameY, uFrameX, pButton->pTextures[0]);
+    pRenderer->DrawTextureAlphaNew(uFrameY/640.0f, uFrameX/480.0f, pButton->pTextures[0]);
     viewparams->bRedrawGameUI = true;
 }
 
@@ -1400,7 +1394,7 @@
     draw_leather();
     CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
     CharacterUI_DrawPaperdoll(pPlayers[uActiveCharacter]);
-    pRenderer->DrawTextureIndexedAlpha(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uTextureID_x_x_u));
+    pRenderer->DrawTextureAlphaNew(pBtn_ExitCancel->uX/640.0f, pBtn_ExitCancel->uY/480.0f, dialogue_ui_x_x_u);
 }
 
 void OnButtonClick::Update()
@@ -1410,7 +1404,7 @@
     if (Hint != (char *)1)
         pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
     GUIButton *pButton = (GUIButton *)ptr_1C;
-    pRenderer->DrawTextureIndexedAlpha(uFrameX, uFrameY, pButton->pTextures[0]);
+    pRenderer->DrawTextureAlphaNew(uFrameX/640.0f, uFrameY/480.0f, pButton->pTextures[0]);
     viewparams->bRedrawGameUI = true;
     if (Hint && Hint != (char *)1)
         pButton->DrawLabel(Hint, pFontCreate, 0, 0);
@@ -1428,7 +1422,7 @@
     {
         if (pButton->uY >= 0 && pButton->uY <= window->GetHeight())
         {
-            pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pButton->pTextures[0]);
+            pRenderer->DrawTextureAlphaNew(uFrameX/640.0f, uFrameY/480.0f, pButton->pTextures[0]);
             viewparams->bRedrawGameUI = true;
             if (Hint && Hint != (char *)1)
                 pButton->DrawLabel(Hint, pFontCreate, 0, 0);
@@ -1449,7 +1443,7 @@
     if (Hint != (char *)1)
         pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
     auto pButton = (GUIButton *)ptr_1C;
-    pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pButton->pTextures[1]);
+    pRenderer->DrawTextureAlphaNew(uFrameX/640.0f, uFrameY/480.0f, pButton->pTextures[1]);
     viewparams->bRedrawGameUI = 1;
     if (Hint && Hint != (char *)1)
         pButton->DrawLabel(Hint, pFontCreate, 0, 0);
@@ -1463,7 +1457,7 @@
     if (Hint != (char *)1)
         pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
     auto pButton = (GUIButton *)ptr_1C;
-    pRenderer->DrawTextureIndexedAlpha(uFrameX, uFrameY, pButton->pTextures[1]);
+    pRenderer->DrawTextureAlphaNew(uFrameX/640.0f, uFrameY/480.0f, pButton->pTextures[1]);
     viewparams->bRedrawGameUI = true;
 
     Release();
@@ -1476,7 +1470,7 @@
     if (Hint != (char *)1)
         pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
     auto pButton = (GUIButton *)ptr_1C;
-    pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pButton->pTextures[0]);
+    pRenderer->DrawTextureAlphaNew(uFrameX/640.0f, uFrameY/480.0f, pButton->pTextures[0]);
     viewparams->bRedrawGameUI = true;
     if (Hint && Hint != (char *)1)
         pButton->DrawLabel(Hint, pFontCreate, 0, 0);
@@ -1495,7 +1489,7 @@
     if (Hint != (char *)1)
         pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
     auto pGUIButton = (GUIButton *)ptr_1C;
-    pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pGUIButton->pTextures[0]);
+    pRenderer->DrawTextureAlphaNew(uFrameX/640.0f, uFrameY/480.0f, pGUIButton->pTextures[0]);
     viewparams->bRedrawGameUI = true;
     if (Hint && Hint != (char *)1)
         pGUIButton->DrawLabel(Hint, pFontCreate, 0, 0);
@@ -1511,7 +1505,7 @@
     if (Hint != (char *)1)
         pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
     auto pButton = (GUIButton *)ptr_1C;
-    pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pButton->pTextures[1]);
+    pRenderer->DrawTextureAlphaNew(uFrameX/640.0f, uFrameY/480.0f, pButton->pTextures[1]);
     viewparams->bRedrawGameUI = true;
     if (Hint && Hint != (char *)1)
         pButton->DrawLabel(Hint, pFontCreate, 0, 0);
@@ -1527,7 +1521,7 @@
     if (Hint != (char *)1)
         pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
     auto pButton = (GUIButton *)ptr_1C;
-    pRenderer->DrawTextureIndexedAlpha(uFrameX, uFrameY, pButton->pTextures[0]);
+    pRenderer->DrawTextureAlphaNew(uFrameX/640.0f, uFrameY/480.0f, pButton->pTextures[0]);
     viewparams->bRedrawGameUI = true;
     if (Hint && Hint != (char *)1)
         pButton->DrawLabel(Hint, pFontCreate, 0, 0);
@@ -1554,8 +1548,8 @@
   GUIButton *pGUIButton; // ebp@146
   //unsigned int pX; // [sp-1Ch] [bp-124h]@17
   //unsigned int pY; // [sp-18h] [bp-120h]@17
-  //Texture *pTexture; // [sp-14h] [bp-11Ch]@17
-  //Texture *pTexture2; // [sp-14h] [bp-11Ch]@86
+  //Texture_MM7 *pTexture; // [sp-14h] [bp-11Ch]@17
+  //Texture_MM7 *pTexture2; // [sp-14h] [bp-11Ch]@86
   int i; // [sp+0h] [bp-108h]@3
 //  ItemGen pItemGen; // [sp+4h] [bp-104h]@98
   GUIButton GUIButton2; // [sp+28h] [bp-E0h]@133
@@ -1732,21 +1726,23 @@
         game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-c.pcx");
 
         game_ui_right_panel_frame = assets->GetImage_16BitAlpha(L"ib-mb-C");
-      minimap_loop = assets->GetTexture("ib-autmask-c");
-      _5079B4_compass = assets->GetTexture("IB-COMP-C");
-      _5079D0_init_g = assets->GetTexture("IB-InitG-c");
-      _5079C8_init_y = assets->GetTexture("IB-InitY-c");
-      _5079CC_init_r = assets->GetTexture("IB-InitR-c");
+
+        game_ui_minimap_frame = assets->GetImage_16BitAlpha(L"ib-autmask-c");
+        game_ui_minimap_compass = assets->GetImage_16BitColorKey(L"IB-COMP-C", 0x7FF);
+
+        game_ui_player_alert_green = assets->GetImage_16BitAlpha(L"IB-InitG-c");
+        game_ui_player_alert_yellow = assets->GetImage_16BitAlpha(L"IB-InitY-c");
+        game_ui_player_alert_red = assets->GetImage_16BitAlpha(L"IB-InitR-c");
 
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-C", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-C", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-C", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-C", 2);
+        ui_btn_npc_left = assets->GetImage_16BitAlpha(L"IB-NPCLD-C");
+        ui_btn_npc_right = assets->GetImage_16BitAlpha(L"IB-NPCRD-C");
+        game_ui_btn_zoomin = assets->GetImage_16BitAlpha("ib-autout-C");
+        game_ui_btn_zoomout = assets->GetImage_16BitAlpha("ib-autin-C");
       pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-C", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-c", 2);
+      game_ui_btn_cast = assets->GetImage_16BitAlpha("ib-m1d-c");
+      game_ui_btn_rest = assets->GetImage_16BitAlpha("ib-m2d-c");
+      game_ui_btn_quickref = assets->GetImage_16BitAlpha("ib-m3d-c");
+      game_ui_btn_settings = assets->GetImage_16BitAlpha("ib-m4d-c");
 
       pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-c", 2);
       pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-c", 2);
@@ -1759,8 +1755,8 @@
       pIconsFrameTable->InitializeAnimation(pUIAnum_Torchlight->uIconID);
 
       ui_exit_cancel_button_background = assets->GetImage_16BitColorKey(L"ib-bcu-c", 0x7FF);
-      uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-c", 2);
+
+      game_ui_evtnpc = assets->GetImage_16BitColorKey(L"evtnpc-c", 0x7FF);
       ui_character_inventory_background = assets->GetImage_16BitColorKey(L"fr_inven-c", 0x7FF);
       messagebox_corner_y = assets->GetImage_16BitAlpha(L"cornr_ll-c");
       messagebox_corner_w = assets->GetImage_16BitAlpha(L"cornr_lr-c");
@@ -1781,28 +1777,28 @@
         game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-c.pcx");
 
         game_ui_right_panel_frame = assets->GetImage_16BitAlpha(L"ib-mb-C");
-      minimap_loop = assets->GetTexture("ib-autmask-c");
-      _5079B4_compass = assets->GetTexture("IB-COMP-C");
-      _5079D0_init_g = assets->GetTexture("IB-InitG-c");
-      _5079C8_init_y = assets->GetTexture("IB-InitY-c");
-      _5079CC_init_r = assets->GetTexture("IB-InitR-c");
+        game_ui_minimap_frame = assets->GetImage_16BitAlpha(L"ib-autmask-c");
+      game_ui_minimap_compass = assets->GetImage_16BitColorKey(L"IB-COMP-C", 0x7FF);
+      game_ui_player_alert_green = assets->GetImage_16BitAlpha(L"IB-InitG-c");
+      game_ui_player_alert_yellow = assets->GetImage_16BitAlpha(L"IB-InitY-c");
+      game_ui_player_alert_red = assets->GetImage_16BitAlpha(L"IB-InitR-c");
 
-      uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-C", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-C", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-C", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-C", TEXTURE_16BIT_PALETTE);
+      ui_btn_npc_left = assets->GetImage_16BitAlpha(L"IB-NPCLD-C");
+      ui_btn_npc_right = assets->GetImage_16BitAlpha(L"IB-NPCRD-C");
+      game_ui_btn_zoomin = assets->GetImage_16BitAlpha(L"ib-autout-C");
+      game_ui_btn_zoomout = assets->GetImage_16BitAlpha(L"ib-autin-C");
       uTextureID_GameUI_CharSelectionFrame = pIcons_LOD->LoadTexture("IB-selec-C", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-c", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-c", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-c", TEXTURE_16BIT_PALETTE);
+      game_ui_btn_cast = assets->GetImage_16BitAlpha(L"ib-m1d-c");
+      game_ui_btn_rest = assets->GetImage_16BitAlpha("ib-m2d-c");
+      game_ui_btn_quickref = assets->GetImage_16BitAlpha("ib-m3d-c");
+      game_ui_btn_settings = assets->GetImage_16BitAlpha("ib-m4d-c");
       ui_exit_cancel_button_background = assets->GetImage_16BitColorKey(L"ib-bcu-c", 0x7FF);
-      uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE);
+
       uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE);
       uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE);
       uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE);
       uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE);
-      uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc-c", TEXTURE_16BIT_PALETTE);
+      game_ui_evtnpc = assets->GetImage_16BitColorKey(L"evtnpc-c", 0x7FF);
       ui_character_inventory_background = assets->GetImage_16BitColorKey(L"fr_inven", 0x7FF);
       pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC");
       pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
@@ -1823,21 +1819,21 @@
       game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-a.pcx");
 
       game_ui_right_panel_frame = assets->GetImage_16BitAlpha(L"ib-mb-a");
-      minimap_loop = assets->GetTexture("ib-autmask-a");
-      _5079B4_compass = assets->GetTexture("IB-COMP-a");
-      _5079D0_init_g = assets->GetTexture("IB-InitG-a");
-      _5079C8_init_y = assets->GetTexture("IB-InitY-a");
-      _5079CC_init_r = assets->GetTexture("IB-InitR-a");
+      game_ui_minimap_frame = assets->GetImage_16BitAlpha(L"ib-autmask-a");
+      game_ui_minimap_compass = assets->GetImage_16BitColorKey(L"IB-COMP-a", 0x7FF);
+      game_ui_player_alert_green = assets->GetImage_16BitAlpha(L"IB-InitG-a");
+      game_ui_player_alert_yellow = assets->GetImage_16BitAlpha(L"IB-InitY-a");
+      game_ui_player_alert_red = assets->GetImage_16BitAlpha(L"IB-InitR-a");
 
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-a", 2);
+      ui_btn_npc_left = assets->GetImage_16BitAlpha(L"IB-NPCLD-a");
+      ui_btn_npc_right = assets->GetImage_16BitAlpha(L"IB-NPCRD-a");
+      game_ui_btn_zoomin = assets->GetImage_16BitAlpha("ib-autout-a");
+      game_ui_btn_zoomout = assets->GetImage_16BitAlpha("ib-autin-a");
       pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-a", 2);
+      game_ui_btn_cast = assets->GetImage_16BitAlpha("ib-m1d-a");
+      game_ui_btn_rest = assets->GetImage_16BitAlpha("ib-m2d-a");
+      game_ui_btn_quickref = assets->GetImage_16BitAlpha("ib-m3d-a");
+      game_ui_btn_settings = assets->GetImage_16BitAlpha("ib-m4d-a");
       pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-a", 2);
       pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-a", 2);
       pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-a", 2);
@@ -1846,9 +1842,10 @@
       pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
       pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA");
       pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID);
+
       ui_exit_cancel_button_background = assets->GetImage_16BitColorKey(L"ib-bcu-a", 0x7FF);
-      uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc", 2);
+
+      game_ui_evtnpc = assets->GetImage_16BitColorKey(L"evtnpc", 0x7FF);
       ui_character_inventory_background = assets->GetImage_16BitColorKey(L"fr_inven", 0x7FF);
       messagebox_corner_y = assets->GetImage_16BitAlpha(L"cornr_ll");
       messagebox_corner_w = assets->GetImage_16BitAlpha(L"cornr_lr");
@@ -1869,28 +1866,28 @@
       game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-a.pcx");
 
       game_ui_right_panel_frame = assets->GetImage_16BitAlpha(L"ib-mb-A");
-      minimap_loop = assets->GetTexture("ib-autmask-a");
-      _5079B4_compass = assets->GetTexture("IB-COMP-A");
-      _5079D0_init_g = assets->GetTexture("IB-InitG-a");
-      _5079C8_init_y = assets->GetTexture("IB-InitY-a");
-      _5079CC_init_r = assets->GetTexture("IB-InitR-a");
+      game_ui_minimap_frame = assets->GetImage_16BitAlpha(L"ib-autmask-a");
+      game_ui_minimap_compass = assets->GetImage_16BitColorKey(L"IB-COMP-A", 0x7FF);
+      game_ui_player_alert_green = assets->GetImage_16BitAlpha(L"IB-InitG-a");
+      game_ui_player_alert_yellow = assets->GetImage_16BitAlpha(L"IB-InitY-a");
+      game_ui_player_alert_red = assets->GetImage_16BitAlpha(L"IB-InitR-a");
 
-      uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-A", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-A", TEXTURE_16BIT_PALETTE);
+      ui_btn_npc_left = assets->GetImage_16BitAlpha(L"IB-NPCLD-A");
+      ui_btn_npc_right = assets->GetImage_16BitAlpha(L"IB-NPCRD-A");
       uTextureID_GameUI_CharSelectionFrame = pIcons_LOD->LoadTexture("IB-selec-A", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-a", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-a", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-a", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-a", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-a", TEXTURE_16BIT_PALETTE);
-      uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-a", TEXTURE_16BIT_PALETTE);
+      game_ui_btn_cast = assets->GetImage_16BitAlpha("ib-m1d-a");
+      game_ui_btn_rest = assets->GetImage_16BitAlpha("ib-m2d-a");
+      game_ui_btn_quickref = assets->GetImage_16BitAlpha("ib-m3d-a");
+      game_ui_btn_settings = assets->GetImage_16BitAlpha("ib-m4d-a");
+      game_ui_btn_zoomin = assets->GetImage_16BitAlpha("ib-autout-a");
+      game_ui_btn_zoomout = assets->GetImage_16BitAlpha("ib-autin-a");
       ui_exit_cancel_button_background = assets->GetImage_16BitColorKey(L"ib-bcu-a", 0x7FF);
-      uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE);
+
       uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE);
       uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE);
       uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE);
       uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE);
-      uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc", TEXTURE_16BIT_PALETTE);
+      game_ui_evtnpc = assets->GetImage_16BitColorKey(L"evtnpc", 0x7FF);
       ui_character_inventory_background = assets->GetImage_16BitColorKey(L"fr_inven", 0x7FF);
       pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA");
       pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
@@ -1920,21 +1917,21 @@
       game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-b.pcx");
 
       game_ui_right_panel_frame = assets->GetImage_16BitAlpha(L"ib-mb-B");
-      minimap_loop = assets->GetTexture("ib-autmask-b");
-      _5079B4_compass = assets->GetTexture("IB-COMP-B");
-      _5079D0_init_g = assets->GetTexture("IB-InitG-b");
-      _5079C8_init_y = assets->GetTexture("IB-InitY-b");
-      _5079CC_init_r = assets->GetTexture("IB-InitR-b");
+      game_ui_minimap_frame = assets->GetImage_16BitAlpha(L"ib-autmask-b");
+      game_ui_minimap_compass = assets->GetImage_16BitColorKey(L"IB-COMP-B", 0x7FF);
+      game_ui_player_alert_green = assets->GetImage_16BitAlpha(L"IB-InitG-b");
+      game_ui_player_alert_yellow = assets->GetImage_16BitAlpha(L"IB-InitY-b");
+      game_ui_player_alert_red = assets->GetImage_16BitAlpha(L"IB-InitR-b");
 
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-B", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-B", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-B", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-B", 2);
+      ui_btn_npc_left = assets->GetImage_16BitAlpha(L"IB-NPCLD-B");
+      ui_btn_npc_right = assets->GetImage_16BitAlpha(L"IB-NPCRD-B");
+      game_ui_btn_zoomin = assets->GetImage_16BitAlpha("ib-autout-B");
+      game_ui_btn_zoomout = assets->GetImage_16BitAlpha("ib-autin-B");
       pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-B", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-b", 2);
+      game_ui_btn_cast = assets->GetImage_16BitAlpha("ib-m1d-b");
+      game_ui_btn_rest = assets->GetImage_16BitAlpha("ib-m2d-b");
+      game_ui_btn_quickref = assets->GetImage_16BitAlpha("ib-m3d-b");
+      game_ui_btn_settings = assets->GetImage_16BitAlpha("ib-m4d-b");
       pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-b", 2);
       pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-b", 2);
       pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-b", 2);
@@ -1944,8 +1941,8 @@
       pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB");
       pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID);
       ui_exit_cancel_button_background = assets->GetImage_16BitColorKey(L"ib-bcu-b", 0x7FF);
-      uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-b", TEXTURE_16BIT_PALETTE);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-b", 2);
+
+      game_ui_evtnpc = assets->GetImage_16BitColorKey(L"evtnpc-b", 0x7FF);
       ui_character_inventory_background = assets->GetImage_16BitColorKey(L"fr_inven-b", 0x7FF);
       messagebox_corner_y = assets->GetImage_16BitAlpha(L"cornr_ll-b");
       messagebox_corner_w = assets->GetImage_16BitAlpha(L"cornr_lr-b");
@@ -2084,7 +2081,7 @@
 }
 
 //----- (0040F92A) --------------------------------------------------------
-void __fastcall ZBuffer_DoFill2(int *pZBuffer, Texture *a2, int a3)
+void __fastcall ZBuffer_DoFill2(int *pZBuffer, Texture_MM7 *a2, int a3)
 {//срабатывает в покупке в магазине
 	void *v4; // eax@3
 	//int *v5; // edi@5
@@ -2123,7 +2120,7 @@
 }
 
 //----- (0040F89C) --------------------------------------------------------
-void __fastcall ZBuffer_DoFill(int *pZBuffer, Texture *pTex, int uZValue)
+void __fastcall ZBuffer_DoFill(int *pZBuffer, Texture_MM7 *pTex, int uZValue)
 {//срабатывает при продаже в магазине
 	void *v3; // eax@3
 	//void *v4; // esi@5
@@ -2651,7 +2648,7 @@
 	pDialogueWindow->Release();
     pDialogueWindow = new GUIWindow(0, 0, window->GetWidth(), 350, a4, 0);
 	pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0,
-		pGlobalTXT_LocalizationStrings[34], pIcons_LOD->GetTexture(uExitCancelTextureId), 0);
+		pGlobalTXT_LocalizationStrings[34], ui_exit_cancel_button_background, 0);
 	pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0);
 	v2 = "";
 	if (contract_approved)
@@ -2763,7 +2760,7 @@
 	pDialogueWindow->Release();
     pDialogueWindow = new GUIWindow(0, 0, window->GetWidth(), 350, 0, 0);
 	pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34],// "Cancel"
-		pIcons_LOD->GetTexture(uExitCancelTextureId), 0);
+        ui_exit_cancel_button_background, 0);
 	pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0);
 	pDialogueWindow->CreateButton(480, 160, 140, 30, 1, 0, UIMSG_0, 83, 0, "", 0);
 	pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2);