changeset 2573:0c67be4ec900

DrawTextureIndexed renamed to DrawTextureTransparentColorKey Changing more class Texture to class Image.
author a.parshin
date Sat, 05 Mar 2016 16:25:53 +0200
parents d87bfbd3bb3b
children dd36326a9994
files Engine/Graphics/IRender.h Engine/Graphics/Overlays.cpp Engine/Graphics/Render.cpp Engine/Graphics/Render.h Engine/Graphics/RenderD3D11.cpp Engine/Graphics/RenderD3D11.h Engine/Graphics/Texture.cpp Engine/Graphics/Texture.h Engine/MMT.cpp Engine/Objects/Actor.cpp Engine/SaveLoad.cpp Engine/mm7_data.cpp Engine/mm7_data.h GUI/GUIProgressBar.cpp GUI/GUIWindow.cpp GUI/GUIWindow.h GUI/UI/Books/AutonotesBook.cpp GUI/UI/Books/CalendarBook.cpp GUI/UI/Books/JournalBook.cpp GUI/UI/Books/LloydsBook.cpp GUI/UI/Books/MapBook.cpp GUI/UI/Books/QuestBook.cpp GUI/UI/Books/TownPortalBook.cpp GUI/UI/Chest.cpp GUI/UI/Spellbook.cpp GUI/UI/UIArena.cpp GUI/UI/UICharacter.cpp GUI/UI/UICharacter.h GUI/UI/UIGuilds.cpp GUI/UI/UIHouses.cpp GUI/UI/UIHouses.h GUI/UI/UIMainMenu.cpp GUI/UI/UIPartyCreation.cpp GUI/UI/UIQuickReference.cpp GUI/UI/UIRest.cpp GUI/UI/UISaveLoad.cpp GUI/UI/UISaveLoad.h GUI/UI/UIShops.cpp GUI/UI/UIShops.h GUI/UI/UITransition.cpp GUI/UI/UiGame.cpp Media/MediaPlayer.cpp
diffstat 42 files changed, 345 insertions(+), 311 deletions(-) [+]
line wrap: on
line diff
--- a/Engine/Graphics/IRender.h	Sat Mar 05 01:51:54 2016 +0200
+++ b/Engine/Graphics/IRender.h	Sat Mar 05 16:25:53 2016 +0200
@@ -72,7 +72,7 @@
     virtual void DrawTextureNew(float u, float v, struct Texture *) = 0;
     virtual void DrawTextureNew(float u, float v, struct Image *) = 0;
     virtual void DrawTextureAlphaNew(float u, float v, struct Image *) = 0;
-    virtual void DrawTextureIndexed(signed int x, signed int y, struct Texture *tex) = 0;
+    virtual void DrawTextureTransparentColorKey(signed int x, signed int y, struct Texture *tex) = 0;
 
     virtual void ZBuffer_Fill_2(signed int a2, signed int a3, struct Texture *pTexture, int a5) = 0;
     virtual void DrawMaskToZBuffer(signed int uOutX, unsigned int uOutY, struct Texture *pTexture, int zVal) = 0;
--- a/Engine/Graphics/Overlays.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/Engine/Graphics/Overlays.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -102,7 +102,7 @@
   else if ( pTurnEngine->turn_stage == TE_ATTACK )//группа атакует(ладонь)
     frame = pIconsFrameTable->GetFrame(uIconID_TurnStop, pEventTimer->uStartTime);
   //if ( pRenderer->pRenderD3D )
-    pRenderer->DrawTextureIndexed(394, 288, &pIcons_LOD->pTextures[frame->uTextureID]);
+    pRenderer->DrawTextureTransparentColorKey(394, 288, &pIcons_LOD->pTextures[frame->uTextureID]);
   /*else
     pRenderer->DrawTextureIndexedAlpha(0x18Au, 0x120u, v7);*/
   if ( dword_50C994 < dword_50C998_turnbased_icon_1A )
@@ -112,9 +112,6 @@
       dword_50C998_turnbased_icon_1A = 0;
   }
 }
-// 4E28F8: using guessed type int current_screen_type;
-// 50C994: using guessed type int dword_50C994;
-// 50C998: using guessed type int dword_50C998_turnbased_icon_1A;
 
 
 //----- (00458D97) --------------------------------------------------------
--- a/Engine/Graphics/Render.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/Engine/Graphics/Render.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -6798,7 +6798,7 @@
   memcpy(&tex, a4, sizeof(tex));
   tex.uTextureHeight = a4->uTextureHeight - height;
   if ( (signed __int16)tex.uTextureHeight > 0 )
-    DrawTextureIndexed(a2, a3, &tex);
+      DrawTextureTransparentColorKey(a2, a3, &tex);
 }
 
 //----- (004A6AB1) --------------------------------------------------------
@@ -7742,8 +7742,10 @@
   }
 }
 
+
+
 //----- (004A5EB2) --------------------------------------------------------
-void Render::DrawTextureIndexed(signed int x, signed int y, Texture *tex)
+void Render::DrawTextureTransparentColorKey(signed int x, signed int y, Texture *tex)
 {
   int v5; // ebx@4
   unsigned int v8; // edx@6
@@ -7825,30 +7827,6 @@
           }
           v19 += v18 - v20;
         }
-        /*if ( (signed int)v5 > 0 )
-        {
-          uYa = v5;
-          v16 = v19;
-          do
-          {
-            if ( v20 > 0 )
-            {
-              uXa = v20;
-              do
-              {
-                *pTarget = v4->pPalette16[*v16];
-                ++pTarget;
-                ++v16;
-                --uXa;
-              }
-              while ( uXa );
-            }
-            v16 += v18 - v20;
-            v17 = uYa-- == 1;
-            pTarget += this->uTargetSurfacePitch - v20;
-          }
-          while ( !v17 );
-        }*/
       }
     }
   }
--- a/Engine/Graphics/Render.h	Sat Mar 05 01:51:54 2016 +0200
+++ b/Engine/Graphics/Render.h	Sat Mar 05 16:25:53 2016 +0200
@@ -254,7 +254,7 @@
   virtual void DrawTextureNew(float u, float v, struct Texture *);
   virtual void DrawTextureNew(float u, float v, struct Image *);
   virtual void DrawTextureAlphaNew(float u, float v, struct Image *);
-  virtual void DrawTextureIndexed(signed int x, signed int y, struct Texture *tex);
+  virtual void DrawTextureTransparentColorKey(signed int x, signed int y, struct Texture *tex);
 
   virtual void ZBuffer_Fill_2(signed int a2, signed int a3, struct Texture *pTexture, int a5);
   virtual void DrawMaskToZBuffer(signed int uOutX, unsigned int uOutY, struct Texture *pTexture, int zVal);
--- a/Engine/Graphics/RenderD3D11.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/Engine/Graphics/RenderD3D11.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -146,7 +146,7 @@
 }
 
 
-void RenderD3D11::DrawTextureIndexed(signed int x, signed int y, struct Texture *tex)
+void RenderD3D11::DrawTextureTransparentColorKey(signed int x, signed int y, struct Texture *tex)
 {
   PrepareTextureIndexed(tex);
   DrawTexture((float)x / window->GetWidth(), (float)y / window->GetHeight(), tex->uTextureWidth, tex->uTextureHeight, tex->d3d11_srv, ui_blend_solid);
--- a/Engine/Graphics/RenderD3D11.h	Sat Mar 05 01:51:54 2016 +0200
+++ b/Engine/Graphics/RenderD3D11.h	Sat Mar 05 16:25:53 2016 +0200
@@ -81,7 +81,7 @@
   virtual void DrawTextureNew(float u, float v, struct Texture *);
   virtual void DrawTextureNew(float u, float v, struct Image *);
   virtual void DrawTextureAlphaNew(float u, float v, struct Image *);
-  virtual void DrawTextureIndexed(signed int x, signed int y, struct Texture *tex);
+  virtual void DrawTextureTransparentColorKey(signed int x, signed int y, struct Texture *tex);
 
   virtual void ZBuffer_Fill_2(signed int a2, signed int a3, struct Texture *pTexture, int a5);
   virtual void DrawMaskToZBuffer(signed int uOutX, unsigned int uOutY, struct Texture *pTexture, int zVal);
--- a/Engine/Graphics/Texture.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/Engine/Graphics/Texture.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -127,7 +127,6 @@
 unsigned int uTextureID_ib_td3_A;
 unsigned int uTextureID_ib_td2_A;
 unsigned int uTextureID_ib_td1_A;
-int uTextureID_CharacterUI_InventoryBackground; // weak
 int uTextureID_50795C; // weak
 
 
@@ -150,10 +149,6 @@
 unsigned int uTextureID_BarBlue;
 
 
-Texture *right_panel;
-Texture *right_panel_loop;
-
-
 
 
 Texture *pTexture_Leather;
@@ -175,11 +170,6 @@
 unsigned int not_available_tinting_texture_id;
 
 
-unsigned int uTextureID_detaliz_close_button; // weak
-unsigned int uTextureID_MAGNIF_B; // weak
-unsigned int uTextureID_BACKDOLL; // weak
-unsigned int uTextureID_BACKHAND; // weak
-
 stru355 stru_4E82A4 = {0x20, 0x41, 0, 0x20, 0xFF0000, 0xFF00, 0xFF, 0xFF000000};
 stru355 stru_4EFCBC = {0x20, 0x41, 0, 0x10, 0x7C00, 0x3E0, 0x1F, 0x8000};
 
--- a/Engine/Graphics/Texture.h	Sat Mar 05 01:51:54 2016 +0200
+++ b/Engine/Graphics/Texture.h	Sat Mar 05 16:25:53 2016 +0200
@@ -304,7 +304,6 @@
 extern unsigned int uTextureID_ib_td3_A;
 extern unsigned int uTextureID_ib_td2_A;
 extern unsigned int uTextureID_ib_td1_A;
-extern int uTextureID_CharacterUI_InventoryBackground; // weak
 extern int uTextureID_50795C; // weak
 
 
@@ -327,9 +326,6 @@
 extern unsigned int uTextureID_BarBlue;
 
 
-extern Texture *right_panel;
-extern Texture *right_panel_loop;
-
 
 extern struct Texture *pTexture_Leather;
 extern struct Texture *pTexture_RestUI_CurrentSkyFrame; // idb
@@ -371,11 +367,6 @@
 extern OptionsMenuSkin options_menu_skin; // 507C60
 
 
-extern unsigned int uTextureID_detaliz_close_button; // weak
-extern unsigned int uTextureID_MAGNIF_B; // weak
-extern unsigned int uTextureID_BACKDOLL; // weak
-extern unsigned int uTextureID_BACKHAND; // weak
-
 
 extern struct Texture pTex_F7CE30;
 
--- a/Engine/MMT.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/Engine/MMT.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -264,7 +264,7 @@
                 pY = window->GetHeight() - 35;
                 break;
             }
-            pRenderer->DrawTextureIndexed(pX, pY, pTexture);
+            pRenderer->DrawTextureTransparentColorKey(pX, pY, pTexture);
            }
           }
         }
--- a/Engine/Objects/Actor.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/Engine/Objects/Actor.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -99,13 +99,13 @@
   uX = window->uFrameX + (signed int)(window->uFrameWidth - bar_length) / 2;
 
   pRenderer->SetUIClipRect(uX, window->uFrameY + 32, uX + bar_length, window->uFrameY + 52);
-  pRenderer->DrawTextureIndexed(uX, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_bd));
+  pRenderer->DrawTextureTransparentColorKey(uX, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_bd));
   pRenderer->SetUIClipRect(uX, window->uFrameY + 32, uX + v10, window->uFrameY + 52);
-  pRenderer->DrawTextureIndexed(uX, window->uFrameY + 34, pIcons_LOD->GetTexture(v9));
+  pRenderer->DrawTextureTransparentColorKey(uX, window->uFrameY + 34, pIcons_LOD->GetTexture(v9));
 
   pRenderer->ResetUIClipRect();
-  pRenderer->DrawTextureIndexed(uX - 5, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capl));
-  pRenderer->DrawTextureIndexed(uX + bar_length, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capr));
+  pRenderer->DrawTextureTransparentColorKey(uX - 5, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capl));
+  pRenderer->DrawTextureTransparentColorKey(uX + bar_length, window->uFrameY + 32, pIcons_LOD->GetTexture(uTextureID_mhp_capr));
 }
 
 //----- (00448A40) --------------------------------------------------------
--- a/Engine/SaveLoad.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/Engine/SaveLoad.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -24,6 +24,7 @@
 
 #include "GUI/GUIWindow.h"
 #include "GUI/GUIFont.h"
