Mercurial > mm7
diff GUI/UI/UiGame.cpp @ 2574:dd36326a9994
More texture refactoring
GetLeather -> DrawTextureCustomHeight
author | a.parshin |
---|---|
date | Mon, 07 Mar 2016 03:48:40 +0200 |
parents | 0c67be4ec900 |
children | a76d408c5132 |
line wrap: on
line diff
--- a/GUI/UI/UiGame.cpp Sat Mar 05 16:25:53 2016 +0200 +++ b/GUI/UI/UiGame.cpp Mon Mar 07 03:48:40 2016 +0200 @@ -4,6 +4,7 @@ #include <crtdbg.h> #include "Engine/Engine.h" +#include "Engine/AssetsManager.h" #include "Engine/Events.h" #include "Engine/Graphics/Texture.h" #include "Engine/Graphics/Vis.h" @@ -52,54 +53,106 @@ Image *game_ui_leftframe = nullptr; Image *game_ui_bottomframe = nullptr; +Image *game_ui_monster_hp_green = nullptr; +Image *game_ui_monster_hp_yellow = nullptr; +Image *game_ui_monster_hp_red = nullptr; +Image *game_ui_monster_hp_background = nullptr; +Image *game_ui_monster_hp_border_left = nullptr; +Image *game_ui_monster_hp_border_right = nullptr; + +Image *game_ui_bar_red = nullptr; +Image *game_ui_bar_yellow = nullptr; +Image *game_ui_bar_green = nullptr; +Image *game_ui_bar_blue = nullptr; + +Image *game_ui_player_alert_yellow = nullptr; // 5079C8 +Image *game_ui_player_alert_red = nullptr; // 5079CC +Image *game_ui_player_alert_green = nullptr; // 5079D0 + +Image *game_ui_minimap_frame = nullptr; // 5079D8 +Image *game_ui_minimap_compass = nullptr; // 5079B4 +std::array<Image *, 8> game_ui_minimap_dirs; + +Image *game_ui_menu_quit = nullptr; +Image *game_ui_menu_resume = nullptr; +Image *game_ui_menu_controls = nullptr; +Image *game_ui_menu_save = nullptr; +Image *game_ui_menu_load = nullptr; +Image *game_ui_menu_new = nullptr; +Image *game_ui_menu_options = nullptr; + +Image *game_ui_tome_storyline = nullptr; +Image *game_ui_tome_calendar = nullptr; +Image *game_ui_tome_maps = nullptr; +Image *game_ui_tome_autonotes = nullptr; +Image *game_ui_tome_quests = nullptr; + +Image *game_ui_btn_rest = nullptr; +Image *game_ui_btn_cast = nullptr; +Image *game_ui_btn_zoomin = nullptr; +Image *game_ui_btn_zoomout = nullptr; +Image *game_ui_btn_quickref = nullptr; +Image *game_ui_btn_settings = nullptr; + +Image *game_ui_dialogue_background = nullptr; + +Image *game_ui_menu_options_video_background = nullptr; +Image *game_ui_menu_options_video_bloodsplats = nullptr; +Image *game_ui_menu_options_video_coloredlights = nullptr; +Image *game_ui_menu_options_video_tinting = nullptr; +std::array<Image *, 10> game_ui_menu_options_video_gamma_positions; +std::array<Image *, 5> game_ui_options_controls; + +Image *game_ui_evtnpc = nullptr; // 50795C + GUIWindow_GameMenu::GUIWindow_GameMenu() : GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr) { // ----------------------- // GameMenuUI_Load -- part - uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE); - uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE); - uTextureID_Load1 = pIcons_LOD->LoadTexture("load1", TEXTURE_16BIT_PALETTE); - uTextureID_Save1 = pIcons_LOD->LoadTexture("save1", TEXTURE_16BIT_PALETTE); - uTextureID_Controls1 = pIcons_LOD->LoadTexture("controls1", TEXTURE_16BIT_PALETTE); - uTextureID_Resume1 = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE); - uTextureID_Quit1 = pIcons_LOD->LoadTexture("quit1", TEXTURE_16BIT_PALETTE); + game_ui_menu_options = assets->GetImage_16BitAlpha(L"options"); + game_ui_menu_new = assets->GetImage_16BitAlpha(L"new1"); + game_ui_menu_load = assets->GetImage_16BitAlpha(L"load1"); + game_ui_menu_save = assets->GetImage_16BitAlpha(L"save1"); + game_ui_menu_controls = assets->GetImage_16BitAlpha(L"controls1"); + game_ui_menu_resume = assets->GetImage_16BitAlpha(L"resume1"); + game_ui_menu_quit = assets->GetImage_16BitAlpha(L"quit1"); pBtn_NewGame = CreateButton( 0x13u, 0x9Bu, 0xD6u, 0x28u, 1, 0, UIMSG_StartNewGame, 0, 0x4Eu, pGlobalTXT_LocalizationStrings[614],// "New Game" - pIcons_LOD->GetTexture(uTextureID_New1), + game_ui_menu_new, 0 ); pBtn_SaveGame = CreateButton( 0x13u, 0xD1u, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenSaveGameDialog, 0, 0x53u, pGlobalTXT_LocalizationStrings[615],// "Save Game" - pIcons_LOD->GetTexture(uTextureID_Save1), + game_ui_menu_save, 0 ); pBtn_LoadGame = CreateButton( 19, 263, 0xD6u, 0x28u, 1, 0, UIMSG_Game_OpenLoadGameDialog, 0, 0x4Cu, pGlobalTXT_LocalizationStrings[616],// "Load Game" - pIcons_LOD->GetTexture(uTextureID_Load1), + game_ui_menu_load, 0 ); pBtn_GameControls = CreateButton( 241, 155, 214, 40, 1, 0, UIMSG_Game_OpenOptionsDialog, 0, 0x43u, pGlobalTXT_LocalizationStrings[617],// ""Sound, Keyboard, Game Options:"" - pIcons_LOD->GetTexture(uTextureID_Controls1), + game_ui_menu_controls, 0 ); pBtn_QuitGame = CreateButton( 241, 209, 214, 40, 1, 0, UIMSG_Quit, 0, 0x51u, pGlobalTXT_LocalizationStrings[618],// "Quit" - pIcons_LOD->GetTexture(uTextureID_Quit1), + game_ui_menu_quit, 0 ); pBtn_Resume = CreateButton( 241, 263, 214, 40, 1, 0, UIMSG_GameMenu_ReturnToGame, 0, 0x52u, pGlobalTXT_LocalizationStrings[619],// "Return to Game" - pIcons_LOD->GetTexture(uTextureID_Resume1), + game_ui_menu_resume, 0 ); _41D08F_set_keyboard_control_group(6, 1, 0, 0); @@ -109,12 +162,13 @@ { // ----------------------------------- // 004156F0 GUI_UpdateWindows --- part - pRenderer->DrawTextureTransparentColorKey( - pViewport->uViewportTL_Y, - pViewport->uViewportTL_X, - pIcons_LOD->GetTexture(uTextureID_Options) + pRenderer->DrawTextureAlphaNew( + pViewport->uViewportTL_X/640.0f, + pViewport->uViewportTL_Y/480.0f, + game_ui_menu_options ); - viewparams->bRedrawGameUI = 1; + + viewparams->bRedrawGameUI = true; } @@ -156,11 +210,11 @@ { // ------------------------------------------ // GameMenuUI_OptionsKeymapping_Load --- part - uTextureID_Optkb[0] = pIcons_LOD->LoadTexture("optkb", TEXTURE_16BIT_PALETTE); - uTextureID_Optkb[1] = pIcons_LOD->LoadTexture("optkb_h", TEXTURE_16BIT_PALETTE); - uTextureID_Optkb[2] = pIcons_LOD->LoadTexture("resume1", TEXTURE_16BIT_PALETTE); - uTextureID_Optkb[3] = pIcons_LOD->LoadTexture("optkb_1", TEXTURE_16BIT_PALETTE); - uTextureID_Optkb[4] = pIcons_LOD->LoadTexture("optkb_2", TEXTURE_16BIT_PALETTE); + game_ui_options_controls[0] = assets->GetImage_16BitColorKey(L"optkb", 0x7FF); + game_ui_options_controls[1] = assets->GetImage_16BitColorKey(L"optkb_h", 0x7FF); + game_ui_options_controls[2] = assets->GetImage_16BitColorKey(L"resume1", 0x7FF); + game_ui_options_controls[3] = assets->GetImage_16BitColorKey(L"optkb_1", 0x7FF); + game_ui_options_controls[4] = assets->GetImage_16BitColorKey(L"optkb_2", 0x7FF); CreateButton(241, 302, 214, 40, 1, 0, UIMSG_Escape, 0, 0, "", 0); @@ -221,10 +275,10 @@ uGameMenuUI_CurentlySelectedKeyIdx = -1; pGUIWindow_CurrentMenu->receives_keyboard_input_2 = WINDOW_INPUT_NONE; } - pRenderer->DrawTextureTransparentColorKey(8, 8, pIcons_LOD->GetTexture(uTextureID_Optkb[0]));//draw base texture + pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, game_ui_options_controls[0]);//draw base texture if (KeyboardPageNum == 1) { - pRenderer->DrawTextureTransparentColorKey(19, 302, pIcons_LOD->GetTexture(uTextureID_Optkb[3])); + pRenderer->DrawTextureAlphaNew(19/640.0f, 302/480.0f, game_ui_options_controls[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 +311,7 @@ } else { - pRenderer->DrawTextureTransparentColorKey(127, 302, pIcons_LOD->GetTexture(uTextureID_Optkb[4])); + pRenderer->DrawTextureAlphaNew(127/640.0f, 302/480.0f, game_ui_options_controls[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); @@ -297,25 +351,24 @@ { // ------------------------------------- // GameMenuUI_OptionsVideo_Load --- part - optvid_base_texture_id = pIcons_LOD->LoadTexture("optvid", TEXTURE_16BIT_PALETTE); - bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdH-bs", TEXTURE_16BIT_PALETTE); - us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdH-cl", TEXTURE_16BIT_PALETTE); - tinting_texture_id = pIcons_LOD->LoadTexture("opvdH-tn", TEXTURE_16BIT_PALETTE); - uTextureID_507C20 = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE); - uTextureID_507C24 = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE); - pTextureIDs_GammaPositions[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE); - not_available_bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdG-bs", TEXTURE_16BIT_PALETTE); - not_available_us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdG-cl", TEXTURE_16BIT_PALETTE); - not_available_tinting_texture_id = pIcons_LOD->LoadTexture("opvdG-tn", TEXTURE_16BIT_PALETTE); + game_ui_menu_options_video_background = assets->GetImage_16BitColorKey(L"optvid", 0x7FF); + game_ui_menu_options_video_bloodsplats = assets->GetImage_16BitColorKey(L"opvdH-bs", 0x7FF); + game_ui_menu_options_video_coloredlights = assets->GetImage_16BitColorKey(L"opvdH-cl", 0x7FF); + game_ui_menu_options_video_tinting = assets->GetImage_16BitColorKey(L"opvdH-tn", 0x7FF); + + game_ui_menu_options_video_gamma_positions[0] = assets->GetImage_16BitColorKey(L"convol10", 0x7FF); + game_ui_menu_options_video_gamma_positions[1] = assets->GetImage_16BitColorKey(L"convol20", 0x7FF); + game_ui_menu_options_video_gamma_positions[2] = assets->GetImage_16BitColorKey(L"convol30", 0x7FF); + game_ui_menu_options_video_gamma_positions[3] = assets->GetImage_16BitColorKey(L"convol40", 0x7FF); + game_ui_menu_options_video_gamma_positions[4] = assets->GetImage_16BitColorKey(L"convol50", 0x7FF); + game_ui_menu_options_video_gamma_positions[5] = assets->GetImage_16BitColorKey(L"convol60", 0x7FF); + game_ui_menu_options_video_gamma_positions[6] = assets->GetImage_16BitColorKey(L"convol70", 0x7FF); + game_ui_menu_options_video_gamma_positions[7] = assets->GetImage_16BitColorKey(L"convol80", 0x7FF); + game_ui_menu_options_video_gamma_positions[8] = assets->GetImage_16BitColorKey(L"convol90", 0x7FF); + game_ui_menu_options_video_gamma_positions[9] = assets->GetImage_16BitColorKey(L"convol00", 0x7FF); + //not_available_bloodsplats_texture_id = pIcons_LOD->LoadTexture("opvdG-bs", TEXTURE_16BIT_PALETTE); + //not_available_us_colored_lights_texture_id = pIcons_LOD->LoadTexture("opvdG-cl", TEXTURE_16BIT_PALETTE); + //not_available_tinting_texture_id = pIcons_LOD->LoadTexture("opvdG-tn", TEXTURE_16BIT_PALETTE); CreateButton(0xF1u, 0x12Eu, 0xD6u, 0x28u, 1, 0, UIMSG_Escape, 0, 0, "", 0); //if ( pRenderer->pRenderD3D ) @@ -324,16 +377,6 @@ CreateButton(0x13u, 0x12Eu, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleColoredLights, 0, 0, "", 0); CreateButton(0x13u, 0x144u, 0xD6u, 0x12u, 1, 0, UIMSG_ToggleTint, 0, 0, "", 0); } - /*if ( !pRenderer->bWindowMode ) - { - //v0 = 1; - if ( pRenderer->IsGammaSupported() ) - { - pBtn_SliderLeft = pGUIWindow_CurrentMenu->CreateButton(0x15u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 4u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C20), 0); - pBtn_SliderRight = pGUIWindow_CurrentMenu->CreateButton(0xD5u, 0xA1u, 0x10u, 0x10u, 1, 0, UIMSG_1A9, 5u, 0, "", pIcons_LOD->GetTexture(uTextureID_507C24), 0); - pGUIWindow_CurrentMenu->CreateButton(42, 162, 170, 18, 1, 0, UIMSG_1A9, 0, 0, "", 0); - } - }*/ } @@ -345,10 +388,14 @@ // 004156F0 GUI_UpdateWindows --- part GUIWindow msg_window; // [sp+8h] [bp-54h]@3 - pRenderer->DrawTextureTransparentColorKey(8, 8, pIcons_LOD->GetTexture(optvid_base_texture_id));//draw base texture + pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, game_ui_menu_options_video_background);//draw base texture //if ( !pRenderer->bWindowMode && pRenderer->IsGammaSupported() ) { - pRenderer->DrawTextureTransparentColorKey(17 * uGammaPos + 42, 162, pIcons_LOD->GetTexture(pTextureIDs_GammaPositions[uGammaPos])); + pRenderer->DrawTextureAlphaNew( + (17 * uGammaPos + 42)/640.0f, + 162/480.0f, + game_ui_menu_options_video_gamma_positions[uGammaPos]); + pRenderer->DrawTextureNew(274/640.0f, 169/480.0f, gamma_preview_image); msg_window.uFrameX = 22; msg_window.uFrameY = 190; @@ -359,21 +406,13 @@ msg_window.DrawTitleText(pFontSmallnum, 0, 0, ui_gamemenu_video_gamma_title_color, pGlobalTXT_LocalizationStrings[226], 3); // "Gamma controls the relative ""brightness"" of the game. May vary depending on your monitor." } - /*if (!pRenderer->pRenderD3D) - { - 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->DrawTextureTransparentColorKey(20, 281, pIcons_LOD->GetTexture(bloodsplats_texture_id)); + pRenderer->DrawTextureAlphaNew(20/640.0f, 281/480.0f, game_ui_menu_options_video_bloodsplats); if (pRenderer->bUseColoredLights) - pRenderer->DrawTextureTransparentColorKey(20, 303, pIcons_LOD->GetTexture(us_colored_lights_texture_id)); + pRenderer->DrawTextureAlphaNew(20/640.0f, 303/480.0f, game_ui_menu_options_video_coloredlights); if (pRenderer->bTinting) - pRenderer->DrawTextureTransparentColorKey(20, 325, pIcons_LOD->GetTexture(tinting_texture_id)); - } + pRenderer->DrawTextureAlphaNew(20/640.0f, 325/480.0f, game_ui_menu_options_video_tinting); } @@ -406,11 +445,13 @@ void OptionsMenuSkin::Relaease() { -#define RELEASE(id) \ +#define RELEASE(img) \ {\ - if (id)\ - pIcons_LOD->GetTexture(id)->Release();\ - id = 0;\ + if (img)\ + {\ + img->Release(); \ + img = nullptr; \ + }\ } RELEASE(uTextureID_Background); @@ -433,67 +474,67 @@ GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr) { // GameMenuUI_Options_Load -- part - options_menu_skin.uTextureID_Background = pIcons_LOD->LoadTexture("ControlBG", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_TurnSpeed[2] = pIcons_LOD->LoadTexture("con_16x", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_TurnSpeed[1] = pIcons_LOD->LoadTexture("con_32x", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_TurnSpeed[0] = pIcons_LOD->LoadTexture("con_Smoo", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_ArrowLeft = pIcons_LOD->LoadTexture("con_ArrL", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_ArrowRight = pIcons_LOD->LoadTexture("con_ArrR", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[0] = pIcons_LOD->LoadTexture("convol10", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[1] = pIcons_LOD->LoadTexture("convol20", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[2] = pIcons_LOD->LoadTexture("convol30", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[3] = pIcons_LOD->LoadTexture("convol40", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[4] = pIcons_LOD->LoadTexture("convol50", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[5] = pIcons_LOD->LoadTexture("convol60", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[6] = pIcons_LOD->LoadTexture("convol70", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[7] = pIcons_LOD->LoadTexture("convol80", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[8] = pIcons_LOD->LoadTexture("convol90", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_SoundLevels[9] = pIcons_LOD->LoadTexture("convol00", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_FlipOnExit = pIcons_LOD->LoadTexture("option04", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_AlwaysRun = pIcons_LOD->LoadTexture("option03", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_ShowDamage = pIcons_LOD->LoadTexture("option02", TEXTURE_16BIT_PALETTE); - options_menu_skin.uTextureID_WalkSound = pIcons_LOD->LoadTexture("option01", TEXTURE_16BIT_PALETTE); + options_menu_skin.uTextureID_Background = assets->GetImage_16BitColorKey(L"ControlBG", 0x7FF); + options_menu_skin.uTextureID_TurnSpeed[2] = assets->GetImage_16BitColorKey(L"con_16x", 0x7FF); + options_menu_skin.uTextureID_TurnSpeed[1] = assets->GetImage_16BitColorKey(L"con_32x", 0x7FF); + options_menu_skin.uTextureID_TurnSpeed[0] = assets->GetImage_16BitColorKey(L"con_Smoo", 0x7FF); + options_menu_skin.uTextureID_ArrowLeft = assets->GetImage_16BitAlpha(L"con_ArrL"); + options_menu_skin.uTextureID_ArrowRight = assets->GetImage_16BitAlpha(L"con_ArrR"); + options_menu_skin.uTextureID_SoundLevels[0] = assets->GetImage_16BitColorKey(L"convol10", 0x7FF); + options_menu_skin.uTextureID_SoundLevels[1] = assets->GetImage_16BitColorKey(L"convol20", 0x7FF); + options_menu_skin.uTextureID_SoundLevels[2] = assets->GetImage_16BitColorKey(L"convol30", 0x7FF); + options_menu_skin.uTextureID_SoundLevels[3] = assets->GetImage_16BitColorKey(L"convol40", 0x7FF); + options_menu_skin.uTextureID_SoundLevels[4] = assets->GetImage_16BitColorKey(L"convol50", 0x7FF); + options_menu_skin.uTextureID_SoundLevels[5] = assets->GetImage_16BitColorKey(L"convol60", 0x7FF); + options_menu_skin.uTextureID_SoundLevels[6] = assets->GetImage_16BitColorKey(L"convol70", 0x7FF); + options_menu_skin.uTextureID_SoundLevels[7] = assets->GetImage_16BitColorKey(L"convol80", 0x7FF); + options_menu_skin.uTextureID_SoundLevels[8] = assets->GetImage_16BitColorKey(L"convol90", 0x7FF); + options_menu_skin.uTextureID_SoundLevels[9] = assets->GetImage_16BitColorKey(L"convol00", 0x7FF); + options_menu_skin.uTextureID_FlipOnExit = assets->GetImage_16BitColorKey(L"option04", 0x7FF); + options_menu_skin.uTextureID_AlwaysRun = assets->GetImage_16BitColorKey(L"option03", 0x7FF); + options_menu_skin.uTextureID_ShowDamage = assets->GetImage_16BitColorKey(L"option02", 0x7FF); + options_menu_skin.uTextureID_WalkSound = assets->GetImage_16BitColorKey(L"option01", 0x7FF); CreateButton(22, 270, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureWidth, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[2])->uTextureHeight, + options_menu_skin.uTextureID_TurnSpeed[2]->GetWidth(), + options_menu_skin.uTextureID_TurnSpeed[2]->GetHeight(), 1, 0, UIMSG_SetTurnSpeed, 0x80, 0, "", 0); CreateButton(93, 270, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureWidth, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[1])->uTextureHeight, + options_menu_skin.uTextureID_TurnSpeed[1]->GetWidth(), + options_menu_skin.uTextureID_TurnSpeed[1]->GetHeight(), 1, 0, UIMSG_SetTurnSpeed, 0x40u, 0, "", 0); CreateButton(164, 270, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureWidth, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_TurnSpeed[0])->uTextureHeight, + options_menu_skin.uTextureID_TurnSpeed[0]->GetWidth(), + options_menu_skin.uTextureID_TurnSpeed[0]->GetHeight(), 1, 0, UIMSG_SetTurnSpeed, 0, 0, "", 0); CreateButton(20, 303, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureWidth, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_WalkSound)->uTextureHeight, + options_menu_skin.uTextureID_WalkSound->GetWidth(), + options_menu_skin.uTextureID_WalkSound->GetHeight(), 1, 0, UIMSG_ToggleWalkSound, 0, 0, "", 0); CreateButton(128, 303, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureWidth, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ShowDamage)->uTextureHeight, + options_menu_skin.uTextureID_ShowDamage->GetWidth(), + options_menu_skin.uTextureID_ShowDamage->GetHeight(), 1, 0, UIMSG_ToggleShowDamage, 0, 0, "", 0); CreateButton(20, 325, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureWidth, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_AlwaysRun)->uTextureHeight, + options_menu_skin.uTextureID_AlwaysRun->GetWidth(), + options_menu_skin.uTextureID_AlwaysRun->GetHeight(), 1, 0, UIMSG_ToggleAlwaysRun, 0, 0, "", 0); CreateButton(128, 325, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureWidth, - pIcons_LOD->GetTexture(options_menu_skin.uTextureID_FlipOnExit)->uTextureHeight, + options_menu_skin.uTextureID_FlipOnExit->GetWidth(), + options_menu_skin.uTextureID_FlipOnExit->GetHeight(), 1, 0, UIMSG_ToggleFlipOnExit, 0, 0, "", 0); - pBtn_SliderLeft = CreateButton(243, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); - pBtn_SliderRight = CreateButton(435, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); + pBtn_SliderLeft = CreateButton(243, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 4, 0, "", options_menu_skin.uTextureID_ArrowLeft, 0); + pBtn_SliderRight = CreateButton(435, 162, 16, 16, 1, 0, UIMSG_ChangeSoundVolume, 5, 0, "", options_menu_skin.uTextureID_ArrowRight, 0); CreateButton(263, 162, 172, 17, 1, 0, UIMSG_ChangeSoundVolume, 0, 0, "", 0); - pBtn_SliderLeft = CreateButton(243, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); - pBtn_SliderRight = CreateButton(435, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); + pBtn_SliderLeft = CreateButton(243, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 4, 0, "", options_menu_skin.uTextureID_ArrowLeft, 0); + pBtn_SliderRight = CreateButton(435, 216, 16, 16, 1, 0, UIMSG_ChangeMusicVolume, 5, 0, "", options_menu_skin.uTextureID_ArrowRight, 0); CreateButton(263, 216, 172, 17, 1, 0, UIMSG_ChangeMusicVolume, 0, 0, "", 0); - pBtn_SliderLeft = CreateButton(243, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 4, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowLeft), 0); - pBtn_SliderRight = CreateButton(435, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 5, 0, "", pIcons_LOD->GetTexture(options_menu_skin.uTextureID_ArrowRight), 0); + pBtn_SliderLeft = CreateButton(243, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 4, 0, "", options_menu_skin.uTextureID_ArrowLeft, 0); + pBtn_SliderRight = CreateButton(435, 270, 16, 16, 1, 0, UIMSG_ChangeVoiceVolume, 5, 0, "", options_menu_skin.uTextureID_ArrowRight, 0); CreateButton(263, 270, 172, 17, 1, 0, UIMSG_ChangeVoiceVolume, 0, 0, "", 0); CreateButton(241, 302, 214, 40, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[619], 0); // "Return to Game" @@ -509,24 +550,24 @@ { // ----------------------------------- // 004156F0 GUI_UpdateWindows --- part - pRenderer->DrawTextureTransparentColorKey(8, 8, pIcons_LOD->GetTexture(uTextureID_Options)); - pRenderer->DrawTextureTransparentColorKey(8, 132, pIcons_LOD->GetTexture(options_menu_skin.uTextureID_Background)); + pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, game_ui_menu_options); + pRenderer->DrawTextureAlphaNew(8/640.0f, 132/480.0f, options_menu_skin.uTextureID_Background); switch (uTurnSpeed) { - 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; + case 64: pRenderer->DrawTextureAlphaNew(BtnTurnCoord[1]/640.0f, 270/480.0f, options_menu_skin.uTextureID_TurnSpeed[1]); break; + case 128: pRenderer->DrawTextureAlphaNew(BtnTurnCoord[2]/640.0f, 270/480.0f, options_menu_skin.uTextureID_TurnSpeed[2]); break; + default: pRenderer->DrawTextureAlphaNew(BtnTurnCoord[0]/640.0f, 270/480.0f, options_menu_skin.uTextureID_TurnSpeed[0]); break; } - 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)); + if (bWalkSound) pRenderer->DrawTextureAlphaNew(20/640.0f, 303/480.0f, options_menu_skin.uTextureID_WalkSound); + if (bShowDamage) pRenderer->DrawTextureAlphaNew(128/640.0f, 303/480.0f, options_menu_skin.uTextureID_ShowDamage); + if (bFlipOnExit) pRenderer->DrawTextureAlphaNew(128/640.0f, 325/480.0f, options_menu_skin.uTextureID_FlipOnExit); + if (bAlwaysRun) pRenderer->DrawTextureAlphaNew(20/640.0f, 325/480.0f, options_menu_skin.uTextureID_AlwaysRun); - 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])); + pRenderer->DrawTextureAlphaNew((265 + 17 * uSoundVolumeMultiplier)/640.0f, 162/480.0f, options_menu_skin.uTextureID_SoundLevels[uSoundVolumeMultiplier]); + pRenderer->DrawTextureAlphaNew((265 + 17 * uMusicVolimeMultiplier)/640.0f, 216/480.0f, options_menu_skin.uTextureID_SoundLevels[uMusicVolimeMultiplier]); + pRenderer->DrawTextureAlphaNew((265 + 17 * uVoicesVolumeMultiplier)/640.0f, 270/480.0f, options_menu_skin.uTextureID_SoundLevels[uVoicesVolumeMultiplier]); } @@ -719,7 +760,7 @@ popup_window.DrawMessageBox(0); sprintfex(pTmpBuf2.data(), "NPC%03d", pNPC->uPortraitID); pRenderer->DrawTextureTransparentColorKey(popup_window.uFrameX + 22, popup_window.uFrameY + 36, - (Texture *)(pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE) != -1 + (Texture_MM7 *)(pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE) != -1 ? &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE)] : 0)); if ( pNPC->uProfession ) { @@ -769,7 +810,8 @@ pDialogueNPCCount = 0; uNumDialogueNPCPortraits = 1; - pTexture_Dialogue_Background = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); + + game_ui_dialogue_background = assets->GetImage_16Bit(pContainer); sprintfex(pContainer, "npc%03u", pNPCInfo->uPortraitID); v9 = 0; pDialogueNPCPortraits[0] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); @@ -871,9 +913,9 @@ pGreetType = GetGreetType(sDialogue_SpeakingActorNPC_ID); window.uFrameWidth -= 10; window.uFrameZ -= 10; - pRenderer->DrawTextureTransparentColorKey(477, 0, pTexture_Dialogue_Background); + pRenderer->DrawTextureNew(477/640.0f, 0, game_ui_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->DrawTextureAlphaNew((pNPCPortraits_x[0][0] - 4)/640.0f, (pNPCPortraits_y[0][0] - 4)/480.0f, game_ui_evtnpc); pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[0]); if (pNPC->uProfession) @@ -964,8 +1006,14 @@ font = pFontCreate; pTextHeight = pFontCreate->CalcTextHeight(pInString, &window, 13, 0) + 7; } - if (uTextureID_Leather != -1) - pRenderer->GetLeather(8, 352 - pTextHeight, &pIcons_LOD->pTextures[uTextureID_Leather], pIcons_LOD->pTextures[uTextureID_Leather].uTextureHeight - pTextHeight); + + if (ui_leather_mm7) + pRenderer->DrawTextureCustomHeight( + 8/640.0f, + (352 - pTextHeight)/480.0f, + ui_leather_mm7, + pTextHeight); + 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); } @@ -1148,7 +1196,12 @@ pFont = pFontCreate; 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->DrawTextureCustomHeight( + 8/640.0f, + (352 - pTextHeight)/480.0f, + ui_leather_mm7, + pTextHeight); 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); @@ -1253,7 +1306,7 @@ //----- (0041D3B7) -------------------------------------------------------- void GameUI_CharacterQuickRecord_Draw(GUIWindow *window, Player *player) { - Texture *v13; // eax@6 + Texture_MM7 *v13; // eax@6 PlayerFrame *v15; // eax@12 unsigned int pTextColor; // eax@15 const char *v29; // eax@16 @@ -1353,9 +1406,9 @@ _50697C_book_flasher = !_50697C_book_flasher; if (_50697C_book_flasher && current_screen_type != SCREEN_REST ) { - if (bFlashQuestBook) pRenderer->DrawTextureIndexedAlpha(493, 355, pIcons_LOD->GetTexture(uTextureID_ib_td1_A)); - if (bFlashAutonotesBook) pRenderer->DrawTextureIndexedAlpha(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A)); - if (bFlashHistoryBook) pRenderer->DrawTextureIndexedAlpha(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A)); + if (bFlashQuestBook) pRenderer->DrawTextureAlphaNew(493/640.0f, 355/480.0f, game_ui_tome_quests); + if (bFlashAutonotesBook) pRenderer->DrawTextureAlphaNew(527/640.0f, 353/480.0f, game_ui_tome_autonotes); + if (bFlashHistoryBook) pRenderer->DrawTextureAlphaNew(600/640.0f, 361/480.0f, game_ui_tome_storyline); } else { @@ -1385,10 +1438,7 @@ { double v3; // st7@3 double v7; // st7@25 - Texture *pTextureHealth; // [sp-4h] [bp-30h]@10 - Texture *pTextureMana; // [sp+Ch] [bp-20h]@1 - pTextureMana = pIcons_LOD->GetTexture(uTextureID_BarBlue); for (uint i = 0; i < 4; ++i) { if (pParty->pPlayers[i].sHealth > 0) @@ -1397,21 +1447,25 @@ if (i == 2 || i == 3) v17 = 2; v3 = (double)pParty->pPlayers[i].sHealth / (double)pParty->pPlayers[i].GetMaxHealth(); + + auto pTextureHealth = game_ui_bar_green; if( v3 > 0.5 ) { if ( v3 > 1.0 ) v3 = 1.0; - pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarGreen); } else if ( v3 > 0.25 ) - pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarYellow); + pTextureHealth = game_ui_bar_yellow; else if ( v3 > 0.0 ) - pTextureHealth = pIcons_LOD->GetTexture(uTextureID_BarRed); + pTextureHealth = game_ui_bar_red; if( v3 > 0.0 ) { - pRenderer->SetUIClipRect(v17 + pHealthBarPos[i], (signed __int64)((1.0 - v3) * pTextureHealth->uTextureHeight) + 402, - v17 + pHealthBarPos[i] + pTextureHealth->uTextureWidth, pTextureHealth->uTextureHeight + 402); - pRenderer->DrawTextureTransparentColorKey(v17 + pHealthBarPos[i], 402, pTextureHealth); + pRenderer->SetUIClipRect( + v17 + pHealthBarPos[i], + (signed __int64)((1.0 - v3) * pTextureHealth->GetHeight()) + 402, + v17 + pHealthBarPos[i] + pTextureHealth->GetWidth(), + pTextureHealth->GetHeight() + 402); + pRenderer->DrawTextureAlphaNew((v17 + pHealthBarPos[i])/640.0f, 402/480.0f, pTextureHealth); pRenderer->ResetUIClipRect(); } } @@ -1423,9 +1477,12 @@ int v17 = 0; if (i == 2) v17 = 1; - pRenderer->SetUIClipRect(v17 + pManaBarPos[i], (signed __int64)((1.0 - v7) * pTextureMana->uTextureHeight) + 402, - v17 + pManaBarPos[i] + pTextureMana->uTextureWidth, pTextureMana->uTextureHeight + 402); - pRenderer->DrawTextureTransparentColorKey(v17 + pManaBarPos[i], 402, pTextureMana); + pRenderer->SetUIClipRect( + v17 + pManaBarPos[i], + (signed __int64)((1.0 - v7) * game_ui_bar_blue->GetHeight()) + 402, + v17 + pManaBarPos[i] + game_ui_bar_blue->GetWidth(), + game_ui_bar_blue->GetHeight() + 402); + pRenderer->DrawTextureAlphaNew((v17 + pManaBarPos[i])/640.0f, 402/480.0f, game_ui_bar_blue); pRenderer->ResetUIClipRect(); } } @@ -1902,8 +1959,8 @@ void GameUI_DrawPartySpells() { unsigned int v0; // ebp@1 - Texture *spell_texture; // [sp-4h] [bp-1Ch]@12 - //Texture *v9; // [sp-4h] [bp-1Ch]@21 + Texture_MM7 *spell_texture; // [sp-4h] [bp-1Ch]@12 + //Texture_MM7 *v9; // [sp-4h] [bp-1Ch]@21 v0 = (signed __int64)((double)GetTickCount() * 0.050000001); //v1 = 0; @@ -1912,7 +1969,7 @@ //v2 = byte_4E5DD8[v1]; if (pParty->pPartyBuffs[byte_4E5DD8[i]].uExpireTime) { - Texture* tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]); + Texture_MM7* tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]); //v3 = pTextureIDs_PartyBuffIcons[i]; pRenderer->_4A65CC(pPartySpellbuffsUI_XYs[i][0], pPartySpellbuffsUI_XYs[i][1], tex, tex, @@ -1964,7 +2021,7 @@ { unsigned int face_expression_ID; // eax@17 PlayerFrame *pFrame; // eax@21 - Texture *pPortrait; // [sp-4h] [bp-1Ch]@27 + Texture_MM7 *pPortrait; // [sp-4h] [bp-1Ch]@27 if ( _A750D8_player_speech_timer ) { @@ -2022,7 +2079,7 @@ if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || _this ) { pPlayer->field_1AA2 = pFrame->uTextureID - 1; - pPortrait = (Texture *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture *)pTextures_PlayerFaces[i][pFrame->uTextureID]; + pPortrait = (Texture_MM7 *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture_MM7 *)pTextures_PlayerFaces[i][pFrame->uTextureID]; if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); else @@ -2047,18 +2104,16 @@ if (PID_TYPE(pTurnEngine->pQueue[i].uPackedID) != OBJECT_Player) break; - auto tex = _5079D0_init_g; - if ( pParty->uFlags & 0x10 ) - tex = _5079CC_init_r; - else - { - if ( pParty->uFlags & 0x20 ) - tex = _5079C8_init_y; - } - pRenderer->DrawTextureIndexedAlpha( - pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[PID_ID(pTurnEngine->pQueue[i].uPackedID)] - 4, - 385, - tex + auto alert_texture = game_ui_player_alert_green; + if (pParty->GetRedAlert()) + alert_texture = game_ui_player_alert_red; + else if (pParty->GetYellowAlert()) + alert_texture = game_ui_player_alert_yellow; + + pRenderer->DrawTextureAlphaNew( + (pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[PID_ID(pTurnEngine->pQueue[i].uPackedID)] - 4)/640.0f, + 385/480.0f, + alert_texture ); } } @@ -2071,15 +2126,16 @@ { if (pParty->pPlayers[i].CanAct() && !pParty->pPlayers[i].uTimeToRecovery) { - auto tex = _5079D0_init_g; - if ( pParty->uFlags & 0x10 ) - tex = _5079CC_init_r; - else - { - if ( pParty->uFlags & 0x20 ) - tex = _5079C8_init_y; - } - pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] - 4, 385, tex); + auto alert_texture = game_ui_player_alert_green; + if (pParty->GetRedAlert()) + alert_texture = game_ui_player_alert_red; + else if (pParty->GetYellowAlert()) + alert_texture = game_ui_player_alert_yellow; + + pRenderer->DrawTextureAlphaNew( + (pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] - 4)/640.0f, + 385/480.0f, + alert_texture); } } } @@ -2309,7 +2365,10 @@ arrow_idx = 0; if ( (signed int)rotate < 128 || (signed int)rotate > 1920 ) arrow_idx = 7; - pRenderer->DrawTextureIndexedAlpha(uCenterX - 3, uCenterY - 3, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[arrow_idx]));//ñòðåëêà + pRenderer->DrawTextureAlphaNew( + (uCenterX - 3)/640.0f, + (uCenterY - 3)/480.0f, + game_ui_minimap_dirs[arrow_idx]); //draw objects on the minimap if ( bWizardEyeActive ) @@ -2398,9 +2457,12 @@ } } } - pRenderer->DrawTextureIndexedAlpha(468, 0, minimap_loop); + pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_minimap_frame); pRenderer->SetUIClipRect(541, 0, 567, 480); - pRenderer->DrawTextureTransparentColorKey(floorf(((double)pParty->sRotationY * 0.1171875) + 0.5f) + 285, 136, _5079B4_compass); + pRenderer->DrawTextureAlphaNew( + (floorf(((double)pParty->sRotationY * 0.1171875) + 0.5f) + 285)/640.0f, + 136/480.0f, + game_ui_minimap_compass); pRenderer->ResetUIClipRect(); } @@ -2431,7 +2493,6 @@ } } } -// 4E28F8: using guessed type int current_screen_type; //----- (00491F87) --------------------------------------------------------