comparison GUI/UI/UIMainMenu.cpp @ 2575:a76d408c5132 tip

DrawTranslucent -> DrawTextureGrayShade Removed old texture drawing stuff
author a.parshin
date Wed, 09 Mar 2016 01:39:52 +0200
parents dd36326a9994
children
comparison
equal deleted inserted replaced
2574:dd36326a9994 2575:a76d408c5132
65 GUIWindow *pWindow = this;//pWindow_MainMenu; 65 GUIWindow *pWindow = this;//pWindow_MainMenu;
66 //if (GetCurrentMenuID() == MENU_SAVELOAD) 66 //if (GetCurrentMenuID() == MENU_SAVELOAD)
67 // pWindow = pGUIWindow_CurrentMenu; 67 // pWindow = pGUIWindow_CurrentMenu;
68 68
69 69
70 static bool b = false;
71 if (!b)
72 {
73 pUIAnim_Food->icon = pIconsFrameTable->GetIcon("torchA");
74 pIconsFrameTable->InitializeAnimation(pUIAnim_Food->icon->id);
75 b = true;
76 }
77
78 auto icon = pIconsFrameTable->GetFrame(pUIAnim_Food->icon->id, GetTickCount()/2);
79 pRenderer->DrawTextureAlphaNew(64 / 640.0f, 48 / 480.0f, icon->texture);
80
81
70 if (GetCurrentMenuID() == MENU_MAIN) 82 if (GetCurrentMenuID() == MENU_MAIN)
71 { 83 {
72 Texture_MM7 *pTexture = nullptr; 84 Image *pTexture = nullptr;
73 if (!pModalWindow)// ??? 85 if (!pModalWindow)// ???
74 { 86 {
75 auto pButton = pWindow->pControlsHead; 87 auto pButton = pWindow->pControlsHead;
76 for (pButton = pWindow->pControlsHead; pButton; pButton = pButton->pNext) 88 for (pButton = pWindow->pControlsHead; pButton; pButton = pButton->pNext)
77 { 89 {
82 auto pControlParam = pButton->msg_param; 94 auto pControlParam = pButton->msg_param;
83 int pY = 0; 95 int pY = 0;
84 switch (pControlParam) // backlight for buttons 96 switch (pControlParam) // backlight for buttons
85 { 97 {
86 case 0: 98 case 0:
87 pTexture = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE); 99 pTexture = assets->GetImage_16BitColorKey("title_new", 0x7FF);
88 pY = 172; 100 pY = 172;
89 break; 101 break;
90 case 1: 102 case 1:
91 pTexture = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE); 103 pTexture = assets->GetImage_16BitColorKey("title_load", 0x7FF);
92 pY = 227; 104 pY = 227;
93 break; 105 break;
94 case 2: 106 case 2:
95 pTexture = pIcons_LOD->LoadTexturePtr("title_cred", TEXTURE_16BIT_PALETTE); 107 pTexture = assets->GetImage_16BitColorKey("title_cred", 0x7FF);
96 pY = 282; 108 pY = 282;
97 break; 109 break;
98 case 3: 110 case 3:
99 pTexture = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE); 111 pTexture = assets->GetImage_16BitColorKey("title_exit", 0x7FF);
100 pY = 337; 112 pY = 337;
101 break; 113 break;
102 } 114 }
103 pRenderer->DrawTextureTransparentColorKey(495, pY, pTexture); 115 pRenderer->DrawTextureAlphaNew(495/640.0f, pY/480.0f, pTexture);
104 } 116 }
105 } 117 }
106 } 118 }
107 } 119 }
108 } 120 }