+#include "GUI/UI/UISaveLoad.h"
 
 #include "Media/Audio/AudioPlayer.h"
 
@@ -307,8 +308,8 @@
 
     if (current_screen_type == SCREEN_SAVEGAME)
     {
-        pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_loadsave));
-        pRenderer->DrawTextureIndexed(18, 141, pIcons_LOD->GetTexture(uTextureID_save_up));
+        pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, img_loadsave);
+        pRenderer->DrawTextureAlphaNew(18/640.0f, 141/480.0f, img_loadsave);
         text_pos = pFontSmallnum->AlignText_Center(186, pGlobalTXT_LocalizationStrings[190]);
         pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, text_pos + 25, 219, 0, pGlobalTXT_LocalizationStrings[190], 0, 0, 0); //Сохранение
         text_pos = pFontSmallnum->AlignText_Center(186, pSavegameHeader[uLoadGameUI_SelectedSlot].pName);
--- a/Engine/mm7_data.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/Engine/mm7_data.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -682,14 +682,6 @@
 }};
 
 int ScreenshotFileNumber; // dword_4EFA80
-std::array<const char *, 19> off_4F03B8 =
-{{
-  "",         "WEPNTABL", "ARMORY",   "MAGSHELF",
-  "MAGSHELF", "MAGSHELF", "MAGSHELF", "MAGSHELF",
-  "MAGSHELF", "MAGSHELF", "MAGSHELF", "MAGSHELF",
-  "MAGSHELF", "MAGSHELF", "MAGSHELF", "MAGSHELF",
-  "MAGSHELF", "MAGSHELF", "MAGSHELF"
-}};
 
 std::array<int, 32> guild_mambership_flags={{
    54, 54, 54, 54, 52, 52, 52, 52, 55, 55, 55, 55, 53, 53,
@@ -741,7 +733,6 @@
 __int64 lloyds_beacon_spell_level; // qword_506350
 char byte_506360; // weak
 int dword_506364; // weak
-unsigned int uExitCancelTextureId;
 int books_page_number; // weak
 int books_primary_item_per_page; // weak
 int Autonotes_Instructors_page_flag; // dword_50652C
@@ -857,7 +848,6 @@
 std::array<std::array<char, 100>, 6> byte_591180; // idb
 std::array<struct NPCData *, 7> HouseNPCData;//0 zero element holds standart house npc
 GUIButton* HouseNPCPortraitsButtonsList[6];//dword_5913F4
-struct Texture *pTexture_591428;
 struct Texture *pTexture_outside; // idb
 struct Texture *pTexture_Dialogue_Background;
 std::array<char, 2000> byte_5B0938;
@@ -948,16 +938,10 @@
 std::array<int, 64> dword_69B010;
 float flt_69B138_dist; // weak
 char byte_69BD41_unused; // weak
-unsigned int uTextureID_x_u;
-unsigned int uTextureID_LS_saveU;
-unsigned int uTextureID_LS_loadU;
 unsigned int uTextureID_AR_DN_DN;
 unsigned int uTextureID_AR_UP_DN;
 unsigned int uTextureID_LS_;
 unsigned int uTextureID_x_d;
-unsigned int uTextureID_save_up;
-unsigned int uTextureID_load_up;
-unsigned int uTextureID_loadsave;
 int pSaveListPosition; // weak
 unsigned int uLoadGameUI_SelectedSlot;
 HWND hInsertCDWindow; // idb
@@ -1062,7 +1046,6 @@
 //int dword_F8B144; // nexindex [-1] to the following
 std::array<int, 4> player_levels = {{1, 1, 1, 1}};
 std::array<__int16, 6> weapons_Ypos; // word_F8B158
-struct Texture *ShopTexture; // idb
 std::array<struct Texture *, 12> ItemsInShopTexture;
 __int16 bountyHunting_monster_id_for_hunting; // word_F8B1A0
 const char *bountyHunting_text; // word_F8B1A4
--- a/Engine/mm7_data.h	Sat Mar 05 01:51:54 2016 +0200
+++ b/Engine/mm7_data.h	Sat Mar 05 16:25:53 2016 +0200
@@ -369,7 +369,6 @@
 extern std::array<__int16, 101> word_4EE088_sound_ids; // weak
 extern std::array<short, 28> word_4EE150;
 extern int ScreenshotFileNumber; // dword_4EFA80
-extern std::array<const char *, 19> off_4F03B8; // idb
 extern __int16 word_4F0576[]; // weak
 
 extern std::array<int, 32> guild_mambership_flags;
@@ -403,7 +402,6 @@
 extern char byte_506360; // weak
 extern int dword_506364; // weak
 //extern Texture *dword_50640C[]; // weak
-extern unsigned int uExitCancelTextureId;
 extern int books_page_number; // number for page in books(номер страницы в книгах)
 extern int books_primary_item_per_page; // number primary item in book page(номер начальной записи на странице)
 extern int Autonotes_Instructors_page_flag; // dword_50652C
@@ -520,7 +518,6 @@
 extern std::array<std::array<char, 100>, 6> byte_591180; // idb
 extern std::array<struct NPCData *, 7> HouseNPCData; //0this array size temporarily increased to 60 from 6 to work aroud house overflow
 extern GUIButton* HouseNPCPortraitsButtonsList[6];
-extern struct Texture *pTexture_591428;
 extern struct Texture *pTexture_outside; // idb
 extern struct Texture *pTexture_Dialogue_Background;
 extern std::array<char, 2000> byte_5B0938;
@@ -610,16 +607,10 @@
 extern std::array<int, 64> dword_69B010;
 extern float flt_69B138_dist; // weak
 extern char byte_69BD41_unused; // weak
-extern unsigned int uTextureID_x_u;
-extern unsigned int uTextureID_LS_saveU;
-extern unsigned int uTextureID_LS_loadU;
 extern unsigned int uTextureID_AR_DN_DN;
 extern unsigned int uTextureID_AR_UP_DN;
 extern unsigned int uTextureID_LS_;
 extern unsigned int uTextureID_x_d;
-extern unsigned int uTextureID_save_up;
-extern unsigned int uTextureID_load_up;
-extern unsigned int uTextureID_loadsave;
 extern int pSaveListPosition; // weak
 extern unsigned int uLoadGameUI_SelectedSlot;
 extern HWND hInsertCDWindow; // idb
@@ -749,7 +740,6 @@
 extern std::array<int, 32> dword_F1B430; // weak
 extern std::array<int, 4> player_levels;
 extern std::array<__int16, 6> weapons_Ypos; // word_F8B158
-extern struct Texture *ShopTexture; // idb
 extern std::array<struct Texture *, 12> ItemsInShopTexture;
 extern __int16 bountyHunting_monster_id_for_hunting; // weak
 extern const char *bountyHunting_text; // idb
--- a/GUI/GUIProgressBar.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/GUIProgressBar.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -166,7 +166,7 @@
     {
       pRenderer->Sub01();
 
-      pRenderer->DrawTextureIndexed(80, 122, &pBardata);//прогрессбар для данжей
+      pRenderer->DrawTextureTransparentColorKey(80, 122, &pBardata);//прогрессбар для данжей
       pRenderer->DrawTextureIndexedAlpha(100, 146, &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconID_TurnHour, 0)->uTextureID]);
       //pRenderer->FillRectFast(174, 164, floorf(((double)(113 * uProgressCurrent) / (double)uProgressMax) + 0.5f),//COERCE_UNSIGNED_INT64(v4 + 6.7553994e15),
         //16, pRenderer->uTargetRMask);
--- a/GUI/GUIWindow.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/GUIWindow.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -26,12 +26,13 @@
 #include "Engine/Tables/IconFrameTable.h"
 #include "Engine/Objects/Actor.h"
 #include "Engine/AssetsManager.h"
+#include "Engine/Events.h"
+#include "Engine/Graphics/Level\Decoration.h"
 
-#include "GUI\UI\UIArena.h"
+#include "GUI/UI/UIArena.h"
 #include "GUI/UI/UIPopup.h"
 #include "GUI/UI/UIGame.h"
-#include "Engine/Events.h"
-#include "Engine/Graphics/Level\Decoration.h"
+#include "GUI/UI/UICharacter.h"
 
 typedef struct _RGBColor
     {
@@ -73,6 +74,9 @@
 struct GUIMessageQueue *pMessageQueue_50C9E8 = new GUIMessageQueue;
 
 
+Image *ui_exit_cancel_button_background = nullptr;
+Image *game_ui_right_panel_frame = nullptr;
+unsigned int uExitCancelTextureId;
 
 
 
@@ -638,8 +642,8 @@
   pWindow.uFrameZ -= 18;
   pWhiteColor = Color16(0xFFu, 0xFFu, 0xFFu);
   pColor2 = Color16(0x15u, 0x99u, 0xE9u);
-  pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
-  pRenderer->DrawTextureIndexedAlpha(0x1D4u, 0, right_panel_loop);
+  pRenderer->DrawTextureTransparentColorKey(0x1DDu, 0, pTexture_Dialogue_Background);
+  pRenderer->DrawTextureAlphaNew(468, 0, game_ui_right_panel_frame);
   if ( pDialogueNPCCount != uNumDialogueNPCPortraits || !uHouse_ExitPic )
   {
     pDialogWindow.uFrameWidth = 130;
@@ -664,11 +668,11 @@
       JailDialog();
       if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic )
       {
-        pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
-        pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
+        pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
+        pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
       }
       else
-        pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]);
+        pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background);
       return;
     }
     if ( current_npc_text )
@@ -679,7 +683,7 @@
       v6 = pTextHeight + 7;
       pRenderer->GetLeather(8, 352 - (pTextHeight + 7), &pIcons_LOD->pTextures[uTextureID_Leather], 
           pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - (pTextHeight + 7));
-      pRenderer->DrawTextureIndexed(8, 347 - v6, pTexture_591428);
+      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);
     }
@@ -687,18 +691,18 @@
     {
       if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic )
       {
-        pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
-        pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
+        pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
+        pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
       }
       else
-        pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]);
+          pRenderer->DrawTextureAlphaNew(471 / 640.0f, 445 / 480.0f, ui_exit_cancel_button_background);
       return;
     }
     for ( v8 = 0; v8 < uNumDialogueNPCPortraits; ++v8 )
     {
-      pRenderer->DrawTextureIndexed(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8] - 4,
+      pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8] - 4,
                                     pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]);
-      pRenderer->DrawTextureIndexed(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8],
+      pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v8],
                                     pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8], pDialogueNPCPortraits[v8]);
       if ( uNumDialogueNPCPortraits < 4 )
       {
@@ -724,26 +728,26 @@
     }
       if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic )
       {
-        pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
-        pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
+        pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
+        pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
       }
       else
-        pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]);
+          pRenderer->DrawTextureAlphaNew(471 / 640.0f, 445 / 480.0f, ui_exit_cancel_button_background);
       return;
   }
   v4 = (char *)pDialogueNPCCount - 1;
-  pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]);
-  pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[(signed int)v4]);
+  pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, &pIcons_LOD->pTextures[uTextureID_50795C]);
+  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->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
-      pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
+      pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
+      pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
     }
     else
-      pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]);
+        pRenderer->DrawTextureAlphaNew(471 / 640.0f, 445 / 480.0f, ui_exit_cancel_button_background);
     return;
   }
   if ( v4 || !dword_591080 )//на изумрудном острове заходит на корабле пока не выполнены квесты
@@ -812,11 +816,11 @@
   }
   if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic )
   {
-    pRenderer->DrawTextureIndexed(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
-    pRenderer->DrawTextureIndexed(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
+    pRenderer->DrawTextureTransparentColorKey(556, 451, &pIcons_LOD->pTextures[uTextureID_x_x_u]);
+    pRenderer->DrawTextureTransparentColorKey(476, 451, &pIcons_LOD->pTextures[uTextureID_x_ok_u]);
   }
   else
-    pRenderer->DrawTextureIndexed(471, 445, &pIcons_LOD->pTextures[uExitCancelTextureId]);
+      pRenderer->DrawTextureAlphaNew(471 / 640.0f, 445 / 480.0f, ui_exit_cancel_button_background);
 }
 
 //----- (004B1854) --------------------------------------------------------
@@ -1324,7 +1328,7 @@
 // -----------------------------------
 // 004156F0 GUI_UpdateWindows --- part
     auto pButton = (GUIButton *)ptr_1C;
-    pRenderer->DrawTextureIndexed(uFrameY, uFrameX, pButton->pTextures[0]);
+    pRenderer->DrawTextureTransparentColorKey(uFrameY, uFrameX, pButton->pTextures[0]);
     viewparams->bRedrawGameUI = true;
 }
 
