Mercurial > mm7
comparison GUI/UI/UiGame.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 |
---|---|
42 #include "GUI/UI/UIGame.h" | 42 #include "GUI/UI/UIGame.h" |
43 #include "GUI/UI/UICharacter.h" | 43 #include "GUI/UI/UICharacter.h" |
44 | 44 |
45 #include "Media/Audio/AudioPlayer.h" | 45 #include "Media/Audio/AudioPlayer.h" |
46 | 46 |
47 int uTextureID_GameUI_CharSelectionFrame; // 50C98C | |
48 | |
49 | 47 |
50 Image *game_ui_statusbar = nullptr; | 48 Image *game_ui_statusbar = nullptr; |
51 Image *game_ui_rightframe = nullptr; | 49 Image *game_ui_rightframe = nullptr; |
52 Image *game_ui_topframe = nullptr; | 50 Image *game_ui_topframe = nullptr; |
53 Image *game_ui_leftframe = nullptr; | 51 Image *game_ui_leftframe = nullptr; |
57 Image *game_ui_monster_hp_yellow = nullptr; | 55 Image *game_ui_monster_hp_yellow = nullptr; |
58 Image *game_ui_monster_hp_red = nullptr; | 56 Image *game_ui_monster_hp_red = nullptr; |
59 Image *game_ui_monster_hp_background = nullptr; | 57 Image *game_ui_monster_hp_background = nullptr; |
60 Image *game_ui_monster_hp_border_left = nullptr; | 58 Image *game_ui_monster_hp_border_left = nullptr; |
61 Image *game_ui_monster_hp_border_right = nullptr; | 59 Image *game_ui_monster_hp_border_right = nullptr; |
62 | |
63 Image *game_ui_bar_red = nullptr; | |
64 Image *game_ui_bar_yellow = nullptr; | |
65 Image *game_ui_bar_green = nullptr; | |
66 Image *game_ui_bar_blue = nullptr; | |
67 | |
68 Image *game_ui_player_alert_yellow = nullptr; // 5079C8 | |
69 Image *game_ui_player_alert_red = nullptr; // 5079CC | |
70 Image *game_ui_player_alert_green = nullptr; // 5079D0 | |
71 | 60 |
72 Image *game_ui_minimap_frame = nullptr; // 5079D8 | 61 Image *game_ui_minimap_frame = nullptr; // 5079D8 |
73 Image *game_ui_minimap_compass = nullptr; // 5079B4 | 62 Image *game_ui_minimap_compass = nullptr; // 5079B4 |
74 std::array<Image *, 8> game_ui_minimap_dirs; | 63 std::array<Image *, 8> game_ui_minimap_dirs; |
75 | 64 |
103 std::array<Image *, 10> game_ui_menu_options_video_gamma_positions; | 92 std::array<Image *, 10> game_ui_menu_options_video_gamma_positions; |
104 std::array<Image *, 5> game_ui_options_controls; | 93 std::array<Image *, 5> game_ui_options_controls; |
105 | 94 |
106 Image *game_ui_evtnpc = nullptr; // 50795C | 95 Image *game_ui_evtnpc = nullptr; // 50795C |
107 | 96 |
97 std::array< std::array<Image *, 56>, 4> game_ui_player_faces; | |
98 Image *game_ui_player_face_eradicated = nullptr; | |
99 Image *game_ui_player_face_dead = nullptr; | |
100 | |
101 Image *game_ui_player_selection_frame = nullptr; // 50C98C | |
102 Image *game_ui_player_alert_yellow = nullptr; // 5079C8 | |
103 Image *game_ui_player_alert_red = nullptr; // 5079CC | |
104 Image *game_ui_player_alert_green = nullptr; // 5079D0 | |
105 | |
106 Image *game_ui_bar_red = nullptr; | |
107 Image *game_ui_bar_yellow = nullptr; | |
108 Image *game_ui_bar_green = nullptr; | |
109 Image *game_ui_bar_blue = nullptr; | |
110 | |
111 Image *game_ui_playerbuff_pain_reflection = nullptr; | |
112 Image *game_ui_playerbuff_hammerhands = nullptr; | |
113 Image *game_ui_playerbuff_preservation = nullptr; | |
114 Image *game_ui_playerbuff_bless = nullptr; | |
108 | 115 |
109 GUIWindow_GameMenu::GUIWindow_GameMenu() : | 116 GUIWindow_GameMenu::GUIWindow_GameMenu() : |
110 GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr) | 117 GUIWindow(0, 0, window->GetWidth(), window->GetHeight(), 0, nullptr) |
111 { | 118 { |
112 // ----------------------- | 119 // ----------------------- |
757 popup_window.uFrameHeight = 130; | 764 popup_window.uFrameHeight = 130; |
758 popup_window.uFrameWidth = 400; | 765 popup_window.uFrameWidth = 400; |
759 popup_window.uFrameZ = popup_window.uFrameX + 399; | 766 popup_window.uFrameZ = popup_window.uFrameX + 399; |
760 popup_window.DrawMessageBox(0); | 767 popup_window.DrawMessageBox(0); |
761 sprintfex(pTmpBuf2.data(), "NPC%03d", pNPC->uPortraitID); | 768 sprintfex(pTmpBuf2.data(), "NPC%03d", pNPC->uPortraitID); |
762 pRenderer->DrawTextureTransparentColorKey(popup_window.uFrameX + 22, popup_window.uFrameY + 36, | 769 pRenderer->DrawTextureAlphaNew( |
763 (Texture_MM7 *)(pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE) != -1 | 770 (popup_window.uFrameX + 22)/640.0f, |
764 ? &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf2.data(), TEXTURE_16BIT_PALETTE)] : 0)); | 771 (popup_window.uFrameY + 36)/480.0f, |
772 assets->GetImage_16BitColorKey(pTmpBuf2.data(), 0x7FF) | |
773 ); | |
765 if ( pNPC->uProfession ) | 774 if ( pNPC->uProfession ) |
766 { | 775 { |
767 v11 = pTmpBuf.data(); | 776 v11 = pTmpBuf.data(); |
768 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]); | 777 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]); |
769 } | 778 } |
812 uNumDialogueNPCPortraits = 1; | 821 uNumDialogueNPCPortraits = 1; |
813 | 822 |
814 game_ui_dialogue_background = assets->GetImage_16Bit(pContainer); | 823 game_ui_dialogue_background = assets->GetImage_16Bit(pContainer); |
815 sprintfex(pContainer, "npc%03u", pNPCInfo->uPortraitID); | 824 sprintfex(pContainer, "npc%03u", pNPCInfo->uPortraitID); |
816 v9 = 0; | 825 v9 = 0; |
817 pDialogueNPCPortraits[0] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); | 826 pDialogueNPCPortraits[0] = assets->GetImage_16BitColorKey(pContainer, 0x7FF); |
818 dword_591084 = areWeLoadingTexture; | 827 dword_591084 = areWeLoadingTexture; |
819 | 828 |
820 if ( !pNPCInfo->Hired() && pNPCInfo->Location2D >= 0 ) | 829 if ( !pNPCInfo->Hired() && pNPCInfo->Location2D >= 0 ) |
821 { | 830 { |
822 if ( (signed int)pParty->GetPartyFame() <= pNPCInfo->fame | 831 if ( (signed int)pParty->GetPartyFame() <= pNPCInfo->fame |
914 window.uFrameWidth -= 10; | 923 window.uFrameWidth -= 10; |
915 window.uFrameZ -= 10; | 924 window.uFrameZ -= 10; |
916 pRenderer->DrawTextureNew(477/640.0f, 0, game_ui_dialogue_background); | 925 pRenderer->DrawTextureNew(477/640.0f, 0, game_ui_dialogue_background); |
917 pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_right_panel_frame); | 926 pRenderer->DrawTextureAlphaNew(468/640.0f, 0, game_ui_right_panel_frame); |
918 pRenderer->DrawTextureAlphaNew((pNPCPortraits_x[0][0] - 4)/640.0f, (pNPCPortraits_y[0][0] - 4)/480.0f, game_ui_evtnpc); | 927 pRenderer->DrawTextureAlphaNew((pNPCPortraits_x[0][0] - 4)/640.0f, (pNPCPortraits_y[0][0] - 4)/480.0f, game_ui_evtnpc); |
919 pRenderer->DrawTextureTransparentColorKey(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], pDialogueNPCPortraits[0]); | 928 pRenderer->DrawTextureAlphaNew(pNPCPortraits_x[0][0]/640.0f, pNPCPortraits_y[0][0]/480.0f, pDialogueNPCPortraits[0]); |
920 | 929 |
921 if (pNPC->uProfession) | 930 if (pNPC->uProfession) |
922 { | 931 { |
923 assert(pNPC->uProfession < sizeof(aNPCProfessionNames) / sizeof(*aNPCProfessionNames.data())); // sometimes buffer overflows; errors emerge both here and in dialogue text | 932 assert(pNPC->uProfession < sizeof(aNPCProfessionNames) / sizeof(*aNPCProfessionNames.data())); // sometimes buffer overflows; errors emerge both here and in dialogue text |
924 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s | 933 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[429], pNPC->pName, aNPCProfessionNames[pNPC->uProfession]);//^Pi[%s] %s |
1304 } | 1313 } |
1305 | 1314 |
1306 //----- (0041D3B7) -------------------------------------------------------- | 1315 //----- (0041D3B7) -------------------------------------------------------- |
1307 void GameUI_CharacterQuickRecord_Draw(GUIWindow *window, Player *player) | 1316 void GameUI_CharacterQuickRecord_Draw(GUIWindow *window, Player *player) |
1308 { | 1317 { |
1309 Texture_MM7 *v13; // eax@6 | 1318 Image *v13; // eax@6 |
1310 PlayerFrame *v15; // eax@12 | 1319 PlayerFrame *v15; // eax@12 |
1311 unsigned int pTextColor; // eax@15 | 1320 unsigned int pTextColor; // eax@15 |
1312 const char *v29; // eax@16 | 1321 const char *v29; // eax@16 |
1313 int v36; // esi@22 | 1322 int v36; // esi@22 |
1314 const char *v39; // eax@24 | 1323 const char *v39; // eax@24 |
1324 window->uFrameZ = window->uFrameWidth + window->uFrameX - 1; | 1333 window->uFrameZ = window->uFrameWidth + window->uFrameX - 1; |
1325 window->uFrameW = ((pFontArrus->uFontHeight + 162) + ((numActivePlayerBuffs - 1) * pFontArrus->uFontHeight)) + window->uFrameY - 1; | 1334 window->uFrameW = ((pFontArrus->uFontHeight + 162) + ((numActivePlayerBuffs - 1) * pFontArrus->uFontHeight)) + window->uFrameY - 1; |
1326 window->DrawMessageBox(0); | 1335 window->DrawMessageBox(0); |
1327 | 1336 |
1328 if (player->IsEradicated()) | 1337 if (player->IsEradicated()) |
1329 v13 = pTexture_PlayerFaceEradicated; | 1338 v13 = game_ui_player_face_eradicated; |
1330 else if (player->IsDead()) | 1339 else if (player->IsDead()) |
1331 v13 = pTexture_PlayerFaceDead; | 1340 v13 = game_ui_player_face_dead; |
1332 else | 1341 else |
1333 { | 1342 { |
1334 uFramesetID = pPlayerFrameTable->GetFrameIdByExpression(player->expression); | 1343 uFramesetID = pPlayerFrameTable->GetFrameIdByExpression(player->expression); |
1335 if ( !uFramesetID ) | 1344 if ( !uFramesetID ) |
1336 uFramesetID = 1; | 1345 uFramesetID = 1; |
1337 if ( player->expression == CHARACTER_EXPRESSION_21) | 1346 if ( player->expression == CHARACTER_EXPRESSION_21) |
1338 v15 = pPlayerFrameTable->GetFrameBy_y(&player->_expression21_frameset, &player->_expression21_animtime, pMiscTimer->uTimeElapsed); | 1347 v15 = pPlayerFrameTable->GetFrameBy_y(&player->_expression21_frameset, &player->_expression21_animtime, pMiscTimer->uTimeElapsed); |
1339 else | 1348 else |
1340 v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, pMiscTimer->Time()); | 1349 v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, pMiscTimer->Time()); |
1341 player->field_1AA2 = v15->uTextureID - 1; | 1350 player->field_1AA2 = v15->uTextureID - 1; |
1342 v13 = pTextures_PlayerFaces[(unsigned int)window->ptr_1C][v15->uTextureID - 1]; | 1351 v13 = game_ui_player_faces[(unsigned int)window->ptr_1C][v15->uTextureID - 1]; |
1343 } | 1352 } |
1344 | 1353 |
1345 pRenderer->DrawTextureIndexedAlpha(window->uFrameX + 24, window->uFrameY + 24, v13); | 1354 pRenderer->DrawTextureAlphaNew((window->uFrameX + 24)/640.0f, (window->uFrameY + 24)/480.0f, v13); |
1346 | 1355 |
1347 sprintfex(pTmpBuf.data(), "\f%05d", ui_character_header_text_color); | 1356 sprintfex(pTmpBuf.data(), "\f%05d", ui_character_header_text_color); |
1348 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); // "%s the %s" | 1357 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); // "%s the %s" |
1349 strcat(pTmpBuf.data(), pTmpBuf2.data()); | 1358 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
1350 strcat(pTmpBuf.data(), "\f00000\n"); | 1359 strcat(pTmpBuf.data(), "\f00000\n"); |
1949 | 1958 |
1950 //----- (0044158F) -------------------------------------------------------- | 1959 //----- (0044158F) -------------------------------------------------------- |
1951 void GameUI_DrawCharacterSelectionFrame() | 1960 void GameUI_DrawCharacterSelectionFrame() |
1952 { | 1961 { |
1953 if ( uActiveCharacter ) | 1962 if ( uActiveCharacter ) |
1954 pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9, 380, | 1963 pRenderer->DrawTextureAlphaNew( |
1955 pIcons_LOD->GetTexture(uTextureID_GameUI_CharSelectionFrame)); | 1964 (pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9)/640.0f, |
1965 380/480.0f, | |
1966 game_ui_player_selection_frame); | |
1956 } | 1967 } |
1957 | 1968 |
1958 //----- (0044162D) -------------------------------------------------------- | 1969 //----- (0044162D) -------------------------------------------------------- |
1959 void GameUI_DrawPartySpells() | 1970 void GameUI_DrawPartySpells() |
1960 { | 1971 { |
1961 unsigned int v0; // ebp@1 | 1972 unsigned int v0; // ebp@1 |
1962 Texture_MM7 *spell_texture; // [sp-4h] [bp-1Ch]@12 | 1973 Image *spell_texture; // [sp-4h] [bp-1Ch]@12 |
1963 //Texture_MM7 *v9; // [sp-4h] [bp-1Ch]@21 | 1974 //Texture_MM7 *v9; // [sp-4h] [bp-1Ch]@21 |
1964 | 1975 |
1965 v0 = (signed __int64)((double)GetTickCount() * 0.050000001); | 1976 v0 = (signed __int64)((double)GetTickCount() * 0.050000001); |
1966 //v1 = 0; | 1977 //v1 = 0; |
1967 for (uint i = 0; i < 14; ++i) | 1978 for (uint i = 0; i < 14; ++i) |
1969 //v2 = byte_4E5DD8[v1]; | 1980 //v2 = byte_4E5DD8[v1]; |
1970 if (pParty->pPartyBuffs[byte_4E5DD8[i]].uExpireTime) | 1981 if (pParty->pPartyBuffs[byte_4E5DD8[i]].uExpireTime) |
1971 { | 1982 { |
1972 Texture_MM7* tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]); | 1983 Texture_MM7* tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]); |
1973 //v3 = pTextureIDs_PartyBuffIcons[i]; | 1984 //v3 = pTextureIDs_PartyBuffIcons[i]; |
1974 pRenderer->_4A65CC(pPartySpellbuffsUI_XYs[i][0], | 1985 pRenderer->_4A65CC( |
1975 pPartySpellbuffsUI_XYs[i][1], tex, tex, | 1986 pPartySpellbuffsUI_XYs[i][0], |
1976 v0 + 20 * pPartySpellbuffsUI_smthns[i], 0, 63); | 1987 pPartySpellbuffsUI_XYs[i][1], tex, tex, |
1988 v0 + 20 * pPartySpellbuffsUI_smthns[i], 0, 63 | |
1989 ); | |
1977 } | 1990 } |
1978 //++v1; | 1991 //++v1; |
1979 } | 1992 } |
1980 //while ( v1 < 14 ); | 1993 //while ( v1 < 14 ); |
1981 if (current_screen_type == SCREEN_GAME || current_screen_type == SCREEN_NPC_DIALOGUE) | 1994 if (current_screen_type == SCREEN_GAME || current_screen_type == SCREEN_NPC_DIALOGUE) |
1982 { | 1995 { |
1983 if (pParty->FlyActive()) | 1996 if (pParty->FlyActive()) |
1984 { | 1997 { |
1985 if ( pParty->bFlying ) | 1998 if ( pParty->bFlying ) |
1986 spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID); | 1999 spell_texture = pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->texture; |
1987 else | 2000 else |
1988 spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID); | 2001 spell_texture = pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->texture; |
1989 //if ( pRenderer->pRenderD3D ) | 2002 //if ( pRenderer->pRenderD3D ) |
1990 pRenderer->DrawTextureTransparentColorKey(8, 8, spell_texture); | 2003 pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, spell_texture); |
1991 /*else | 2004 /*else |
1992 pRenderer->DrawTextureIndexedAlpha(8, 8, v7);*/ | 2005 pRenderer->DrawTextureIndexedAlpha(8, 8, v7);*/ |
1993 } | 2006 } |
1994 if ( pParty->WaterWalkActive() ) | 2007 if ( pParty->WaterWalkActive() ) |
1995 { | 2008 { |
1996 if ( pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER ) | 2009 if ( pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER ) |
1997 spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID); | 2010 spell_texture = pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->texture; |
1998 else | 2011 else |
1999 spell_texture = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID); | 2012 spell_texture = pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->texture; |
2000 //if ( pRenderer->pRenderD3D ) | 2013 //if ( pRenderer->pRenderD3D ) |
2001 pRenderer->DrawTextureTransparentColorKey(396, 8, spell_texture); | 2014 pRenderer->DrawTextureAlphaNew(396/640.0f, 8/480.0f, spell_texture); |
2002 /*else | 2015 /*else |
2003 pRenderer->DrawTextureIndexedAlpha(396, 8, v9);*/ | 2016 pRenderer->DrawTextureIndexedAlpha(396, 8, v9);*/ |
2004 } | 2017 } |
2005 } | 2018 } |
2006 for (uint i = 0; i < 4; ++i) | 2019 for (uint i = 0; i < 4; ++i) |
2007 { | 2020 { |
2008 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime ) | 2021 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime ) |
2009 pRenderer->DrawTextureTransparentColorKey(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 427, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Hammerhands)); | 2022 pRenderer->DrawTextureAlphaNew((pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72)/640.0f, 427/480.0f, game_ui_playerbuff_hammerhands); |
2010 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime ) | 2023 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime ) |
2011 pRenderer->DrawTextureTransparentColorKey(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 393, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Bless)); | 2024 pRenderer->DrawTextureAlphaNew((pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72)/640.0f, 393/480.0f, game_ui_playerbuff_bless); |
2012 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime ) | 2025 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime ) |
2013 pRenderer->DrawTextureTransparentColorKey(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation)); | 2026 pRenderer->DrawTextureAlphaNew((pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72)/640.0f, 410/480.0f, game_ui_playerbuff_preservation); |
2014 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime ) | 2027 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime ) |
2015 pRenderer->DrawTextureTransparentColorKey(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection)); | 2028 pRenderer->DrawTextureAlphaNew((pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72)/640.0f, 444/480.0f, game_ui_playerbuff_pain_reflection); |
2016 } | 2029 } |
2017 } | 2030 } |
2018 | 2031 |
2019 //----- (004921C1) -------------------------------------------------------- | 2032 //----- (004921C1) -------------------------------------------------------- |
2020 void GameUI_DrawPortraits(unsigned int _this) | 2033 void GameUI_DrawPortraits(unsigned int _this) |
2021 { | 2034 { |
2022 unsigned int face_expression_ID; // eax@17 | 2035 unsigned int face_expression_ID; // eax@17 |
2023 PlayerFrame *pFrame; // eax@21 | 2036 PlayerFrame *pFrame; // eax@21 |
2024 Texture_MM7 *pPortrait; // [sp-4h] [bp-1Ch]@27 | 2037 Image *pPortrait; // [sp-4h] [bp-1Ch]@27 |
2025 | 2038 |
2026 if ( _A750D8_player_speech_timer ) | 2039 if ( _A750D8_player_speech_timer ) |
2027 { | 2040 { |
2028 _A750D8_player_speech_timer -= (signed int)pMiscTimer->uTimeElapsed; | 2041 _A750D8_player_speech_timer -= (signed int)pMiscTimer->uTimeElapsed; |
2029 if ( _A750D8_player_speech_timer <= 0 ) | 2042 if ( _A750D8_player_speech_timer <= 0 ) |
2037 for (uint i = 0; i < 4; ++i) | 2050 for (uint i = 0; i < 4; ++i) |
2038 { | 2051 { |
2039 Player* pPlayer = &pParty->pPlayers[i]; | 2052 Player* pPlayer = &pParty->pPlayers[i]; |
2040 if ( pPlayer->IsEradicated() ) | 2053 if ( pPlayer->IsEradicated() ) |
2041 { | 2054 { |
2042 pPortrait = pTexture_PlayerFaceEradicated; | 2055 pPortrait = game_ui_player_face_eradicated; |
2043 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) | 2056 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) |
2044 pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); | 2057 pRenderer->DrawTextureGrayShade(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i]/640.0f, 388/480.0f, pPortrait); |
2045 else | 2058 else |
2046 pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait); | 2059 pRenderer->DrawTextureAlphaNew((pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1)/640.0f, 388/480.0f, pPortrait); |
2047 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime | 2060 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime |
2048 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime | 2061 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime |
2049 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime ) | 2062 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime ) |
2050 sub_441A4E(i); | 2063 sub_441A4E(i); |
2051 continue; | 2064 continue; |
2052 } | 2065 } |
2053 if (pPlayer->IsDead()) | 2066 if (pPlayer->IsDead()) |
2054 { | 2067 { |
2055 pPortrait = pTexture_PlayerFaceDead; | 2068 pPortrait = game_ui_player_face_dead; |
2056 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) | 2069 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) |
2057 pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); | 2070 pRenderer->DrawTextureGrayShade(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i]/640.0f, 388/480.0f, pPortrait); |
2058 else | 2071 else |
2059 pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait); | 2072 pRenderer->DrawTextureAlphaNew((pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1)/640.0f, 388/480.0f, pPortrait); |
2060 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime | 2073 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime |
2061 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime | 2074 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime |
2062 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime ) | 2075 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime ) |
2063 sub_441A4E(i); | 2076 sub_441A4E(i); |
2064 continue; | 2077 continue; |
2077 else | 2090 else |
2078 pFrame = pPlayerFrameTable->GetFrameBy_x(face_expression_ID, pPlayer->uExpressionTimePassed); | 2091 pFrame = pPlayerFrameTable->GetFrameBy_x(face_expression_ID, pPlayer->uExpressionTimePassed); |
2079 if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || _this ) | 2092 if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || _this ) |
2080 { | 2093 { |
2081 pPlayer->field_1AA2 = pFrame->uTextureID - 1; | 2094 pPlayer->field_1AA2 = pFrame->uTextureID - 1; |
2082 pPortrait = (Texture_MM7 *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture_MM7 *)pTextures_PlayerFaces[i][pFrame->uTextureID]; | 2095 pPortrait = game_ui_player_faces[i][pPlayer->field_1AA2];//pFace = (Texture_MM7 *)game_ui_player_faces[i][pFrame->uTextureID]; |
2083 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) | 2096 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) |
2084 pRenderer->DrawTranslucent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); | 2097 pRenderer->DrawTextureGrayShade(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i]/640.0f, 388/480.0f, pPortrait); |
2085 else | 2098 else |
2086 pRenderer->DrawTextureIndexedAlpha(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait); | 2099 pRenderer->DrawTextureAlphaNew((pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1)/640.0f, 388/480.0f, pPortrait); |
2087 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime | 2100 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_HASTE].uExpireTime |
2088 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime | 2101 | pPlayer->pPlayerBuffs[PLAYER_BUFF_HEROISM].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_SHIELD].uExpireTime |
2089 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime ) | 2102 | pPlayer->pPlayerBuffs[PLAYER_BUFF_STONESKIN].uExpireTime ) |
2090 sub_441A4E(i); | 2103 sub_441A4E(i); |
2091 continue; | 2104 continue; |
2481 || current_screen_type == SCREEN_BOOKS | 2494 || current_screen_type == SCREEN_BOOKS |
2482 || current_screen_type == SCREEN_BRANCHLESS_NPC_DIALOG ) | 2495 || current_screen_type == SCREEN_BRANCHLESS_NPC_DIALOG ) |
2483 { | 2496 { |
2484 if (pParty->TorchlightActive()) | 2497 if (pParty->TorchlightActive()) |
2485 { | 2498 { |
2486 IconFrame* icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time()); | 2499 pRenderer->DrawTextureAlphaNew( |
2487 pRenderer->DrawTextureIndexedAlpha(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID)); | 2500 pUIAnum_Torchlight->x/640.0f, |
2501 pUIAnum_Torchlight->y/480.0f, | |
2502 pIconsFrameTable->GetFrame(pUIAnum_Torchlight->icon->id, pEventTimer->Time())->texture | |
2503 ); | |
2488 } | 2504 } |
2489 if (pParty->WizardEyeActive()) | 2505 if (pParty->WizardEyeActive()) |
2490 { | 2506 { |
2491 IconFrame* icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time()); | 2507 pRenderer->DrawTextureAlphaNew( |
2492 pRenderer->DrawTextureIndexedAlpha(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID)); | 2508 pUIAnim_WizardEye->x/640.0f, |
2509 pUIAnim_WizardEye->y/480.0f, | |
2510 pIconsFrameTable->GetFrame(pUIAnim_WizardEye->icon->id, pEventTimer->Time())->texture | |
2511 ); | |
2493 } | 2512 } |
2494 } | 2513 } |
2495 } | 2514 } |
2496 | 2515 |
2497 | 2516 |
2528 for ( int i = pParty->hirelingScrollPosition; i < v22 && pNPC_limit_ID < 2; i++ ) | 2547 for ( int i = pParty->hirelingScrollPosition; i < v22 && pNPC_limit_ID < 2; i++ ) |
2529 { | 2548 { |
2530 if ( (unsigned __int8)pTmpBuf[i] >= 2 ) | 2549 if ( (unsigned __int8)pTmpBuf[i] >= 2 ) |
2531 { | 2550 { |
2532 sprintf(pContainer, "NPC%03d", pNPCStats->pNPCData[(unsigned __int8)pTmpBuf[i] + 499].uPortraitID); | 2551 sprintf(pContainer, "NPC%03d", pNPCStats->pNPCData[(unsigned __int8)pTmpBuf[i] + 499].uPortraitID); |
2533 pRenderer->DrawTextureTransparentColorKey(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID], | 2552 pRenderer->DrawTextureAlphaNew( |
2534 pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE))); | 2553 pHiredNPCsIconsOffsetsX[pNPC_limit_ID]/640.0f, |
2554 pHiredNPCsIconsOffsetsY[pNPC_limit_ID]/480.0f, | |
2555 //pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)) | |
2556 assets->GetImage_16BitColorKey(pContainer, 0x7FF) | |
2557 ); | |
2535 } | 2558 } |
2536 else | 2559 else |
2537 { | 2560 { |
2538 sprintf(pContainer, "NPC%03d", pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].uPortraitID); | 2561 sprintf(pContainer, "NPC%03d", pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].uPortraitID); |
2539 pRenderer->DrawTextureTransparentColorKey(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID], | 2562 pRenderer->DrawTextureAlphaNew( |
2540 pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE))); | 2563 pHiredNPCsIconsOffsetsX[pNPC_limit_ID]/640.0f, |
2564 pHiredNPCsIconsOffsetsY[pNPC_limit_ID]/480.0f, | |
2565 //pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)) | |
2566 assets->GetImage_16BitColorKey(pContainer, 0x7FF) | |
2567 ); | |
2541 if ( pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].evt_A == 1 ) | 2568 if ( pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].evt_A == 1 ) |
2542 { | 2569 { |
2543 uFrameID = pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].evt_B; | 2570 uFrameID = pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].evt_B; |
2544 v13 = 0; | 2571 v13 = 0; |
2545 if (pIconsFrameTable->uNumIcons) | 2572 if (pIconsFrameTable->uNumIcons) |
2546 { | 2573 { |
2547 for ( v13 = 0; v13 < pIconsFrameTable->uNumIcons; ++v13 ) | 2574 for ( v13 = 0; v13 < pIconsFrameTable->uNumIcons; ++v13 ) |
2548 { | 2575 { |
2549 if ( !_stricmp("spell96", pIconsFrameTable->pIcons[v13].pAnimationName) ) | 2576 if ( !_stricmp("spell96", pIconsFrameTable->pIcons[v13].GetAnimationName()) ) |
2550 break; | 2577 break; |
2551 } | 2578 } |
2552 } | 2579 } |
2553 pRenderer->DrawTextureIndexedAlpha(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID], | 2580 pRenderer->DrawTextureAlphaNew( |
2554 &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(v13, uFrameID)->uTextureID]); | 2581 pHiredNPCsIconsOffsetsX[pNPC_limit_ID]/640.0f, |
2582 pHiredNPCsIconsOffsetsY[pNPC_limit_ID]/480.0f, | |
2583 //&pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(v13, uFrameID)->uTextureID] | |
2584 pIconsFrameTable->GetFrame(v13, uFrameID)->texture | |
2585 ); | |
2555 } | 2586 } |
2556 } | 2587 } |
2557 ++pNPC_limit_ID; | 2588 ++pNPC_limit_ID; |
2558 } | 2589 } |
2559 } | 2590 } |