@@ -1424,7 +1428,7 @@
     {
         if (pButton->uY >= 0 && pButton->uY <= window->GetHeight())
         {
-            pRenderer->DrawTextureIndexed(uFrameX, uFrameY, pButton->pTextures[0]);
+            pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pButton->pTextures[0]);
             viewparams->bRedrawGameUI = true;
             if (Hint && Hint != (char *)1)
                 pButton->DrawLabel(Hint, pFontCreate, 0, 0);
@@ -1445,7 +1449,7 @@
     if (Hint != (char *)1)
         pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
     auto pButton = (GUIButton *)ptr_1C;
-    pRenderer->DrawTextureIndexed(uFrameX, uFrameY, pButton->pTextures[1]);
+    pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pButton->pTextures[1]);
     viewparams->bRedrawGameUI = 1;
     if (Hint && Hint != (char *)1)
         pButton->DrawLabel(Hint, pFontCreate, 0, 0);
@@ -1472,7 +1476,7 @@
     if (Hint != (char *)1)
         pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
     auto pButton = (GUIButton *)ptr_1C;
-    pRenderer->DrawTextureIndexed(uFrameX, uFrameY, pButton->pTextures[0]);
+    pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pButton->pTextures[0]);
     viewparams->bRedrawGameUI = true;
     if (Hint && Hint != (char *)1)
         pButton->DrawLabel(Hint, pFontCreate, 0, 0);
@@ -1491,7 +1495,7 @@
     if (Hint != (char *)1)
         pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
     auto pGUIButton = (GUIButton *)ptr_1C;
-    pRenderer->DrawTextureIndexed(uFrameX, uFrameY, pGUIButton->pTextures[0]);
+    pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pGUIButton->pTextures[0]);
     viewparams->bRedrawGameUI = true;
     if (Hint && Hint != (char *)1)
         pGUIButton->DrawLabel(Hint, pFontCreate, 0, 0);
@@ -1507,7 +1511,7 @@
     if (Hint != (char *)1)
         pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
     auto pButton = (GUIButton *)ptr_1C;
-    pRenderer->DrawTextureIndexed(uFrameX, uFrameY, pButton->pTextures[1]);
+    pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, pButton->pTextures[1]);
     viewparams->bRedrawGameUI = true;
     if (Hint && Hint != (char *)1)
         pButton->DrawLabel(Hint, pFontCreate, 0, 0);
@@ -1727,7 +1731,7 @@
         game_ui_leftframe = assets->GetImage_PCXFromIconsLOD(L"ib-l-C.pcx");
         game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-c.pcx");
 
-      right_panel = assets->GetTexture("ib-mb-C");
+        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");
@@ -1754,9 +1758,10 @@
       pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC");
       pIconsFrameTable->InitializeAnimation(pUIAnum_Torchlight->uIconID);
 
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-c", 2);
+      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);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_CharacterUI_InventoryBackground], "fr_inven-c", 2);
+      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");
       messagebox_corner_x = assets->GetImage_16BitAlpha(L"cornr_ul-c");
@@ -1765,7 +1770,7 @@
       messagebox_border_left = assets->GetImage_16BitAlpha(L"edge_lf-c");
       messagebox_border_right = assets->GetImage_16BitAlpha(L"edge_rt-c");
       messagebox_border_top = assets->GetImage_16BitAlpha(L"edge_top-c");
-      pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-c", 2);
+      _591428_endcap = assets->GetImage_16BitColorKey(L"endcap-c", 0x7FF);
     }
     else
     {
@@ -1773,9 +1778,9 @@
         game_ui_bottomframe = assets->GetImage_PCXFromIconsLOD(L"ib-b-c.pcx");
         game_ui_topframe = assets->GetImage_PCXFromIconsLOD(L"ib-t-C.pcx");
         game_ui_leftframe = assets->GetImage_PCXFromIconsLOD(L"ib-l-C.pcx");
-      game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-c.pcx");
+        game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-c.pcx");
 
-      right_panel = assets->GetTexture("ib-mb-C");
+        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");
@@ -1791,13 +1796,14 @@
       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);
+      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);
-      uTextureID_CharacterUI_InventoryBackground = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE);
+      ui_character_inventory_background = assets->GetImage_16BitColorKey(L"fr_inven", 0x7FF);
       pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC");
       pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
       pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC");
@@ -1816,7 +1822,7 @@
         game_ui_leftframe = assets->GetImage_PCXFromIconsLOD(L"ib-l-a.pcx");
       game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-a.pcx");
 
-      right_panel = assets->GetTexture("ib-mb-a");
+      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");
@@ -1840,9 +1846,10 @@
       pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
       pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA");
       pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-a", 2);
+      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);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_CharacterUI_InventoryBackground], "fr_inven", 2);
+      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");
       messagebox_corner_x = assets->GetImage_16BitAlpha(L"cornr_ul");
@@ -1851,7 +1858,7 @@
       messagebox_border_left = assets->GetImage_16BitAlpha(L"edge_lf");
       messagebox_border_right = assets->GetImage_16BitAlpha(L"edge_rt");
       messagebox_border_top = assets->GetImage_16BitAlpha(L"edge_top");
-      pIcons_LOD->ReloadTexture(pTexture_591428, "endcap", 2);
+      _591428_endcap = assets->GetImage_16BitColorKey(L"endcap", 0x7FF);
     }
     else
     {
@@ -1861,7 +1868,7 @@
         game_ui_leftframe = assets->GetImage_PCXFromIconsLOD(L"ib-l-A.pcx");
       game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-a.pcx");
 
-      right_panel = assets->GetTexture("ib-mb-A");
+      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");
@@ -1877,13 +1884,14 @@
       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);
+      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);
-      uTextureID_CharacterUI_InventoryBackground = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE);
+      ui_character_inventory_background = assets->GetImage_16BitColorKey(L"fr_inven", 0x7FF);
       pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA");
       pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
       pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA");
@@ -1896,7 +1904,7 @@
       messagebox_border_left = assets->GetImage_16BitAlpha(L"edge_lf");
       messagebox_border_right = assets->GetImage_16BitAlpha(L"edge_rt");
       messagebox_border_top = assets->GetImage_16BitAlpha(L"edge_top");
-      pTexture_591428 = pIcons_LOD->LoadTexturePtr("endcap", TEXTURE_16BIT_PALETTE);
+      _591428_endcap = assets->GetImage_16BitColorKey(L"endcap", 0x7FF);
     }
     uGameUIFontMain = Color16(0xAu, 0, 0);
     uGameUIFontShadow = Color16(230, 214, 193);
@@ -1911,7 +1919,7 @@
         game_ui_leftframe = assets->GetImage_PCXFromIconsLOD(L"ib-l-B.pcx");
       game_ui_statusbar = assets->GetImage_PCXFromIconsLOD(L"IB-Foot-b.pcx");
 
-      right_panel = assets->GetTexture("ib-mb-B");
+      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");
@@ -1935,9 +1943,10 @@
       pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
       pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB");
       pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-b", 2);
+      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);
-      pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_CharacterUI_InventoryBackground], "fr_inven-b", 2);
+      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");
       messagebox_corner_x = assets->GetImage_16BitAlpha(L"cornr_ul-b");
@@ -1946,7 +1955,7 @@
       messagebox_border_left = assets->GetImage_16BitAlpha(L"edge_lf-b");
       messagebox_border_right = assets->GetImage_16BitAlpha(L"edge_rt-b");
       messagebox_border_top = assets->GetImage_16BitAlpha(L"edge_top-b");
-      pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-b", 2);
+      _591428_endcap = assets->GetImage_16BitColorKey(L"endcap-b", 0x7FF);
     }
     uGameUIFontMain = Color16(0, 0, 0xC8u);
     uGameUIFontShadow = Color16(255, 255, 255);
--- a/GUI/GUIWindow.h	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/GUIWindow.h	Sat Mar 05 16:25:53 2016 +0200
@@ -915,4 +915,9 @@
 extern unsigned int ui_game_dialogue_npc_name_color;
 extern unsigned int ui_game_dialogue_option_highlight_color;
 extern unsigned int ui_game_dialogue_option_normal_color;
-extern unsigned int ui_house_player_cant_interact_color;
\ No newline at end of file
+extern unsigned int ui_house_player_cant_interact_color;
+
+
+extern class Image *ui_exit_cancel_button_background;
+extern class Image *game_ui_right_panel_frame;
+extern unsigned int uExitCancelTextureId;
\ No newline at end of file
--- a/GUI/UI/Books/AutonotesBook.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/Books/AutonotesBook.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -112,7 +112,7 @@
 // ----- (00413CC6) --------------------------------------------------------
 // void BookUI_Draw(WindowType book) --- part
 // {
-    pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId));
+    pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background);
 //     BookUI_Autonotes_Draw();
 
 // ----- (0041338E) --------------------------------------------------------
@@ -123,7 +123,7 @@
     GUIWindow autonotes_window; // [sp+14h] [bp-54h]@46
 
     change_flag = false;
-    pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_AutonotesBook);
+    pRenderer->DrawTextureTransparentColorKey(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_AutonotesBook);
     if (BtnUp_flag || !books_primary_item_per_page)
         pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 2, pTex_book_button1_off);
     else
--- a/GUI/UI/Books/CalendarBook.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/Books/CalendarBook.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -63,7 +63,7 @@
 // ----- (00413CC6) --------------------------------------------------------
 // void BookUI_Draw(WindowType book) --- part
 // {
-    pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId));
+    pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background);
 //     BookUI_Calendar_Draw();
 
 // ----- (00413D6F) --------------------------------------------------------
@@ -87,7 +87,7 @@
         1, 1, 1, 1
     };
 
-    pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_13);
+    pRenderer->DrawTextureTransparentColorKey(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_13);
     pHour = pParty->uCurrentHour;
     if ((signed int)pHour >= 12)
     {
--- a/GUI/UI/Books/JournalBook.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/Books/JournalBook.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -93,7 +93,7 @@
 // ----- (00413CC6) --------------------------------------------------------
 // void BookUI_Draw(WindowType book) --- part
 // {
-    pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId));
+    pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background);
 //     BookUI_Journal_Draw();
 
 // ----- (00412E85) --------------------------------------------------------
@@ -103,7 +103,7 @@
     char* pStringOnPage; // eax@22
     GUIWindow journal_window; // [sp+8h] [bp-54h]@10
 
-    pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_11);
+    pRenderer->DrawTextureTransparentColorKey(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_11);
     if (BtnUp_flag || !books_primary_item_per_page)
         pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 2, pTex_book_button1_off);
     else
--- a/GUI/UI/Books/LloydsBook.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/Books/LloydsBook.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -65,7 +65,7 @@
 // ----- (00413CC6) --------------------------------------------------------
 // void BookUI_Draw(WindowType book) --- part
 // {
-    pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId));
+    pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background);
 //     DrawLloydBeaconsScreen();
 
 // ----- (00410DEC) --------------------------------------------------------
@@ -85,7 +85,7 @@
     int uNumMaxBeacons; // [sp+84h] [bp-4h]@6
 
     pPlayer = &pParty->pPlayers[_506348_current_lloyd_playerid];
-    pRenderer->DrawTextureIndexed(8, 8, pTexture_LloydBeacons[(unsigned __int8)bRecallingBeacon]);
+    pRenderer->DrawTextureTransparentColorKey(8, 8, pTexture_LloydBeacons[(unsigned __int8)bRecallingBeacon]);
     pText = pGlobalTXT_LocalizationStrings[523];     // Recall Beacon
     pWindow.uFrameX = game_viewport_x;
     pWindow.uFrameY = game_viewport_y;
--- a/GUI/UI/Books/MapBook.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/Books/MapBook.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -80,7 +80,7 @@
 // ----- (00413CC6) --------------------------------------------------------
 // void BookUI_Draw(WindowType book) --- part
 // {
-    pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId));
+    pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background);
 //     BookUI_Map_Draw();
 
 // ----- (00413980) --------------------------------------------------------
@@ -90,7 +90,7 @@
     char party_coord[120]; // [sp+Ch] [bp-CCh]@37
     GUIWindow map_window; // [sp+84h] [bp-54h]@35
 
-    pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_12);
+    pRenderer->DrawTextureTransparentColorKey(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_12);
     if (BtnUp_flag || viewparams->uMapBookMapZoom / 128 >= 12)//Button 1
         pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 408, pViewport->uViewportTL_Y + 2, pTex_book_button1_off);
     else
--- a/GUI/UI/Books/QuestBook.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/Books/QuestBook.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -72,7 +72,7 @@
 // ----- (00413CC6) --------------------------------------------------------
 // void BookUI_Draw(WindowType book) --- part
 // {
-    pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId));
+    pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background);
 //     BookUI_Questbook_Draw();
 
 // ----- (00413126) --------------------------------------------------------
@@ -81,7 +81,7 @@
     int pTextHeight; // eax@19
     GUIWindow questbook_window; // [sp+Ch] [bp-54h]@9
 
-    pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_CurrentBook);
+    pRenderer->DrawTextureTransparentColorKey(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_CurrentBook);
     if (BtnUp_flag || !books_primary_item_per_page)//Bookmark Up(Закладка вверх)
         pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportTL_X + 407, pViewport->uViewportTL_Y + 2, pTex_book_button1_off);
     else
--- a/GUI/UI/Books/TownPortalBook.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/Books/TownPortalBook.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -53,7 +53,7 @@
 // ----- (00413CC6) --------------------------------------------------------
 // void BookUI_Draw(WindowType book) --- part
 // {
-    pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId));
+    pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background);
 //     BookUI_DrawTownPortalMap();
 
 // ----- (00411150) --------------------------------------------------------
@@ -65,7 +65,7 @@
 
     pRenderer->ClearZBuffer(0, 479);
     pRenderer->DrawTextureIndexedAlpha(8, 8, pTexture_CurrentBook);
-    pRenderer->DrawTextureIndexedAlpha(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId));
+    pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background);
 
     TownPortalWindow.uFrameX = game_viewport_x;
     TownPortalWindow.uFrameY = game_viewport_y;
@@ -100,7 +100,7 @@
     if (v3)
     {
         if (_449B57_test_bit(pParty->_quest_bits, fountain_bits_lut[v3 - 1]))
-            pRenderer->DrawTextureIndexed(pTownPortalBook_xs[v3 - 1], pTownPortalBook_ys[v3 - 1], pTexture_TownPortalIcons[v3 - 1]);
+            pRenderer->DrawTextureTransparentColorKey(pTownPortalBook_xs[v3 - 1], pTownPortalBook_ys[v3 - 1], pTexture_TownPortalIcons[v3 - 1]);
     }
     TownPortalWindow.DrawTitleText(pBook2Font, 0, 22, 0, pGlobalTXT_LocalizationStrings[10], 3);
 }
\ No newline at end of file
--- a/GUI/UI/Chest.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/Chest.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -46,7 +46,7 @@
         pRenderer->ClearZBuffer(0, 479);
         draw_leather();
         CharacterUI_InventoryTab_Draw(pPlayers[uActiveCharacter], true);
-        pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uExitCancelTextureId));
+        pRenderer->DrawTextureAlphaNew(pBtn_ExitCancel->uX/640.0f, pBtn_ExitCancel->uY/480.0f, ui_exit_cancel_button_background);
     }
     else if (current_screen_type == SCREEN_CHEST)
     {
@@ -85,7 +85,7 @@
         chestHeghtCells = pChestHeightsByType[chestBitmapId];
         sprintfex(pTmpBuf.data(), "chest%02d", pChestList->pChests[chestBitmapId].uTextureID);
         v5 = pIcons_LOD->LoadTexture(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
-        pRenderer->DrawTextureIndexed(8u, 8u, pIcons_LOD->GetTexture(v5));
+        pRenderer->DrawTextureTransparentColorKey(8u, 8u, pIcons_LOD->GetTexture(v5));
 
         for (item_counter = 0; item_counter < chestWidthCells * chestHeghtCells; ++item_counter)
         {
@@ -112,6 +112,6 @@
                 ZBuffer_DoFill2(&v16[itemPixelPosX + pSRZBufferLineOffsets[itemPixelPosY]], item_texture, item_counter + 1);
             }
         }
-        pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pIcons_LOD->GetTexture(uExitCancelTextureId));
+        pRenderer->DrawTextureAlphaNew(pBtn_ExitCancel->uX/640.0f, pBtn_ExitCancel->uY/480.0f, ui_exit_cancel_button_background);
     }
 }
\ No newline at end of file
--- a/GUI/UI/Spellbook.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/Spellbook.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -175,7 +175,7 @@
                         if (pTexture->pBits & 0x200)
                             pRenderer->DrawTextureIndexedAlpha(pX_coord, pY_coord, pTexture);
                         else
-                            pRenderer->DrawTextureIndexed(pX_coord, pY_coord, pTexture);
+                            pRenderer->DrawTextureTransparentColorKey(pX_coord, pY_coord, pTexture);
                         pRenderer->DrawMaskToZBuffer(pIconPos[player->lastOpenedSpellbookPage][pSpellbookSpellIndices[player->lastOpenedSpellbookPage][i]].Xpos,
                             pIconPos[player->lastOpenedSpellbookPage][pSpellbookSpellIndices[player->lastOpenedSpellbookPage][i]].Ypos, pTexture, i);
                     }
@@ -195,7 +195,7 @@
             if (SBPageCSpellsTextureList[v10]->pBits & 0x200)
                 pRenderer->DrawTextureIndexedAlpha(pX_coord, pY_coord, SBPageCSpellsTextureList[v10]);
             else
-                pRenderer->DrawTextureIndexed(pX_coord, pY_coord, SBPageCSpellsTextureList[v10]);
+                pRenderer->DrawTextureTransparentColorKey(pX_coord, pY_coord, SBPageCSpellsTextureList[v10]);
         }
     }
     //pX_coord = (unsigned int)&player->pActiveSkills[PLAYER_SKILL_FIRE];
@@ -263,9 +263,9 @@
   int pTexID = 0;
   if ( uActiveCharacter )
     pTexID = pParty->pPlayers[uActiveCharacter - 1].lastOpenedSpellbookPage;
-  pRenderer->DrawTextureIndexed(8, 8, pSpellBookPagesTextr[pTexID]);
-  pRenderer->DrawTextureIndexed(476, 450, pSBQuickSpellBtnTextr);
-  pRenderer->DrawTextureIndexed(561, 450, pSpellBookCloseBtnTextr);
+  pRenderer->DrawTextureTransparentColorKey(8, 8, pSpellBookPagesTextr[pTexID]);
+  pRenderer->DrawTextureTransparentColorKey(476, 450, pSBQuickSpellBtnTextr);
+  pRenderer->DrawTextureTransparentColorKey(561, 450, pSpellBookCloseBtnTextr);
 }
 
 
--- a/GUI/UI/UIArena.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/UIArena.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -18,6 +18,8 @@
 #include "../../Engine/Graphics/Viewport.h"
 #include "../../Engine/texts.h"
 
+#include "GUI/UI/UIHouses.h"
+
 std::array<Vec2_int_, 20> pMonsterArenaPlacements = 
   {{
     Vec2_int_(1524, 8332),
@@ -166,7 +168,7 @@
   Texture* pTex = pIcons_LOD->GetTexture(uTextureID_Leather);
   pRenderer->GetLeather(8, 352 - v0, pTex, pTex->uTextureHeight - v0);
 
-  pRenderer->DrawTextureIndexed(8, 347 - v0, pTexture_591428);
+  pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - v0)/480.0f, _591428_endcap);
   v1 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[575], pFontArrus, &window, 0xDu, 0);//Пожалуйста, подождите пока я вызываю существ. Удачи.
   pDialogueWindow->DrawText(pFontArrus, 13, 354 - v0, 0, v1, 0, 0, 0);
   pRenderer->EndScene();
--- a/GUI/UI/UICharacter.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/UICharacter.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -5,6 +5,7 @@
 #include <algorithm> 
 
 #include "Engine/Engine.h"
+#include "Engine/AssetsManager.h"
 
 #include "UICharacter.h"
 #include "..\../Engine/MapInfo.h"
@@ -406,6 +407,18 @@
     PLAYER_SKILL_MIND,     PLAYER_SKILL_BODY,        PLAYER_SKILL_LIGHT,      PLAYER_SKILL_DARK};
 
 
+
+Image *ui_character_skills_background = nullptr;
+Image *ui_character_awards_background = nullptr;
+Image *ui_character_stats_background = nullptr;
+Image *ui_character_inventory_background = nullptr;
+Image *ui_character_inventory_background_strip = nullptr;
+Image *ui_character_inventory_magnification_glass = nullptr;
+Image *ui_character_inventory_paperdoll_background = nullptr;
+Image *ui_character_inventory_paperdoll_rings_background = nullptr;
+Image *ui_character_inventory_paperdoll_rings_close = nullptr;
+
+
 GUIWindow_CharacterRecord::GUIWindow_CharacterRecord(unsigned int uActiveCharacter, enum CURRENT_SCREEN screen) :
     GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), uActiveCharacter, nullptr)
 {
@@ -465,6 +478,13 @@
 
   CreateButton(0, 0, 0, 0, 1, 0, UIMSG_CycleCharacters, 0, '\t', "", 0);
   FillAwardsData();
+
+
+
+  ui_character_skills_background = assets->GetImage_16BitColorKey(L"fr_skill", 0x7FF);
+  ui_character_awards_background = assets->GetImage_16BitColorKey(L"fr_award", 0x7FF);
+  ui_character_stats_background = assets->GetImage_16BitColorKey(L"fr_stats", 0x7FF);
+  ui_character_inventory_background_strip = assets->GetImage_16BitColorKey(L"fr_strip", 0x7FF);
 }
 
 //----- (0041ABFD) --------------------------------------------------------
@@ -486,7 +506,7 @@
             CharacterUI_ReleaseButtons();
             ReleaseAwardsScrollBar();
             CharacterUI_StatsTab_Draw(player);
-            pRenderer->DrawTextureIndexed(
+            pRenderer->DrawTextureTransparentColorKey(
                 pCharacterScreen_StatsBtn->uX,
                 pCharacterScreen_StatsBtn->uY,
                 pIcons_LOD->LoadTexturePtr("ib-cd1-d", TEXTURE_16BIT_PALETTE)
@@ -503,7 +523,7 @@
             }
             ReleaseAwardsScrollBar();
             CharacterUI_SkillsTab_Draw(player);
-            pRenderer->DrawTextureIndexed(
+            pRenderer->DrawTextureTransparentColorKey(
                 pCharacterScreen_SkillsBtn->uX,
                 pCharacterScreen_SkillsBtn->uY,
                 pIcons_LOD->LoadTexturePtr("ib-cd2-d", TEXTURE_16BIT_PALETTE)
@@ -517,7 +537,7 @@
             ReleaseAwardsScrollBar();
             CreateAwardsScrollBar();
             CharacterUI_AwardsTab_Draw(player);
-            pRenderer->DrawTextureIndexed(
+            pRenderer->DrawTextureTransparentColorKey(
                 pCharacterScreen_AwardsBtn->uX,
                 pCharacterScreen_AwardsBtn->uY,
                 pIcons_LOD->LoadTexturePtr("ib-cd4-d", TEXTURE_16BIT_PALETTE)
@@ -530,7 +550,7 @@
             CharacterUI_ReleaseButtons();
             ReleaseAwardsScrollBar();
             CharacterUI_InventoryTab_Draw(player, false);
-            pRenderer->DrawTextureIndexed(
+            pRenderer->DrawTextureTransparentColorKey(
                 pCharacterScreen_InventoryBtn->uX,
                 pCharacterScreen_InventoryBtn->uY,
                 pIcons_LOD->LoadTexturePtr("ib-cd3-d", TEXTURE_16BIT_PALETTE)
@@ -597,8 +617,8 @@
     pCharacterScreen_DollBtn->Release();
     if (bRingsShownInCharScreen)
     {
-        v128 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureHeight;
-        v125 = pIcons_LOD->GetTexture(uTextureID_detaliz_close_button)->uTextureWidth;
+        v128 = ui_character_inventory_paperdoll_rings_close->GetHeight();
+        v125 = ui_character_inventory_paperdoll_rings_close->GetWidth();
         v123 = 445;
         v121 = 470;
     }
@@ -726,7 +746,7 @@
 //----- (00419719) --------------------------------------------------------
 void GUIWindow_CharacterRecord::CharacterUI_SkillsTab_Draw(Player *player)
 {
-  pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("fr_skill", TEXTURE_16BIT_PALETTE));
+  pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, ui_character_skills_background);
 
   sprintfex(pTmpBuf.data(), "%s \f%05d^Pv[%s]\f00000\r177%s: \f%05d%d\f00000",
             pGlobalTXT_LocalizationStrings[206],        // Skills for
@@ -758,7 +778,8 @@
   char Source[100]; // [sp+Ch] [bp-C4h]@1
   GUIWindow awards_window; // [sp+70h] [bp-60h]@1
 
-  pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("fr_award", TEXTURE_16BIT_PALETTE));
+  pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, ui_character_awards_background);
+
   sprintfex(pTmpBuf.data(), "%s \f%05d", pGlobalTXT_LocalizationStrings[LOCSTR_AVARDS_FOR], ui_character_header_text_color);
   sprintfex(Source, pGlobalTXT_LocalizationStrings[LOCSTR_S_THE_S], player->pName, pClassNames[player->classType]);
   strcat(pTmpBuf.data(), Source);
@@ -846,7 +867,7 @@
 //----- (0041A556) --------------------------------------------------------
 void draw_leather()
 {
-  pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_Leather));
+  pRenderer->DrawTextureTransparentColorKey(8, 8, pIcons_LOD->GetTexture(uTextureID_Leather));
 }
 
 
@@ -890,7 +911,7 @@
     }
 
   pRenderer->ResetUIClipRect();
-  pRenderer->DrawTextureIndexed(467, 0, pIcons_LOD->GetTexture(uTextureID_BACKDOLL));//Подложка
+  pRenderer->DrawTextureAlphaNew(467/640.0f, 0, ui_character_inventory_paperdoll_background);
   if ( IsPlayerWearingWatersuit[uPlayerID] )//акваланг
   {
     pRenderer->DrawTextureIndexedAlpha(pPaperdoll_BodyX, pPaperdoll_BodyY, pIcons_LOD->GetTexture(papredoll_dbods[uPlayerID - 1]));
@@ -1606,9 +1627,11 @@
                                         pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[pBodyComplection][1], 
                                         pIcons_LOD->GetTexture(papredoll_dlhus[uPlayerID - 1]));
   }
+
   if ( !bRingsShownInCharScreen )//рисование лупы
-    pRenderer->DrawTextureIndexedAlpha(603, 299, pIcons_LOD->GetTexture(uTextureID_MAGNIF_B));
-  pRenderer->DrawTextureIndexedAlpha(468, 0, right_panel_loop);//обрамление
+    pRenderer->DrawTextureAlphaNew(603/640.0f, 299/480.0f, ui_character_inventory_magnification_glass);
+
+  pRenderer->DrawTextureAlphaNew(468 / 640.0f, 0, game_ui_right_panel_frame);
 }
 
 //----- (0041A2D1) --------------------------------------------------------
@@ -1619,9 +1642,10 @@
   unsigned int uCellX; // [sp+30h] [bp-8h]@5
   unsigned int uCellY; // [sp+34h] [bp-4h]@5
 
-  pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_CharacterUI_InventoryBackground));
+  pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, ui_character_inventory_background);
   if (a2)
-    pRenderer->DrawTextureIndexed(8, 305, pIcons_LOD->LoadTexturePtr("fr_strip", TEXTURE_16BIT_PALETTE));
+    pRenderer->DrawTextureAlphaNew(8/640.0f, 305/480.0f, ui_character_inventory_background_strip);
+
   for (uint i = 0; i < 126; ++i)
   {
     if ( player->pInventoryMatrix[i] <= 0 )
@@ -1722,10 +1746,11 @@
 void CharacterUI_DrawPaperdollWithRingOverlay(Player *player)
 {
   CharacterUI_DrawPaperdoll(player);
-  pRenderer->DrawTextureIndexedAlpha(0x1D9u, 0, pIcons_LOD->GetTexture(uTextureID_BACKHAND));
-  pRenderer->DrawTextureIndexedAlpha(0x1D4u, 0, right_panel_loop);
-  pRenderer->DrawTextureIndexed(pCharacterScreen_DetalizBtn->uX, pCharacterScreen_DetalizBtn->uY,
-                                pIcons_LOD->GetTexture(uTextureID_detaliz_close_button));
+
+  pRenderer->DrawTextureAlphaNew(473/640.0f, 0, ui_character_inventory_paperdoll_rings_background);
+  pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_right_panel_frame);
+  pRenderer->DrawTextureAlphaNew(pCharacterScreen_DetalizBtn->uX/640.0f, pCharacterScreen_DetalizBtn->uY/480.0f, ui_character_inventory_paperdoll_rings_close);
+
   for (uint i = 0; i < 6; ++i)
   {
     if (!player->pEquipment.uRings[i])
@@ -1752,12 +1777,16 @@
   signed int v38; // [sp+14h] [bp-24h]@79
   char pContainer[128]; // [sp+24h] [bp-14h]@12
 
-  uTextureID_MAGNIF_B = pIcons_LOD->LoadTexture("MAGNIF-B", TEXTURE_16BIT_PALETTE);
+  if (!ui_character_inventory_magnification_glass)
+      ui_character_inventory_magnification_glass = assets->GetImage_16BitAlpha(L"MAGNIF-B");
+
   //if ( !pParty->uAlignment || pParty->uAlignment == 1 || pParty->uAlignment == 2 )
-  uTextureID_BACKDOLL = pIcons_LOD->LoadTexture("BACKDOLL", TEXTURE_16BIT_PALETTE);
-  right_panel_loop = right_panel;
-  uTextureID_BACKHAND = pIcons_LOD->LoadTexture("BACKHAND", TEXTURE_16BIT_PALETTE);
-  uTextureID_detaliz_close_button = uExitCancelTextureId;
+  if (!ui_character_inventory_paperdoll_background)
+      ui_character_inventory_paperdoll_background = assets->GetImage_16BitColorKey(L"BACKDOLL", 0x7FF);
+
+  ui_character_inventory_paperdoll_rings_background = assets->GetImage_16BitAlpha(L"BACKHAND");
+
+  ui_character_inventory_paperdoll_rings_close = ui_exit_cancel_button_background;
   for ( uint i = 0; i < 4; ++i )
   {
     if ( pPlayers[i + 1]->HasUnderwaterSuitEquipped() )
@@ -2058,7 +2087,8 @@
   const char *pText; // eax@9
   const char *text_format; // [sp+14h] [bp-Ch]@4
 
-  pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("fr_stats", TEXTURE_16BIT_PALETTE));
+  pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, ui_character_stats_background);
+
   sprintf(pTmpBuf.data(), "\f%05d", ui_character_header_text_color);
   sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]);//"^Pi[%s] %s" / "%s the %s"
   strcat(pTmpBuf.data(), pTmpBuf2.data());
--- a/GUI/UI/UICharacter.h	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/UICharacter.h	Sat Mar 05 16:25:53 2016 +0200
@@ -20,4 +20,13 @@
         void CharacterUI_AwardsTab_Draw(struct Player *);
 
         void CharacterUI_SkillsTab_CreateButtons();
-};
\ No newline at end of file
+};
+
+
+
+extern class Image *ui_character_skills_background;
+extern class Image *ui_character_awards_background;
+extern class Image *ui_character_stats_background;
+extern class Image *ui_character_inventory_background;
+extern class Image *ui_character_inventory_background_strip;
+extern class Image *ui_character_inventory_paperdoll_background;
\ No newline at end of file
--- a/GUI/UI/UIGuilds.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/UIGuilds.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -6,6 +6,8 @@
 
 #include "Engine/Engine.h"
 
+#include "GUI/UI/UIShops.h"
+
 #include "..\../Engine/Objects/Items.h"
 #include "..\../GUI/GUIWindow.h"
 #include "..\../Engine/texts.h"
@@ -157,7 +159,7 @@
   }
   if ( dialog_menu_id == HOUSE_DIALOGUE_GUILD_BUY_BOOKS ) //buy skill
   {
-    pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
+    pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, shop_ui_background);
     v6 = 0;
     v62 = 0;
     for ( pX = 32; pX < 452; pX += 70 )//расположение в верхнем ряду
--- a/GUI/UI/UIHouses.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/UIHouses.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -5,6 +5,7 @@
 #define _CRT_SECURE_NO_WARNINGS
 
 #include "Engine/Engine.h"
+#include "Engine/AssetsManager.h"
 
 #include "UIGuilds.h"
 #include "UIPartyCreation.h"
@@ -44,6 +45,10 @@
 BuildingType in_current_building_type; // 00F8B198
 HOUSE_DIALOGUE_MENU dialog_menu_id; // 00F8B19C
 
+
+class Image *_591428_endcap = nullptr;
+
+
 #pragma pack(push, 1)
 struct stru365_travel_info
 {
@@ -321,6 +326,18 @@
 }};
 
 
+static std::array<const char *, 19> _4F03B8_shop_background_names =
+{
+    {
+        "",         "WEPNTABL", "ARMORY",   "MAGSHELF",
+        "MAGSHELF", "MAGSHELF", "MAGSHELF", "MAGSHELF",
+        "MAGSHELF", "MAGSHELF", "MAGSHELF", "MAGSHELF",
+        "MAGSHELF", "MAGSHELF", "MAGSHELF", "MAGSHELF",
+        "MAGSHELF", "MAGSHELF", "MAGSHELF"
+    }
+};
+
+
 
 //----- (004B3A72) --------------------------------------------------------
 void InitializaDialogueOptions_Tavern(BuildingType type)
@@ -887,10 +904,10 @@
 		v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);
 		pDialogueNPCCount = 0;
 		pTexture_Dialogue_Background = &pIcons_LOD->pTextures[v17];
-        right_panel_loop = right_panel;
+
 		PrepareHouse(uHouseID);
 		v18 = 1;
-        right_panel_loop = right_panel;
+
 		if ( uNumDialogueNPCPortraits == 1 )
 			pDialogueNPCCount = 1;
 		pMediaPlayer->OpenHouseMovie(pAnimatedRooms[uCurrentHouse_Animation].video_name, 1u);
@@ -1047,8 +1064,13 @@
       }
     }
     dialog_menu_id = (HOUSE_DIALOGUE_MENU)uMessageParam;
-    if ( in_current_building_type < BuildingType_19 )
-      ShopTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(off_4F03B8[(int)in_current_building_type], TEXTURE_16BIT_PALETTE)];
+    if (in_current_building_type < BuildingType_19)
+    {
+        wchar_t name[1024];
+        swprintf(name, L"%S", _4F03B8_shop_background_names[(int)in_current_building_type]);
+
+        shop_ui_background = assets->GetImage_16BitColorKey(name, 0x7FF);
+    }
   }
   
   //NEW
@@ -1715,7 +1737,7 @@
         pTextHeight = pFontCreate->CalcTextHeight(current_npc_text, &window, 13, 0) + 7;
       }
       pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight);
-      pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
+      pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - pTextHeight)/480.0f, _591428_endcap);
       window.DrawText(pOutString, 13, 354 - pTextHeight, 0, FitTextInAWindow(current_npc_text, pOutString, &window, 13, 0), 0, 0, 0);
       break;
     }
@@ -2014,7 +2036,7 @@
         pTextHeight = pFontCreate->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0) + 7;
       }
       pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight);
-      pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
+      pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - pTextHeight)/480.0f, _591428_endcap);
       window_SpeakInHouse->DrawText(pOutString, 12, 354 - pTextHeight, 0, FitTextInAWindow(pTmpBuf.data(), pOutString, &dialog_window, 0xCu, 0), 0, 0, 0);
       break;
     }
@@ -2025,7 +2047,7 @@
       dialog_window.uFrameZ = 452;
       pTextHeight = pFontArrus->CalcTextHeight(pTmpBuf.data(), &dialog_window, 12, 0) + 7;
       pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight);
-      pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
+      pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - pTextHeight)/480.0f, _591428_endcap);
       window_SpeakInHouse->DrawText(pFontArrus, 12, 354 - pTextHeight, 0,
                                     FitTextInAWindow(pTmpBuf.data(), pFontArrus, &dialog_window, 0xCu, 0), 0, 0, 0);
       break;
@@ -2905,9 +2927,10 @@
         pRenderer->GetLeather(8, 352 - (pFontArrus->CalcTextHeight(pInString, &house_window, 13, 0) + 7),
            pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight
            - (pFontArrus->CalcTextHeight(pInString, &house_window, 13, 0) + 7));
-        pRenderer->DrawTextureIndexed(8, 347 - (pFontArrus->CalcTextHeight(pInString, &house_window, 13, 0) + 7), pTexture_591428);
-        pDialogueWindow->DrawText(pFontArrus, 13, 354 - (pFontArrus->CalcTextHeight(pInString, &house_window, 13, 0) + 7),
-                                             0, FitTextInAWindow(pInString, pFontArrus, &house_window, 0xDu, 0), 0, 0, 0);
+
+        int h = (pFontArrus->CalcTextHeight(pInString, &house_window, 13, 0) + 7);
+        pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - h)/480.0f, _591428_endcap);
+        pDialogueWindow->DrawText(pFontArrus, 13, 354 - h, 0, FitTextInAWindow(pInString, pFontArrus, &house_window, 0xDu, 0), 0, 0, 0);
       }
     }
   }
@@ -3062,7 +3085,7 @@
       pTextHeight = pFontCreate->CalcTextHeight(current_npc_text, &w, 13, 0) + 7;
     }
     pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight);
-    pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
+    pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - pTextHeight)/480.0f, _591428_endcap);
     house_window.DrawText(pTextFont, 13, 354 - pTextHeight, 0, FitTextInAWindow(current_npc_text, pTextFont, &w, 13, 0), 0, 0, 0);
   }
 }
@@ -3319,10 +3342,10 @@
   if ( pDialogueNPCCount == 0)
     return 0;
 
-  if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL && ShopTexture )
+  if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL && shop_ui_background)
   {
-    ShopTexture->Release();
-    ShopTexture = 0;
+      shop_ui_background->Release();
+      shop_ui_background = nullptr;
   }
 
   switch(dialog_menu_id)
--- a/GUI/UI/UIHouses.h	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/UIHouses.h	Sat Mar 05 16:25:53 2016 +0200
@@ -151,3 +151,7 @@
 extern HOUSE_DIALOGUE_MENU dialog_menu_id; // 00F8B19C
 
 int HouseDialogPressCloseBtn();
+
+
+
+extern class Image *_591428_endcap;
\ No newline at end of file
--- a/GUI/UI/UIMainMenu.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/UIMainMenu.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -94,7 +94,7 @@
                         pY = 337;
                         break;
                     }
-                    pRenderer->DrawTextureIndexed(495, pY, pTexture);
+                    pRenderer->DrawTextureTransparentColorKey(495, pY, pTexture);
                 }
             }
         }
--- a/GUI/UI/UIPartyCreation.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/UIPartyCreation.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -112,8 +112,8 @@
   pRenderer->BeginScene();
   pRenderer->DrawTextureNew(0, 0, main_menu_background);
   uPlayerCreationUI_SkySliderPos = (GetTickCount() % 12800) / 20;
-  pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos, 2, pTexture_MAKESKY);
-  pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos - window->GetWidth(), 2, pTexture_MAKESKY);
+  pRenderer->DrawTextureTransparentColorKey(uPlayerCreationUI_SkySliderPos, 2, pTexture_MAKESKY);
+  pRenderer->DrawTextureTransparentColorKey(uPlayerCreationUI_SkySliderPos - window->GetWidth(), 2, pTexture_MAKESKY);
   pRenderer->DrawTextureIndexedAlpha(0, 0, pTexture_MAKETOP);
 
   uPlayerCreationUI_SelectedCharacter = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) / 7;
--- a/GUI/UI/UIQuickReference.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/UIQuickReference.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -44,7 +44,7 @@
     const char *pText; // eax@38
     int pFontHeight; // [sp+18h] [bp-14h]@1
 
-    pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("quikref", TEXTURE_16BIT_PALETTE));
+    pRenderer->DrawTextureTransparentColorKey(8, 8, pIcons_LOD->LoadTexturePtr("quikref", TEXTURE_16BIT_PALETTE));
     pFontHeight = LOBYTE(pFontArrus->uFontHeight) + 1;
     for (uint i = 0; i < 4; ++i)
     {
--- a/GUI/UI/UIRest.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/UIRest.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -33,7 +33,7 @@
     GUIButton2.uHeight = 37;
     GUIButton2.pParent = pButton_RestUI_WaitUntilDawn->pParent;
     pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
-    pRenderer->DrawTextureIndexed(uFrameX, uFrameY, *((Texture **)ptr_1C + 15));
+    pRenderer->DrawTextureTransparentColorKey(uFrameX, uFrameY, *((Texture **)ptr_1C + 15));
     viewparams->bRedrawGameUI = 1;
     GUIButton2.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, 0, 0); // Rest & Heal 8 hrs / Отдых и лечение 8 часов
     GUIButton2.pParent = 0;
@@ -129,7 +129,7 @@
 
   if ( live_characters )
   {
-    pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_RestUI_restmain));
+    pRenderer->DrawTextureTransparentColorKey(8, 8, pIcons_LOD->GetTexture(uTextureID_RestUI_restmain));
     am_pm_hours = pParty->uCurrentHour;
     dword_506F1C = pGUIWindow_CurrentMenu->pCurrentPosActiveItem;
     if ( (signed int)pParty->uCurrentHour <= 12 )
@@ -139,7 +139,7 @@
     }
     else
       am_pm_hours -= 12;
-    pRenderer->DrawTextureIndexed(16, 26, pTexture_RestUI_CurrentSkyFrame);
+    pRenderer->DrawTextureTransparentColorKey(16, 26, pTexture_RestUI_CurrentSkyFrame);
     if ( pTexture_RestUI_CurrentHourglassFrame )
     {
       pTexture_RestUI_CurrentHourglassFrame->Release();
@@ -158,7 +158,7 @@
 
     sprintf(pTmpBuf.data(), "hglas%03d", hourglass_icon_idx);
     pTexture_RestUI_CurrentHourglassFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf.data(), TEXTURE_16BIT_PALETTE);
-    pRenderer->DrawTextureIndexed(267, 159, pTexture_RestUI_CurrentHourglassFrame);
+    pRenderer->DrawTextureTransparentColorKey(267, 159, pTexture_RestUI_CurrentHourglassFrame);
     memset(&tmp_button, 0, sizeof(GUIButton));
     tmp_button.uX = 24;
     tmp_button.uY = 154;
--- a/GUI/UI/UISaveLoad.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/UISaveLoad.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -5,6 +5,7 @@
 #include <io.h>
 
 #include "Engine/Engine.h"
+#include "Engine/AssetsManager.h"
 #include "Engine/MapInfo.h"
 #include "Engine/Graphics/Render.h"
 #include "Engine/LOD.h"
@@ -21,6 +22,14 @@
 void UI_DrawSaveLoad(bool save);
 
 
+Image *img_save_up = nullptr;
+Image *img_load_up = nullptr;
+Image *img_loadsave = nullptr;
+Image *img_loadsave_saveu = nullptr;
+Image *img_loadsave_loadu = nullptr;
+Image *img_loadsave_x_u = nullptr;
+
+
 GUIWindow_Save::GUIWindow_Save() :
     GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr)
 {
@@ -34,25 +43,26 @@
         pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles;
     memset(&pSavegameUsedSlots, 0, sizeof(pSavegameUsedSlots));
     memset(&pSavegameThumbnails, 0, sizeof(pSavegameThumbnails));
-    uTextureID_loadsave = pIcons_LOD->LoadTexture("loadsave", TEXTURE_16BIT_PALETTE);
-    uTextureID_load_up = pIcons_LOD->LoadTexture("load_up", TEXTURE_16BIT_PALETTE);
-    uTextureID_save_up = pIcons_LOD->LoadTexture("save_up", TEXTURE_16BIT_PALETTE);
-    uTextureID_LS_loadU = pIcons_LOD->LoadTexture("LS_loadU", TEXTURE_16BIT_PALETTE);
-    uTextureID_LS_saveU = pIcons_LOD->LoadTexture("LS_saveU", TEXTURE_16BIT_PALETTE);
-    uTextureID_x_u = pIcons_LOD->LoadTexture("x_u", TEXTURE_16BIT_PALETTE);
-    pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_loadsave));
+    img_loadsave = assets->GetImage_16BitColorKey(L"loadsave", 0x7FF);
+    img_save_up = assets->GetImage_16BitColorKey(L"save_up", 0x7FF);
+    img_load_up = assets->GetImage_16BitColorKey(L"load_up", 0x7FF);
+    img_loadsave_saveu = assets->GetImage_16BitColorKey(L"LS_saveU", 0x7FF);
+    img_loadsave_loadu = assets->GetImage_16BitColorKey(L"LS_loadU", 0x7FF);
+    img_loadsave_x_u = assets->GetImage_16BitColorKey(L"x_u", 0x7FF);
+
+    pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, img_loadsave);
 
     //if (screen == SCREEN_SAVEGAME)
     {
-        pRenderer->DrawTextureIndexed(241, 302, pIcons_LOD->GetTexture(uTextureID_LS_saveU));
-        pRenderer->DrawTextureIndexed(351, 302, pIcons_LOD->GetTexture(uTextureID_x_u));
-        pRenderer->DrawTextureIndexed(18, 141, pIcons_LOD->GetTexture(uTextureID_save_up));
+        pRenderer->DrawTextureAlphaNew(241/640.0f, 302/480.0f, img_loadsave_saveu);
+        pRenderer->DrawTextureAlphaNew(351/640.0f, 302/480.0f, img_loadsave_x_u);
+        pRenderer->DrawTextureAlphaNew(18/640.0f, 141/480.0f, img_save_up);
     }
     /*else
     {
-    pRenderer->DrawTextureIndexed(241, 302, pIcons_LOD->GetTexture(uTextureID_LS_loadU));
-    pRenderer->DrawTextureIndexed(351, 302, pIcons_LOD->GetTexture(uTextureID_x_u));
-    pRenderer->DrawTextureIndexed(18, 141, pIcons_LOD->GetTexture(uTextureID_load_up));
+    pRenderer->DrawTextureTransparentColorKey(241, 302, pIcons_LOD->GetTexture(uTextureID_LS_loadU));
+    pRenderer->DrawTextureTransparentColorKey(351, 302, pIcons_LOD->GetTexture(uTextureID_x_u));
+    pRenderer->DrawTextureTransparentColorKey(18, 141, pIcons_LOD->GetTexture(uTextureID_load_up));
     }*/
 
     //pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, 25, 199, 0, pGlobalTXT_LocalizationStrings[505], 0, 0, 0);//Read...(Чтение...)
@@ -138,26 +148,27 @@
 
     memset(pSavegameUsedSlots.data(), 0, sizeof(pSavegameUsedSlots));
     memset(pSavegameThumbnails.data(), 0, 45 * sizeof(Image *));
-    uTextureID_loadsave = pIcons_LOD->LoadTexture("loadsave", TEXTURE_16BIT_PALETTE);
-    uTextureID_load_up = pIcons_LOD->LoadTexture("load_up", TEXTURE_16BIT_PALETTE);
-    uTextureID_save_up = pIcons_LOD->LoadTexture("save_up", TEXTURE_16BIT_PALETTE);
-    uTextureID_LS_loadU = pIcons_LOD->LoadTexture("LS_loadU", TEXTURE_16BIT_PALETTE);
-    uTextureID_LS_saveU = pIcons_LOD->LoadTexture("LS_saveU", TEXTURE_16BIT_PALETTE);
-    uTextureID_x_u = pIcons_LOD->LoadTexture("x_u", TEXTURE_16BIT_PALETTE);
+    img_loadsave = assets->GetImage_16BitColorKey(L"loadsave", 0x7FF);
+    img_save_up = assets->GetImage_16BitColorKey(L"save_up", 0x7FF);
+    img_load_up = assets->GetImage_16BitColorKey(L"load_up", 0x7FF);
+    img_loadsave_saveu = assets->GetImage_16BitColorKey(L"LS_saveU", 0x7FF);
+    img_loadsave_loadu = assets->GetImage_16BitColorKey(L"LS_loadU", 0x7FF);
+    img_loadsave_x_u = assets->GetImage_16BitColorKey(L"x_u", 0x7FF);
+
     if (ingame)
     {
-        pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_loadsave));
+        pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, img_loadsave);
         if (current_screen_type == SCREEN_SAVEGAME)
         {
-            pRenderer->DrawTextureIndexed(241, 302, pIcons_LOD->GetTexture(uTextureID_LS_saveU));
-            pRenderer->DrawTextureIndexed(18, 141, pIcons_LOD->GetTexture(uTextureID_save_up));
+            pRenderer->DrawTextureAlphaNew(241/640.0f, 302/480.0f, img_loadsave_saveu);
+            pRenderer->DrawTextureAlphaNew(18 / 640.0f, 141 / 480.0f, img_save_up);
         }
         else
         {
-            pRenderer->DrawTextureIndexed(241, 302, pIcons_LOD->GetTexture(uTextureID_LS_loadU));
-            pRenderer->DrawTextureIndexed(18, 141, pIcons_LOD->GetTexture(uTextureID_load_up));
+            pRenderer->DrawTextureAlphaNew(241 / 640.0f, 302 / 480.0f, img_loadsave_loadu);
+            pRenderer->DrawTextureAlphaNew(18 / 640.0f, 141 / 480.0f, img_load_up);
         }
-        pRenderer->DrawTextureIndexed(351, 302, pIcons_LOD->GetTexture(uTextureID_x_u));
+        pRenderer->DrawTextureAlphaNew(351 / 640.0f, 302 / 480.0f, img_loadsave_x_u);
     }
     else
         pRenderer->DrawTextureNew(0, 0, main_menu_background);
@@ -277,18 +288,18 @@
   pRenderer->BeginScene();
   if ( GetCurrentMenuID() != MENU_SAVELOAD && GetCurrentMenuID() != MENU_LoadingProcInMainMenu )
   {
-    pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_loadsave));
+    pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, img_loadsave);
     if (save)
     {
-      pRenderer->DrawTextureIndexed(241, 302, pIcons_LOD->GetTexture(uTextureID_LS_saveU));
-      pRenderer->DrawTextureIndexed( 18, 139, pIcons_LOD->GetTexture(uTextureID_save_up));
+      pRenderer->DrawTextureAlphaNew(241 / 640.0f, 302 / 480.0f, img_loadsave_saveu);
+      pRenderer->DrawTextureAlphaNew( 18 / 640.0f, 139 / 480.0f, img_save_up);
     }
     else
     {
-      pRenderer->DrawTextureIndexed(241, 302, pIcons_LOD->GetTexture(uTextureID_LS_loadU));
-      pRenderer->DrawTextureIndexed( 18, 139, pIcons_LOD->GetTexture(uTextureID_load_up));
+      pRenderer->DrawTextureAlphaNew(241 / 640.0f, 302 / 480.0f, img_loadsave_loadu);
+      pRenderer->DrawTextureAlphaNew( 18 / 640.0f, 139 / 480.0f, img_load_up);
     }
-    pRenderer->DrawTextureIndexed(351, 302, pIcons_LOD->GetTexture(uTextureID_x_u));
+    pRenderer->DrawTextureAlphaNew(351 / 640.0f, 302 / 480.0f, img_loadsave_x_u);
   }
   if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] )
   {
--- a/GUI/UI/UISaveLoad.h	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/UISaveLoad.h	Sat Mar 05 16:25:53 2016 +0200
@@ -15,4 +15,12 @@
     virtual ~GUIWindow_Load() {}
 
     virtual void Update();
-};
\ No newline at end of file
+};
+
+
+extern class Image *img_save_up;
+extern class Image *img_load_up;
+extern class Image *img_loadsave;
+extern class Image *img_loadsave_saveu;
+extern class Image *img_loadsave_loadu;
+extern class Image *img_loadsave_x_u;
\ No newline at end of file
--- a/GUI/UI/UIShops.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/UIShops.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -24,6 +24,8 @@
 #include "..\../Engine/Graphics/Indoor.h"
 
 
+Image *shop_ui_background = nullptr;
+
 
 //----- (004B910F) --------------------------------------------------------
 void  WeaponShopDialog()
@@ -84,7 +86,7 @@
     }
     case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
     {
-      pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
+      pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, shop_ui_background);
       item_X = 0;
       for ( uint i = 0; i < 6; ++i )
       {
@@ -135,7 +137,7 @@
 
     case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
     {
-      pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
+        pRenderer->DrawTextureAlphaNew(8 / 640.0f, 8 / 480.0f, shop_ui_background);
       item_X = 0;
       for ( uint i = 0; i < 6; ++i )
       {
@@ -410,7 +412,7 @@
 
     case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
     {
-      pRenderer->DrawTextureIndexed(8, 8, ShopTexture);// подложка
+        pRenderer->DrawTextureAlphaNew(8 / 640.0f, 8 / 480.0f, shop_ui_background);
       item_x = 0;
       for ( int i = 0; i < 8; ++i )// разместить вещи
       {
@@ -469,7 +471,7 @@
 
     case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
     {
-      pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
+        pRenderer->DrawTextureAlphaNew(8 / 640.0f, 8 / 480.0f, shop_ui_background);
       item_x = 0;
       for ( int i = 0; i < 8; ++i )
       {
@@ -757,7 +759,7 @@
 
     case HOUSE_DIALOGUE_SHOP_BUY_STANDARD:
     {
-      pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
+        pRenderer->DrawTextureAlphaNew(8 / 640.0f, 8 / 480.0f, shop_ui_background);
       for ( uint i = 0; i < 6; ++i )
       {
         if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID )
@@ -842,7 +844,7 @@
 
     case HOUSE_DIALOGUE_SHOP_BUY_SPECIAL:
     {
-      pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
+        pRenderer->DrawTextureAlphaNew(8 / 640.0f, 8 / 480.0f, shop_ui_background);
       for ( uint i = 0; i < 6; ++i )
       {
         if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID)
@@ -1131,7 +1133,7 @@
 
   if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD)
   {
-    pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
+      pRenderer->DrawTextureAlphaNew(8 / 640.0f, 8 / 480.0f, shop_ui_background);
     for ( uint i = 0; i < 6; ++i )
     {
       if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID)
@@ -1217,7 +1219,7 @@
 
   if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL)
   {
-    pRenderer->DrawTextureIndexed(8, 8, ShopTexture);
+      pRenderer->DrawTextureAlphaNew(8 / 640.0f, 8 / 480.0f, shop_ui_background);
     for ( uint i = 0; i < 6; ++i )
     {
       if ( pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID )
--- a/GUI/UI/UIShops.h	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/UIShops.h	Sat Mar 05 16:25:53 2016 +0200
@@ -4,3 +4,6 @@
 void ShowPopupShopItem();
 void GetHouseGoodbyeSpeech();
 void sub_4B1447_party_fine(int shopId, int stealingResult, int fineToAdd);
+
+
+extern class Image *shop_ui_background;
\ No newline at end of file
--- a/GUI/UI/UITransition.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/UITransition.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -215,11 +215,11 @@
 
   memcpy(&travel_window, pPrimaryWindow, sizeof(travel_window));
   pOutdoor->GetTravelDestination(pParty->vPosition.x, pParty->vPosition.y, pDestinationMapName, 20);
-  pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background);
-  pRenderer->DrawTextureIndexedAlpha(468, 0, right_panel_loop);
-  pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside);
-  pRenderer->DrawTextureIndexed(556, 451, pIcons_LOD->GetTexture(uTextureID_x_x_u));
-  pRenderer->DrawTextureIndexed(476, 451, pIcons_LOD->GetTexture(uTextureID_x_ok_u));
+  pRenderer->DrawTextureTransparentColorKey(477, 0, pTexture_Dialogue_Background);
+  pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_right_panel_frame);
+  pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside);
+  pRenderer->DrawTextureTransparentColorKey(556, 451, pIcons_LOD->GetTexture(uTextureID_x_x_u));
+  pRenderer->DrawTextureTransparentColorKey(476, 451, pIcons_LOD->GetTexture(uTextureID_x_ok_u));
   if ( pMapStats->GetMapInfo(pDestinationMapName) )
   {
     travel_window.uFrameX = 493;
@@ -256,13 +256,13 @@
 
   memcpy(&transition_window, pPrimaryWindow, sizeof(transition_window));
   v9 = IndoorLocation::GetLocationIndex(dword_591164_teleport_map_name);
-  pRenderer->DrawTextureIndexed(0x1DDu, 0, pTexture_Dialogue_Background);
-  pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, pIcons_LOD->GetTexture(uTextureID_50795C));
-  pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside);
-  right_panel_loop = right_panel;
-  pRenderer->DrawTextureIndexedAlpha(468, 0, right_panel);
-  pRenderer->DrawTextureIndexed(556, 451, pIcons_LOD->GetTexture(uTextureID_x_x_u));
-  pRenderer->DrawTextureIndexed(476, 451, pIcons_LOD->GetTexture(uTextureID_x_ok_u));
+  pRenderer->DrawTextureTransparentColorKey(0x1DDu, 0, pTexture_Dialogue_Background);
+  pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, pIcons_LOD->GetTexture(uTextureID_50795C));
+  pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pTexture_outside);
+
+  pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_right_panel_frame);
+  pRenderer->DrawTextureTransparentColorKey(556, 451, pIcons_LOD->GetTexture(uTextureID_x_x_u));
+  pRenderer->DrawTextureTransparentColorKey(476, 451, pIcons_LOD->GetTexture(uTextureID_x_ok_u));
   map_id = pMapStats->GetMapInfo(pCurrentMapName);
   if ( (pMovie_Track || v9) && *dword_591164_teleport_map_name != ' ' )
     map_id = pMapStats->GetMapInfo(dword_591164_teleport_map_name);
--- a/GUI/UI/UiGame.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/GUI/UI/UiGame.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -109,7 +109,7 @@
 {
 // -----------------------------------
 // 004156F0 GUI_UpdateWindows --- part
-    pRenderer->DrawTextureIndexed(
+    pRenderer->DrawTextureTransparentColorKey(
         pViewport->uViewportTL_Y,
         pViewport->uViewportTL_X,
         pIcons_LOD->GetTexture(uTextureID_Options)
@@ -221,10 +221,10 @@
         uGameMenuUI_CurentlySelectedKeyIdx = -1;
         pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE;
     }
-    pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_Optkb[0]));//draw base texture
+    pRenderer->DrawTextureTransparentColorKey(8, 8, pIcons_LOD->GetTexture(uTextureID_Optkb[0]));//draw base texture
     if (KeyboardPageNum == 1)
     {
-        pRenderer->DrawTextureIndexed(19, 302, pIcons_LOD->GetTexture(uTextureID_Optkb[3]));
+        pRenderer->DrawTextureTransparentColorKey(19, 302, pIcons_LOD->GetTexture(uTextureID_Optkb[3]));
 
         pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, ui_gamemenu_keys_action_name_color, "ВПЕРЁД", 0, 0, 0);
         pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, GameMenuUI_GetKeyBindingColor(0), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[0]), 0, 0, 0);
@@ -257,7 +257,7 @@
     }
     else
     {
-        pRenderer->DrawTextureIndexed(127, 302, pIcons_LOD->GetTexture(uTextureID_Optkb[4]));
+        pRenderer->DrawTextureTransparentColorKey(127, 302, pIcons_LOD->GetTexture(uTextureID_Optkb[4]));
 
         pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, ui_gamemenu_keys_action_name_color, "Б. СПРАВКА", 0, 0, 0);
         pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, GameMenuUI_GetKeyBindingColor(14), pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[14]), 0, 0, 0);
@@ -345,10 +345,10 @@
 // 004156F0 GUI_UpdateWindows --- part
     GUIWindow msg_window; // [sp+8h] [bp-54h]@3
 
-    pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(optvid_base_texture_id));//draw base texture
+    pRenderer->DrawTextureTransparentColorKey(8, 8, pIcons_LOD->GetTexture(optvid_base_texture_id));//draw base texture
     //if ( !pRenderer->bWindowMode && pRenderer->IsGammaSupported() )
     {
-        pRenderer->DrawTextureIndexed(17 * uGammaPos + 42, 162, pIcons_LOD->GetTexture(pTextureIDs_GammaPositions[uGammaPos]));
+        pRenderer->DrawTextureTransparentColorKey(17 * uGammaPos + 42, 162, pIcons_LOD->GetTexture(pTextureIDs_GammaPositions[uGammaPos]));
         pRenderer->DrawTextureNew(274/640.0f, 169/480.0f, gamma_preview_image);
         msg_window.uFrameX = 22;
         msg_window.uFrameY = 190;
@@ -361,18 +361,18 @@
 
     /*if (!pRenderer->pRenderD3D)
     {
-    pRenderer->DrawTextureIndexed(20, 281, pIcons_LOD->GetTexture(not_available_bloodsplats_texture_id));
-    pRenderer->DrawTextureIndexed(20, 303, pIcons_LOD->GetTexture(not_available_us_colored_lights_texture_id));
-    pRenderer->DrawTextureIndexed(20, 325, pIcons_LOD->GetTexture(not_available_tinting_texture_id));
+    pRenderer->DrawTextureTransparentColorKey(20, 281, pIcons_LOD->GetTexture(not_available_bloodsplats_texture_id));
+    pRenderer->DrawTextureTransparentColorKey(20, 303, pIcons_LOD->GetTexture(not_available_us_colored_lights_texture_id));
+    pRenderer->DrawTextureTransparentColorKey(20, 325, pIcons_LOD->GetTexture(not_available_tinting_texture_id));
     }
     else*/
   {
       if (pEngine->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS)
-          pRenderer->DrawTextureIndexed(20, 281, pIcons_LOD->GetTexture(bloodsplats_texture_id));
+          pRenderer->DrawTextureTransparentColorKey(20, 281, pIcons_LOD->GetTexture(bloodsplats_texture_id));
       if (pRenderer->bUseColoredLights)
-          pRenderer->DrawTextureIndexed(20, 303, pIcons_LOD->GetTexture(us_colored_lights_texture_id));
+          pRenderer->DrawTextureTransparentColorKey(20, 303, pIcons_LOD->GetTexture(us_colored_lights_texture_id));
       if (pRenderer->bTinting)
-          pRenderer->DrawTextureIndexed(20, 325, pIcons_LOD->GetTexture(tinting_texture_id));
+          pRenderer->DrawTextureTransparentColorKey(20, 325, pIcons_LOD->GetTexture(tinting_texture_id));
   }
 }
 
@@ -509,24 +509,24 @@
 {
 // -----------------------------------
 // 004156F0 GUI_UpdateWindows --- part
-    pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_Options));
-    pRenderer->DrawTextureIndexed(8, 132, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_Background));
+    pRenderer->DrawTextureTransparentColorKey(8, 8, pIcons_LOD->GetTexture(uTextureID_Options));
+    pRenderer->DrawTextureTransparentColorKey(8, 132, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_Background));
 
     switch (uTurnSpeed)
     {
-        case 64:   pRenderer->DrawTextureIndexed(BtnTurnCoord[1], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])); break;
-        case 128:  pRenderer->DrawTextureIndexed(BtnTurnCoord[2], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])); break;
-        default:   pRenderer->DrawTextureIndexed(BtnTurnCoord[0], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])); break;
+        case 64:   pRenderer->DrawTextureTransparentColorKey(BtnTurnCoord[1], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])); break;
+        case 128:  pRenderer->DrawTextureTransparentColorKey(BtnTurnCoord[2], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])); break;
+        default:   pRenderer->DrawTextureTransparentColorKey(BtnTurnCoord[0], 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])); break;
     }
 
-    if (bWalkSound)  pRenderer->DrawTextureIndexed(20, 303, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound));
-    if (bShowDamage) pRenderer->DrawTextureIndexed(128, 303, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage));
-    if (bFlipOnExit) pRenderer->DrawTextureIndexed(128, 325, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit));
-    if (bAlwaysRun)  pRenderer->DrawTextureIndexed(20, 325, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun));
+    if (bWalkSound)  pRenderer->DrawTextureTransparentColorKey(20, 303, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound));
+    if (bShowDamage) pRenderer->DrawTextureTransparentColorKey(128, 303, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage));
+    if (bFlipOnExit) pRenderer->DrawTextureTransparentColorKey(128, 325, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit));
+    if (bAlwaysRun)  pRenderer->DrawTextureTransparentColorKey(20, 325, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun));
 
-    pRenderer->DrawTextureIndexed(265 + 17 * uSoundVolumeMultiplier, 162, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uSoundVolumeMultiplier]));
-    pRenderer->DrawTextureIndexed(265 + 17 * uMusicVolimeMultiplier, 216, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uMusicVolimeMultiplier]));
-    pRenderer->DrawTextureIndexed(265 + 17 * uVoicesVolumeMultiplier, 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uVoicesVolumeMultiplier]));
+    pRenderer->DrawTextureTransparentColorKey(265 + 17 * uSoundVolumeMultiplier, 162, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uSoundVolumeMultiplier]));
+    pRenderer->DrawTextureTransparentColorKey(265 + 17 * uMusicVolimeMultiplier, 216, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uMusicVolimeMultiplier]));
+    pRenderer->DrawTextureTransparentColorKey(265 + 17 * uVoicesVolumeMultiplier, 270, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_SoundLevels[uVoicesVolumeMultiplier]));
 }
 
 
@@ -718,7 +718,7 @@
         popup_window.uFrameZ = popup_window.uFrameX + 399;
         popup_window.DrawMessageBox(0);
         sprintfex(pTmpBuf2.data(), "NPC%03d", pNPC->uPortraitID);
-        pRenderer->DrawTextureIndexed(popup_window.uFrameX + 22, popup_window.uFrameY + 36,
+        pRenderer->DrawTextureTransparentColorKey(popup_window.uFrameX + 22, popup_window.uFrameY + 36,
             (Texture *)(pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE) != -1
             ? &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE)] : 0));
         if ( pNPC->uProfession )
@@ -774,7 +774,7 @@
   v9 = 0;
   pDialogueNPCPortraits[0] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE);
   dword_591084 = areWeLoadingTexture;
-  right_panel_loop = right_panel;
+
   if ( !pNPCInfo->Hired() && pNPCInfo->Location2D >= 0 )
   {
     if ( (signed int)pParty->GetPartyFame() <= pNPCInfo->fame
@@ -871,10 +871,10 @@
   pGreetType = GetGreetType(sDialogue_SpeakingActorNPC_ID);
   window.uFrameWidth -= 10;
   window.uFrameZ -= 10;
-  pRenderer->DrawTextureIndexed(477, 0, pTexture_Dialogue_Background);
-  pRenderer->DrawTextureIndexedAlpha(468, 0, right_panel_loop);
-  pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0));
-  pRenderer->DrawTextureIndexed(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[0]);
+  pRenderer->DrawTextureTransparentColorKey(477, 0, pTexture_Dialogue_Background);
+  pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_right_panel_frame);
+  pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0] - 4, pNPCPortraits_y[0][0] - 4, (Texture *)(uTextureID_50795C != -1 ? &pIcons_LOD->pTextures[uTextureID_50795C] : 0));
+  pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[0]);
 
   if (pNPC->uProfession)
   {
@@ -966,7 +966,7 @@
     }
     if (uTextureID_Leather != -1)
       pRenderer->GetLeather(8, 352 - pTextHeight, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - pTextHeight);
-    pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
+    pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - pTextHeight)/480.0f, _591428_endcap);
     pDialogueWindow->DrawText(font, 13, 354 - pTextHeight, 0, FitTextInAWindow(pInString, font,  &window, 13, 0), 0, 0, 0);
   }
   // Right panel(Правая панель)------- 
@@ -1126,7 +1126,7 @@
       window.DrawTitleText(pFontArrus, 0, pButton->uY, pTextColor, pButton->pButtonName, 3);
     }
   }
-  pRenderer->DrawTextureIndexed(471, 445, pIcons_LOD->GetTexture(uExitCancelTextureId));
+  pRenderer->DrawTextureAlphaNew(471/640.0f, 445/480.0f, ui_exit_cancel_button_background);
 }
 
 //----- (00444FBE) --------------------------------------------------------
@@ -1149,7 +1149,7 @@
     pTextHeight = pFontCreate->CalcTextHeight(byte_5B0938.data(), &BranchlessDlg_window, 12, 0) + 7;
   }
   pRenderer->GetLeather(8, 352 - pTextHeight, pIcons_LOD->GetTexture(uTextureID_Leather), pIcons_LOD->GetTexture(uTextureID_Leather)->uTextureHeight - pTextHeight);
-  pRenderer->DrawTextureIndexed(8, 347 - pTextHeight, pTexture_591428);
+  pRenderer->DrawTextureAlphaNew(8/640.0f, (347 - pTextHeight)/480.0f, _591428_endcap);
   pGUIWindow2->DrawText(pFont, 12, 354 - pTextHeight, 0, FitTextInAWindow(byte_5B0938.data(), pFont, &BranchlessDlg_window, 12, 0), 0, 0, 0);
   pRenderer->DrawTextureNew(0, 352/480.0f, game_ui_statusbar);
   if ( pGUIWindow2->receives_keyboard_input_2 != WINDOW_INPUT_IN_PROGRESS)
@@ -1411,7 +1411,7 @@
       {
         pRenderer->SetUIClipRect(v17 + pHealthBarPos[i], (signed __int64)((1.0 - v3) * pTextureHealth->uTextureHeight) + 402,
                                           v17 + pHealthBarPos[i] + pTextureHealth->uTextureWidth, pTextureHealth->uTextureHeight + 402);
-        pRenderer->DrawTextureIndexed(v17 + pHealthBarPos[i], 402, pTextureHealth);
+        pRenderer->DrawTextureTransparentColorKey(v17 + pHealthBarPos[i], 402, pTextureHealth);
         pRenderer->ResetUIClipRect();
       }
     }
@@ -1425,7 +1425,7 @@
         v17 = 1;
       pRenderer->SetUIClipRect(v17 + pManaBarPos[i], (signed __int64)((1.0 - v7) * pTextureMana->uTextureHeight) + 402,
                                     v17 + pManaBarPos[i] + pTextureMana->uTextureWidth, pTextureMana->uTextureHeight + 402);
-      pRenderer->DrawTextureIndexed(v17 + pManaBarPos[i], 402, pTextureMana);
+      pRenderer->DrawTextureTransparentColorKey(v17 + pManaBarPos[i], 402, pTextureMana);
       pRenderer->ResetUIClipRect();
     }
   }
@@ -1434,7 +1434,7 @@
 //----- (0041B3B6) --------------------------------------------------------
 void GameUI_DrawRightPanel()
 {
-  pRenderer->DrawTextureIndexedAlpha(pViewport->uViewportBR_X, 0, right_panel);
+  pRenderer->DrawTextureAlphaNew(pViewport->uViewportBR_X/640.0f, 0, game_ui_right_panel_frame);
 }
 
 //----- (0041B3E2) --------------------------------------------------------
@@ -1930,7 +1930,7 @@
       else
         spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID);
       //if ( pRenderer->pRenderD3D )
-        pRenderer->DrawTextureIndexed(8, 8, spell_texture);
+        pRenderer->DrawTextureTransparentColorKey(8, 8, spell_texture);
       /*else
         pRenderer->DrawTextureIndexedAlpha(8, 8, v7);*/
     }
@@ -1941,7 +1941,7 @@
       else
         spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID);
       //if ( pRenderer->pRenderD3D )
-        pRenderer->DrawTextureIndexed(396, 8, spell_texture);
+        pRenderer->DrawTextureTransparentColorKey(396, 8, spell_texture);
       /*else
         pRenderer->DrawTextureIndexedAlpha(396, 8, v9);*/
     }
@@ -1949,13 +1949,13 @@
   for (uint i = 0; i < 4; ++i)
   {
     if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime )
-      pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 427, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Hammerhands));
+      pRenderer->DrawTextureTransparentColorKey(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 427, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Hammerhands));
     if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime )
-      pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 393, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Bless));
+      pRenderer->DrawTextureTransparentColorKey(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 393, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Bless));
     if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime )
-      pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation));
+      pRenderer->DrawTextureTransparentColorKey(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation));
     if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime )
-      pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection));
+      pRenderer->DrawTextureTransparentColorKey(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection));
   }
 }
 
@@ -2400,7 +2400,7 @@
   }
   pRenderer->DrawTextureIndexedAlpha(468, 0, minimap_loop);
   pRenderer->SetUIClipRect(541, 0, 567, 480);
-  pRenderer->DrawTextureIndexed(floorf(((double)pParty->sRotationY * 0.1171875) + 0.5f) + 285, 136, _5079B4_compass);
+  pRenderer->DrawTextureTransparentColorKey(floorf(((double)pParty->sRotationY * 0.1171875) + 0.5f) + 285, 136, _5079B4_compass);
   pRenderer->ResetUIClipRect();
 }
 
@@ -2469,13 +2469,13 @@
       if ( (unsigned __int8)pTmpBuf[i] >= 2 )
       {
         sprintf(pContainer, "NPC%03d", pNPCStats->pNPCData[(unsigned __int8)pTmpBuf[i] + 499].uPortraitID);
-        pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
+        pRenderer->DrawTextureTransparentColorKey(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
                       pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)));
       }
       else
       {
         sprintf(pContainer, "NPC%03d", pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].uPortraitID);
-        pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
+        pRenderer->DrawTextureTransparentColorKey(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
                    pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)));
         if ( pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].evt_A == 1 )
         {
--- a/Media/MediaPlayer.cpp	Sat Mar 05 01:51:54 2016 +0200
+++ b/Media/MediaPlayer.cpp	Sat Mar 05 16:25:53 2016 +0200
@@ -1349,10 +1349,6 @@
 //----- (004BF794) --------------------------------------------------------
 void MPlayer::ShowMM7IntroVideo_and_LoadingScreen()
 {
-  //RGBTexture tex; // [sp+Ch] [bp-30h]@1
-  unsigned int uTrackStartMS; // [sp+34h] [bp-8h]@8
-  unsigned int uTrackEndMS; // [sp+38h] [bp-4h]@8
-
   pMediaPlayer->bStopBeforeSchedule = false;
 //  pMediaPlayer->pResetflag = 0;
   bGameoverLoop = true;