# HG changeset patch # User Ritor1 # Date 1363780155 -21600 # Node ID 70c5a87a13076cb83b1be1dc3e708acd4d0ce6d0 # Parent f39d5902c85a31f20b2ce349d2fedc78e289a209# Parent d6236f6a9882f010319432836c59a7fa1721c029 Слияние diff -r f39d5902c85a -r 70c5a87a1307 Chest.cpp --- a/Chest.cpp Wed Mar 20 17:48:51 2013 +0600 +++ b/Chest.cpp Wed Mar 20 17:49:15 2013 +0600 @@ -250,7 +250,7 @@ } //----- (0042092D) -------------------------------------------------------- -void Chest::DrawChestUI(unsigned int uChestID) +void Chest::DrawChestUI(signed int uChestID) { int chestBitmapId; // eax@1 @@ -315,7 +315,7 @@ //----- (0041FE71) -------------------------------------------------------- -bool Chest::CanPlaceItemAt( signed int test_cell_position, int item_id, unsigned int uChestID ) +bool Chest::CanPlaceItemAt( signed int test_cell_position, int item_id, signed int uChestID ) { int v3; // eax@1 unsigned int item_texture_id; // eax@1 @@ -383,7 +383,7 @@ // 506128: using guessed type int areWeLoadingTexture; //----- (0041FF64) -------------------------------------------------------- -int Chest::CountChestItems(unsigned int uChestID) +int Chest::CountChestItems(signed int uChestID) { signed int item_count; // eax@1 int max_items; // edx@1 @@ -409,7 +409,7 @@ } //----- (0041FFA2) -------------------------------------------------------- -int Chest::PutItemInChest(int position, ItemGen *put_item, unsigned int uChestID) +int Chest::PutItemInChest(int position, ItemGen *put_item, signed int uChestID) { int v3; // eax@1 ItemGen *v4; // edi@1 @@ -516,7 +516,7 @@ // 506128: using guessed type int areWeLoadingTexture; //----- (0042013E) -------------------------------------------------------- -void Chest::PlaceItemAt( unsigned int put_cell_pos, unsigned int item_at_cell, unsigned int uChestID ) +void Chest::PlaceItemAt( unsigned int put_cell_pos, unsigned int item_at_cell, signed int uChestID ) { int uItemID; // edi@1 @@ -568,7 +568,7 @@ // 506128: using guessed type int areWeLoadingTexture; //----- (00420284) -------------------------------------------------------- -void Chest::PlaceItems( unsigned int uChestID ) +void Chest::PlaceItems(signed int uChestID ) { int uChestArea; // edi@1 int random_chest_pos; // eax@2 @@ -622,6 +622,21 @@ } // 420284: using guessed type char Dst[144]; +//----- (00448A17) -------------------------------------------------------- +void Chest::ToggleFlag(signed int uChestID, unsigned __int16 uFlag, unsigned int bToggle) + { + unsigned __int16 *pFlags; // eax@3 + + if ( uChestID >= 0 && uChestID <= 19 ) + { + pFlags = &pChests[uChestID].uFlags; + if ( bToggle ) + *pFlags |= uFlag; + else + *pFlags &= ~uFlag; + } + } + //----- (00458B03) -------------------------------------------------------- void ChestList::ToFile() { diff -r f39d5902c85a -r 70c5a87a1307 Chest.h --- a/Chest.h Wed Mar 20 17:48:51 2013 +0600 +++ b/Chest.h Wed Mar 20 17:49:15 2013 +0600 @@ -53,14 +53,14 @@ inline void SetInitialized(bool b) {if (b) uFlags |= CHEST_ITEMS_PLACED; else uFlags &= ~CHEST_ITEMS_PLACED;} inline bool Trapped() const {return uFlags & CHEST_TRAPPED;} - static bool CanPlaceItemAt(signed int a1, int a2, unsigned int uChestID); - static int CountChestItems(unsigned int uChestID); - static int PutItemInChest(int a1, ItemGen *a2, unsigned int uChestID); - static void PlaceItemAt(unsigned int put_cell_pos, unsigned int uItemIdx, unsigned int uChestID); - static void PlaceItems(unsigned int uChestID); + static bool CanPlaceItemAt(signed int a1, int a2, signed int uChestID); + static int CountChestItems(signed int uChestID); + static int PutItemInChest(int a1, ItemGen *a2, signed int uChestID); + static void PlaceItemAt(unsigned int put_cell_pos, unsigned int uItemIdx, signed int uChestID); + static void PlaceItems(signed int uChestID); static bool Open(signed int uChestID); - static void DrawChestUI(unsigned int uChestID); - static void ToggleFlag(unsigned int uChestID, unsigned __int16 uFlag, unsigned int bToggle); + static void DrawChestUI(signed int uChestID); + static void ToggleFlag(signed int uChestID, unsigned __int16 uFlag, unsigned int bToggle); unsigned __int16 uChestBitmapID; //0 unsigned __int16 uFlags; //2 diff -r f39d5902c85a -r 70c5a87a1307 UIBooks.cpp --- a/UIBooks.cpp Wed Mar 20 17:48:51 2013 +0600 +++ b/UIBooks.cpp Wed Mar 20 17:49:15 2013 +0600 @@ -0,0 +1,1557 @@ +#include + +#include "MM7.h" + +#include "MapInfo.h" +#include "Game.h" +#include "GUIWindow.h" +#include "GUIFont.h" +#include "GUIButton.h" +#include "GUIProgressBar.h" +#include "Party.h" +#include "AudioPlayer.h" +#include "Outdoor.h" +#include "IndoorCamera.h" +#include "Overlays.h" +#include "Monsters.h" +#include "Arcomage.h" +#include "LOD.h" +#include "Actor.h" +#include "Allocator.h" +#include "Events.h" +#include "Viewport.h" +#include "FrameTableInc.h" +#include "Math.h" +#include "SpriteObject.h" +#include "ObjectList.h" +#include "Chest.h" +#include "PaletteManager.h" +#include "DecorationList.h" +#include "SaveLoad.h" +#include "stru123.h" +#include "Time.h" +#include "IconFrameTable.h" +#include "Awards.h" +#include "Autonotes.h" +#include "stru160.h" +#include "stru279.h" +#include "TurnEngine.h" +#include "stru277.h" +#include "Weather.h" +#include "stru272.h" +#include "stru298.h" +#include "StorylineTextTable.h" +#include "Events2D.h" +#include "texts.h" +#include "stru351.h" + +#include "mm7_data.h" + + + + +//----- (00411300) -------------------------------------------------------- +void LoadSpellbook(unsigned int spell_school) +{ + //unsigned int v1; // esi@1 + Player *pPlayer; // ecx@1 + char v3; // al@1 + //int v4; // edi@5 + //Texture *result; // eax@6 + //unsigned char *v6; // edi@7 + //unsigned int v7; // eax@7 + //unsigned __int8 v8; // sf@8 + //unsigned __int8 v9; // of@8 + char pContainer[20]; // [sp+Ch] [bp-1Ch]@7 + //Texture *v11; // [sp+20h] [bp-8h]@5 + //int v12; // [sp+24h] [bp-4h]@5 + + byte_506550 = 0; + //v1 = uID; + pPlayer = pPlayers[uActiveCharacter]; + v3 = pPlayer->uQuickSpell; + if ( v3 && (unsigned __int8)v3 / 11 == spell_school ) + quick_spell_at_page = (unsigned __int8)v3 - 11 * spell_school; + else + quick_spell_at_page = 0; + + for (uint i = 1; i < 12; ++i) + { + if (pPlayer->spellbook.pChapters[spell_school].bIsSpellAvailable[i - 1]) + { + sprintf(pContainer, "SB%sS%02d", spellbook_texture_filename_suffices[spell_school], pSpellbookSpellIndices[spell_school][i]); + dword_506408[i] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); + + sprintf(pContainer, "SB%sC%02d", spellbook_texture_filename_suffices[spell_school], pSpellbookSpellIndices[spell_school][i]); + dword_5063D8[i] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); + } + } +} + +//----- (0041140B) -------------------------------------------------------- +GUIWindow *__cdecl sub_41140B() +{ + signed int v0; // esi@1 + GUIButton *v1; // eax@3 + GUIButton *v2; // esi@4 + GUIWindow *result; // eax@5 + + v0 = 0; + do + { + dword_5063D8[11+v0]->Release(); + dword_506408[11+v0]->Release(); + --v0; + } + while ( v0 >= -11 ); + pIcons_LOD->_40F9C5(); + v1 = pGUIWindow_CurrentMenu->pControlsHead; + if ( v1 ) + { + do + { + v2 = v1->pNext; + pAllocator->FreeChunk(v1); + v1 = v2; + } + while ( v2 ); + } + pGUIWindow_CurrentMenu->pControlsHead = 0; + pGUIWindow_CurrentMenu->pControlsTail = 0; + result = pGUIWindow_CurrentMenu; + pGUIWindow_CurrentMenu->uNumControls = 0; + return result; +} + +//----- (00411473) -------------------------------------------------------- +void __cdecl sub_411473() +{ + pTexture_pagemask->Release(); + pTexture_506448->Release(); + pTexture_50643C->Release(); + for (uint i = 0; i < 8; ++i) + { + pSpellBookPagesTextr[i]->Release(); + pTextures_tabs[i][0]->Release(); + pTextures_tabs[i][1]->Release(); + } + pAudioPlayer->PlaySound((SoundID)231, 0, 0, -1, 0, 0, 0, 0); + pIcons_LOD->_4114F2(); +} + + +//----- (00411597) -------------------------------------------------------- +void __cdecl OnCloseSpellook() +{ + pAllocator->FreeChunk(pSpellFont); + pSpellFont = 0; + pAllocator->FreeChunk(pBookFont); + pBookFont = 0; + pAllocator->FreeChunk(pBook2Font); + pBook2Font = 0; + pAllocator->FreeChunk(pAutonoteFont); + pAutonoteFont = 0; + pTexture_mapbordr->Release(); + pAudioPlayer->PlaySound((SoundID)231, 0, 0, -1, 0, 0, 0, 0); + pIcons_LOD->_4114F2(); + dword_506364 = 0; +} +// 506364: using guessed type int dword_506364; + + + + + + + +//----- (00412AF9) -------------------------------------------------------- +void sub_412AF9() + { + int v0; // ecx@1 + + v0 = 0; + if ( uActiveCharacter ) + v0 = pParty->pPlayers[uActiveCharacter-1].lastOpenedSpellbookPage;//*((char *)&pParty->pPartyBuffs[5].uExpireTime + 6972 * uActiveCharacter + 2); + pRenderer->DrawTextureIndexed(8u, 8u, pSpellBookPagesTextr[v0]); + pRenderer->DrawTextureIndexed(0x1DCu, 0x1C2u, pTexture_50643C); + pRenderer->DrawTextureIndexed(0x231u, 0x1C2u, pTexture_506448); +} + +//----- (00412B58) -------------------------------------------------------- +void __cdecl DrawSpellBookContent() +{ + Player *v0; // ebx@1 + int v1; // ebp@1 + unsigned int v2; // eax@1 + Texture *v3; // edi@1 + int v4; // esi@1 + Texture *v5; // eax@3 + Texture *v6; // edx@5 + int v7; // eax@8 + int v8; // eax@11 + POINT *v9; // esi@13 + int v10; // eax@13 + Texture *v11; // edx@14 + int v12; // eax@15 + signed int v13; // ecx@18 + unsigned int v14; // esi@18 + unsigned int v15; // edi@18 + Texture *pPageTexture; // eax@21 + unsigned int v17; // [sp-Ch] [bp-2Ch]@8 + unsigned int v18; // [sp-Ch] [bp-2Ch]@15 + unsigned int v19; // [sp-8h] [bp-28h]@8 + unsigned int v20; // [sp-8h] [bp-28h]@15 + Texture *v21; // [sp-4h] [bp-24h]@15 + signed int v22; // [sp-4h] [bp-24h]@22 + Texture *v23; // [sp+10h] [bp-10h]@5 + POINT a2; // [sp+18h] [bp-8h]@13 + POINT v24; + int v25; + + sub_412AF9(); + v0 = pPlayers[uActiveCharacter]; + v1 = 11 * v0->lastOpenedSpellbookPage; + v2 = pIcons_LOD->FindTextureByName("Pending"); + v3 = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0); + pRenderer->ClearZBuffer(0, 479); + v4 = 1; + if ( __OFSUB__(v1, v1 + 11) ^ 1 ) + { + do + { + if ( *(&v0->_guilds_member_bits[v1 + 63] + v4) ) + { + v5 = (Texture *)dword_506408[v4]; + if ( v5 != v3 ) + { + if ( quick_spell_at_page == v4 ) + { + v6 = dword_5063D8[v4]; + v23 = dword_5063D8[v4]; + } + else + { + v23 = dword_506408[v4]; + v6 = v5; + } + if ( v6->pLevelOfDetail0 ) + { + v7 = v0->lastOpenedSpellbookPage; + // v7 = (12 * v0->lastOpenedSpellbookPage + pSpellbookSpellIndices[v0->lastOpenedSpellbookPage][v4]); + v19 = pViewport->uViewportTL_Y + pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Ypos; + v17 = pViewport->uViewportTL_X + pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Xpos; + if ( BYTE1(v6->pBits) & 2 ) + pRenderer->DrawTextureTransparent(v17, v19, v6); + else + pRenderer->DrawTextureIndexed(v17, v19, v6); + pRenderer->_4A612A(pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Xpos, + pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Ypos, v23, v4); + } + } + } + ++v4; + } + while ( v4 + v1 - 1 < v1 + 11 ); + } + v9 = pMouse->GetCursorPos(&a2); + v10 = pRenderer->pActiveZBuffer[v9->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v24)->y]] & 0xFFFF; + if ( v10 ) + { + v11 = dword_5063D8[v10]; + if ( v11->pLevelOfDetail0 ) + { + v21 = dword_5063D8[v10]; + v12 = v0->lastOpenedSpellbookPage; + // v12 = (12 * v0->lastOpenedSpellbookPage + pSpellbookSpellIndices[v0->lastOpenedSpellbookPage][v10]); + v20 = pViewport->uViewportTL_Y + pIconPos[v12][pSpellbookSpellIndices[v12][v10]].Ypos; + v18 = pViewport->uViewportTL_X + pIconPos[v12][pSpellbookSpellIndices[v12][v10]].Xpos; + if ( BYTE1(v11->pBits) & 2 ) + pRenderer->DrawTextureTransparent(v18, v20, v21); + else + pRenderer->DrawTextureIndexed(v18, v20, v21); + } + } + v13 = 0; + a2.x = (LONG)&v0->pActiveSkills[12]; + v14 = (unsigned int)&v0->pActiveSkills[12]; + v15 = (unsigned int)&v0->pActiveSkills[12]; + v25 = 0; + do + { + if ( *(short *)a2.x ) + { + if ( v0->lastOpenedSpellbookPage == v13 ) + { + pPageTexture = pTextures_tabs[v13][1]; + switch ( v13 ) + { + case 0: + v14 = 406; + v22 = 9; + goto LABEL_27; + case 1: + v14 = 406; + goto LABEL_38; + case 2: + v14 = 406; + v22 = 84; + goto LABEL_27; + case 3: + v14 = 406; + goto LABEL_26; + case 4: + v14 = 407; + goto LABEL_29; + case 5: + v15 = 196; + goto LABEL_34; + case 6: + v15 = 234; + goto LABEL_34; + case 7: + v15 = 272; + goto LABEL_34; + case 8: + v15 = 309; +LABEL_34: + v14 = 405; + break; + default: + break; + } + } + else + { + pPageTexture = pTextures_tabs[v13][0]; + switch ( v13 ) + { + case 0: + v14 = 415; + v22 = 10; + goto LABEL_27; + case 1: + v14 = 415; +LABEL_38: + v22 = 46; + goto LABEL_27; + case 2: + v14 = 415; + v22 = 83; + goto LABEL_27; + case 3: + v14 = 415; +LABEL_26: + v22 = 121; +LABEL_27: + v15 = v22; + break; + case 4: + v14 = 415; +LABEL_29: + v15 = 158; + break; + case 5: + v15 = 196; + goto LABEL_46; + case 6: + v15 = 234; + goto LABEL_46; + case 7: + v15 = 271; + goto LABEL_46; + case 8: + v15 = 307; +LABEL_46: + v14 = 416; + break; + default: + break; + } + } + pRenderer->DrawTextureTransparent(v14, v15, pPageTexture); + v13 = v25; + } + a2.x += 2; + ++v13; + v25 = v13; + } + while ( v13 < 9 ); +} +// 506408: using guessed type int dword_506408[]; +// 50654C: using guessed type int dword_50654C; + +//----- (00412E85) -------------------------------------------------------- +char __cdecl DrawBook_History() +{ + unsigned int v0; // eax@3 + unsigned int v1; // eax@7 + int v2; // eax@10 + const char *v3; // eax@10 + signed int v4; // ecx@12 + int v5; // ecx@14 + int v6; // eax@21 + int v7; // esi@21 + char *v8; // eax@21 + int v9; // eax@22 + unsigned int v11; // [sp-8h] [bp-64h]@3 + unsigned int v12; // [sp-8h] [bp-64h]@7 + Texture *v13; // [sp-4h] [bp-60h]@3 + Texture *v14; // [sp-4h] [bp-60h]@7 + GUIWindow a1; // [sp+8h] [bp-54h]@10 + + pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_11); + if ( dword_506548 || !dword_506528 ) + { + v13 = pTex_tab_an_6a__zoom_off; + v11 = pViewport->uViewportTL_Y + 2; + v0 = pViewport->uViewportTL_X + 407; + } + else + { + v13 = pTex_tab_an_6b__zoom_on; + v11 = pViewport->uViewportTL_Y + 1; + v0 = pViewport->uViewportTL_X + 398; + } + pRenderer->DrawTextureTransparent(v0, v11, v13); + if ( dword_506544 || dword_506528 + awards_count >= awards_count2 ) + { + v14 = pTex_tab_an_7a__zoot_off; + v12 = pViewport->uViewportTL_Y + 38; + v1 = pViewport->uViewportTL_X + 407; + } + else + { + v14 = pTex_tab_an_7b__zoot_on; + v12 = pViewport->uViewportTL_Y + 38; + v1 = pViewport->uViewportTL_X + 398; + } + pRenderer->DrawTextureTransparent(v1, v12, v14); + if ( !byte_5C6D50[dword_506528] ) + { + v2 = achievedAwardsIndex[dword_506528]; + a1.uFrameWidth = 460; + a1.uFrameX = 8; + a1.uFrameY = 8; + a1.uFrameHeight = 344; + v3 = (const char *)pStorylineText->StoreLine[v2].pPageTitle;//field_4[]; + a1.uFrameZ = 467; + a1.uFrameW = 351; + if ( v3 ) + a1.DrawTitleText(pBook2Font, 0, 0x16u, 0, v3, 3u); + } + a1.uFrameX = 48; + a1.uFrameY = 70; + a1.uFrameWidth = 360; + a1.uFrameHeight = 264; + v4 = LOBYTE(pAutonoteFont->uFontHeight) - 3; + a1.uFrameZ = 407; + a1.uFrameHeight = v4 * 264 / v4; + a1.uFrameW = a1.uFrameHeight + 69; + if ( dword_506544 && dword_506528 + awards_count < awards_count2 ) + { + pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); + v5 = dword_50651C++; + dword_506528 += awards_count; + byte_506130[v5] = awards_count; + } + if ( dword_506548 && dword_50651C ) + { + pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); + --dword_50651C; + dword_506528 -= (unsigned __int8)byte_506130[dword_50651C]; + } + if ( !awards_count || dword_506528 < 1 ) + { + dword_506528 = 0; + dword_50651C = 0; + } + dword_506544 = 0; + v6 = achievedAwardsIndex[dword_506528]; + dword_506548 = 0; + awards_count = 0; + //v7 = *pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6); + v7 = (int)pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6); + v8 = BuilDialogueString( + pStorylineText->StoreLine[v6].pText, + uActiveCharacter - 1, + 0, + 0, + 0, + (__int64 *)&pParty->field_3C._s_times[ v6 + 21]); + if ( v7 ) + { + v9 = pAutonoteFont->_44C6C2(v8, &a1, 1u, (unsigned __int8)byte_5C6D50[dword_506528]); + LOBYTE(v8) = a1.DrawText(pAutonoteFont, 1, 0, 0, (const char *)v9, 0, a1.uFrameY + a1.uFrameHeight, 0); + ++awards_count; + } + return (char)v8; +} + + +//----- (00413126) -------------------------------------------------------- +void __cdecl DrawBook_Quests() +{ + unsigned int v0; // eax@3 + unsigned int v1; // eax@7 + int v2; // ecx@11 + int v3; // ebx@16 + int v4; // eax@19 + const char *v5; // edi@19 + int v6; // eax@19 + unsigned int v7; // edi@19 + unsigned int v8; // [sp-8h] [bp-68h]@3 + unsigned int v9; // [sp-8h] [bp-68h]@7 + Texture *v10; // [sp-4h] [bp-64h]@3 + Texture *v11; // [sp-4h] [bp-64h]@7 + GUIWindow a1; // [sp+Ch] [bp-54h]@9 + + pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_CurrentBook); + if ( dword_506548 || !dword_506528 ) + { + v10 = pTex_tab_an_6a__zoom_off; + v8 = pViewport->uViewportTL_Y + 2; + v0 = pViewport->uViewportTL_X + 407; + } + else + { + v10 = pTex_tab_an_6b__zoom_on; + v8 = pViewport->uViewportTL_Y + 1; + v0 = pViewport->uViewportTL_X + 398; + } + pRenderer->DrawTextureTransparent(v0, v8, v10); + if ( dword_506544 || dword_506528 + awards_count >= awards_count2 ) + { + v11 = pTex_tab_an_7a__zoot_off; + v9 = pViewport->uViewportTL_Y + 38; + v1 = pViewport->uViewportTL_X + 407; + } + else + { + v11 = pTex_tab_an_7b__zoot_on; + v9 = pViewport->uViewportTL_Y + 38; + v1 = pViewport->uViewportTL_X + 398; + } + pRenderer->DrawTextureTransparent(v1, v9, v11); + a1.uFrameWidth = 460; + a1.uFrameHeight = 344; + a1.uFrameX = 8; + a1.uFrameY = 8; + a1.uFrameZ = 467; + a1.uFrameW = 351; + a1.DrawTitleText(pBook2Font, 0, 0x16u, 0, pGlobalTXT_LocalizationStrings[174], 3u); + a1.uFrameX = 48; + a1.uFrameY = 70; + a1.uFrameWidth = 360; + a1.uFrameHeight = 264; + a1.uFrameZ = 407; + a1.uFrameW = 333; + if ( dword_506544 && dword_506528 + awards_count < awards_count2 ) + { + pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); + v2 = dword_50651C++; + dword_506528 += awards_count; + byte_506130[v2] = awards_count; + } + if ( dword_506548 && dword_50651C ) + { + pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); + --dword_50651C; + dword_506528 -= (unsigned __int8)byte_506130[dword_50651C]; + } + if ( !awards_count || (v3 = dword_506528, dword_506528 < 1) ) + { + v3 = 0; + dword_50651C = 0; + dword_506528 = 0; + } + dword_506544 = 0; + dword_506548 = 0; + awards_count = 0; + while ( v3 < awards_count2 ) + { + v4 = achievedAwardsIndex[v3]; + ++awards_count; + v5 = pQuestTable[v4-1];//(&dword_722F10)[4 * v4]; + a1.DrawText(pAutonoteFont, 1, 0, 0, pQuestTable[v4-1], 0, 0, 0);//(&dword_722F10)[4 * v4], 0, 0, 0); + v6 = pAutonoteFont->CalcTextHeight(v5, &a1, 1, 0); + v7 = a1.uFrameY + v6; + if ( (signed int)(a1.uFrameY + v6) > (signed int)a1.uFrameHeight ) + break; + pRenderer->DrawTextureTransparent(100, v7 + 12, pSpellBookPagesTextr_10); + ++v3; + a1.uFrameY = v7 + 24; + } +} + + +//----- (0041338E) -------------------------------------------------------- +void __cdecl DrawBook_Autonotes() +{ + unsigned int v0; // eax@3 + unsigned int v1; // eax@7 + signed int v2; // ebp@11 + unsigned int v3; // eax@18 + unsigned int v4; // eax@24 + unsigned int v5; // eax@30 + unsigned int v6; // eax@36 + unsigned int v7; // eax@42 + signed int v8; // ebp@47 + int v9; // eax@52 + int v10; // eax@56 + int v11; // edx@57 + int v12; // ebp@64 + int v13; // eax@65 + const char *v14; // edi@65 + int v15; // eax@65 + unsigned int v16; // edi@65 + unsigned int v17; // [sp-8h] [bp-70h]@3 + unsigned int v18; // [sp-8h] [bp-70h]@7 + unsigned int v19; // [sp-8h] [bp-70h]@18 + unsigned int v20; // [sp-8h] [bp-70h]@24 + unsigned int v21; // [sp-8h] [bp-70h]@30 + unsigned int v22; // [sp-8h] [bp-70h]@36 + unsigned int v23; // [sp-8h] [bp-70h]@42 + Texture *v24; // [sp-4h] [bp-6Ch]@3 + Texture *v25; // [sp-4h] [bp-6Ch]@7 + Texture *v26; // [sp-4h] [bp-6Ch]@18 + Texture *v27; // [sp-4h] [bp-6Ch]@24 + Texture *v28; // [sp-4h] [bp-6Ch]@30 + Texture *v29; // [sp-4h] [bp-6Ch]@36 + Texture *v30; // [sp-4h] [bp-6Ch]@42 + signed __int16 v31; // [sp+10h] [bp-58h]@1 + char *v32; // [sp+10h] [bp-58h]@49 + GUIWindow a1; // [sp+14h] [bp-54h]@46 + + v31 = 0; + pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_AutonotesBook); + if ( dword_506548 || !dword_506528 ) + { + v24 = pTex_tab_an_6a__zoom_off; + v17 = pViewport->uViewportTL_Y + 2; + v0 = pViewport->uViewportTL_X + 407; + } + else + { + v24 = pTex_tab_an_6b__zoom_on; + v17 = pViewport->uViewportTL_Y + 1; + v0 = pViewport->uViewportTL_X + 398; + } + pRenderer->DrawTextureTransparent(v0, v17, v24); + if ( dword_506544 || dword_506528 + awards_count >= awards_count2 ) + { + v25 = pTex_tab_an_7a__zoot_off; + v18 = pViewport->uViewportTL_Y + 38; + v1 = pViewport->uViewportTL_X + 407; + } + else + { + v25 = pTex_tab_an_7b__zoot_on; + v18 = pViewport->uViewportTL_Y + 38; + v1 = pViewport->uViewportTL_X + 398; + } + pRenderer->DrawTextureTransparent(v1, v18, v25); + if ( !dword_506540 ) + { + if ( dword_506568 ) + { + pRenderer->DrawTextureTransparent( + pViewport->uViewportTL_X + 408, + pViewport->uViewportTL_Y + 113, + pTexture_506390); + v2 = 1; + goto LABEL_16; + } + goto LABEL_14; + } + if ( !dword_506568 ) + { +LABEL_14: + v2 = 1; + goto LABEL_15; + } + v2 = 1; + v31 = 1; + pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); +LABEL_15: + dword_506568 = 0; + pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTexture_506394); +LABEL_16: + if ( dword_50653C ) + { + if ( dword_506568 != v2 ) + { + v31 = v2; + pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); + } + } + else + { + if ( dword_506568 != v2 ) + { + v26 = pTexture_506388; + v19 = pViewport->uViewportTL_Y + 150; + v3 = pViewport->uViewportTL_X + 408; + goto LABEL_22; + } + } + v26 = pTexture_50638C; + dword_506568 = v2; + v19 = pViewport->uViewportTL_Y + 150; + v3 = pViewport->uViewportTL_X + 399; +LABEL_22: + pRenderer->DrawTextureTransparent(v3, v19, v26); + if ( dword_506538 ) + { + if ( dword_506568 != 2 ) + { + v31 = v2; + pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); + } + } + else + { + if ( dword_506568 != 2 ) + { + v27 = pTexture_506380; + v20 = pViewport->uViewportTL_Y + 188; + v4 = pViewport->uViewportTL_X + 408; + goto LABEL_28; + } + } + v27 = pTexture_506384; + dword_506568 = 2; + v20 = pViewport->uViewportTL_Y + 188; + v4 = pViewport->uViewportTL_X + 397; +LABEL_28: + pRenderer->DrawTextureTransparent(v4, v20, v27); + if ( dword_506534 ) + { + if ( dword_506568 != 3 ) + { + v31 = v2; + pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); + } + } + else + { + if ( dword_506568 != 3 ) + { + v28 = pTexture_506378; + v21 = pViewport->uViewportTL_Y + 226; + v5 = pViewport->uViewportTL_X + 408; + goto LABEL_34; + } + } + v28 = pTexture_50637C; + dword_506568 = 3; + v21 = pViewport->uViewportTL_Y + 226; + v5 = pViewport->uViewportTL_X + 397; +LABEL_34: + pRenderer->DrawTextureTransparent(v5, v21, v28); + if ( dword_506530 ) + { + if ( dword_506568 != 4 ) + { + v31 = v2; + pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); + } + } + else + { + if ( dword_506568 != 4 ) + { + v29 = pTexture_506370; + v22 = pViewport->uViewportTL_Y + 263; + v6 = pViewport->uViewportTL_X + 408; + goto LABEL_40; + } + } + v29 = pTexture_506374; + dword_506568 = 4; + v22 = pViewport->uViewportTL_Y + 264; + v6 = pViewport->uViewportTL_X + 397; +LABEL_40: + pRenderer->DrawTextureTransparent(v6, v22, v29); + if ( dword_50652C ) + { + if ( dword_506568 != 5 ) + { + v31 = v2; + pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); + } + } + else + { + if ( dword_506568 != 5 ) + { + v30 = pTexture_506368; + v23 = pViewport->uViewportTL_Y + 302; + v7 = pViewport->uViewportTL_X + 408; + goto LABEL_46; + } + } + v30 = pTexture_50636C; + dword_506568 = 5; + v23 = pViewport->uViewportTL_Y + 302; + v7 = pViewport->uViewportTL_X + 397; +LABEL_46: + pRenderer->DrawTextureTransparent(v7, v23, v30); + a1.uFrameWidth = 460; + a1.uFrameHeight = 344; + a1.uFrameX = 8; + a1.uFrameY = 8; + a1.uFrameZ = 467; + a1.uFrameW = 467; + a1.DrawTitleText(pBook2Font, 0, 0x16u, 0, pGlobalTXT_LocalizationStrings[154], 3u); + a1.uFrameX = 48; + a1.uFrameY = 70; + a1.uFrameWidth = 360; + a1.uFrameHeight = 264; + a1.uFrameZ = 407; + a1.uFrameW = 333; + if ( v31 ) + { + awards_count2 = 0; + dword_506528 = 0; + dword_50651C = 0; + awards_count = 0; + v8 = 0; + do + { + //if ( dword_72371C[2 * v8] == dword_506568 ) + if ( pAutonoteTxt[v8-1].eType == dword_506568 ) + { + //v32 = (&dword_723718_autonote_related)[8 * (signed __int16)v8]; + v32 = (char *)pAutonoteTxt[v8-1].pText; + if ( (short)v8 ) + { + if ( (unsigned __int16)_449B57_test_bit(pParty->_autonote_bits, v8) && v32 ) + { + v9 = awards_count++; + achievedAwardsIndex[v9] = (signed __int16)v8; + } + } + } + ++v8; + } + while ( v8 < 196 ); + awards_count2 = awards_count; + } + else + { + if ( dword_506544 ) + { + v10 = awards_count + dword_506528; + if ( awards_count + dword_506528 < awards_count2 ) + { + v11 = dword_50651C++; + byte_506130[v11] = awards_count; + dword_506528 = v10; + pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); + } + } + if ( dword_506548 && dword_50651C ) + { + --dword_50651C; + dword_506528 -= (unsigned __int8)byte_506130[dword_50651C]; + pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); + } + if ( !awards_count || dword_506528 < 1 ) + { + dword_506528 = 0; + dword_50651C = 0; + } + } + v12 = dword_506528; + dword_50652C = 0; + dword_506544 = 0; + dword_506548 = 0; + awards_count = 0; + dword_506530 = 0; + dword_506534 = 0; + dword_506538 = 0; + dword_50653C = 0; + dword_506540 = 0; + while ( v12 < awards_count2 ) + { + v13 = achievedAwardsIndex[v12]; + ++awards_count; + //v14 = (&dword_723718_autonote_related)[8 * v13]; + v14 = pAutonoteTxt[v13-1].pText; + //a1.DrawText(pAutonoteFont, 1, 0, 0, (&dword_723718_autonote_related)[8 * v13], 0, 0, 0); + a1.DrawText(pAutonoteFont, 1, 0, 0, pAutonoteTxt[v13-1].pText, 0, 0, 0); + v15 = pAutonoteFont->CalcTextHeight(v14, &a1, 1, 0); + v16 = a1.uFrameY + v15; + if ( (signed int)(a1.uFrameY + v15) > (signed int)a1.uFrameHeight ) + break; + pRenderer->DrawTextureTransparent(0x64u, v16 + 12, pSpellBookPagesTextr_10); + ++v12; + a1.uFrameY = v16 + 24; + } +} + + +//----- (00413980) -------------------------------------------------------- +void DrawBook_Maps() + { + + int v6; // eax@31 + unsigned int map_id; // eax@35 + Texture *buttnTxtr; // [sp-4h] [bp-DCh]@3 + char party_coord[120]; // [sp+Ch] [bp-CCh]@37 + GUIWindow map_window; // [sp+84h] [bp-54h]@35 + unsigned int textrX, textrY; + + pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_12); + if ( dword_506548 || viewparams->field_2C / 128 >= 12 ) + { + buttnTxtr = pTex_tab_an_6a__zoom_off; + textrY = pViewport->uViewportTL_Y + 2; + textrX = pViewport->uViewportTL_X + 408; + } + else + { + buttnTxtr = pTex_tab_an_6b__zoom_on; + textrY = pViewport->uViewportTL_Y + 1; + textrX = pViewport->uViewportTL_X + 398; + } + pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr); + if ( dword_506544 || viewparams->field_2C / 128 <= 3 ) + { + buttnTxtr = pTex_tab_an_7a__zoot_off; + textrY = pViewport->uViewportTL_Y + 38; + textrX = pViewport->uViewportTL_X + 408; + } + else + { + buttnTxtr = pTex_tab_an_7b__zoot_on; + textrY = pViewport->uViewportTL_Y + 38; + textrX = pViewport->uViewportTL_X + 398; + } + pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr); + if ( dword_506540 ) + { + buttnTxtr = pTexture_506390; + textrY = pViewport->uViewportTL_Y + 113; + textrX = pViewport->uViewportTL_X + 408; + } + else + { + buttnTxtr = pTexture_506394; + textrY = pViewport->uViewportTL_Y + 113; + textrX = pViewport->uViewportTL_X + 398; + } + pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr); + if ( dword_50653C ) + { + buttnTxtr = pTexture_506388; + textrY = pViewport->uViewportTL_X + 150; + textrX = pViewport->uViewportTL_Y + 408; + } + else + { + buttnTxtr = pTexture_50638C; + textrY = pViewport->uViewportTL_X + 150; + textrX = pViewport->uViewportTL_Y + 399; + } + pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr); + if ( dword_506538 ) + { + buttnTxtr = pTexture_506380; + textrY = pViewport->uViewportTL_Y + 188; + textrX = pViewport->uViewportTL_X + 408; + } + else + { + buttnTxtr = pTexture_506384; + textrY = pViewport->uViewportTL_Y + 188; + textrX = pViewport->uViewportTL_X + 397; + } + pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr); + if ( dword_506534 ) + { + buttnTxtr = pTexture_506378; + textrY = pViewport->uViewportTL_Y + 226; + textrX = pViewport->uViewportTL_X + 408; + } + else + { + buttnTxtr = pTexture_50637C; + textrY = pViewport->uViewportTL_Y + 226; + textrX = pViewport->uViewportTL_X + 397; + } + pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr); + if ( dword_506544 ) + viewparams->CenterOnParty2(); + if ( dword_506548 ) + viewparams->CenterOnParty(); + if ( dword_506540 ) + viewparams->_443219(); + if ( dword_50653C ) + viewparams->_443231(); + if ( dword_506538 ) + viewparams->_44323D(); + if ( dword_506534 ) + viewparams->_443225(); + + if ( dword_506548 | dword_506544 | dword_506540 | dword_50653C | dword_506538 | dword_506534 ) + pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); + dword_506548 = 0; + dword_506544 = 0; + dword_506534 = 0; + dword_506538 = 0; + dword_50653C = 0; + dword_506540 = 0; + DrawBook_Map_sub(97, 49, 361, 313, 0); + pRenderer->DrawTextureTransparent(75, 22, pTexture_mapbordr); + map_window.uFrameWidth = 460; + map_window.uFrameHeight = 344; + map_window.uFrameX = 8; + map_window.uFrameY = 8; + map_window.uFrameZ = 467; + map_window.uFrameW = 467; + map_id = pMapStats->GetMapInfo(pCurrentMapName); + if ( map_id ) + map_window.DrawTitleText(pBook2Font, -14, 12, 0, pMapStats->pInfos[map_id].pName, 3); + map_window.uFrameX = 0; + sprintf(party_coord, pGlobalTXT_LocalizationStrings[659], pParty->vPosition.x, pParty->vPosition.y); //"x: %d y: %d" + map_window.DrawTitleText(pFontComic, 0, 320, 0, party_coord, 0); +} + +//----- (00442955) -------------------------------------------------------- +void DrawBook_Map_sub( unsigned int tl_x, unsigned int tl_y, unsigned int br_x, int br_y, int _48074 ) + { + int v5; // ebx@1 + int v6; // edi@1 + BLVMapOutlines *v7; // eax@8 + unsigned __int8 v8; // zf@8 + unsigned __int8 v9; // sf@8 + int v10; // esi@10 + unsigned int v11; // edx@11 + __int16 v12; // cx@12 + signed int v13; // eax@15 + int v14; // eax@16 + Vec3_short_ *v15; // ecx@16 + int v16; // edx@16 + int v17; // ecx@16 + Vec3_short_ *v18; // eax@16 + int v19; // ecx@16 + int v20; // eax@16 + signed int v21; // esi@18 + int v22; // ecx@21 + BLVMapOutline *v23; // ecx@21 + Vec3_short_ *v24; // edx@21 + Vec3_short_ *v25; // eax@21 + int v26; // ecx@21 + unsigned __int16 *v27; // edi@21 + int v28; // edx@21 + int v29; // eax@21 + double v30; // st7@23 + signed __int64 v31; // qax@23 + unsigned short *v32; // edx@23 + int textr_width; // esi@23 + signed int v34; // eax@23 + signed int v35; // ecx@23 + int v36; // esi@27 + int v37; // ecx@27 + int v38; // edx@31 + unsigned int v39; // eax@33 + short *v40; // esi@33 + short *v41; // edi@33 + unsigned __int8 v42; // cf@33 + unsigned int v43; // ecx@33 + short *v44; // edi@33 + short *v45; // esi@33 + int v46; // ecx@33 + signed int v47; // esi@38 + signed int v48; // ecx@38 + int v49; // eax@38 + signed int v50; // edx@55 + unsigned int v51; // ecx@55 + int result; // eax@72 + int v53; // eax@75 + int v54; // esi@75 + int v55; // eax@75 + __int16 v56; // si@85 + double v57; // st7@85 + int v58; // ebx@85 + signed __int64 v59; // qax@85 + signed int v60; // edi@85 + signed __int64 v61; // qax@85 + signed int v62; // ebx@85 + signed int v63; // esi@85 + int v64; // eax@87 + unsigned int v65; // ebx@95 + unsigned short *v66; // edx@95 + unsigned __int16 *v67; // esi@96 + int v68; // edi@98 + unsigned __int16 v69; // cx@99 + unsigned int v70; // [sp-10h] [bp-48074h]@80 + unsigned int v71; // [sp-Ch] [bp-48070h]@80 + unsigned int v72; // [sp-8h] [bp-4806Ch]@80 + signed int v73; // [sp-4h] [bp-48068h]@59 + unsigned __int16 v74; // [sp-4h] [bp-48068h]@79 + unsigned short map_texture_16[147456]; // [sp+Ch] [bp-48058h]@23 + int v76; // [sp+4800Ch] [bp-58h]@23 + unsigned __int16 *v77; // [sp+48010h] [bp-54h]@27 + unsigned __int16 *pPalette_16; // [sp+48014h] [bp-50h]@23 + unsigned int surfPitch; // [sp+48018h] [bp-4Ch]@1 + + int v81; // [sp+48020h] [bp-44h]@23 + unsigned __int16* render16_data; + unsigned char* texture8_data; + unsigned char* curr_line; + int scale_increment; + int scaled_posX; + int scaled_posY; + int stepX_r; + int stepY_r; + + + unsigned int teal; // [sp+48028h] [bp-3Ch]@8 + int v84; // [sp+4802Ch] [bp-38h]@1 + int screenCenter_X; // [sp+48030h] [bp-34h]@1 + int v86; // [sp+48034h] [bp-30h]@1 + int v87; // [sp+48038h] [bp-2Ch]@16 + unsigned int v88; // [sp+4803Ch] [bp-28h]@16 + int black; // [sp+48040h] [bp-24h]@8 + int screenCenterY; // [sp+48044h] [bp-20h]@1 + unsigned int i; // [sp+48048h] [bp-1Ch]@9 + unsigned int screenHeight; // [sp+4804Ch] [bp-18h]@16 + unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16 + signed int screenWidth; // [sp+48054h] [bp-10h]@8 + unsigned int v95; // [sp+48058h] [bp-Ch]@16 + int v96; // [sp+4805Ch] [bp-8h]@10 + const void *v97; // [sp+48060h] [bp-4h]@16 + unsigned short *a4a; // [sp+4806Ch] [bp+8h]@85 + int a5a; // [sp+48070h] [bp+Ch]@86 + + tl_x = tl_x; + tl_y = tl_y; + screenCenter_X = (signed int)(tl_x + br_x) >> 1; + screenCenterY = (signed int)(tl_y + br_y) >> 1; + surfPitch = pRenderer->uTargetSurfacePitch; + pRenderer->Clip_v2(tl_x, tl_y, br_x, br_y); + v5 = viewparams->field_2C; + v6 = viewparams->sViewCenterX; + v86 = viewparams->sViewCenterX; + v84 = viewparams->sViewCenterY; + if ( viewparams->field_2C != 384 ) + { + if ( viewparams->field_2C == 768 ) + { + if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) + v5 = 680; + } + } + else + { + v6 = viewparams->field_38; + v86 = viewparams->field_38; + v84 = viewparams->field_3A; + if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) + v5 = viewparams->field_2C - 34; + } + if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) + { + screenWidth = br_x - tl_x + 1; + screenHeight = br_y - tl_y + 1; + render16_data = &pRenderer->pTargetSurface[tl_x + tl_y * surfPitch]; + texture8_data = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0; + pPalette_16 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16; + scale_increment = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / v5; + + v30 = (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2)); + + + teal = (unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16; + v97 = (const void *)((unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16); + + v32 = map_texture_16; + textr_width = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; + stepY_r = (int)(signed __int64)((double)(- v84 - 22528 / (v5 / 384)+ 32768) / v30) << 16; + v81 = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30); + black = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30); + + v76 = textr_width; + scaled_posY = stepY_r >> 16; + //nearest neiborhood scaling + if ( texture8_data) + { + for(uint i=0; i>16; + map_texture_16[i*screenWidth+j]=pPalette_16[*(curr_line+scaled_posX)]; + stepX_r+=scale_increment; + } + stepY_r+=scale_increment; + scaled_posY=stepY_r>>16; + } + } + //move visible square to render + for(uint i=0; i 0 ) + { + memcpy((void*)&render16_data[surfPitch*i],(void*)&map_texture_16[i*screenWidth], screenWidth*2); + } + } + } + else + { + black = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0); + teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu); + v7 = pIndoor->pMapOutlines; + uNumBlueFacesInBLVMinimap = 0; + v8 = pIndoor->pMapOutlines->uNumOutlines == 0; + v9 = pIndoor->pMapOutlines->uNumOutlines < 0; + screenWidth = 0; + if ( !(v9 | v8) ) + { + i = 0; + do + { + v10 = (int)((char *)v7 + i + 4); + v96 = pIndoor->pFaces[*(short *)((char *)v7 + i + 8)].uAttributes; + if ( !(BYTE1(v96) & 0x20 || (v11 = pIndoor->pFaces[*(short *)((char *)v7 + i + 10)].uAttributes, BYTE1(v11) & 0x20) )) + { + v12 = *(short *)((char *)v7 + i + 14); + if ( !(v12 & 1) ) + { + if ( !(!(v96 & 0x80) && (v11 & 0x80u) == 0 )) + { + v96 = (signed int)screenWidth >> 3; + v13 = screenWidth; + *(short *)(v10 + 10) = v12 | 1; + pIndoor->_visible_outlines[v96] |= 1 << (7 - v13 % 8); + } + } + if ( (!(v12 & 1) && !(!(v96 & 0x80) && (v11 & 0x80u) == 0 )) || v12 & 1) + { + v14 = *(short *)v10; + v88 = v5; + v15 = &pIndoor->pVertices[v14]; + v16 = v15->x; + v17 = v15->y - v84; + v93 = (unsigned __int16 *)(v16 - v6); + screenHeight = v17; + v18 = &pIndoor->pVertices[*(short *)(v10 + 2)]; + v19 = v18->x; + v20 = v18->y - v84; + v95 = v19 - v6; + v97 = (const void *)v20; + v88 = (unsigned __int64)((v16 - v6) * (signed __int64)v5) >> 16; + v87 = (unsigned __int64)((signed int)screenHeight * (signed __int64)v5) >> 16; + v93 = (unsigned __int16 *)((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16); + screenHeight = (unsigned __int64)(v20 * (signed __int64)v5) >> 16; + pRenderer->Line2D( + screenCenter_X + v88, + screenCenterY - v87, + screenCenter_X + ((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16), + screenCenterY - screenHeight, + black); + v7 = pIndoor->pMapOutlines; + } + } + ++screenWidth; + i += 12; + } + while ( screenWidth < (signed int)v7->uNumOutlines ); + } + v21 = 0; + if ( (signed int)uNumBlueFacesInBLVMinimap > 0 ) + { + while ( 1 ) + { + v22 = pBlueFacesInBLVMinimapIDs[v21]; + v87 = v5; + v23 = &v7->pOutlines[v22]; + v24 = &pIndoor->pVertices[v23->uVertex1ID]; + v25 = &pIndoor->pVertices[v23->uVertex2ID]; + v26 = v25->x; + v27 = (unsigned __int16 *)(v24->x - v86); + v28 = v24->y - v84; + v29 = v25->y - v84; + v93 = v27; + screenHeight = v28; + v97 = (const void *)v29; + v87 = (unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16; + v88 = (unsigned __int64)(v28 * (signed __int64)v5) >> 16; + i = (unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16; + v95 = (unsigned __int64)(v29 * (signed __int64)v5) >> 16; + pRenderer->Line2D( + screenCenter_X + ((unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16), + screenCenterY - v88, + screenCenter_X + ((unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16), + screenCenterY - v95, + teal); + ++v21; + if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap ) + break; + v7 = pIndoor->pMapOutlines; + } + v6 = v86; + } + } + v47 = ((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + screenCenter_X - 3; + v81 = pParty->vPosition.y - v84; + v97 = (const void *)((unsigned __int64)((pParty->vPosition.y - v84) * (signed __int64)v5) >> 16); + v48 = 1; + v49 = screenCenterY - (int)v97 - 3; + if ( v47 >= (signed int)tl_x ) + { + if ( v47 > (signed int)br_x ) + { + if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + screenCenter_X - 6) > (signed int)br_x ) + v48 = 0; + v47 = br_x; + } + } + else + { + if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + screenCenter_X) < (signed int)tl_x ) + v48 = 0; + v47 = tl_x; + } + if ( v49 >= (signed int)tl_y ) + { + if ( v49 > br_y ) + { + if ( screenCenterY - (signed int)v97 - 6 > br_y ) + v48 = 0; + v49 = br_y; + } + } + else + { + if ( screenCenterY - (signed int)v97 < (signed int)tl_y ) + v48 = 0; + v49 = tl_y; + } + if ( v48 == 1 ) + { + v50 = 0; + v51 = pParty->sRotationY & stru_5C6E00->uDoublePiMask; + if ( (signed int)(pParty->sRotationY & stru_5C6E00->uDoublePiMask) >= 128 ) + { + if ( (signed int)v51 > 384 ) + { + if ( (signed int)v51 >= 640 ) + { + if ( (signed int)v51 > 896 ) + { + if ( (signed int)v51 >= 1152 ) + { + if ( (signed int)v51 > 1408 ) + { + if ( (signed int)v51 >= 1664 ) + { + if ( (signed int)v51 <= 1920 ) + v73 = 7; + } + else + { + v73 = 6; + } + } + else + { + v73 = 5; + } + } + else + { + v73 = 4; + } + } + else + { + v73 = 3; + } + } + else + { + v73 = 2; + } + if( (signed int)v51 <=1920) + v50 = v73; + } + else + v50 = 1; + } + pRenderer->DrawTransparentRedShade(v47, v49, (Texture *)(pTextureIDs_pMapDirs[v50] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v50]] : 0)); + } + result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); + v95 = 0; + v86 = result; + if ( (signed int)uNumLevelDecorations > 0 ) + { + screenWidth = (unsigned int)&pLevelDecorations[0].vPosition; + do + { + if ( *(char *)(screenWidth - 2) & 8 ) + { + v53 = *(int *)(screenWidth + 4) - v84; + v93 = (unsigned __int16 *)(*(int *)screenWidth - v6); + screenHeight = v53; + v54 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + screenCenter_X; + v97 = (const void *)((unsigned __int64)(v53 * (signed __int64)v5) >> 16); + v55 = screenCenterY - (int)v97; + if ( v54 >= pRenderer->field_1C_clipx ) + { + if ( v54 <= pRenderer->field_24_width && v55 >= pRenderer->field_20_clipy && v55 <= pRenderer->field_28_height ) + { + v74 = v86; + if ( v5 > 512 ) + { + v96 = v55 + 1; + black = v55 - 1; + pRenderer->Line2D(v54 - 1, v55 - 1, v54 - 1, v55 + 1, v86); + pRenderer->Line2D(v54, black, v54, v96, v86); + ++v54; + v74 = v86; + v72 = v96; + v71 = v54; + v70 = black; + } + else + { + v72 = screenCenterY - (int)v97; + v71 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + screenCenter_X; + v70 = screenCenterY - (int)v97; + } + pRenderer->Line2D(v54, v70, v71, v72, v74); + } + } + } + ++v95; + result = v95; + screenWidth += 32; + } + while ( (signed int)v95 < (signed int)uNumLevelDecorations ); + } + if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) + { + screenCenterY = br_x - tl_x + 1; + v95 = br_y - tl_y + 1; + v77 = &pRenderer->pTargetSurface[tl_x + tl_y * surfPitch]; + v56 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2; + black = (1 << (v56 + 16)) / v5; + v57 = (double)(1 << (16 - v56)); + v58 = 22528 / (v5 / 384); + v59 = (signed __int64)((double)(v6 - v58 + 32768) / v57); + v60 = (int)v59 << 16; + v97 = (const void *)((int)v59 << 16); + v61 = (signed __int64)((double)(32768 - v58 - v84) / v57); + pPalette_16 = (unsigned __int16 *)(v60 >> 16); + v62 = (int)v61 << 16; + teal = v60 >> 16; + v63 = (signed __int16)v61; + a4a = map_texture_16; + result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xCu, 0xCu, 0xCu); + screenCenter_X = 0; + for ( i = result; screenCenter_X < (signed int)v95; result = screenCenter_X ) + { + a5a = 0; + if ( screenCenterY > 0 ) + { + v96 = (v63 - 80) / 4; + v64 = teal; + do + { + v81 = (v64 - 80) / 4; + if ( !pOutdoor->_47F04C(v81, v96) ) + { + if ( pOutdoor->_47F097(v81, v96) ) + { + if ( !((a5a + screenCenter_X) % 2) ) + *a4a = i; + } + else + { + *a4a = 0; + } + } + ++a4a; + v97 = (char *)v97 + black; + v64 = (signed int)v97 >> 16; + ++a5a; + } + while ( a5a < screenCenterY ); + } + v62 += black; + v97 = (const void *)v60; + a4a += screenCenterY - a5a; + v63 = v62 >> 16; + ++screenCenter_X; + teal = (unsigned int)pPalette_16; + } + v65 = v95; + v66 = map_texture_16; + if ( (signed int)v95 > 0 ) + { + v67 = v77; + result = 2 * (surfPitch - screenCenterY); + do + { + if ( screenCenterY > 0 ) + { + v68 = screenCenterY; + do + { + v69 = *(short *)v66; + if ( !*(short *)v66 || v69 == (short)i ) + *v67 = v69; + ++v66; + ++v67; + --v68; + } + while ( v68 ); + } + v67 = (unsigned __int16 *)((char *)v67 + result); + --v65; + } + while ( v65 ); + } + } + } + + + + +//----- (00413CC6) -------------------------------------------------------- +void __thiscall SellectDrawBook(unsigned int uBook) +{ + enum WindowType pWindowType; // esi@1 + + pWindowType = (enum WindowType)uBook; + pRenderer->DrawTextureIndexed(471u, 445u, (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0)); + switch ( pWindowType ) + { + case WINDOW_Lloyd: // 177 + DrawLloydBeaconsScreen(); + break; + case WINDOW_TownPortal: //195 + DrawTownPortalScreen(); + break; + case WINDOW_QuestBook: //200 + DrawBook_Quests(); + break; + case WINDOW_AutonotesBook: //201 + DrawBook_Autonotes(); + break; + case WINDOW_MapsBook://202 + DrawBook_Maps(); + break; + case WINDOW_CalendarBook://203 + DrawBook_Calendar(); + break; + case WINDOW_HistoryBook://224 + DrawBook_History(); + break; + } +} diff -r f39d5902c85a -r 70c5a87a1307 UICharacter.cpp --- a/UICharacter.cpp Wed Mar 20 17:48:51 2013 +0600 +++ b/UICharacter.cpp Wed Mar 20 17:49:15 2013 +0600 @@ -0,0 +1,4264 @@ +#include + +#include "MM7.h" + +#include "MapInfo.h" +#include "Game.h" +#include "GUIWindow.h" +#include "GUIFont.h" +#include "GUIButton.h" +#include "GUIProgressBar.h" +#include "Party.h" +#include "AudioPlayer.h" +#include "Outdoor.h" +#include "IndoorCamera.h" +#include "Overlays.h" +#include "Monsters.h" +#include "Arcomage.h" +#include "LOD.h" +#include "Actor.h" +#include "Allocator.h" +#include "Events.h" +#include "Viewport.h" +#include "FrameTableInc.h" +#include "Math.h" +#include "SpriteObject.h" +#include "ObjectList.h" +#include "Chest.h" +#include "PaletteManager.h" +#include "DecorationList.h" +#include "SaveLoad.h" +#include "stru123.h" +#include "Time.h" +#include "IconFrameTable.h" +#include "Awards.h" +#include "Autonotes.h" +#include "stru160.h" +#include "stru279.h" +#include "TurnEngine.h" +#include "stru277.h" +#include "Weather.h" +#include "stru272.h" +#include "stru298.h" +#include "StorylineTextTable.h" +#include "Events2D.h" +#include "texts.h" +#include "stru351.h" + +#include "mm7_data.h" + + + + + +//----- (00419719) -------------------------------------------------------- +char __fastcall CharacterUI_SkillsTab_Draw(unsigned int uPlayerID) + { + unsigned int v1; // esi@1 + Player *pPlayer; // ebp@1 + unsigned int v3; // eax@1 + signed int v4; // ecx@1 + int v5; // edi@3 + GUIWindow *v6; // ecx@3 + int v7; // eax@4 + GUIButton *v8; // edx@5 + int v9; // eax@7 + unsigned int v10; // ecx@9 + unsigned __int16 v11; // ax@9 + int v12; // eax@9 + unsigned __int8 v13; // cf@12 + unsigned __int8 v14; // zf@12 + unsigned int v15; // eax@12 + char *v16; // ecx@22 + GUIWindow *v17; // ecx@33 + int v18; // edx@34 + GUIButton *v19; // eax@35 + int v20; // edx@37 + unsigned __int16 v21; // cx@39 + unsigned int v22; // eax@39 + int v23; // edi@39 + unsigned int v24; // eax@42 + char v25; // sf@52 + char *v26; // ecx@52 + int v27; // edi@63 + GUIWindow *v28; // ecx@63 + int v29; // edx@64 + GUIButton *v30; // eax@65 + int v31; // edx@67 + unsigned int v32; // ecx@69 + int v33; // eax@69 + unsigned int v34; // eax@72 + char *v35; // ecx@82 + GUIWindow *v36; // ecx@93 + int v37; // edx@94 + GUIButton *v38; // eax@94 + int v39; // edx@97 + unsigned __int16 v40; // cx@99 + unsigned int v41; // eax@99 + int v42; // edi@99 + unsigned int v43; // eax@102 + char *v44; // ecx@112 + char *v46; // [sp-Ch] [bp-4Ch]@19 + char *v47; // [sp-Ch] [bp-4Ch]@49 + char *v48; // [sp-Ch] [bp-4Ch]@79 + char *v49; // [sp-Ch] [bp-4Ch]@109 + unsigned int v50; // [sp-8h] [bp-48h]@19 + unsigned int v51; // [sp-8h] [bp-48h]@49 + unsigned int v52; // [sp-8h] [bp-48h]@79 + unsigned int v53; // [sp-8h] [bp-48h]@109 + int v54; // [sp-4h] [bp-44h]@19 + int v55; // [sp-4h] [bp-44h]@49 + int v56; // [sp-4h] [bp-44h]@79 + int v57; // [sp-4h] [bp-44h]@109 + unsigned int v58; // [sp+10h] [bp-30h]@9 + unsigned int v59; // [sp+10h] [bp-30h]@39 + unsigned int v60; // [sp+10h] [bp-30h]@69 + unsigned int v61; // [sp+10h] [bp-30h]@99 + int v62; // [sp+14h] [bp-2Ch]@4 + int v63; // [sp+14h] [bp-2Ch]@34 + int v64; // [sp+14h] [bp-2Ch]@64 + int v65; // [sp+14h] [bp-2Ch]@94 + signed int i; // [sp+18h] [bp-28h]@4 + signed int v67; // [sp+18h] [bp-28h]@34 + signed int v68; // [sp+18h] [bp-28h]@64 + signed int v69; // [sp+18h] [bp-28h]@94 + int v70; // [sp+1Ch] [bp-24h]@3 + int v71; // [sp+1Ch] [bp-24h]@33 + int v72; // [sp+1Ch] [bp-24h]@63 + int v73; // [sp+1Ch] [bp-24h]@93 + int uY; // [sp+20h] [bp-20h]@9 + int uYa; // [sp+20h] [bp-20h]@33 + int uYb; // [sp+20h] [bp-20h]@69 + int uYc; // [sp+20h] [bp-20h]@93 + unsigned int a5; // [sp+24h] [bp-1Ch]@1 + unsigned int v79; // [sp+28h] [bp-18h]@1 + int *v80; // [sp+2Ch] [bp-14h]@3 + int *v81; // [sp+2Ch] [bp-14h]@33 + int *v82; // [sp+2Ch] [bp-14h]@63 + int *v83; // [sp+2Ch] [bp-14h]@93 + unsigned int v84; // [sp+30h] [bp-10h]@1 + int v85; // [sp+34h] [bp-Ch]@1 + unsigned int v86; // [sp+38h] [bp-8h]@1 + unsigned __int16 v87; // [sp+3Ch] [bp-4h]@9 + char *v88; // [sp+3Ch] [bp-4h]@24 + char *v89; // [sp+3Ch] [bp-4h]@54 + unsigned __int16 v90; // [sp+3Ch] [bp-4h]@69 + char *v91; // [sp+3Ch] [bp-4h]@84 + char *v92; // [sp+3Ch] [bp-4h]@114 + + v1 = uPlayerID; + a5 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); + v84 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xAFu, 0xFFu); + v85 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem; + v86 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0); + v79 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); + pPlayer = &pParty->pPlayers[v1-1]; + v3 = pIcons_LOD->LoadTexture("fr_skill", TEXTURE_16BIT_PALETTE); + pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0)); + v4 = v79; + if ( !pPlayer->uSkillPoints ) + v4 = 65535; + sprintf( + pTmpBuf, + "%s \f%05d%s\f00000\r177%s: \f%05d%d\f00000", + pGlobalTXT_LocalizationStrings[206], // Skills for + a5, + pPlayer->pName, + pGlobalTXT_LocalizationStrings[207], // Skill Points + v4, + pPlayer->uSkillPoints); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0); + v5 = 2 * LOBYTE(pFontLucida->uFontHeight) + 13;// Weapons, Level + sprintf(pTmpBuf, "%s\r400%s", pGlobalTXT_LocalizationStrings[242], pGlobalTXT_LocalizationStrings[131]); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, v5, a5, pTmpBuf, 0, 0, 0); + v6 = pGUIWindow_CurrentMenu; + v70 = 0; + v80 = pWeaponSkills; + do + { + v62 = *v80; + v7 = 0; + for ( i = 0; i < (signed int)v6->uNumControls; v7 = i++ + 1 ) + { + v8 = v6->pControlsHead; + if ( v7 > 0 ) + { + do + { + v8 = v8->pNext; + --v7; + } + while ( v7 ); + } + v9 = v8->field_1C; + if ( SBYTE1(v9) >= 0 ) + continue; + BYTE1(v9) &= 0x7Fu; + if ( v9 != v62 ) + continue; + v5 = v8->uY; + v10 = pPlayer->uSkillPoints; + ++v70; + v11 = pPlayer->pActiveSkills[v62]; + v87 = pPlayer->pActiveSkills[v62]; + v12 = v11 & 0x3F; + v58 = 0; + uY = v12; + if ( v10 >= v12 + 1 ) + v58 = v84; + if ( v85 == i ) + { + v13 = v10 < v12; + v14 = v10 == v12; + v15 = v86; + if ( !(v13 | v14) ) + v15 = v79; + v58 = v15; + } + else + { + v15 = v58; + } + if ( HIBYTE(v87) & 1 ) + { + if ( !v15 ) + v15 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); + v54 = uY; + v50 = v58; + v46 = pGlobalTXT_LocalizationStrings[96]; + } + else + { + if ( !(v87 & 0xC0) ) + { + sprintf(pTmpBuf, "%s\r400%2d", pSkillNames[v62], uY); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 24, v5, v58, pTmpBuf, 0, 0, 0); + v6 = pGUIWindow_CurrentMenu; + continue; + } + v16 = pGlobalTXT_LocalizationStrings[432]; + if ( (v87 & 0x80u) == 0 ) + v16 = pGlobalTXT_LocalizationStrings[433]; + v88 = v16; + if ( !v15 ) + v15 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); + v54 = uY; + v50 = v58; + v46 = v88; + } + sprintf(pTmpBuf, "%s ", pSkillNames[v62], v15, v46, v50, v54); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 24, v5, v58, pTmpBuf, 0, 0, 0); + v6 = pGUIWindow_CurrentMenu; + } + ++v80; + } + while ( v80 <= &pWeaponSkills[8]); + if ( !v70 ) + { + v5 = v5 + LOBYTE(pFontLucida->uFontHeight) - 3; + v6->DrawText(pFontLucida, 24, v5, 0, pGlobalTXT_LocalizationStrings[153], 0, 0, 0); + } + uYa = v5 + 2 * LOBYTE(pFontLucida->uFontHeight) - 10; + sprintf(pTmpBuf, "%s\r400%s", pGlobalTXT_LocalizationStrings[138], pGlobalTXT_LocalizationStrings[131]); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, uYa, a5, pTmpBuf, 0, 0, 0); + v17 = pGUIWindow_CurrentMenu; + v71 = 0; + v81 = pMagicSkills; + do + { + v18 = 0; + v67 = 0; + v63 = *v81; + while ( v67 < (signed int)v17->uNumControls ) + { + v19 = v17->pControlsHead; + if ( v18 > 0 ) + { + do + { + v19 = v19->pNext; + --v18; + } + while ( v18 ); + } + v20 = v19->field_1C; + if ( SBYTE1(v20) >= 0 || (BYTE1(v20) &= 0x7Fu, v20 != v63) ) + { + v18 = v67++ + 1; + continue; + } + ++v71; + uYa = v19->uY; + v21 = pPlayer->pActiveSkills[v63]; + v22 = pPlayer->uSkillPoints; + v23 = pPlayer->pActiveSkills[v63] & 0x3F; + v59 = 0; + if ( v22 >= v23 + 1 ) + v59 = v84; + if ( v85 == v67 ) + { + v13 = v22 < v23; + v14 = v22 == v23; + v24 = v86; + if ( !(v13 | v14) ) + v24 = v79; + v59 = v24; + } + else + { + v24 = v59; + } + if ( HIBYTE(v21) & 1 ) + { + if ( !v24 ) + v24 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); + v55 = v23; + v51 = v59; + v47 = pGlobalTXT_LocalizationStrings[96]; + } + else + { + if ( !(v21 & 0xC0) ) + { + sprintf(pTmpBuf, "%s\r400%2d", pSkillNames[v63], v23); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 24, uYa, v59, pTmpBuf, 0, 0, 0); + v17 = pGUIWindow_CurrentMenu; + v18 = v67++ + 1; + continue; + } + v25 = (v21 & 0x80u) != 0; + v26 = pGlobalTXT_LocalizationStrings[432]; + if ( !v25 ) + v26 = pGlobalTXT_LocalizationStrings[433]; + v89 = v26; + if ( !v24 ) + v24 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); + v55 = v23; + v51 = v59; + v47 = v89; + } + sprintf(pTmpBuf, "%s ", pSkillNames[v63], v24, v47, v51, v55); + //LABEL_58: + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 24, uYa, v59, pTmpBuf, 0, 0, 0); + v17 = pGUIWindow_CurrentMenu; + //LABEL_59: + v18 = v67++ + 1; + } + ++v81; + } + while ( v81 <= &pMagicSkills[8]); + if ( !v71 ) + v17->DrawText( + pFontLucida, + 24, + LOBYTE(pFontLucida->uFontHeight) + uYa - 3, + 0, + pGlobalTXT_LocalizationStrings[153], + 0, + 0, + 0); + v27 = 2 * LOBYTE(pFontLucida->uFontHeight) + 13; + sprintf(pTmpBuf, "%s\r177%s", pGlobalTXT_LocalizationStrings[11], pGlobalTXT_LocalizationStrings[131]); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 248, v27, a5, pTmpBuf, 0, 0, 0); + v28 = pGUIWindow_CurrentMenu; + v72 = 0; + v82 = pArmorSkills; + do + { + v29 = 0; + v68 = 0; + v64 = *v82; + while ( v68 < (signed int)v28->uNumControls ) + { + v30 = v28->pControlsHead; + if ( v29 > 0 ) + { + do + { + v30 = v30->pNext; + --v29; + } + while ( v29 ); + } + v31 = v30->field_1C; + if ( SBYTE1(v31) >= 0 || (BYTE1(v31) &= 0x7Fu, v31 != v64) ) + { + v29 = v68++ + 1; + continue; + } + v27 = v30->uY; + ++v72; + v60 = 0; + v90 = pPlayer->pActiveSkills[v64]; + v32 = pPlayer->uSkillPoints; + v33 = pPlayer->pActiveSkills[v64] & 0x3F; + uYb = v33; + if ( v32 >= v33 + 1 ) + v60 = v84; + if ( v85 == v68 ) + { + v13 = v32 < v33; + v14 = v32 == v33; + v34 = v86; + if ( !(v13 | v14) ) + v34 = v79; + v60 = v34; + } + else + { + v34 = v60; + } + if ( (pPlayer->pActiveSkills[v64] >> 8) & 1 ) + { + if ( !v34 ) + v34 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); + v56 = uYb; + v52 = v60; + v48 = pGlobalTXT_LocalizationStrings[96]; + } + else + { + if ( !(v90 & 0xC0) ) + { + sprintf(pTmpBuf, "%s\r177%2d", pSkillNames[v64], uYb); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 248, v27, v60, pTmpBuf, 0, 0, 0); + v28 = pGUIWindow_CurrentMenu; + v29 = v68++ + 1; + continue; + } + v35 = pGlobalTXT_LocalizationStrings[432]; + if ( (v90 & 0x80u) == 0 ) + v35 = pGlobalTXT_LocalizationStrings[433]; + v91 = v35; + if ( !v34 ) + v34 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); + v56 = uYb; + v52 = v60; + v48 = v91; + } + sprintf(pTmpBuf, "%s ", pSkillNames[v64], v34, v48, v52, v56); + //LABEL_88: + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 248, v27, v60, pTmpBuf, 0, 0, 0); + v28 = pGUIWindow_CurrentMenu; + //LABEL_89: + v29 = v68++ + 1; + } + ++v82; + } + while ( v82 <= &pArmorSkills[4]); + if ( !v72 ) + { + v27 = v27 + LOBYTE(pFontLucida->uFontHeight) - 3; + v28->DrawText(pFontLucida, 248, v27, 0, pGlobalTXT_LocalizationStrings[153], 0, 0, 0); + } + uYc = v27 + 2 * LOBYTE(pFontLucida->uFontHeight) - 10; + sprintf(pTmpBuf, "%s\r177%s", pGlobalTXT_LocalizationStrings[143], pGlobalTXT_LocalizationStrings[131]); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 248, uYc, a5, pTmpBuf, 0, 0, 0); + v36 = pGUIWindow_CurrentMenu; + v73 = 0; + v83 = pMiscSkills; + do + { + v37 = 0; + v69 = 0; + v38 = (GUIButton *)*v83; + v65 = *v83; + while ( v69 < (signed int)v36->uNumControls ) + { + v38 = v36->pControlsHead; + if ( v37 > 0 ) + { + do + { + v38 = v38->pNext; + --v37; + } + while ( v37 ); + } + v39 = v38->field_1C; + if ( SBYTE1(v39) >= 0 || (BYTE1(v39) &= 0x7Fu, v39 != v65) ) + { + //goto LABEL_119; + v37 = v69++ + 1; + continue; + } + ++v73; + uYc = v38->uY; + v40 = pPlayer->pActiveSkills[v65]; + v41 = pPlayer->uSkillPoints; + v42 = pPlayer->pActiveSkills[v65] & 0x3F; + v61 = 0; + if ( v41 >= v42 + 1 ) + v61 = v84; + if ( v85 == v69 ) + { + v13 = v41 < v42; + v14 = v41 == v42; + v43 = v86; + if ( !(v13 | v14) ) + v43 = v79; + v61 = v43; + } + else + { + v43 = v61; + } + if ( HIBYTE(v40) & 1 ) + { + if ( !v43 ) + v43 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); + v57 = v42; + v53 = v61; + v49 = pGlobalTXT_LocalizationStrings[96]; + } + else + { + if ( !(v40 & 0xC0) ) + { + sprintf(pTmpBuf, "%s\r177%2d", pSkillNames[v65], v42); + LOBYTE(v38) = pGUIWindow_CurrentMenu->DrawText(pFontLucida, 248, uYc, v61, pTmpBuf, 0, 0, 0); + v36 = pGUIWindow_CurrentMenu; + v37 = v69++ + 1; + continue; + } + v25 = (v40 & 0x80u) != 0; + v44 = pGlobalTXT_LocalizationStrings[432]; + if ( !v25 ) + v44 = pGlobalTXT_LocalizationStrings[433]; + v92 = v44; + if ( !v43 ) + v43 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); + v57 = v42; + v53 = v61; + v49 = v92; + } + sprintf(pTmpBuf, "%s ", pSkillNames[v65], v43, v49, v53, v57); + LOBYTE(v38) = pGUIWindow_CurrentMenu->DrawText(pFontLucida, 248, uYc, v61, pTmpBuf, 0, 0, 0); + v36 = pGUIWindow_CurrentMenu; + v37 = v69++ + 1; + } + ++v83; + } + while ( v83 <= &pMiscSkills[11]); + if ( !v73 ) + LOBYTE(v38) = v36->DrawText( + pFontLucida, + 248, + LOBYTE(pFontLucida->uFontHeight) + uYc - 3, + 0, + pGlobalTXT_LocalizationStrings[153], + 0, + 0, + 0); + return (char)v38; + } + +//----- (0041A000) -------------------------------------------------------- +void CharacterUI_AwardsTab_Draw( unsigned int uPlayerID ) + { + //unsigned int v1; // esi@1 + unsigned int v2; // ebx@1 + unsigned int award_texture_id; // eax@1 + unsigned int result; // eax@1 + int v5; // eax@15 + char *v6; // ebx@15 + int v7; // eax@23 + int v8; // eax@24 + int v9; // eax@25 + int v10; // eax@27 + int v11; // eax@32 + int v12; // eax@33 + int v13; // eax@34 + signed int v14; // eax@43 + unsigned int v15; // eax@43 + int v16; // eax@43 + int v17; // [sp-4h] [bp-D4h]@16 + char Source[100]; // [sp+Ch] [bp-C4h]@1 + GUIWindow a1; // [sp+70h] [bp-60h]@1 + unsigned int v20; // [sp+C4h] [bp-Ch]@15 + int v21; // [sp+C8h] [bp-8h]@14 + int v22; // [sp+CCh] [bp-4h]@40 + + auto player = &pParty->pPlayers[uPlayerID - 1]; + //v1 = uPlayerID; + v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); + award_texture_id = pIcons_LOD->LoadTexture("fr_award", TEXTURE_16BIT_PALETTE); + pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(award_texture_id != -1 ? &pIcons_LOD->pTextures[award_texture_id] : 0)); + sprintfex(pTmpBuf, "%s \f%05d", pGlobalTXT_LocalizationStrings[LOCSTR_AVARDS_FOR], v2); + sprintfex(Source, pGlobalTXT_LocalizationStrings[LOCSTR_S_THE_S], player->pName, pClassNames[player->classType]); + strcat(pTmpBuf, Source); + strcat(pTmpBuf, "\f00000"); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0); + result = dword_506528; + a1.uFrameX = 12; + a1.uFrameY = 48; + a1.uFrameWidth = 424; + a1.uFrameHeight = 290; + a1.uFrameZ = 435; + a1.uFrameW = 337; + if ( dword_506544 && awards_count + dword_506528 < awards_count2 ) + result = dword_506528++ + 1; + if ( dword_506548 && result ) + { + --result; + dword_506528 = result; + } + if ( dword_50651C < 0 ) + { + result += awards_count; + dword_506528 = result; + if ( (signed int)(awards_count + result) > awards_count2 ) + { + result = awards_count2 - awards_count; + dword_506528 = result; + } + } + else if ( dword_50651C > 0 ) + { + result -= awards_count; + dword_506528 = result; + if ( (result & 0x80000000u) != 0 ) + { + result = 0; + dword_506528 = result; + } + } + //LABEL_14: + dword_506544 = 0; + dword_506548 = 0; + awards_count = 0; + dword_50651C = 0; + v21 = result; + if ( (signed int)result < awards_count2 ) + { + while ( 1 ) + { + v5 = achievedAwardsIndex[v21]; + v20 = achievedAwardsIndex[v21]; + v6 = (char *)pAwards[v20].pText;//(char *)dword_723E80_award_related[v20 / 4]; + if ( v5 != 1 ) + { + if (!( (v5 < 85 || v5 > 91) && (v5 < 103 || v5 > 104) )) + { + if ( v5 > 89 ) + { + if ( v5 == 90 ) + { + v10 = (unsigned __int8)pParty->uNumArenaKnightWins; + v22 = v10; + } + else if ( v5 == 91 ) + { + v10 = (unsigned __int8)pParty->uNumArenaLordWins; + v22 = v10; + } + else if ( v5 == 103 ) + { + v10 = pParty->field_874; + v22 = v10; + } + else if ( v5 == 104 ) + { + v10 = pParty->field_878; + v22 = v10; + } + } + else + { + if ( v5 == 89 ) + { + v10 = (unsigned __int8)pParty->uNumArenaSquireWins; + v22 = v10; + } + else if ( v5 == 85 ) + { + v10 = pParty->uNumDeaths; + v22 = v10; + } + else if ( v5 == 86 ) + { + v10 = pParty->uNumBountiesCollected; + v22 = v10; + } + else if ( v5 == 87 ) + { + v10 = pParty->uNumPrisonTerms; + v22 = v10; + } + else if ( v5 == 88) + { + v10 = (unsigned __int8)pParty->uNumArenaPageWins; + v22 = v10; + } + } + v17 = v22; + sprintf(pTmpBuf, v6, v17); + v6 = pTmpBuf; + } + } + else + { + v17 = pParty->uFine; + sprintf(pTmpBuf, v6, v17); + v6 = pTmpBuf; + } + v14 = pAwards[v20].uSort;//dword_723E84[v20 / 4]; + ++awards_count; + v15 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat( + pAwardsTextColors[3 * v14 % 6], + pAwardsTextColors[3 * v14 % 6 + 1], + pAwardsTextColors[3 * v14 % 6 + 2]); + a1.DrawText(pFontArrus, 0, 0, v15, v6, 0, 0, 0); + v16 = pFontArrus->CalcTextHeight(v6, &a1, 0, 0); + result = v16 + a1.uFrameY + 4; + if ( (signed int)result <= (signed int)a1.uFrameHeight ) + { + ++v21; + a1.uFrameY = result; + result = v21; + if ( v21 < awards_count2 ) + continue; + } + return; + } + + } + return; + } + + + + + + + //----- (0041A2C1) -------------------------------------------------------- + unsigned int __fastcall GetSizeInInventorySlots(unsigned int uNumPixels) + { + if ( (signed int)uNumPixels < 14 ) + uNumPixels = 14; + return ((signed int)(uNumPixels - 14) >> 5) + 1; + } + + //----- (0041A2D1) -------------------------------------------------------- + void __fastcall CharacterUI_InventoryTab_Draw(unsigned int uPlayerID, char a2) + { + Player *pPlayer; // esi@1 + char v3; // bl@1 + unsigned int v4; // eax@2 + ItemGen *pItem; // ebx@5 + unsigned int v6; // eax@6 + Texture *v7; // esi@6 + __int16 v8; // ax@6 + signed int v9; // edi@6 + signed int v10; // ecx@6 + signed int v11; // edx@6 + signed int v12; // eax@11 + int v13; // eax@13 + signed int v14; // edx@13 + int v15; // eax@13 + unsigned int v16; // ebx@15 + unsigned int v17; // edi@15 + Texture *pTexture; // ebx@24 + double v19; // st7@26 + const char *v20; // [sp-8h] [bp-40h]@20 + Player *pPlayer2; // [sp+14h] [bp-24h]@1 + int uTextureId; // [sp+18h] [bp-20h]@6 + int *v23; // [sp+1Ch] [bp-1Ch]@1 + int v24; // [sp+20h] [bp-18h]@5 + ItemGen *pItem2; // [sp+24h] [bp-14h]@5 + int v26; // [sp+28h] [bp-10h]@3 + unsigned int uCellID; // [sp+2Ch] [bp-Ch]@3 + unsigned int uCellX; // [sp+30h] [bp-8h]@5 + unsigned int uCellY; // [sp+34h] [bp-4h]@5 + + v23 = pRenderer->pActiveZBuffer; + pPlayer = pPlayers[uPlayerID]; + v3 = a2; + pPlayer2 = pPlayers[uPlayerID]; + pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_507958 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507958] : 0)); + if ( v3 ) + { + v4 = pIcons_LOD->LoadTexture("fr_strip", TEXTURE_16BIT_PALETTE); + pRenderer->DrawTextureIndexed(8u, 0x131u, (Texture *)(v4 != -1 ? (int)&pIcons_LOD->pTextures[v4] : 0)); + } + uCellID = 0; + v26 = (int)pPlayer->pInventoryIndices; + do + { + if ( *(int *)v26 > 0 ) + { + v24 = *(int *)v26 - 1; + uCellY = 32 * (uCellID / 14) + 17; + pItem = &pPlayer->pInventoryItems[v24]; + uCellX = 32 * (uCellID % 14) + 14; + pItem2 = pItem; + if ( pItem->uItemID ) + { + v6 = pIcons_LOD->LoadTexture(pItemsTable->pItems[pItem->uItemID].pIconName, TEXTURE_16BIT_PALETTE); + uTextureId = v6; + v7 = (Texture *)(v6 != -1 ? (int)&pIcons_LOD->pTextures[v6] : 0); + v8 = (v6 != -1 ? pIcons_LOD->pTextures[v6].uTextureWidth : 24); + v9 = v7->uTextureHeight; + v10 = v7->uTextureWidth; + v11 = v7->uTextureWidth; + if ( v10 < 14 ) + v11 = 14; + if ( (v11 - 14) >> 5 == 0 && v8 < 32 ) + uCellX += (32 - v10) / 2; + v12 = v7->uTextureWidth; + if ( v10 < 14 ) + v12 = 14; + v13 = v12 - 14; + v14 = v7->uTextureHeight; + LOBYTE(v13) = v13 & 0xE0; + v15 = v13 + 32; + if ( v9 < 14 ) + v14 = 14; + v16 = pItem->uAttributes; + v17 = uCellX + ((v15 - v10) >> 1) + pSRZBufferLineOffsets[uCellY + ((((v14 - 14) & 0xFFFFFFE0) - v9 + 32) >> 1)]; + if ( !(v16 & 0xF0) ) + { + if (pItem->Identified() || pCurrentScreen != SCREEN_HOUSE ) + { + if (pItem->Broken()) + pRenderer->DrawTransparentRedShade(uCellX, uCellY, v7); + else + pRenderer->DrawTextureTransparent(uCellX, uCellY, v7); + } + else + { + pRenderer->DrawTransparentGreenShade(uCellX, uCellY, v7); + } + ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); + pPlayer = pPlayer2; + //goto LABEL_34; + ++uCellID; + v26 += 4; + continue; + } + if ( (unsigned __int8)(v16 & 0xF0) != 16 ) + { + if ( (unsigned __int8)(v16 & 0xF0) == 32 ) + { + v20 = "sp28a"; + pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + LOBYTE(pItem2->uAttributes) &= 0xFu; + ptr_50C9A4 = 0; + } + v19 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255); + ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); + pPlayer = pPlayer2; + //goto LABEL_34; + ++uCellID; + v26 += 4; + continue; + } + if ( (unsigned __int8)(v16 & 0xF0) == 64 ) + { + v20 = "sp30a"; + pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + LOBYTE(pItem2->uAttributes) &= 0xFu; + ptr_50C9A4 = 0; + } + v19 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255); + ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); + pPlayer = pPlayer2; + //goto LABEL_34; + ++uCellID; + v26 += 4; + continue; + } + if ( (unsigned __int8)(v16 & 0xF0) == 128 ) + { + v20 = "sp91a"; + pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + LOBYTE(pItem2->uAttributes) &= 0xFu; + ptr_50C9A4 = 0; + } + v19 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255); + ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); + pPlayer = pPlayer2; + //goto LABEL_34; + ++uCellID; + v26 += 4; + continue; + } + } + v20 = "sptext01"; + pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + LOBYTE(pItem2->uAttributes) &= 0xFu; + ptr_50C9A4 = 0; + } + v19 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255); + ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); + pPlayer = pPlayer2; + } + } + //LABEL_34: + ++uCellID; + v26 += 4; + } + while ( uCellID < 126 ); + } + + //----- (0041A556) -------------------------------------------------------- + void __cdecl draw_leather() + { + pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_Leather)); + } + + //----- (0041A57E) -------------------------------------------------------- + void QuickRefDraw() + { + unsigned int v0; // ebx@1 + //unsigned int v1; // eax@1 + Player *pPlayer; // ebp@2 + int v3; // eax@6 + int v4; // edi@6 + unsigned int v5; // eax@7 + unsigned int v6; // edi@9 + unsigned int v7; // edi@11 + signed int v8; // eax@13 + unsigned int v9; // eax@13 + unsigned int v10; // edi@13 + int v11; // eax@15 + unsigned int v12; // eax@15 + unsigned int v13; // edi@15 + int v14; // eax@17 + int v15; // ST18_4@17 + int v16; // ebx@17 + int v17; // eax@17 + unsigned int v18; // eax@17 + unsigned int v19; // edi@17 + int v20; // eax@19 + unsigned int v21; // edi@19 + char *v22; // eax@21 + unsigned int v23; // edi@21 + int v24; // eax@23 + unsigned int v25; // edi@23 + char *v26; // eax@25 + unsigned int v27; // edi@25 + int v28; // ecx@27 + char *v29; // eax@27 + signed int v30; // edx@27 + unsigned int v31; // edi@31 + unsigned int v32; // edi@33 + const char *v33; // ST10_4@35 + unsigned int v34; // eax@35 + unsigned int v35; // edi@35 + unsigned __int8 v36; // al@37 + char *v37; // eax@38 + int v38; // eax@41 + signed int v39; // edi@42 + char *v40; // eax@45 + unsigned int v41; // eax@45 + signed int v43; // [sp+10h] [bp-1Ch]@1 + unsigned int v44; // [sp+14h] [bp-18h]@2 + int v45; // [sp+18h] [bp-14h]@1 + unsigned int v46; // [sp+1Ch] [bp-10h]@1 + unsigned int v47; // [sp+20h] [bp-Ch]@1 + unsigned int v48; // [sp+24h] [bp-8h]@33 + //unsigned int v49; // [sp+28h] [bp-4h]@1 + + v0 = 0; + v47 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); + //v49 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0); + v46 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); + //v1 = pIcons_LOD->LoadTexture("quikref", TEXTURE_16BIT_PALETTE); + pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("quikref", TEXTURE_16BIT_PALETTE)); + v43 = 0; + v45 = LOBYTE(pFontArrus->uFontHeight) + 1; + do + { + pPlayer = &pParty->pPlayers[v43]; + v44 = 94 * v43 + 89; + if ( v43 == v0 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x12u, v0, pGlobalTXT_LocalizationStrings[149], 60, v0);//Name + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 94 * v43 + 89, 0x12u, v47, pPlayer->pName, 84, v0); + if ( v43 == v0 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x2Fu, v0, pGlobalTXT_LocalizationStrings[131], 60, v0); //. + v3 = pPlayer->GetActualLevel(); + sprintf(pTmpBuf, "%lu", v3); + v4 = pPlayer->GetBaseLevel(); + if ( pPlayer->GetActualLevel() <= v4 ) + v5 = pPlayer->GetExperienceDisplayColor(); + else + v5 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, v0); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, 0x2Fu, v5, pTmpBuf, 84, v0); + v6 = v45 + 47; + if ( v43 == v0 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v45 + 47, v0, pGlobalTXT_LocalizationStrings[41], 60, v0);// + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v6, v0, pClassNames[pPlayer->classType], 84, v0); + v7 = v45 + v6; + if ( v43 == v0 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v7, v0, pGlobalTXT_LocalizationStrings[107], 60, v0);//. + sprintf(pTmpBuf, "%d", pPlayer->sHealth); + v8 = pPlayer->GetMaxHealth(); + v9 = UI_GetHealthManaStringColor(pPlayer->sHealth, v8); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v7, v9, pTmpBuf, 84, v0); + v10 = v45 + v7; + if ( v43 == v0 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v10, v0, pGlobalTXT_LocalizationStrings[209], 60, v0);// + sprintf(pTmpBuf, "%d", pPlayer->sMana); + v11 = pPlayer->GetMaxMana(); + v12 = UI_GetHealthManaStringColor(pPlayer->sMana, v11); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v10, v12, pTmpBuf, 84, v0); + v13 = v45 + v10; + if ( v43 == v0 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v13, v0, pGlobalTXT_LocalizationStrings[0], 60, v0);// + v14 = pPlayer->GetActualAC(); + sprintf(pTmpBuf, "%d", v14); + v15 = v0; + v16 = pPlayer->GetBaseAC(); + v17 = pPlayer->GetActualAC(); + v18 = UI_GetHealthManaStringColor(v17, v16); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v13, v18, pTmpBuf, 84, v15); + v0 = 0; + v19 = v45 + v13; + if ( !v43 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v19, 0, pGlobalTXT_LocalizationStrings[18], 60, 0);// + v20 = pPlayer->GetActualAttack(0); + sprintf(pTmpBuf, "%+d", v20); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v19, 0, pTmpBuf, 84, 0); + v21 = v45 + v19; + if ( !v43 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v21, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//. + v22 = pPlayer->GetMeleeDamageString(); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v21, 0, v22, 84, 0); + v23 = v45 + v21; + if ( !v43 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v23, 0, pGlobalTXT_LocalizationStrings[203], 60, 0);// + v24 = pPlayer->GetRangedAttack(); + sprintf(pTmpBuf, "%+d", v24); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v23, 0, pTmpBuf, 84, 0); + v25 = v45 + v23; + if ( !v43 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v25, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//. + v26 = pPlayer->GetRangedDamageString(); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v25, 0, v26, 84, 0); + v27 = v45 + v25; + if ( !v43 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v27, 0, pGlobalTXT_LocalizationStrings[205], 60, 0);// + v28 = 0; + v29 = (char *)pPlayer->pActiveSkills; + v30 = 36; + do + { + if ( *(short *)v29 ) + ++v28; + v29 += 2; + --v30; + } + while ( v30 ); + sprintf(pTmpBuf, "%lu", v28); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v27, 0, pTmpBuf, 84, 0); + v31 = v45 + v27; + if ( !v43 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v31, 0, pGlobalTXT_LocalizationStrings[168], 60, 0);// + sprintf(pTmpBuf, "%lu", pPlayer->uSkillPoints); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v31, pPlayer->uSkillPoints != 0 ? v46 : 0, pTmpBuf, 84, 0); + v32 = v45 + v31; + v48 = pPlayer->GetMajorConditionIdx(); + if ( !v43 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v32, 0, pGlobalTXT_LocalizationStrings[45], 60, 0);//. + v33 = aCharacterConditionNames[v48]; + v34 = GetConditionDrawColor(v48); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v32, v34, v33, 84, 0); + v35 = v45 + v32; + if ( !v43 ) + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v35, 0, pGlobalTXT_LocalizationStrings[170], 60, 0);//.. + v36 = pPlayer->uQuickSpell; + if ( v36 ) + v37 = pSpellStats->pInfos[v36].pShortName; + else + v37 = pGlobalTXT_LocalizationStrings[153];// + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v35, 0, v37, 84, 0); + ++v43; + } + while ( v43 < 4 ); + + v38 = GetPartyReputation(); + if ( v38 >= 0 ) + { + if ( v38 <= 5 ) + v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0xFF); + else + v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0, 0); + } + else + v39 = v46; + + v40 = GetReputationString(v38); + sprintf(pTmpBuf, "%s: \f%05d%s\f00000", pGlobalTXT_LocalizationStrings[180], v39, v40);//Reputation + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 22, 323, 0, pTmpBuf, 0, 0, 0); + v41 = pParty->GetPartyFame(); + sprintf(pTmpBuf, "\r261%s: %d", pGlobalTXT_LocalizationStrings[84], v41);// Fame + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 0, 323, 0, pTmpBuf, 0, 0, 0); + } + + //----- (0041ABFD) -------------------------------------------------------- + void __thiscall CharacterUI_CharacterScreen_Draw(unsigned int uPlayerIdx) + { + unsigned int v1; // edi@1 + unsigned int v2; // eax@6 + Texture *pTexture; // ecx@6 + GUIButton *pButton; // eax@6 + unsigned int v5; // eax@7 + unsigned int v6; // eax@10 + unsigned int v7; // eax@11 + + v1 = uPlayerIdx; + if ( uPlayerIdx ) + { + pRenderer->ClearZBuffer(0, 479); + switch ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] ) + { + case WINDOW_CharacterWindow_Stats: // stats + sub_4196A0(); + sub_419379(); + CharacterUI_StatsTab_Draw(v1); + v7 = pIcons_LOD->LoadTexture("ib-cd1-d", TEXTURE_16BIT_PALETTE); + pTexture = (Texture *)(v7 != -1 ? (int)&pIcons_LOD->pTextures[v7] : 0); + pButton = pCharacterScreen_StatsBtn; + pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture); + break; + case WINDOW_CharacterWindow_Skills: // skills + if ( dword_507CC0 != uActiveCharacter ) + { + sub_4196A0(); + CharacterUI_SkillScreen_Draw(); + } + sub_419379(); + CharacterUI_SkillsTab_Draw(v1); + v6 = pIcons_LOD->LoadTexture("ib-cd2-d", TEXTURE_16BIT_PALETTE); + pTexture = (Texture *)(v6 != -1 ? (int)&pIcons_LOD->pTextures[v6] : 0); + pButton = pCharacterScreen_SkillsBtn; + pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture); + break; + case WINDOW_CharacterWindow_Awards: // awards + sub_4196A0(); + sub_419379(); + sub_419220(); + CharacterUI_AwardsTab_Draw(v1); + v5 = pIcons_LOD->LoadTexture("ib-cd4-d", TEXTURE_16BIT_PALETTE); + pTexture = (Texture *)(v5 != -1 ? (int)&pIcons_LOD->pTextures[v5] : 0); + pButton = pCharacterScreen_AwardsBtn; + pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture); + break; + case WINDOW_CharacterWindow_Inventory: // inventory and other + sub_4196A0(); + sub_419379(); + CharacterUI_InventoryTab_Draw(v1, 0); + v2 = pIcons_LOD->LoadTexture("ib-cd3-d", TEXTURE_16BIT_PALETTE); + pTexture = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0); + pButton = pCharacterScreen_InventoryBtn; + pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture); + break; + default: + break; + } + if ( bRingsShownInCharScreen ) + CharacterUI_DrawPaperdollWithRingOverlay(v1); + else + CharacterUI_DrawPaperdoll(v1); + } + } + + //----- (0043CC7C) -------------------------------------------------------- + void __fastcall CharacterUI_DrawPaperdoll(unsigned int uPlayerID) + { + //Player **ppPlayer; // esi@1 + Player *pPlayer; // ebx@1 + //enum CHARACTER_RACE pRace; // edi@1 + signed int pSex; // eax@1 + //int v5; // edi@4 + unsigned int v6; // ecx@9 + int v7; // ecx@10 + unsigned int v8; // eax@14 + int v9; // eax@15 + int v10; // edx@15 + int v11; // ecx@15 + int v12; // eax@15 + unsigned int v13; // edi@15 + unsigned int v14; // ebx@18 + int v15; // ecx@18 + Texture *v16; // ebp@27 + double v17; // st7@29 + int v18; // edi@30 + char *v19; // eax@30 + Texture *v20; // edi@31 + unsigned int v21; // eax@37 + int v22; // edi@38 + int v23; // eax@38 + int v24; // ebx@38 + int v25; // eax@38 + LODFile_IconsBitmaps *v26; // ecx@42 + Texture *v27; // edi@51 + double v28; // st7@51 + char v29; // zf@54 + char *v30; // eax@54 + unsigned int v31; // eax@59 + int v32; // edx@60 + int v33; // eax@65 + int v34; // eax@74 + int v35; // ebx@74 + unsigned int v36; // ecx@74 + int v37; // eax@74 + LODFile_IconsBitmaps *v38; // ecx@78 + Texture *v39; // edi@85 + double v40; // st7@87 + int v41; // edi@88 + Texture *v42; // edi@89 + unsigned int v43; // eax@93 + int v44; // edx@94 + int v45; // eax@98 + int v46; // eax@106 + int v47; // ecx@106 + int v48; // ebx@106 + int v49; // eax@106 + LODFile_IconsBitmaps *v50; // ecx@110 + Texture *v51; // edi@117 + double v52; // st7@119 + int v53; // edi@120 + Texture *v54; // edi@121 + char *v55; // eax@122 + unsigned int v56; // eax@127 + int v57; // edi@128 + int v58; // ecx@128 + int v59; // ebx@129 + int v60; // ecx@132 + int v61; // eax@134 + int v62; // ecx@136 + Texture *v63; // edi@145 + double v64; // st7@147 + int v65; // edi@148 + char *v66; // eax@148 + Texture *v67; // edi@149 + //Player *v68; // ebx@155 + unsigned int v69; // edx@155 + int v70; // edx@156 + unsigned int v71; // eax@160 + int v72; // edi@161 + int v73; // edx@163 + int v74; // ecx@168 + unsigned int v75; // ebx@170 + int v76; // ecx@172 + Texture *v77; // edi@181 + double v78; // st7@183 + int v79; // edi@184 + char *v80; // eax@184 + Texture *v81; // edi@185 + unsigned int v82; // eax@192 + int v83; // eax@193 + int v84; // eax@197 + int v85; // eax@197 + int v86; // ecx@197 + int v87; // eax@197 + int v88; // eax@198 + int v89; // eax@199 + int v90; // edi@201 + int v91; // edi@213 + int v92; // ebx@213 + int v93; // edi@214 + int v94; // ebx@214 + int v95; // eax@214 + char *v96; // edi@226 + double v97; // st7@228 + int v98; // edi@229 + char *v99; // eax@229 + Render *v100; // ecx@229 + Texture *v101; // edi@230 + int v102; // edi@236 + int v103; // eax@237 + int v104; // ecx@237 + int v105; // edx@237 + int v106; // edx@238 + int v107; // edx@239 + int v108; // edx@240 + int v109; // edi@250 + char *v110; // edx@250 + unsigned int v111; // eax@259 + int v112; // eax@260 + int v113; // eax@260 + int v114; // eax@265 + int v115; // eax@274 + int v116; // ebx@274 + unsigned int v117; // edi@274 + double v118; // st7@286 + int v119; // edi@287 + char *v120; // eax@287 + Texture *v121; // edi@288 + unsigned int v122; // edi@295 + int v123; // ebx@297 + int v124; // edi@298 + int v125; // ecx@303 + int v126; // eax@312 + unsigned int v127; // ebx@314 + int v128; // ecx@316 + Texture *v129; // edi@325 + double v130; // st7@327 + int v131; // edi@328 + char *v132; // eax@328 + Texture *v133; // edi@329 + unsigned int v134; // eax@335 + int v135; // eax@336 + int v136; // edx@336 + int v137; // eax@336 + unsigned int v138; // ebx@339 + int v139; // ecx@339 + Texture *v140; // edi@348 + double v141; // st7@350 + int v142; // edi@351 + char *v143; // eax@351 + Texture *v144; // edi@352 + unsigned int v145; // eax@358 + int v146; // eax@359 + int v147; // ecx@359 + int v148; // eax@359 + int v149; // edx@359 + int v150; // ebx@362 + int v151; // ecx@363 + int v152; // ecx@364 + unsigned int v153; // eax@370 + unsigned int v154; // edi@370 + int v155; // eax@370 + LODFile_IconsBitmaps *v156; // ecx@374 + Texture *v157; // ebp@381 + double v158; // st7@383 + Texture *v159; // edi@385 + char *v160; // eax@386 + unsigned int v161; // eax@393 + int v162; // eax@394 + unsigned int v163; // [sp-Ch] [bp-58h]@230 + unsigned int v164; // [sp-Ch] [bp-58h]@233 + signed int v165; // [sp-Ch] [bp-58h]@235 + char *v166; // [sp-8h] [bp-54h]@16 + const char *v167; // [sp-8h] [bp-54h]@23 + const char *v168; // [sp-8h] [bp-54h]@43 + const char *v169; // [sp-8h] [bp-54h]@79 + const char *v170; // [sp-8h] [bp-54h]@111 + const char *v171; // [sp-8h] [bp-54h]@141 + const char *v172; // [sp-8h] [bp-54h]@177 + const char *v173; // [sp-8h] [bp-54h]@222 + int v174; // [sp-8h] [bp-54h]@228 + unsigned int v175; // [sp-8h] [bp-54h]@230 + unsigned int v176; // [sp-8h] [bp-54h]@233 + signed int v177; // [sp-8h] [bp-54h]@235 + const char *v178; // [sp-8h] [bp-54h]@242 + const char *v179; // [sp-8h] [bp-54h]@280 + const char *v180; // [sp-8h] [bp-54h]@321 + char *v181; // [sp-8h] [bp-54h]@337 + const char *v182; // [sp-8h] [bp-54h]@344 + const char *v183; // [sp-8h] [bp-54h]@375 + signed int v184; // [sp-4h] [bp-50h]@66 + signed int v185; // [sp-4h] [bp-50h]@99 + signed int v186; // [sp-4h] [bp-50h]@202 + int v187; // [sp-4h] [bp-50h]@228 + Texture *v188; // [sp-4h] [bp-50h]@230 + Texture *v189; // [sp-4h] [bp-50h]@233 + Texture *v190; // [sp-4h] [bp-50h]@235 + signed int v191; // [sp-4h] [bp-50h]@266 + signed int v192; // [sp-4h] [bp-50h]@304 + unsigned int a3; // [sp+10h] [bp-3Ch]@7 + int a3a; // [sp+10h] [bp-3Ch]@15 + int a3b; // [sp+10h] [bp-3Ch]@38 + unsigned int a3c; // [sp+10h] [bp-3Ch]@74 + unsigned int a3d; // [sp+10h] [bp-3Ch]@106 + int a3e; // [sp+10h] [bp-3Ch]@129 + int a3f; // [sp+10h] [bp-3Ch]@168 + unsigned int a3g; // [sp+10h] [bp-3Ch]@216 + unsigned int a3h; // [sp+10h] [bp-3Ch]@274 + int a3i; // [sp+10h] [bp-3Ch]@312 + int a3j; // [sp+10h] [bp-3Ch]@336 + int a3k; // [sp+10h] [bp-3Ch]@362 + signed int a2; // [sp+14h] [bp-38h]@7 + unsigned int a2a; // [sp+14h] [bp-38h]@15 + Texture *a2b; // [sp+14h] [bp-38h]@49 + int a2c; // [sp+14h] [bp-38h]@74 + int a2d; // [sp+14h] [bp-38h]@106 + int a2e; // [sp+14h] [bp-38h]@129 + int a2f; // [sp+14h] [bp-38h]@168 + int a2g; // [sp+14h] [bp-38h]@214 + int a2h; // [sp+14h] [bp-38h]@274 + Texture *a2i; // [sp+14h] [bp-38h]@284 + int a2j; // [sp+14h] [bp-38h]@312 + int a2k; // [sp+14h] [bp-38h]@336 + //Player *v217; // [sp+18h] [bp-34h]@1 + int v218; // [sp+1Ch] [bp-30h]@15 + int v219; // [sp+1Ch] [bp-30h]@60 + int v220; // [sp+1Ch] [bp-30h]@94 + int v221; // [sp+1Ch] [bp-30h]@128 + int v222; // [sp+1Ch] [bp-30h]@161 + int v223; // [sp+1Ch] [bp-30h]@213 + char v224; // [sp+1Ch] [bp-30h]@237 + int v225; // [sp+1Ch] [bp-30h]@260 + int v226; // [sp+1Ch] [bp-30h]@298 + int v227; // [sp+1Ch] [bp-30h]@336 + int v228; // [sp+1Ch] [bp-30h]@359 + int v229; // [sp+20h] [bp-2Ch]@15 + int v230; // [sp+20h] [bp-2Ch]@38 + int v231; // [sp+20h] [bp-2Ch]@60 + int v232; // [sp+20h] [bp-2Ch]@94 + int v233; // [sp+20h] [bp-2Ch]@128 + int v234; // [sp+20h] [bp-2Ch]@161 + int v235; // [sp+20h] [bp-2Ch]@197 + int v236; // [sp+20h] [bp-2Ch]@260 + int v237; // [sp+20h] [bp-2Ch]@298 + int v238; // [sp+20h] [bp-2Ch]@336 + int pBodyComplection; // [sp+24h] [bp-28h]@6 + int v240; // [sp+28h] [bp-24h]@7 + unsigned int v241; // [sp+2Ch] [bp-20h]@38 + int v242; // [sp+2Ch] [bp-20h]@197 + unsigned int v243; // [sp+2Ch] [bp-20h]@370 + int v244; // [sp+34h] [bp-18h]@6 + signed int v245; // [sp+34h] [bp-18h]@361 + unsigned int uPlayerID_; // [sp+38h] [bp-14h]@1 + int uPlayerID_a; // [sp+38h] [bp-14h]@9 + signed int IsDwarf; // [sp+40h] [bp-Ch]@4 + int v249; // [sp+40h] [bp-Ch]@358 + //signed int v250; // [sp+44h] [bp-8h]@1 + + pPlayer = pPlayers[uPlayerID]; + uPlayerID_ = uPlayerID; + pIcons_LOD->LoadTexture("sptext01", TEXTURE_16BIT_PALETTE); + pSex = pPlayer->GetSexByVoice(); + if ( pPlayer->GetRace() && pPlayer->GetRace() != 1 && pPlayer->GetRace() != 2 ) + { + IsDwarf = 1; + pBodyComplection = (pSex != 0) + 2; + } + else + { + IsDwarf = 0; + pBodyComplection = pSex != 0; + } + v244 = pPlayer->uFace; + pRenderer->ResetClip(); + pRenderer->DrawTextureIndexed(0x1D3u, 0, (Texture *)(uTextureID_BACKDOLL != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BACKDOLL] : 0));// + if ( !IsPlayerWearingWatersuit[uPlayerID_] ) + { + v21 = pPlayer->pEquipment.uBow; // + if ( !v21 ) + goto LABEL_59; + v230 = pPlayer->pEquipment.uBow; + v22 = (int)&pPlayer->pInventoryItems[v21-1]; + v23 = *(int *)v22; + v24 = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][2][0] - pItemsTable->pItems[v23].uEquipX; + a3b = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][2][1] - pItemsTable->pItems[v23].uEquipY; + v241 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v23].pIconName, TEXTURE_16BIT_PALETTE); + v25 = *(int *)(v22 + 20); + if ( !(*(int *)(v22 + 20) & 0xF0) ) + { + if ( v25 & 2 ) + { + v27 = (Texture *)(v241 != -1 ? (int)&pIcons_LOD->pTextures[v241] : 0); + pRenderer->DrawTransparentRedShade(v24, a3b, v27); + } + else + { + v29 = (v25 & 1) == 0; + v30 = (char *)&pIcons_LOD->pTextures[v241]; + if ( v29 ) + { + v27 = (Texture *)(v241 != -1 ? (int)v30 : 0); + pRenderer->DrawTransparentGreenShade(v24, a3b, (Texture *)(v241 != -1 ? (int)v30 : 0)); + } + else + { + v27 = (Texture *)(v241 != -1 ? (int)v30 : 0); + pRenderer->DrawTextureTransparent(v24, a3b, (Texture *)(v241 != -1 ? (int)v30 : 0)); + } + } +LABEL_57: + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(v24, a3b, v27, v230); +LABEL_59: + v31 = pPlayer->pEquipment.uCloak;// + if ( !v31 ) + goto LABEL_93; + v231 = pPlayer->pEquipment.uCloak; + v32 = (int)&pPlayer->pInventoryItems[v31-1]; + v219 = v32; + if ( *(int *)v32 != 525 ) + { + switch ( *(int *)v32 ) + { + case 0x212: + v184 = 6; + break; + case 0x223: + v184 = 7; + break; + case 0x224: + v184 = 8; + break; + default: + if ( *(int *)v32 != 550 ) + { + v33 = *(int *)v32 - 105; +LABEL_72: + if ( v33 < 0 || v33 >= 10 ) + goto LABEL_93; +LABEL_74: + v34 = v33 + 10 * pBodyComplection; + v35 = paperdoll_array_511828[0][v34];//Texture_Cloak + a2c = pPaperdoll_BodyX + paperdoll_Cloak[0][v34][0]; + v36 = pPaperdoll_BodyY + paperdoll_Cloak[0][v34][1]; + v37 = *(int *)(v32 + 20); + a3c = v36; + if ( !(v37 & 0xF0) ) + { + v41 = v35 + 1; + if ( v37 & 2 ) + { + v42 = (Texture *)(v41 != 0 ? (int)&pIcons_LOD->pTextures[v35] : 0); + pRenderer->DrawTransparentRedShade(a2c, v36, v42); + } + else + { + v42 = (Texture *)(v41 != 0 ? (int)&pIcons_LOD->pTextures[v35] : 0); + pRenderer->DrawTextureTransparent(a2c, v36, v42); + } + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2c, a3c, v42, v231); +LABEL_93: + v240 = 4 * uPlayerID_ - 4; + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX, pPaperdoll_BodyY, + (Texture *)(*(unsigned int *)((char *)papredoll_dbods + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dbods + v240)] : 0)); + v43 = pPlayer->pEquipment.uBody;// + if ( !v43 ) + goto LABEL_127; + v232 = pPlayer->pEquipment.uBody; + v44 = (int)&pPlayer->pInventoryItems[v43-1]; + v220 = v44; + if ( *(int *)v44 != 504 ) + { + if ( *(int *)v44 == 505 ) + { + v185 = 14; + } + else + { + if ( *(int *)v44 == 516 ) + { + v185 = 13; + } + else + { + if ( *(int *)v44 != 533 ) + { + v45 = *(int *)v44 - 66; +LABEL_104: + if ( v45 < 0 || v45 >= 17 ) + goto LABEL_127; +LABEL_106: + v46 = 17 * pBodyComplection + v45; + a2d = pPaperdoll_BodyX + paperdoll_Armor[0][v46][0]; + v47 = pPaperdoll_BodyY + paperdoll_Armor[0][v46][1]; + v48 = paperdoll_array_511290[0][v46][0];//Texture_Armor + v49 = *(int *)(v44 + 20); + a3d = v47; + if ( !(v49 & 0xF0) ) + { + v53 = v48 + 1; + if ( v49 & 2 ) + { + v54 = (Texture *)(v53 != 0 ? (int)&pIcons_LOD->pTextures[v48] : 0); + pRenderer->DrawTransparentRedShade(a2d, v47, v54); + } + else + { + v29 = (v49 & 1) == 0; + v55 = (char *)&pIcons_LOD->pTextures[v48]; + if ( v29 ) + { + v54 = (Texture *)(v53 != 0 ? (int)v55 : 0); + pRenderer->DrawTransparentGreenShade(a2d, v47, v54); + } + else + { + v54 = (Texture *)(v53 != 0 ? (int)v55 : 0); + pRenderer->DrawTextureTransparent(a2d, v47, v54); + } + } + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2d, a3d, v54, v232); +LABEL_127: + v56 = pPlayer->pEquipment.field_20; + if ( !v56 ) + goto LABEL_155; + v233 = pPlayer->pEquipment.field_20; + v57 = (int)&pPlayer->pInventoryItems[v56-1]; + v221 = v57; + v58 = *(int *)v57; + if ( *(int *)v57 == 529 ) + { + a3e = pPaperdoll_BodyY + paperdoll_Boot[pBodyComplection][5][1]; + a2e = pPaperdoll_BodyX + paperdoll_Boot[pBodyComplection][5][0]; + v59 = papredoll_flying_feet[v244]; + } + else + { + if ( v58 == 512 ) + { + a3e = pPaperdoll_BodyY + paperdoll_Boot[pBodyComplection][6][1]; + a2e = pPaperdoll_BodyX + paperdoll_Boot[pBodyComplection][6][0]; + v59 = dword_511638[pBodyComplection][5]; + } + else + { + v60 = v58 - 115; + if ( v60 < 0 || v60 >= 5 ) + { + a2e = 0; + a3e = 0; + v59 = dword_511638[pBodyComplection][0]; + } + else + { + v61 = v60 + 7 * pBodyComplection; + a3e = pPaperdoll_BodyY + paperdoll_Boot[0][v61][1]; + a2e = pPaperdoll_BodyX + paperdoll_Boot[0][v61][0]; + v59 = dword_511638[0][v60 + 6 * pBodyComplection]; + } + } + } + v62 = *(int *)(v57 + 20); + if ( !(*(int *)(v57 + 20) & 0xF0) ) + { + v65 = v59 + 1; + v66 = (char *)&pIcons_LOD->pTextures[v59]; + if ( v62 & 2 ) + { + v67 = (Texture *)(v65 != 0 ? (int)v66 : 0); + pRenderer->DrawTransparentRedShade(a2e, a3e, v67); + } + else + { + if ( v62 & 1 ) + { + v67 = (Texture *)(v65 != 0 ? (int)v66 : 0); + pRenderer->DrawTextureTransparent(a2e, a3e, v67); + } + else + { + v67 = (Texture *)(v65 != 0 ? (int)v66 : 0); + pRenderer->DrawTransparentGreenShade(a2e, a3e, v67); + } + } + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2e, a3e, v67, v233); +LABEL_155: + v69 = pPlayer->pEquipment.uMainHand; + uPlayerID_a = 2 * pBodyComplection; + if ( !v69 || (v70 = *(int *)&pPlayer->pInventoryItems[v69-1], pItemsTable->pItems[v70].uEquipType != 1) + && (pItemsTable->pItems[v70].uSkillType != 4 || pPlayer->pEquipment.uOffHand) ) + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0], + pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1], + (Texture *)(*(unsigned int *)((char *)papredoll_dlads + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlads + v240)] : 0)); + v71 = pPlayer->pEquipment.uBelt; + if ( v71 ) + { + v234 = pPlayer->pEquipment.uBelt; + v72 = (int)&pPlayer->pInventoryItems[v71-1]; + v222 = v72; + if ( *(int *)v72 == 524 ) + { + v73 = 5; + } + else + { + if ( *(int *)v72 == 535 ) + { + v73 = 6; + goto LABEL_168; + } + v73 = *(int *)v72 - 100; + } + if ( v73 >= 0 && v73 < 7 ) + { +LABEL_168: + v74 = 7 * pBodyComplection + v73; + a2f = pPaperdoll_BodyX + paperdoll_Belt[0][v74][0]; + a3f = pPaperdoll_BodyY + paperdoll_Belt[0][v74][1]; + if ( IsDwarf != 1 || v73 == 5 ) + v75 = stru_511718[pBodyComplection].texids[v73]; + else + v75 = stru_511718[pBodyComplection - 2].texids[v73]; + v76 = *(int *)&pPlayer->field_1F5[36 * v71 + 15]; + if ( !(*(int *)&pPlayer->field_1F5[36 * v71 + 15] & 0xF0) ) + { + v79 = v75 + 1; + v80 = (char *)&pIcons_LOD->pTextures[v75]; + if ( v76 & 2 ) + { + v81 = (Texture *)(v79 != 0 ? (int)v80 : 0); + pRenderer->DrawTransparentRedShade(a2f, a3f, v81); + } + else + { + if ( v76 & 1 ) + { + v81 = (Texture *)(v79 != 0 ? (int)v80 : 0); + pRenderer->DrawTextureTransparent(a2f, a3f, v81); + } + else + { + v81 = (Texture *)(v79 != 0 ? (int)v80 : 0); + pRenderer->DrawTransparentGreenShade(a2f, a3f, v81); + } + } + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2f, a3f, v81, v234); + goto LABEL_192; + } + if ( (*(int *)&pPlayer->field_1F5[36 * v71 + 15] & 0xF0) != 16 ) + { + if ( (*(int *)&pPlayer->field_1F5[36 * v71 + 15] & 0xF0) == 32 ) + { + v172 = "sp28a"; + v77 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v172, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v222 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v78 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2f, a3f, (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), v77, (signed __int64)v78, 0, 255); + goto LABEL_192; + } + if ( (*(int *)&pPlayer->field_1F5[36 * v71 + 15] & 0xF0) == 64 ) + { + v172 = "sp30a"; + v77 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v172, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v222 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v78 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2f, a3f, (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), v77, (signed __int64)v78, 0, 255); + goto LABEL_192; + } + if ( (*(int *)&pPlayer->field_1F5[36 * v71 + 15] & 0xF0) == 128 ) + { + v172 = "sp91a"; + v77 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v172, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v222 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v78 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2f, a3f, (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), v77, (signed __int64)v78, 0, 255); + goto LABEL_192; + } + } + v172 = "sptext01"; + v77 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v172, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v222 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v78 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2f, a3f, (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), v77, (signed __int64)v78, 0, 255); + goto LABEL_192; + } + } +LABEL_192: + v82 = pPlayer->pEquipment.uMainHand; + if ( v82 ) + { + v83 = *(int *)&pPlayer->pInventoryItems[v82-1]; + if ( pItemsTable->pItems[v83].uEquipType == 1 + || pItemsTable->pItems[v83].uSkillType == 4 && !pPlayer->pEquipment.uOffHand ) + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[0][uPlayerID_a], + pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[0][uPlayerID_a + 1], + (Texture *)(*(unsigned int *)((char *)papredoll_dlaus + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlaus + v240)] : 0)); + } + v84 = pPlayer->pEquipment.uBody; + v235 = v84; + v85 = (int)((char *)pPlayer + 36 * v84); + v242 = v85; + v86 = *(int *)(v85 + 496); + v87 = *(int *)(v85 + 496) - 504; + if ( v87 ) + { + v88 = v87 - 1; + if ( v88 ) + { + v89 = v88 - 11; + if ( v89 ) + { + if ( v89 != 17 ) + { + v90 = v86 - 66; +LABEL_207: + if ( v90 < 0 || v90 > 17 ) + { +LABEL_259: + v111 = pPlayer->pEquipment.uCloak; + if ( !v111 ) + goto LABEL_293; + v236 = pPlayer->pEquipment.uCloak; + v112 = (int)&pPlayer->pInventoryItems[v111-1]; + v225 = v112; + v113 = *(int *)v112; + if ( v113 != 525 ) + { + switch ( v113 ) + { + case 530: + v191 = 6; + break; + case 547: + v191 = 7; + break; + case 548: + v191 = 8; + break; + default: + if ( v113 != 550 ) + { + v114 = v113 - 105; +LABEL_272: + if ( v114 < 0 || v114 >= 10 ) + goto LABEL_293; +LABEL_274: + v115 = v114 + 10 * pBodyComplection; + v116 = dword_511788[v115]; + v115 *= 8; + v117 = pPaperdoll_BodyX + *(int *)((char *)&dword_4E56B0 + v115); + a2h = pPaperdoll_BodyX + *(int *)((char *)&dword_4E56B0 + v115); + a3h = pPaperdoll_BodyY + *(int *)((char *)&dword_4E56B4 + v115); + if ( v116 == pIcons_LOD->FindTextureByName("pending") ) + { +LABEL_292: +LABEL_293: + if ( v244 == 12 || v244 == 13 ) + { + v122 = papredoll_dbrds[v244]; + if ( v122 != pIcons_LOD->FindTextureByName("Pending") ) + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_Beards[2 * v244 - 24], + pPaperdoll_BodyY + pPaperdoll_Beards[2 * v244 - 23], + (Texture *)(v122 != -1 ? (int)&pIcons_LOD->pTextures[v122] : 0)); + } + v123 = pPlayer->pEquipment.uHelm; + if ( !v123 ) + goto LABEL_335; + v237 = v123; + v124 = (int)&pPlayer->pInventoryItems[v123-1]; + v226 = v124; + if ( *(int *)v124 != 521 ) + { + switch ( *(int *)v124 ) + { + case 0x20A: + v192 = 12; + break; + case 0x20B: + v192 = 13; + break; + case 0x214: + v192 = 14; + break; + default: + if ( *(int *)v124 != 544 ) + { + v125 = *(int *)v124 - 89; + if ( v125 < 0 || v125 >= 16 ) + goto LABEL_335; + goto LABEL_312; + } + v192 = 15; + break; + } + v125 = v192; +LABEL_312: + v126 = 2 * (v125 + 16 * pBodyComplection); + a2j = pPaperdoll_BodyX + dword_4E58D0[v126]; + a3i = pPaperdoll_BodyY + dword_4E58D4[v126]; + if ( IsDwarf != 1 || *(int *)v124 != 92 ) + v127 = stru_511698[0].texids[v125 + 16 * pSex]; + else + v127 = papredoll_dbrds[11]; + v128 = *(int *)(v124 + 20); + if ( *(int *)(v124 + 20) & 0xF0 ) + { + if ( (*(int *)(v124 + 20) & 0xF0) != 16 ) + { + if ( (*(int *)(v124 + 20) & 0xF0) == 32 ) + { + v180 = "sp28a"; + v129 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v180, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v226 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v130 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2j, a3i, (Texture *)(v127 != -1 ? (int)&pIcons_LOD->pTextures[v127] : 0), + v129, (signed __int64)v130, 0, 255); + goto LABEL_335; + } + if ( (*(int *)(v124 + 20) & 0xF0) == 64 ) + { + v180 = "sp30a"; + v129 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v180, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v226 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v130 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2j, a3i, (Texture *)(v127 != -1 ? (int)&pIcons_LOD->pTextures[v127] : 0), + v129, (signed __int64)v130, 0, 255); + goto LABEL_335; + } + if ( (*(int *)(v124 + 20) & 0xF0) == 128 ) + { + v180 = "sp91a"; + v129 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v180, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v226 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v130 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2j, a3i, (Texture *)(v127 != -1 ? (int)&pIcons_LOD->pTextures[v127] : 0), + v129, (signed __int64)v130, 0, 255); + goto LABEL_335; + } + } + v180 = "sptext01"; + v129 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v180, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v226 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v130 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2j, a3i, (Texture *)(v127 != -1 ? (int)&pIcons_LOD->pTextures[v127] : 0), + v129, (signed __int64)v130, 0, 255); + goto LABEL_335; + } + v131 = v127 + 1; + v132 = (char *)&pIcons_LOD->pTextures[v127]; + if ( v128 & 2 ) + { + v133 = (Texture *)(v131 != 0 ? (int)v132 : 0); + pRenderer->DrawTransparentRedShade(a2j, a3i, v133); + } + else + { + if ( v128 & 1 ) + { + v133 = (Texture *)(v131 != 0 ? (int)v132 : 0); + pRenderer->DrawTextureTransparent(a2j, a3i, v133); + } + else + { + v133 = (Texture *)(v131 != 0 ? (int)v132 : 0); + pRenderer->DrawTransparentGreenShade(a2j, a3i, v133); + } + } + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2j, a3i, v133, v237); +LABEL_335: + v134 = pPlayer->pEquipment.uMainHand; + if ( !v134 ) + goto LABEL_358; + v238 = pPlayer->pEquipment.uMainHand; + v135 = (int)&pPlayer->pInventoryItems[v134-1]; + v227 = v135; + v136 = *(int *)v135; + v137 = *(int *)v135; + a2k = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[v137].uEquipX; + a3j = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[v137].uEquipY; + if ( v136 == 64 ) + v181 = "item64v1"; + else + v181 = pItemsTable->pItems[v137].pIconName; + v138 = pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE); + v139 = *(int *)(v227 + 20); + if ( !(*(int *)(v227 + 20) & 0xF0) ) + { + v142 = v138 + 1; + v143 = (char *)&pIcons_LOD->pTextures[v138]; + if ( v139 & 2 ) + { + v144 = (Texture *)(v142 != 0 ? (int)v143 : 0); + pRenderer->DrawTransparentRedShade(a2k, a3j, v144); + } + else + { + if ( v139 & 1 ) + { + v144 = (Texture *)(v142 != 0 ? (int)v143 : 0); + pRenderer->DrawTextureTransparent(a2k, a3j, v144); + } + else + { + v144 = (Texture *)(v142 != 0 ? (int)v143 : 0); + pRenderer->DrawTransparentGreenShade(a2k, a3j, v144); + } + } + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2k, a3j, v144, v238); +LABEL_358: + v145 = pPlayer->pEquipment.uOffHand; + v249 = pPlayer->pEquipment.uOffHand; + if ( !v145 ) + goto LABEL_393; + v146 = (int)&pPlayer->pInventoryItems[v145-1]; + v228 = v146; + v147 = *(int *)v146; + v148 = *(int *)v146; + v149 = pItemsTable->pItems[v148].uSkillType; + if ( v149 != 2 && v149 != 1 ) + { + v245 = 0; + v150 = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][0][0] - pItemsTable->pItems[v148].uEquipX; + a3k = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][0][1] - pItemsTable->pItems[v148].uEquipY; + goto LABEL_370; + } + v151 = v147 - 400; + v245 = 1; + if ( v151 ) + { + v152 = v151 - 3; + if ( v152 ) + { + if ( v152 != 12 ) + { + v150 = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][0][0] - pItemsTable->pItems[v148].uEquipX; + a3k = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][0][1] - pItemsTable->pItems[v148].uEquipY; + goto LABEL_370; + } + v150 = 595; + a3k = 33; +LABEL_370: + v153 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v148].pIconName, TEXTURE_16BIT_PALETTE); + v154 = v153; + v243 = v153; + v155 = *(int *)(v228 + 20); + if ( !(*(int *)(v228 + 20) & 0xF0) ) + { + if ( v155 & 2 ) + { + v159 = (Texture *)(v243 != -1 ? (int)&pIcons_LOD->pTextures[v243] : 0); + pRenderer->DrawTransparentRedShade(v150, a3k, v159); + } + else + { + v29 = (v155 & 1) == 0; + v160 = (char *)&pIcons_LOD->pTextures[v243]; + if ( v29 ) + { + v159 = (Texture *)(v243 != -1 ? (int)v160 : 0); + pRenderer->DrawTransparentGreenShade(v150, a3k, (Texture *)(v243 != -1 ? (int)v160 : 0)); + } + else + { + v159 = (Texture *)(v243 != -1 ? (int)v160 : 0); + pRenderer->DrawTextureTransparent(v150, a3k, (Texture *)(v243 != -1 ? (int)v160 : 0)); + } + } + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(v150, a3k, v159, v249); + if ( v245 ) + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a], + pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1], + (Texture *)(*(unsigned int *)((char *)papredoll_dlhs + + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0)); + goto LABEL_393; + } + if ( (*(int *)(v228 + 20) & 0xF0) != 16 ) + { + if ( (*(int *)(v228 + 20) & 0xF0) == 32 ) + { + v183 = "sp28a"; + } + else + { + if ( (*(int *)(v228 + 20) & 0xF0) != 64 ) + { + v156 = pIcons_LOD; + if ( (*(int *)(v228 + 20) & 0xF0) == 128 ) + { + v183 = "sp91a"; + v157 = &pIcons_LOD->pTextures[v156->LoadTexture(v183, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v228 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v158 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v150, a3k, (Texture *)(v154 != -1 ? (int)&pIcons_LOD->pTextures[v154] : 0), + v157, (signed __int64)v158, 0, 255); + if ( v245 ) + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a], + pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1], + (Texture *)(*(unsigned int *)((char *)papredoll_dlhs + + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0)); + goto LABEL_393; + } + v183 = "sptext01"; + v157 = &pIcons_LOD->pTextures[v156->LoadTexture(v183, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v228 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v158 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v150, a3k, (Texture *)(v154 != -1 ? (int)&pIcons_LOD->pTextures[v154] : 0), + v157, (signed __int64)v158, 0, 255); + if ( v245 ) + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a], + pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1], + (Texture *)(*(unsigned int *)((char *)papredoll_dlhs + + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0)); + goto LABEL_393; + } + v183 = "sp30a"; + } + v156 = pIcons_LOD; + v157 = &pIcons_LOD->pTextures[v156->LoadTexture(v183, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v228 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v158 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v150, a3k, (Texture *)(v154 != -1 ? (int)&pIcons_LOD->pTextures[v154] : 0), + v157, (signed __int64)v158, 0, 255); + if ( v245 ) + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a], + pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1], + (Texture *)(*(unsigned int *)((char *)papredoll_dlhs + + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0)); + goto LABEL_393; + } + v156 = pIcons_LOD; + v183 = "sptext01"; + v157 = &pIcons_LOD->pTextures[v156->LoadTexture(v183, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v228 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v158 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v150, a3k, (Texture *)(v154 != -1 ? (int)&pIcons_LOD->pTextures[v154] : 0), + v157, (signed __int64)v158, 0, 255); + if ( v245 ) + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a], + pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1], + (Texture *)(*(unsigned int *)((char *)papredoll_dlhs + + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0)); + goto LABEL_393; + } + a3k = 28; + } + else + { + a3k = 86; + } + v150 = 596; + goto LABEL_370; + } + if ( (*(int *)(v227 + 20) & 0xF0) != 16 ) + { + if ( (*(int *)(v227 + 20) & 0xF0) == 32 ) + { + v182 = "sp28a"; + v140 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v182, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v227 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v141 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2k, a3j, (Texture *)(v138 != -1 ? (int)&pIcons_LOD->pTextures[v138] : 0), + v140, (signed __int64)v141, 0, 255); + goto LABEL_358; + } + if ( (*(int *)(v227 + 20) & 0xF0) == 64 ) + { + v182 = "sp30a"; + v140 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v182, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v227 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v141 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2k, a3j, (Texture *)(v138 != -1 ? (int)&pIcons_LOD->pTextures[v138] : 0), + v140, (signed __int64)v141, 0, 255); + goto LABEL_358; + } + if ( (*(int *)(v227 + 20) & 0xF0) == 128 ) + { + v182 = "sp91a"; + v140 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v182, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v227 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v141 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2k, a3j, (Texture *)(v138 != -1 ? (int)&pIcons_LOD->pTextures[v138] : 0), + v140, (signed __int64)v141, 0, 255); + goto LABEL_358; + } + } + v182 = "sptext01"; + v140 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v182, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v227 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v141 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2k, a3j, (Texture *)(v138 != -1 ? (int)&pIcons_LOD->pTextures[v138] : 0), + v140, (signed __int64)v141, 0, 255); + goto LABEL_358; + } + v125 = 11; + if ( v125 < 0 || v125 >= 16 ) + goto LABEL_335; + goto LABEL_312; + } + if ( !(*(int *)(v225 + 20) & 0xF0) ) + { + v119 = v116 + 1; + v120 = (char *)&pIcons_LOD->pTextures[v116]; + if ( *(int *)(v225 + 20) & 2 ) + { + v121 = (Texture *)(v119 != 0 ? (int)v120 : 0); + pRenderer->DrawTransparentRedShade(a2h, a3h, v121); + } + else + { + v121 = (Texture *)(v119 != 0 ? (int)v120 : 0); + pRenderer->DrawTextureTransparent(a2h, a3h, v121); + } + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2h, a3h, v121, v236); + goto LABEL_292; + } + if ( (*(int *)(v225 + 20) & 0xF0) != 16 ) + { + if ( (*(int *)(v225 + 20) & 0xF0) == 32 ) + { + v179 = "sp28a"; + a2i = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v179, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v225 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v118 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v117, a3h, (Texture *)(v116 != -1 ? (int)&pIcons_LOD->pTextures[v116] : 0), + a2i, (signed __int64)v118, 0, 255); + goto LABEL_292; + } + if ( (*(int *)(v225 + 20) & 0xF0) == 64 ) + { + v179 = "sp30a"; + a2i = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v179, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v225 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v118 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v117, a3h, (Texture *)(v116 != -1 ? (int)&pIcons_LOD->pTextures[v116] : 0), + a2i, (signed __int64)v118, 0, 255); + goto LABEL_292; + } + if ( (*(int *)(v225 + 20) & 0xF0) == 128 ) + { + v179 = "sp91a"; + a2i = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v179, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v225 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v118 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v117, a3h, (Texture *)(v116 != -1 ? (int)&pIcons_LOD->pTextures[v116] : 0), + a2i, (signed __int64)v118, 0, 255); + goto LABEL_292; + } + } + v179 = "sptext01"; + a2i = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v179, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v225 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v118 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v117, a3h, (Texture *)(v116 != -1 ? (int)&pIcons_LOD->pTextures[v116] : 0), + a2i, (signed __int64)v118, 0, 255); + goto LABEL_292; + } + v191 = 9; + break; + } + v114 = v191; + goto LABEL_274; + } + v114 = 5; + goto LABEL_272; + } +LABEL_209: + if ( pPlayer->pEquipment.uMainHand + && (pPlayer->GetEquippedItemEquipType(1u) == 1 + || pPlayer->GetEquippedItemSkillType(EQUIP_TWO_HANDED) == 4 + && !pPlayer->pEquipment.uOffHand) ) + { + v91 = 17 * pBodyComplection + v90; + v92 = v91; + v223 = paperdoll_array_511290[0][v91][2]; + if ( v223 == pIcons_LOD->FindTextureByName("pending") ) + { + v93 = 2 * v91; + v94 = paperdoll_array_511290[0][v92][1]; + a2g = pPaperdoll_BodyX + paperdoll_shoulder[0][0][v93]; + v95 = paperdoll_shoulder[0][0][v93 + 1]; + } + else + { + v94 = v223; + a2g = pPaperdoll_BodyX + dword_4E5270[2 * v91]; + v95 = dword_4E5270[2 * v91 + 1]; + } + a3g = pPaperdoll_BodyY + v95; + if ( v94 == pIcons_LOD->FindTextureByName("pending") ) + goto LABEL_259; + if ( *(int *)(v242 + 516) & 0xF0 ) + { + if ( (*(int *)(v242 + 516) & 0xF0) != 16 ) + { + if ( (*(int *)(v242 + 516) & 0xF0) == 32 ) + { + v173 = "sp28a"; + v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v173, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v242 + 516) &= 0xFu; + ptr_50C9A4 = 0; + } + v187 = 255; + v174 = 0; + v97 = (double)GetTickCount(); + pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), + (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); + goto LABEL_259; + } + if ( (*(int *)(v242 + 516) & 0xF0) == 64 ) + { + v173 = "sp30a"; + v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v173, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v242 + 516) &= 0xFu; + ptr_50C9A4 = 0; + } + v187 = 255; + v174 = 0; + v97 = (double)GetTickCount(); + pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), + (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); + goto LABEL_259; + } + if ( (*(int *)(v242 + 516) & 0xF0) == 128 ) + { + v173 = "sp91a"; + v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v173, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v242 + 516) &= 0xFu; + ptr_50C9A4 = 0; + } + v187 = 255; + v174 = 0; + v97 = (double)GetTickCount(); + pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), + (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); + goto LABEL_259; + } + } + v173 = "sptext01"; + v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v173, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v242 + 516) &= 0xFu; + ptr_50C9A4 = 0; + } + v187 = 255; + v174 = 0; + v97 = (double)GetTickCount(); + pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), + (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); + goto LABEL_259; + } + v98 = v94 + 1; + v99 = (char *)&pIcons_LOD->pTextures[v94]; + v100 = pRenderer; + if ( *(int *)(v242 + 516) & 2 ) + { + v101 = (Texture *)(v98 != 0 ? (int)v99 : 0); + v188 = v101; + v175 = a3g; + v163 = a2g; + v100->DrawTransparentRedShade(v163, v175, v188); + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2g, a3g, v101, v235); + goto LABEL_259; + } + if ( *(char *)(v242 + 516) & 1 ) + { + v101 = (Texture *)(v98 != 0 ? (int)v99 : 0); + v189 = v101; + v176 = a3g; + v164 = a2g; + pRenderer->DrawTextureTransparent(v164, v176, v189); + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2g, a3g, v101, v235); + goto LABEL_259; + } + v101 = (Texture *)(v98 != 0 ? (int)v99 : 0); + v190 = v101; + v177 = a3g; + v165 = a2g; + pRenderer->DrawTransparentGreenShade(v165, v177, v190); + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2g, a3g, v101, v235); + goto LABEL_259; + } + v102 = 17 * pBodyComplection + v90; + v94 = paperdoll_array_511290[0][v102][1]; + if ( v94 == pIcons_LOD->FindTextureByName("pending") ) + goto LABEL_259; + v103 = pPaperdoll_BodyX + paperdoll_shoulder[0][v102][0]; + v104 = pPaperdoll_BodyY + paperdoll_shoulder[0][v102][1]; + v224 = *(int *)(v242 + 516); + v105 = *(int *)(v242 + 516) & 0xF0; + a2g = pPaperdoll_BodyX + paperdoll_shoulder[0][v102][0]; + a3g = pPaperdoll_BodyY + paperdoll_shoulder[0][v102][1]; + if ( !v105 ) + { + v109 = v94 + 1; + v110 = (char *)&pIcons_LOD->pTextures[v94]; + if ( v224 & 2 ) + { + v101 = (Texture *)(v109 != 0 ? (int)v110 : 0); + v188 = v101; + v175 = v104; + v163 = v103; + v100 = pRenderer; + v100->DrawTransparentRedShade(v163, v175, v188); + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2g, a3g, v101, v235); + goto LABEL_259; + } + if ( v224 & 1 ) + { + v101 = (Texture *)(v109 != 0 ? (int)v110 : 0); + v189 = v101; + v176 = v104; + v164 = v103; + v100 = pRenderer; + pRenderer->DrawTextureTransparent(v164, v176, v189); + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2g, a3g, v101, v235); + goto LABEL_259; + } + v101 = (Texture *)(v109 != 0 ? (int)v110 : 0); + v190 = v101; + v177 = v104; + v165 = v103; + v100 = pRenderer; + pRenderer->DrawTransparentGreenShade(v165, v177, v190); + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2g, a3g, v101, v235); + goto LABEL_259; + } + v106 = v105 - 16; + if ( v106 ) + { + v107 = v106 - 16; + if ( !v107 ) + { + v178 = "sp28a"; + v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v178, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v242 + 516) &= 0xFu; + ptr_50C9A4 = 0; + } + v187 = 255; + v174 = 0; + v97 = (double)GetTickCount(); + pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), + (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); + goto LABEL_259; + } + v108 = v107 - 32; + if ( !v108 ) + { + v178 = "sp30a"; + v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v178, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v242 + 516) &= 0xFu; + ptr_50C9A4 = 0; + } + v187 = 255; + v174 = 0; + v97 = (double)GetTickCount(); + pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), + (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); + goto LABEL_259; + } + if ( v108 == 64 ) + { + v178 = "sp91a"; + v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v178, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v242 + 516) &= 0xFu; + ptr_50C9A4 = 0; + } + v187 = 255; + v174 = 0; + v97 = (double)GetTickCount(); + pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), + (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); + goto LABEL_259; + } + } + v178 = "sptext01"; + v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v178, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v242 + 516) &= 0xFu; + ptr_50C9A4 = 0; + } + v187 = 255; + v174 = 0; + v97 = (double)GetTickCount(); + pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), + (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); + goto LABEL_259; + } + v186 = 16; + } + else + { + v186 = 13; + } + } + else + { + v186 = 14; + } + v90 = v186; + goto LABEL_209; + } + v90 = 15; + goto LABEL_207; + } + if ( (*(int *)(v57 + 20) & 0xF0) != 16 ) + { + if ( (*(int *)(v57 + 20) & 0xF0) == 32 ) + { + v171 = "sp28a"; + v63 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v171, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v221 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v64 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2e, a3e, (Texture *)(v59 != -1 ? (int)&pIcons_LOD->pTextures[v59] : 0), v63, + (signed __int64)v64, 0, 255); + goto LABEL_155; + } + if ( (*(int *)(v57 + 20) & 0xF0) == 64 ) + { + v171 = "sp30a"; + v63 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v171, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v221 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v64 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2e, a3e, (Texture *)(v59 != -1 ? (int)&pIcons_LOD->pTextures[v59] : 0), v63, + (signed __int64)v64, 0, 255); + goto LABEL_155; + } + if ( (*(int *)(v57 + 20) & 0xF0) == 128 ) + { + v171 = "sp91a"; + v63 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v171, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v221 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v64 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2e, a3e, (Texture *)(v59 != -1 ? (int)&pIcons_LOD->pTextures[v59] : 0), v63, + (signed __int64)v64, 0, 255); + goto LABEL_155; + } + } + v171 = "sptext01"; + v63 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v171, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v221 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v64 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2e, a3e, (Texture *)(v59 != -1 ? (int)&pIcons_LOD->pTextures[v59] : 0), v63, + (signed __int64)v64, 0, 255); + goto LABEL_155; + } + if ( (*(int *)(v44 + 20) & 0xF0) != 16 ) + { + if ( (*(int *)(v44 + 20) & 0xF0) == 32 ) + { + v170 = "sp28a"; + } + else + { + if ( (*(int *)(v44 + 20) & 0xF0) != 64 ) + { + v50 = pIcons_LOD; + if ( (*(int *)(v44 + 20) & 0xF0) == 128 ) + { + v170 = "sp91a"; + v51 = &pIcons_LOD->pTextures[v50->LoadTexture(v170, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v220 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v52 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2d, a3d, (Texture *)(v48 != -1 ? (int)&pIcons_LOD->pTextures[v48] : 0), + v51, (signed __int64)v52, 0, 255); + goto LABEL_127; + } + v170 = "sptext01"; + v51 = &pIcons_LOD->pTextures[v50->LoadTexture(v170, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v220 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v52 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2d, a3d, (Texture *)(v48 != -1 ? (int)&pIcons_LOD->pTextures[v48] : 0), + v51, (signed __int64)v52, 0, 255); + goto LABEL_127; + } + v170 = "sp30a"; + } + v50 = pIcons_LOD; + v51 = &pIcons_LOD->pTextures[v50->LoadTexture(v170, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v220 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v52 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2d, a3d, (Texture *)(v48 != -1 ? (int)&pIcons_LOD->pTextures[v48] : 0), + v51, (signed __int64)v52, 0, 255); + goto LABEL_127; + } + v50 = pIcons_LOD; + v170 = "sptext01"; + v51 = &pIcons_LOD->pTextures[v50->LoadTexture(v170, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v220 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v52 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2d, a3d, (Texture *)(v48 != -1 ? (int)&pIcons_LOD->pTextures[v48] : 0), + v51, (signed __int64)v52, 0, 255); + goto LABEL_127; + } + v185 = 16; + } + } + v45 = v185; + goto LABEL_106; + } + v45 = 15; + goto LABEL_104; + } + if ( (*(int *)(v32 + 20) & 0xF0) != 16 ) + { + if ( (*(int *)(v32 + 20) & 0xF0) == 32 ) + { + v169 = "sp28a"; + } + else + { + if ( (*(int *)(v32 + 20) & 0xF0) != 64 ) + { + v38 = pIcons_LOD; + if ( (*(int *)(v32 + 20) & 0xF0) == 128 ) + { + v169 = "sp91a"; + v39 = &pIcons_LOD->pTextures[v38->LoadTexture(v169, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v219 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v40 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2c, a3c, (Texture *)(v35 != -1 ? (int)&pIcons_LOD->pTextures[v35] : 0), v39, + (signed __int64)v40, 0, 255); + goto LABEL_93; + } + v169 = "sptext01"; + v39 = &pIcons_LOD->pTextures[v38->LoadTexture(v169, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v219 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v40 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2c, a3c, (Texture *)(v35 != -1 ? (int)&pIcons_LOD->pTextures[v35] : 0), v39, + (signed __int64)v40, 0, 255); + goto LABEL_93; + } + v169 = "sp30a"; + } + v38 = pIcons_LOD; + v39 = &pIcons_LOD->pTextures[v38->LoadTexture(v169, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v219 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v40 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2c, a3c, (Texture *)(v35 != -1 ? (int)&pIcons_LOD->pTextures[v35] : 0), v39, + (signed __int64)v40, 0, 255); + goto LABEL_93; + } + v38 = pIcons_LOD; + v169 = "sptext01"; + v39 = &pIcons_LOD->pTextures[v38->LoadTexture(v169, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v219 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v40 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2c, a3c, (Texture *)(v35 != -1 ? (int)&pIcons_LOD->pTextures[v35] : 0), v39, + (signed __int64)v40, 0, 255); + goto LABEL_93; + } + v184 = 9; + break; + } + v33 = v184; + goto LABEL_74; + } + v33 = 5; + goto LABEL_72; + } + if ( (*(int *)(v22 + 20) & 0xF0) != 16 ) + { + if ( (*(int *)(v22 + 20) & 0xF0) == 32 ) + { + v168 = "sp28a"; + } + else + { + if ( (*(int *)(v22 + 20) & 0xF0) != 64 ) + { + v26 = pIcons_LOD; + if ( (*(int *)(v22 + 20) & 0xF0) == 128 ) + { + v168 = "sp91a"; + a2b = &pIcons_LOD->pTextures[v26->LoadTexture(v168, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v22 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v27 = (Texture *)(v241 != -1 ? (int)&pIcons_LOD->pTextures[v241] : 0); + v28 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v24, a3b, v27, a2b, (signed __int64)v28, 0, 255); + goto LABEL_57; + } + v168 = "sptext01"; + a2b = &pIcons_LOD->pTextures[v26->LoadTexture(v168, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v22 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v27 = (Texture *)(v241 != -1 ? (int)&pIcons_LOD->pTextures[v241] : 0); + v28 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v24, a3b, v27, a2b, (signed __int64)v28, 0, 255); + goto LABEL_57; + } + v168 = "sp30a"; + } + v26 = pIcons_LOD; + a2b = &pIcons_LOD->pTextures[v26->LoadTexture(v168, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v22 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v27 = (Texture *)(v241 != -1 ? (int)&pIcons_LOD->pTextures[v241] : 0); + v28 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v24, a3b, v27, a2b, (signed __int64)v28, 0, 255); + goto LABEL_57; + } + v26 = pIcons_LOD; + v168 = "sptext01"; + a2b = &pIcons_LOD->pTextures[v26->LoadTexture(v168, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v22 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v27 = (Texture *)(v241 != -1 ? (int)&pIcons_LOD->pTextures[v241] : 0); + v28 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v24, a3b, v27, a2b, (signed __int64)v28, 0, 255); + goto LABEL_57;; + } + a3 = pPaperdoll_BodyY; + a2 = pPaperdoll_BodyX; + v240 = 4 * uPlayerID_ - 4; + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX, pPaperdoll_BodyY, + (Texture *)(*(unsigned int *)((char *)papredoll_dbods + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dbods + v240)] : 0)); + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2, a3, + (Texture *)(*(unsigned int *)((char *)papredoll_dbods + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dbods + v240)] : 0), + pPlayer->pEquipment.uBody); + uPlayerID_a = 2 * pBodyComplection; + v6 = pPlayer->pEquipment.uMainHand; + if ( !v6 + || (v7 = *(int *)&pPlayer->pInventoryItems[v6-1], pItemsTable->pItems[v7].uEquipType != 1) + && (pItemsTable->pItems[v7].uSkillType != 4 || pPlayer->pEquipment.uOffHand) ) + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0], pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1], + (Texture *)(*(unsigned int *)((char *)papredoll_dlads + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlads + v240)] : 0)); + v8 = pPlayer->pEquipment.uMainHand; + if ( v8 ) + { + v229 = pPlayer->pEquipment.uMainHand; + v9 = (int)&pPlayer->pInventoryItems[v8-1]; + // v10 = pBodyComplection << 7; + v218 = v9; + v11 = *(int *)v9; + v12 = *(int *)v9; + v13 = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[v12].uEquipX; + a2a = v13; + a3a = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[v12].uEquipY; + if ( v11 == 64 ) + v166 = "item64v1"; + else + v166 = pItemsTable->pItems[v12].pIconName; + v14 = pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE); + v15 = *(int *)(v218 + 20); + if ( *(int *)(v218 + 20) & 0xF0 ) + { + if ( (*(int *)(v218 + 20) & 0xF0) != 16 ) + { + if ( (*(int *)(v218 + 20) & 0xF0) == 32 ) + { + v167 = "sp28a"; + //v16 = (Texture *)(72 * pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE) + 7145548); + v16 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v218 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v17 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v13, a3a, (Texture *)(v14 != -1 ? (int)&pIcons_LOD->pTextures[v14] : 0), v16, (signed __int64)v17, 0, 255); + goto LABEL_393;; + } + if ( (*(int *)(v218 + 20) & 0xF0) == 64 ) + { + v167 = "sp30a"; + //v16 = (Texture *)(72 * pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE) + 7145548); + v16 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v218 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v17 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v13, a3a, (Texture *)(v14 != -1 ? (int)&pIcons_LOD->pTextures[v14] : 0), v16, (signed __int64)v17, 0, 255); + goto LABEL_393; + } + if ( (*(int *)(v218 + 20) & 0xF0) == 128 ) + { + v167 = "sp91a"; + //v16 = (Texture *)(72 * pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE) + 7145548); + v16 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v218 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v17 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v13, a3a, (Texture *)(v14 != -1 ? (int)&pIcons_LOD->pTextures[v14] : 0), v16, (signed __int64)v17, 0, 255); + goto LABEL_393; + } + } + v167 = "sptext01"; + //v16 = (Texture *)(72 * pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE) + 7145548); + v16 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v218 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v17 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(v13, a3a, (Texture *)(v14 != -1 ? (int)&pIcons_LOD->pTextures[v14] : 0), v16, (signed __int64)v17, 0, 255); + goto LABEL_393; + } + v18 = v14 + 1; + v19 = (char *)&pIcons_LOD->pTextures[v14]; + if ( v15 & 2 ) + { + v20 = (Texture *)(v18 != 0 ? (int)v19 : 0); + pRenderer->DrawTransparentRedShade(a2a, a3a, v20); + } + else + { + if ( v15 & 1 ) + { + v20 = (Texture *)(v18 != 0 ? (int)v19 : 0); + pRenderer->DrawTextureTransparent(a2a, a3a, v20); + } + else + { + v20 = (Texture *)(v18 != 0 ? (int)v19 : 0); + pRenderer->DrawTransparentGreenShade(a2a, a3a, v20); + } + } + if ( !bRingsShownInCharScreen ) + pRenderer->_4A612A(a2a, a3a, v20, v229); + } +LABEL_393: + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_RightHand[uPlayerID_a], + pPaperdoll_BodyY + pPaperdoll_RightHand[uPlayerID_a + 1], + (Texture *)(*(unsigned int *)((char *)papredoll_drhs + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_drhs + v240)] : 0)); + v161 = pPlayer->pEquipment.uMainHand; + if ( v161 ) + { + v162 = *(int *)&pPlayer->pInventoryItems[v161-1]; + if ( pItemsTable->pItems[v162].uEquipType == 1 || pItemsTable->pItems[v162].uSkillType == 4 && !pPlayer->pEquipment.uOffHand ) + pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[0][uPlayerID_a], + pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[0][uPlayerID_a + 1], + (Texture *)(*(unsigned int *)((char *)papredoll_dlhus + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhus + v240)] : 0)); + } + if ( !bRingsShownInCharScreen ) + pRenderer->DrawTextureTransparent(0x25Bu, 0x12Bu, + (Texture *)(uTextureID_MAGNIF_B != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_MAGNIF_B] : 0)); + pRenderer->DrawTextureTransparent(0x1D4u, 0, + (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0)); + } + + + //----- (0043E825) -------------------------------------------------------- + void __fastcall CharacterUI_DrawPaperdollWithRingOverlay(unsigned int uPlayerID) + { + unsigned int v1; // ebx@1 + Player *pPlayer; // edi@1 + int v3; // ecx@1 + int *v4; // edi@3 + unsigned int v5; // ebx@3 + int v6; // eax@3 + LODFile_IconsBitmaps *v7; // ecx@7 + double v8; // st7@16 + int v9; // edi@17 + Texture *v10; // edi@18 + unsigned __int8 v11; // zf@19 + Texture *v12; // eax@19 + char v13; // sf@24 + unsigned __int8 v14; // of@24 + unsigned int v15; // eax@25 + unsigned int v16; // ebx@26 + int v17; // eax@26 + LODFile_IconsBitmaps *v18; // ecx@30 + double v19; // st7@39 + int v20; // edi@40 + int v21; // eax@41 + signed int v22; // ebx@41 + Texture *v23; // edi@41 + int v24; // eax@42 + char *v25; // eax@42 + unsigned int v26; // eax@46 + int v27; // edi@47 + unsigned int v28; // ebx@47 + int v29; // eax@47 + LODFile_IconsBitmaps *v30; // ecx@51 + Texture *v31; // esi@58 + double v32; // st7@60 + int v33; // esi@61 + int v34; // esi@62 + Texture *v35; // eax@63 + const char *v36; // [sp-8h] [bp-38h]@8 + const char *v37; // [sp-8h] [bp-38h]@31 + const char *v38; // [sp-8h] [bp-38h]@52 + int v39; // [sp+10h] [bp-20h]@3 + Texture *v40; // [sp+10h] [bp-20h]@14 + int v41; // [sp+10h] [bp-20h]@26 + Texture *v42; // [sp+10h] [bp-20h]@37 + int v43; // [sp+10h] [bp-20h]@47 + unsigned int a3; // [sp+14h] [bp-1Ch]@3 + unsigned int a2; // [sp+18h] [bp-18h]@3 + unsigned int *v46; // [sp+1Ch] [bp-14h]@1 + Player *v47; // [sp+20h] [bp-10h]@1 + int v48; // [sp+24h] [bp-Ch]@1 + int v49; // [sp+24h] [bp-Ch]@26 + + v1 = uPlayerID; + pPlayer = pPlayers[uPlayerID]; + v47 = pPlayers[uPlayerID]; + pIcons_LOD->LoadTexture("sptext01", TEXTURE_16BIT_PALETTE); + CharacterUI_DrawPaperdoll(v1); + pRenderer->DrawTextureTransparent(0x1D9u, 0, (Texture *)(uTextureID_BACKHAND != -1 ? &pIcons_LOD->pTextures[uTextureID_BACKHAND] : 0)); + pRenderer->DrawTextureTransparent(0x1D4u, 0, (Texture *)(uTextureID_507B04 != -1 ? &pIcons_LOD->pTextures[uTextureID_507B04] : 0)); + pRenderer->DrawTextureIndexed(pCharacterScreen_DetalizBtn->uX, pCharacterScreen_DetalizBtn->uY, + (Texture *)(uTextureID_5118C8 != -1 ? &pIcons_LOD->pTextures[uTextureID_5118C8] : 0)); + v3 = 0; + v46 = &pPlayer->pEquipment.field_28; + v48 = 0; + do + { + if ( !*v46 ) + goto LABEL_24; + v39 = *v46; + v4 = (int *)&pPlayer->pInventoryItems[*v46-1].uItemID; + a3 = pPaperdollRingsY[v3]; + a2 = pPaperdollRingsX[v3]; + v5 = pIcons_LOD->LoadTexture(pItemsTable->pItems[*v4].pIconName, TEXTURE_16BIT_PALETTE); + v6 = *(int *)(v4 + 20); + if ( *(int *)(v4 + 20) & 0xF0 ) + { + if ( (*(int *)(v4 + 20) & 0xF0) != 16 ) + { + if ( (*(int *)(v4 + 20) & 0xF0) == 32 ) + { + v36 = "sp28a"; + } + else + { + if ( (*(int *)(v4 + 20) & 0xF0) != 64 ) + { + v7 = pIcons_LOD; + if ( (*(int *)(v4 + 20) & 0xF0) == 128 ) + { + v36 = "sp91a"; +LABEL_14: + v40 = &pIcons_LOD->pTextures[v7->LoadTexture(v36, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v4 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v8 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(a2, a3, (Texture *)(v5 != -1 ? (int)&pIcons_LOD->pTextures[v5] : 0), + v40, (signed __int64)v8, 0, 255); + goto LABEL_23; + } +LABEL_13: + v36 = "sptext01"; + goto LABEL_14; + } + v36 = "sp30a"; + } + v7 = pIcons_LOD; + goto LABEL_14; + } + v7 = pIcons_LOD; + goto LABEL_13; + } + v9 = v5 + 1; + if ( v6 & 2 ) + { + v10 = (Texture *)(v9 != 0 ? (int)&pIcons_LOD->pTextures[v5] : 0); + pRenderer->DrawTransparentRedShade(a2, a3, v10); + } + else + { + v11 = (v6 & 1) == 0; + v12 = &pIcons_LOD->pTextures[v5]; + if ( v11 ) + { + v10 = (Texture *)(v9 != 0 ? (int)v12 : 0); + pRenderer->DrawTransparentGreenShade(a2, a3, v10); + } + else + { + v10 = (Texture *)(v9 != 0 ? (int)v12 : 0); + pRenderer->DrawTextureTransparent(a2, a3, v10); + } + } + pRenderer->_4A601E(a2, a3, v10, v39); +LABEL_23: + pPlayer = v47; +LABEL_24: + v46 += 4; + v3 = v48 + 4; + v14 = __OFSUB__(v48 + 4, 20); + v11 = v48 == 16; + v13 = v48 - 16 < 0; + v48 += 4; + } + while ( (unsigned __int8)(v13 ^ v14) | v11 ); + v15 = pPlayer->pEquipment.field_24; + if ( !v15 ) + goto LABEL_46; + v41 = pPlayer->pEquipment.field_24; + v49 = (int)&pPlayer->pInventoryItems[v15-1]; + v16 = pIcons_LOD->LoadTexture(pItemsTable->pItems[*(int *)v49].pIconName, TEXTURE_16BIT_PALETTE); + v17 = *(int *)(v49 + 20); + if ( !(*(int *)(v49 + 20) & 0xF0) ) + { + v20 = v16 + 1; + if ( v17 & 2 ) + { + v21 = 9 * v16; + v22 = 493; + v23 = (Texture *)(v20 != 0 ? (int)&pIcons_LOD->pTextures[8 * v21 / 0x48u] : 0); + pRenderer->DrawTransparentRedShade(0x1EDu, 0x5Bu, v23); + } + else + { + v11 = (v17 & 1) == 0; + v24 = 9 * v16; + v22 = 493; + v25 = (char *)&pIcons_LOD->pTextures[8 * v24 / 0x48u]; + if ( v11 ) + { + v23 = (Texture *)(v20 != 0 ? (int)v25 : 0); + pRenderer->DrawTransparentGreenShade(493, 91, v23); + } + else + { + v23 = (Texture *)(v20 != 0 ? (int)v25 : 0); + pRenderer->DrawTextureTransparent(0x1EDu, 0x5Bu, v23); + } + } + pRenderer->_4A601E(v22, 91, v23, v41); + pPlayer = v47; + goto LABEL_46; + } + if ( (*(int *)(v49 + 20) & 0xF0) == 16 ) + { + v18 = pIcons_LOD; + goto LABEL_36; + } + if ( (*(int *)(v49 + 20) & 0xF0) == 32 ) + { + v37 = "sp28a"; + goto LABEL_34; + } + if ( (*(int *)(v49 + 20) & 0xF0) == 64 ) + { + v37 = "sp30a"; +LABEL_34: + v18 = pIcons_LOD; + goto LABEL_37; + } + v18 = pIcons_LOD; + if ( (*(int *)(v49 + 20) & 0xF0) == 128 ) + { + v37 = "sp91a"; + goto LABEL_37; + } +LABEL_36: + v37 = "sptext01"; +LABEL_37: + v42 = &pIcons_LOD->pTextures[v18->LoadTexture(v37, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v49 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v19 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6( + 0x1EDu, + 0x5Bu, + (Texture *)(v16 != -1 ? (int)&pIcons_LOD->pTextures[v16] : 0), + v42, + (signed __int64)v19, + 0, + 255); +LABEL_46: + v26 = pPlayer->pEquipment.field_1C; + if ( !v26 ) + return; + v43 = pPlayer->pEquipment.field_1C; + v27 = (int)&pPlayer->pInventoryItems[v26-1]; + v28 = pIcons_LOD->LoadTexture(pItemsTable->pItems[*(int *)v27].pIconName, TEXTURE_16BIT_PALETTE); + v29 = *(int *)(v27 + 20); + if ( !(*(int *)(v27 + 20) & 0xF0) ) + { + v33 = v28 + 1; + if ( v29 & 2 ) + { + v34 = v33 != 0 ? (int)&pIcons_LOD->pTextures[v28] : 0; + pRenderer->DrawTransparentRedShade(0x24Au, 0x58u, (Texture *)v34); + } + else + { + v11 = (v29 & 1) == 0; + v35 = &pIcons_LOD->pTextures[v28]; + if ( v11 ) + { + v34 = v33 != 0 ? (int)v35 : 0; + pRenderer->DrawTransparentGreenShade(586, 88, (Texture *)v34); + } + else + { + v34 = v33 != 0 ? (int)v35 : 0; + pRenderer->DrawTextureTransparent(0x24Au, 0x58u, (Texture *)v34); + } + } + pRenderer->_4A601E(586, 88, (Texture *)v34, v43); + return; + } + if ( (*(int *)(v27 + 20) & 0xF0) == 16 ) + { + v30 = pIcons_LOD; + goto LABEL_57; + } + if ( (*(int *)(v27 + 20) & 0xF0) == 32 ) + { + v38 = "sp28a"; + goto LABEL_55; + } + if ( (*(int *)(v27 + 20) & 0xF0) == 64 ) + { + v38 = "sp30a"; +LABEL_55: + v30 = pIcons_LOD; + goto LABEL_58; + } + v30 = pIcons_LOD; + if ( (*(int *)(v27 + 20) & 0xF0) == 128 ) + { + v38 = "sp91a"; + goto LABEL_58; + } +LABEL_57: + v38 = "sptext01"; +LABEL_58: + v31 = &pIcons_LOD->pTextures[v30->LoadTexture(v38, TEXTURE_16BIT_PALETTE)]; + dword_50C9A8 -= pEventTimer->uTimeElapsed; + if ( dword_50C9A8 <= 0 ) + { + dword_50C9A8 = 0; + *(char *)(v27 + 20) &= 0xFu; + ptr_50C9A4 = 0; + } + v32 = (double)GetTickCount() * 0.1; + pRenderer->_4A63E6(0x24Au, 0x58u, (Texture *)(v28 != -1 ? (int)&pIcons_LOD->pTextures[v28] : 0), + v31, (signed __int64)v32, 0, 255); + } + +//----- (0043BCA7) -------------------------------------------------------- +void CharacterUI_LoadPaperdollTextures() +{ + int v0; // edi@7 + enum CHARACTER_RACE pRace; // ebx@7 + signed int pSex; // eax@7 + int v3; // ebx@10 + Player *pPlayer; // edi@12 + unsigned __int8 v5; // cl@12 + int v6; // edi@16 + unsigned int v7; // eax@16 + Player *pPlayer2; // ebx@16 + char *v9; // ebx@16 + char v10; // al@16 + signed int v11; // edi@21 + Player *pPlayer3; // ebx@23 + //Player *pPlayer4; // edi@29 + //int v14; // ebp@29 + //stru331 *v15; // edi@65 + //signed int v16; // ebx@66 + //unsigned int v17; // eax@67 + //unsigned int *v18; // ecx@67 + //unsigned int *v19; // ebx@68 + //int v20; // edi@73 + int v21; // ebp@73 + unsigned int v22; // eax@76 + int v23; // ecx@76 + unsigned int v24; // eax@78 + int v25; // ecx@78 + int v26; // ebx@79 + unsigned int v27; // eax@80 + int v28; // ecx@80 + //int result; // eax@83 + int v30; // [sp+10h] [bp-28h]@5 + //signed int v31; // [sp+10h] [bp-28h]@68 + signed int v32; // [sp+10h] [bp-28h]@75 + signed int v33; // [sp+10h] [bp-28h]@77 + int v34; // [sp+10h] [bp-28h]@79 + //char *v35; // [sp+14h] [bp-24h]@65 + int v36; // [sp+14h] [bp-24h]@75 + int v37; // [sp+14h] [bp-24h]@77 + signed int v38; // [sp+14h] [bp-24h]@79 + //unsigned int *v39; // [sp+18h] [bp-20h]@66 + int *v40; // [sp+18h] [bp-20h]@73 + //unsigned int *v41; // [sp+1Ch] [bp-1Ch]@73 + int v42; // [sp+20h] [bp-18h]@6 + int v43; // [sp+20h] [bp-18h]@73 + char pContainer[128]; // [sp+24h] [bp-14h]@12 + + uTextureID_MAGNIF_B = pIcons_LOD->LoadTexture("MAGNIF-B", TEXTURE_16BIT_PALETTE); + //if ( !pParty->uAlignment || pParty->uAlignment == 1 || pParty->uAlignment == 2 ) + uTextureID_BACKDOLL = pIcons_LOD->LoadTexture("BACKDOLL", TEXTURE_16BIT_PALETTE); + uTextureID_507B04 = uTextureID_right_panel; + v30 = 0; + uTextureID_BACKHAND = pIcons_LOD->LoadTexture("BACKHAND", TEXTURE_16BIT_PALETTE); + uTextureID_5118C8 = uExitCancelTextureId; + do + { + v42 = v30 + 1; + if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(v30 + 1) ) + { + v0 = v30; + pRace = pPlayers[v30 + 1]->GetRace(); + pSex = pPlayers[v30 + 1]->GetSexByVoice(); + if ( pRace && pRace != 1 && pRace != 2 )//race == 3 + v3 = (pSex != 0) + 3; + else + v3 = (pSex != 0) + 1; + wsprintfA(pContainer, "pc23v%dBod", v3); + papredoll_dbods[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);//Body texture + wsprintfA(pContainer, "pc23v%dlad", v3); + papredoll_dlads[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand + wsprintfA(pContainer, "pc23v%dlau", v3); + papredoll_dlaus[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand2 + wsprintfA(pContainer, "pc23v%drh", v3); + papredoll_drhs[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Right Hand + wsprintfA(pContainer, "pc23v%dlh", v3); + papredoll_dlhs[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Fist + wsprintfA(pContainer, "pc23v%dlhu", v3); + papredoll_dlhus[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); // Left Fist 2 + pPlayer = pPlayers[v0 + 1]; + v5 = pPlayer->uFace; + if ( v5 == 12 || v5 == 13 ) + papredoll_dbrds[(char)v5] = 0; + papredoll_flying_feet[pPlayer->uFace] = 0; + IsPlayerWearingWatersuit[v30 + 1] = 1; + } + else + { + v6 = v30; + papredoll_dbods[v30] = pIcons_LOD->LoadTexture(dbod_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE); + papredoll_dlads[v30] = pIcons_LOD->LoadTexture(dlad_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE); + papredoll_dlaus[v30] = pIcons_LOD->LoadTexture(dlau_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE); + papredoll_drhs[v30] = pIcons_LOD->LoadTexture(drh_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE); + papredoll_dlhs[v30] = pIcons_LOD->LoadTexture(dlh_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE); + v7 = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE); + pPlayer2 = pPlayers[v30 + 1]; + papredoll_dlhus[v30] = v7; + v9 = (char *)&pPlayer2->uFace; + v10 = *v9; + if ( *v9 == 12 || v10 == 13 ) + { + wsprintfA(pContainer, "pc%02dbrd", v10 + 1); + v9 = (char *)&pPlayers[v6 + 1]->uFace; + papredoll_dbrds[*v9] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + } + wsprintfA(pContainer, "item281pc%02d", *v9 + 1); + papredoll_flying_feet[pPlayers[v6 + 1]->uFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + IsPlayerWearingWatersuit[v30 + 1] = 0; + } + ++v30; + } + while ( v42 < 4 ); + uTextureID_ar_up_up = pIcons_LOD->LoadTexture("ar_up_up", TEXTURE_16BIT_PALETTE); + uTextureID_ar_up_dn = pIcons_LOD->LoadTexture("ar_up_dn", TEXTURE_16BIT_PALETTE); + uTextureID_ar_dn_up = pIcons_LOD->LoadTexture("ar_dn_up", TEXTURE_16BIT_PALETTE); + uTextureID_ar_dn_dn = pIcons_LOD->LoadTexture("ar_dn_dn", TEXTURE_16BIT_PALETTE); + papredoll_dbrds[9] = pIcons_LOD->LoadTexture("ib-cd1-d", TEXTURE_16BIT_PALETTE); + papredoll_dbrds[7] = pIcons_LOD->LoadTexture("ib-cd2-d", TEXTURE_16BIT_PALETTE); + papredoll_dbrds[5] = pIcons_LOD->LoadTexture("ib-cd3-d", TEXTURE_16BIT_PALETTE); + papredoll_dbrds[3] = pIcons_LOD->LoadTexture("ib-cd4-d", TEXTURE_16BIT_PALETTE); + papredoll_dbrds[1] = pIcons_LOD->LoadTexture("ib-cd5-d", TEXTURE_16BIT_PALETTE); + v11 = 0; + do + { + byte_5111C0[v11] = 0; + if ( pParty->pPickedItem.uItemID != v11 + 66 ) + { + pPlayer3 = pParty->pPlayers; + while ( !sub_43EE15_player_has_item(v11 + 66, pPlayer3, 0) ) + { + ++pPlayer3; + if ( (signed int)pPlayer3 >= (signed int)pParty->pHirelings ) + goto LABEL_28; + } + } + byte_5111C0[v11] = 1; +LABEL_28: + ++v11; + } + while ( v11 < 54 ); + + memset(byte_5111F6, 0, 16); + for (uint i = 0; i < 4; ++i) + { + auto player = pParty->pPlayers + i; + + if (sub_43EE15_player_has_item(ITEM_ARTICACT_GOVERNONS_ARMOR, player, 1)) byte_5111F6[0] = 1; + if (sub_43EE15_player_has_item(ITEM_ARTIFACT_YORUBA, player, 1)) byte_5111F6[1] = 1; + if (sub_43EE15_player_has_item(ITEM_RELIC_HARECS_LEATHER, player, 1)) byte_5111F6[2] = 1; + if (sub_43EE15_player_has_item(ITEM_ARTIFACT_LEAGUE_BOOTS, player, 1)) byte_5111F6[3] = 1; + if (sub_43EE15_player_has_item(ITEM_RELIC_TALEDONS_HELM, player, 1)) byte_5111F6[4] = 1; + if (sub_43EE15_player_has_item(ITEM_RELIC_SCHOLARS_CAP, player, 1)) byte_5111F6[5] = 1; + if (sub_43EE15_player_has_item(ITEM_RELIC_PHYNAXIAN_CROWN, player, 1)) byte_5111F6[6] = 1; + if (sub_43EE15_player_has_item(ITEM_ARTIFACT_MINDS_EYE, player, 1)) byte_5111F6[7] = 1; + if (sub_43EE15_player_has_item(ITEM_RARE_SHADOWS_MASK, player, 1)) byte_5111F6[8] = 1; + if (sub_43EE15_player_has_item(ITEM_RILIC_TITANS_BELT, player, 1)) byte_5111F6[9] = 1; + if (sub_43EE15_player_has_item(ITEM_ARTIFAT_HEROS_BELT, player, 1)) byte_5111F6[10] = 1; + if (sub_43EE15_player_has_item(ITEM_RELIC_TWILIGHT, player, 1)) byte_5111F6[11] = 1; + if (sub_43EE15_player_has_item(ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, player, 1)) byte_5111F6[12] = 1; + if (sub_43EE15_player_has_item(ITEM_RARE_SUN_CLOAK, player, 1)) byte_5111F6[13] = 1; + if (sub_43EE15_player_has_item(ITEM_RARE_MOON_CLOAK, player, 1)) byte_5111F6[14] = 1; + if (sub_43EE15_player_has_item(ITEM_RARE_VAMPIRES_CAPE, player, 1)) byte_5111F6[15] = 1; + if (sub_43EE15_player_has_item(ITEM_ELVEN_CHAINMAIL, player, 1)) byte_5111F6[16] = 1; + } + + //v14 = 1; + //v15 = &stru_511698.field_2C; + //v35 = (char *)&stru_511718.field_18; + for (uint i = 0; i < 2; ++i) + { + //v16 = 0; + //v39 = (unsigned int *)(v35 - 24); + for (uint j = 0; j < 5; ++j) + { + _43C91D_FormItemTextureFilename(pContainer, j + 100, i + 1, 0); + //v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + //++v16; + //v18 = v39; + //++v39; + //*v18 = v17; + stru_511718[i].texids[j] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + } + //while ( v16 < 5 ); + + //*(int *)v35 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 535, i + 1, 0); + stru_511718[i].texid2 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + + //v31 = 0; + //v19 = (unsigned int *)((char *)v15 - 44); + for (uint j = 0; j < 11; ++j) + { + _43C91D_FormItemTextureFilename(pContainer, j + 89, i + 1, 0); + //*v19 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + //++v19; + stru_511698[i].texids[j] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + } + //while ( v31 < 11 ); + + _43C91D_FormItemTextureFilename(pContainer, 521, i + 1, 0); + stru_511698[i].texid1 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 522, i + 1, 0); + stru_511698[i].texid2 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 523, i + 1, 0); + stru_511698[i].texid3 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 532, i + 1, 0); + stru_511698[i].texid4 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 544, i + 1, 0); + stru_511698[i].texid5 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + if ( _43ED6F_check_party_races(true) ) + papredoll_dbrds[11] = pIcons_LOD->LoadTexture("item092v3", TEXTURE_16BIT_PALETTE); + //v35 += 28; + //++v14; + //++v15; + } + //while ( v14 - 1 < 2 ); + + v43 = 0; + //v20 = 1; + v40 = &dword_511638[0][5]; + v21 = (int)paperdoll_array_511290[0][13]; + //v41 = (unsigned int *)&stru_511718.texid1; + for (uint i = 0; i < 4; ++i) + { + if ( sub_43EDB9_get_some_race_sex_relation_2(i) ) + { + _43C91D_FormItemTextureFilename(pContainer, 524, i + 1, 0); + v32 = 66; + stru_511718[i].texid1 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + v36 = v21 - 152; + do + { + _43C91D_FormItemTextureFilename(pContainer, v32, i + 1, 0); + *(int *)(v36 - 4) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, v32, i + 1, 1); + *(int *)v36 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, v32, i + 1, 2); + v22 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + v23 = v36; + v36 += 12; + ++v32; + *(int *)(v23 + 4) = v22; + } + while ( v32 - 66 < 13 ); + _43C91D_FormItemTextureFilename(pContainer, 516, i + 1, 0); + *(int *)v21 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 516, i + 1, 1); + *(int *)(v21 + 4) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 516, i + 1, 2); + *(int *)(v21 + 8) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 505, i + 1, 0); + *(int *)(v21 + 12) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 505, i + 1, 1); + *(int *)(v21 + 16) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 505, i + 1, 2); + *(int *)(v21 + 20) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 504, i + 1, 0); + *(int *)(v21 + 24) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 504, i + 1, 1); + *(int *)(v21 + 28) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 504, i + 1, 2); + *(int *)(v21 + 32) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 533, i + 1, 0); + *(int *)(v21 + 36) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 533, i + 1, 1); + *(int *)(v21 + 40) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 533, i + 1, 2); + *(int *)(v21 + 44) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + v33 = 0; + v37 = (int)(v40 - 5); + do + { + _43C91D_FormItemTextureFilename(pContainer, v33 + 115, i + 1, 0); + v24 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + ++v33; + v25 = v37; + v37 += 4; + *(int *)v25 = v24; + } + while ( v33 < 5 ); + _43C91D_FormItemTextureFilename(pContainer, 512, i + 1, 0); + v26 = v43; + v38 = 105; + v34 = v43; + *v40 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + do + { + _43C91D_FormItemTextureFilename(pContainer, v38, i + 1, 0); + *(int *)((char *)paperdoll_array_511828 + v34) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, v38, i + 1, 1); + v27 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + v28 = v34; + v34 += 4; + ++v38; + *(int *)((char *)dword_511788 + v28) = v27; + } + while ( v38 - 105 < 5 ); + _43C91D_FormItemTextureFilename(pContainer, 525, i + 1, 0); + *(int *)((char *)&paperdoll_array_511828[0][5] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 530, i + 1, 0); + *(int *)((char *)&paperdoll_array_511828[0][6] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 547, i + 1, 0); + *(int *)((char *)&paperdoll_array_511828[0][7] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 548, i + 1, 0); + *(int *)((char *)&paperdoll_array_511828[0][8] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 550, i + 1, 0); + *(int *)((char *)&paperdoll_array_511828[0][9] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 525, i + 1, 1); + *(int *)((char *)&dword_51179C + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 530, i + 1, 1); + *(int *)((char *)&dword_5117A0 + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 547, i + 1, 1); + *(int *)((char *)&dword_5117A4 + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 548, i + 1, 1); + *(int *)((char *)&dword_5117A8 + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + _43C91D_FormItemTextureFilename(pContainer, 550, i + 1, 1); + *(int *)((char *)&dword_5117AC + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + } + else + { + v26 = v43; + } + //v41 += 7; + v40 += 6; + v21 += 204; + //++v20; + //result = v20 - 1; + v43 = v26 + 40; + } + //while ( v20 - 1 < 4 ); + //return result; +} + +//----- (00419401) -------------------------------------------------------- +void __cdecl CharacterUI_SkillScreen_Draw() + { + unsigned int v0; // ecx@3 + GUIButton *pButton; // eax@3 + GUIFont *v2; // eax@8 + unsigned int v3; // esi@8 + int v4; // eax@10 + unsigned int v5; // esi@14 + int v6; // eax@17 + unsigned int v7; // esi@19 + int v8; // eax@21 + unsigned int v9; // esi@25 + int v10; // eax@27 + int a2; // [sp+10h] [bp-14h]@1 + int v12; // [sp+14h] [bp-10h]@8 + int v13; // [sp+14h] [bp-10h]@19 + int *v14; // [sp+18h] [bp-Ch]@8 + int *v15; // [sp+18h] [bp-Ch]@14 + int *v16; // [sp+18h] [bp-Ch]@19 + int *v17; // [sp+18h] [bp-Ch]@25 + Player *v18; // [sp+1Ch] [bp-8h]@8 + int a5; // [sp+20h] [bp-4h]@8 + + a2 = 0; + if ( dword_507CC0 ) + sub_4196A0(); + v0 = uActiveCharacter; + dword_507CC0 = uActiveCharacter; + for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext ) + { + if ( pButton->uControlID == 120 ) + { + dword_50698C = pButton->uX; + dword_506988 = pButton->uY; + dword_506984 = pButton->uZ; + dword_506980 = pButton->uW; + pButton->uW = 0; + pButton->uZ = 0; + pButton->uY = 0; + pButton->uX = 0; + v0 = uActiveCharacter; + } + } + v12 = 0; + a5 = pGUIWindow_CurrentMenu->uNumControls; + v18 = &pParty->pPlayers[v0-1]; + v2 = pFontLucida; + v14 = pWeaponSkills; + v3 = 2 * LOBYTE(pFontLucida->uFontHeight) + 13; + do + { + if ( v18->pActiveSkills[*v14] & 0x3F )//crash + { + v4 = LOBYTE(v2->uFontHeight); + v3 = v3 + v4 - 3; + ++a2; + ++v12; + pGUIWindow_CurrentMenu->CreateButton(0x18u, v3, 0xCCu, v4 - 3, 3, *v14 | 0x8000, 0x79u, *v14, 0, "", 0, 0); + v2 = pFontLucida; + } + ++v14; + } + while ( v14 <= &pWeaponSkills[8] ); + if ( !v12 ) + v3 = v3 + LOBYTE(v2->uFontHeight) - 3; + v15 = pMagicSkills; + v5 = v3 + 2 * LOBYTE(v2->uFontHeight) - 6; + do + { + if ( v18->pActiveSkills[*v15] & 0x3F && a2 < 15 ) + { + v6 = LOBYTE(v2->uFontHeight); + v5 = v5 + v6 - 3; + ++a2; + pGUIWindow_CurrentMenu->CreateButton(0x18u, v5, 0xCCu, v6 - 3, 3, *v15 | 0x8000, 0x79u, *v15, 0, "", 0, 0); + v2 = pFontLucida; + } + ++v15; + } + while ( v15 <= &pMagicSkills[8] ); + v13 = 0; + v16 = pArmorSkills; + v7 = 2 * LOBYTE(v2->uFontHeight) + 13; + do + { + if ( v18->pActiveSkills[*v16] & 0x3F ) + { + v8 = LOBYTE(v2->uFontHeight); + v7 = v7 + v8 - 3; + ++a2; + ++v13; + pGUIWindow_CurrentMenu->CreateButton(0xF6u, v7, 0xCCu, v8 - 3, 3, *v16 | 0x8000, 0x79u, *v16, 0, "", 0, 0); + v2 = pFontLucida; + } + ++v16; + } + while ( v16 <= &pArmorSkills[4] ); + if ( !v13 ) + v7 = v7 + LOBYTE(v2->uFontHeight) - 3; + v17 = pMiscSkills; + v9 = v7 + 2 * LOBYTE(v2->uFontHeight) - 6; + do + { + if ( v18->pActiveSkills[*v17] & 0x3F ) + { + v10 = LOBYTE(v2->uFontHeight); + v9 = v9 + v10 - 3; + ++a2; + pGUIWindow_CurrentMenu->CreateButton(0xF6u, v9, 0xCCu, v10 - 3, 3, *v17 | 0x8000, 0x79u, *v17, 0, "", 0, 0); + v2 = pFontLucida; + } + ++v17; + } + while ( v17 <= &pMiscSkills[11] ); + if ( a2 ) + pGUIWindow_CurrentMenu->_41D08F(a2, 1, 0, a5); + } + + + //----- (00418511) -------------------------------------------------------- + char __fastcall CharacterUI_StatsTab_Draw(unsigned int uPlayerID) + { + Player *pPlayer; // edi@1 + unsigned int v2; // eax@1 + unsigned int v3; // eax@1 + unsigned int v4; // eax@2 + int v5; // ST20_4@4 + int v6; // ST1C_4@4 + int v7; // ebp@4 + int v8; // eax@4 + unsigned int v9; // eax@4 + int v10; // ST34_4@4 + int v11; // ST20_4@4 + int v12; // ST1C_4@4 + int v13; // ebp@4 + int v14; // eax@4 + unsigned int v15; // eax@4 + int v16; // ST34_4@4 + int v17; // ST20_4@4 + int v18; // ST1C_4@4 + int v19; // ebp@4 + int v20; // eax@4 + unsigned int v21; // eax@4 + int v22; // ST34_4@4 + int v23; // ST20_4@4 + int v24; // ST1C_4@4 + int v25; // ebp@4 + int v26; // eax@4 + unsigned int v27; // eax@4 + int v28; // ST34_4@4 + int v29; // ST20_4@4 + int v30; // ST1C_4@4 + int v31; // ebp@4 + int v32; // eax@4 + unsigned int v33; // eax@4 + int v34; // ST34_4@4 + int v35; // ST20_4@4 + int v36; // ST1C_4@4 + int v37; // ebp@4 + int v38; // eax@4 + unsigned int v39; // eax@4 + int v40; // ST34_4@4 + int v41; // ST20_4@4 + int v42; // ST1C_4@4 + int v43; // ebp@4 + int v44; // eax@4 + unsigned int v45; // eax@4 + int v46; // ebp@4 + signed int v47; // ST20_4@6 + int v48; // ST1C_4@6 + signed int v49; // eax@6 + unsigned int v50; // eax@6 + int v51; // ST20_4@8 + int v52; // ST1C_4@8 + int v53; // eax@8 + unsigned int v54; // eax@8 + int v55; // ST34_4@8 + int v56; // ST20_4@8 + int v57; // ST1C_4@8 + int v58; // ebp@8 + int v59; // eax@8 + unsigned int v60; // eax@8 + unsigned int v61; // ebp@8 + unsigned int v62; // eax@8 + char *v63; // ST20_4@8 + signed int v64; // eax@8 + unsigned int v65; // ebp@8 + unsigned __int8 v66; // al@8 + char *v67; // eax@9 + unsigned int v68; // ST20_4@11 + unsigned int v69; // ST1C_4@11 + signed int v70; // ebp@11 + signed int v71; // eax@11 + unsigned int v72; // eax@11 + int v73; // ST20_4@13 + int v74; // ST1C_4@13 + int v75; // ebp@13 + int v76; // eax@13 + unsigned int v77; // eax@13 + char *v78; // ecx@14 + int v79; // ST20_4@16 + char *v80; // ST40_4@16 + unsigned int v81; // eax@16 + int v82; // ST34_4@16 + int v83; // eax@16 + int v84; // ST34_4@16 + char *v85; // eax@16 + int v86; // ST34_4@16 + int v87; // eax@16 + int v88; // ST34_4@16 + char *v89; // eax@16 + int v90; // eax@16 + int v91; // ST20_4@19 + unsigned int v92; // eax@19 + int v93; // eax@19 + int v94; // ST20_4@22 + unsigned int v95; // eax@22 + int v96; // eax@22 + int v97; // ST20_4@25 + unsigned int v98; // eax@25 + int v99; // eax@25 + int v100; // ST20_4@27 + unsigned int v101; // eax@27 + int v102; // eax@27 + int v103; // ST20_4@30 + unsigned int v104; // eax@30 + char *v105; // ST20_4@32 + unsigned int v106; // eax@32 + int v107; // eax@33 + int v108; // ST20_4@36 + unsigned int v109; // eax@36 + char *v110; // ST20_4@38 + unsigned int v111; // eax@38 + int uY; // [sp+10h] [bp-10h]@6 + int uYa; // [sp+10h] [bp-10h]@11 + int uYb; // [sp+10h] [bp-10h]@13 + int uYc; // [sp+10h] [bp-10h]@16 + int uYd; // [sp+10h] [bp-10h]@19 + int uYe; // [sp+10h] [bp-10h]@22 + int uYf; // [sp+10h] [bp-10h]@25 + int uYg; // [sp+10h] [bp-10h]@27 + int uYh; // [sp+10h] [bp-10h]@33 + const char *a2; // [sp+14h] [bp-Ch]@4 + const char *a2a; // [sp+14h] [bp-Ch]@6 + const char *a2b; // [sp+14h] [bp-Ch]@11 + const char *a2c; // [sp+14h] [bp-Ch]@16 + const char *a2d; // [sp+14h] [bp-Ch]@19 + const char *a2e; // [sp+14h] [bp-Ch]@22 + const char *a2f; // [sp+14h] [bp-Ch]@25 + const char *a2g; // [sp+14h] [bp-Ch]@27 + const char *a2h; // [sp+14h] [bp-Ch]@33 + int v131; // [sp+18h] [bp-8h]@16 + int v132; // [sp+18h] [bp-8h]@19 + int v133; // [sp+18h] [bp-8h]@22 + int v134; // [sp+18h] [bp-8h]@25 + int v135; // [sp+18h] [bp-8h]@27 + int v136; // [sp+18h] [bp-8h]@33 + int v137; // [sp+1Ch] [bp-4h]@27 + int v138; // [sp+1Ch] [bp-4h]@33 + + pPlayer = &pParty->pPlayers[uPlayerID-1]; + v2 = pIcons_LOD->LoadTexture("fr_stats", TEXTURE_16BIT_PALETTE); + pRenderer->DrawTextureIndexed(8, 8, (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0)); + v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); + sprintf(pTmpBuf, "\f%05d", v3); + sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], pPlayer->pName, pClassNames[pPlayer->classType]);//^Pi[%s] %s + strcat(pTmpBuf, pTmpBuf2); + if ( pPlayer->uSkillPoints ) + v4 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); + else + v4 = 0xFFFFu; + sprintf(pTmpBuf2, "\f00000\r180%s: \f%05d%d\f00000\n\n\n", pGlobalTXT_LocalizationStrings[207], v4, pPlayer->uSkillPoints);//Skill points + strcat(pTmpBuf, pTmpBuf2); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, 18, 0, pTmpBuf, 0, 0, 0); + v5 = pPlayer->GetBaseStrength(); + v6 = pPlayer->GetActualMight(); + v7 = pPlayer->GetBaseStrength(); + v8 = pPlayer->GetActualMight(); + v9 = UI_GetHealthManaStringColor(v8, v7); + sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[144], v9, v6, v5);//Might + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, 53, 0, pTmpBuf, 0, 0, 0); + v10 = LOBYTE(pFontArrus->uFontHeight) + 51; + v11 = pPlayer->GetBaseIntelligence(); + v12 = pPlayer->GetActualIntelligence(); + v13 = pPlayer->GetBaseIntelligence(); + v14 = pPlayer->GetActualIntelligence(); + v15 = UI_GetHealthManaStringColor(v14, v13); + sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[116], v15, v12, v11);//Intellect + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf, 0, 0, 0); + v16 = LOBYTE(pFontArrus->uFontHeight) + v10 - 2; + v17 = pPlayer->GetBaseWillpower(); + v18 = pPlayer->GetActualWillpower(); + v19 = pPlayer->GetBaseWillpower(); + v20 = pPlayer->GetActualWillpower(); + v21 = UI_GetHealthManaStringColor(v20, v19); + sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[163], v21, v18, v17);// + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v16, 0, pTmpBuf, 0, 0, 0); + v22 = LOBYTE(pFontArrus->uFontHeight) + v16 - 2; + v23 = pPlayer->GetBaseEndurance(); + v24 = pPlayer->GetActualEndurance(); + v25 = pPlayer->GetBaseEndurance(); + v26 = pPlayer->GetActualEndurance(); + v27 = UI_GetHealthManaStringColor(v26, v25); + sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[75], v27, v24, v23);// + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v22, 0, pTmpBuf, 0, 0, 0); + v28 = LOBYTE(pFontArrus->uFontHeight) + v22 - 2; + v29 = pPlayer->GetBaseAccuracy(); + v30 = pPlayer->GetActualAccuracy(); + v31 = pPlayer->GetBaseAccuracy(); + v32 = pPlayer->GetActualAccuracy(); + v33 = UI_GetHealthManaStringColor(v32, v31); + sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[1], v33, v30, v29); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v28, 0, pTmpBuf, 0, 0, 0); + v34 = LOBYTE(pFontArrus->uFontHeight) + v28 - 2; + v35 = pPlayer->GetBaseSpeed(); + v36 = pPlayer->GetActualSpeed(); + v37 = pPlayer->GetBaseSpeed(); + v38 = pPlayer->GetActualSpeed(); + v39 = UI_GetHealthManaStringColor(v38, v37); + sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[211], v39, v36, v35); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v34, 0, pTmpBuf, 0, 0, 0); + v40 = LOBYTE(pFontArrus->uFontHeight) + v34 - 2; + v41 = pPlayer->GetBaseLuck(); + v42 = pPlayer->GetActualLuck(); + v43 = pPlayer->GetBaseLuck(); + v44 = pPlayer->GetActualLuck(); + v45 = UI_GetHealthManaStringColor(v44, v43); + sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[136], v45, v42, v41); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v40, 0, pTmpBuf, 0, 0, 0); + a2 = "%s\f%05u\r424%d\f00000 /\t185%d\n"; + v46 = v40 + 2 * LOBYTE(pFontArrus->uFontHeight) + 5; + if ( pPlayer->GetMaxHealth() >= 1000 ) + a2 = "%s\f%05u\r388%d\f00000 / %d\n"; + v47 = pPlayer->GetMaxHealth(); + v48 = pPlayer->sHealth; + v49 = pPlayer->GetMaxHealth(); + v50 = UI_GetHealthManaStringColor(pPlayer->sHealth, v49); + sprintf(pTmpBuf, a2, pGlobalTXT_LocalizationStrings[108], v50, v48, v47); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v46, 0, pTmpBuf, 0, 0, 0); + a2a = "%s\f%05u\r424%d\f00000 /\t185%d\n"; + uY = LOBYTE(pFontArrus->uFontHeight) + v46 - 2; + if ( pPlayer->GetMaxMana() >= 1000 ) + a2a = "%s\f%05u\r388%d\f00000 / %d\n"; + v51 = pPlayer->GetMaxMana(); + v52 = pPlayer->sMana; + v53 = pPlayer->GetMaxMana(); + v54 = UI_GetHealthManaStringColor(pPlayer->sMana, v53); + sprintf(pTmpBuf, a2a, pGlobalTXT_LocalizationStrings[212], v54, v52, v51); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, uY, 0, pTmpBuf, 0, 0, 0); + v55 = LOBYTE(pFontArrus->uFontHeight) + uY - 2; + v56 = pPlayer->GetBaseAC(); + v57 = pPlayer->GetActualAC(); + v58 = pPlayer->GetBaseAC(); + v59 = pPlayer->GetActualAC(); + v60 = UI_GetHealthManaStringColor(v59, v58); + sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[12], v60, v57, v56); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v55, 0, pTmpBuf, 0, 0, 0); + v61 = v55 + 2 * LOBYTE(pFontArrus->uFontHeight) - 2; + v62 = pPlayer->GetMajorConditionIdx(); + v63 = aCharacterConditionNames[v62]; + v64 = GetConditionDrawColor(v62); + sprintf(pTmpBuf, "%s: \f%05d%s\n", pGlobalTXT_LocalizationStrings[47], v64, v63); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x1Au, v61, 0, pTmpBuf, 226, 0); + v65 = LOBYTE(pFontArrus->uFontHeight) + v61 - 1; + v66 = pPlayer->uQuickSpell; + if ( v66 ) + v67 = pSpellStats->pInfos[v66].pShortName; + else + v67 = pGlobalTXT_LocalizationStrings[153]; + sprintf(pTmpBuf, "%s: %s", pGlobalTXT_LocalizationStrings[172], v67); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x1Au, v65, 0, pTmpBuf, 226, 0); + v68 = pPlayer->GetBaseAge(); + v69 = pPlayer->GetActualAge(); + v70 = pPlayer->GetBaseAge(); + v71 = pPlayer->GetActualAge(); + v72 = UI_GetHealthManaStringColor(v71, v70); + sprintf(pTmpBuf, "%s\f%05u\t100%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[5], v72, v69, v68); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, 50, 0, pTmpBuf, 0, 0, 0); + a2b = "%s\f%05u\t100%d\f00000 / %d\n"; + uYa = LOBYTE(pFontArrus->uFontHeight) + 48; + if ( pPlayer->GetBaseLevel() > 99 ) + a2b = format_4E2E68; + v73 = pPlayer->GetBaseLevel(); + v74 = pPlayer->GetActualLevel(); + v75 = pPlayer->GetBaseLevel(); + v76 = pPlayer->GetActualLevel(); + v77 = UI_GetHealthManaStringColor(v76, v75); + sprintf(pTmpBuf, a2b, pGlobalTXT_LocalizationStrings[131], v77, v74, v73); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYa, 0, pTmpBuf, 0, 0, 0); + uYb = uYa + LOBYTE(pFontArrus->uFontHeight) - 2; + if ( (signed __int64)pPlayer->uExperience <= 9999999 ) + v78 = pGlobalTXT_LocalizationStrings[83]; + else + v78 = pGlobalTXT_LocalizationStrings[17]; + v79 = LODWORD(pPlayer->uExperience); + v80 = v78; + v81 = pPlayer->GetExperienceDisplayColor(); + sprintf(pTmpBuf, "%s\r180\f%05d%lu\f00000\n\n", v80, v81, v79); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYb, 0, pTmpBuf, 0, 0, 0); + v82 = uYb + 2 * LOBYTE(pFontArrus->uFontHeight); + v83 = pPlayer->GetActualAttack(0); + sprintf(pTmpBuf, "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[18], v83); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v82, 0, pTmpBuf, 0, 0, 0); + v84 = v82 + LOBYTE(pFontArrus->uFontHeight) - 2; + v85 = pPlayer->GetMeleeDamageString(); + sprintf(pTmpBuf, "%s\t100 %s\n", pGlobalTXT_LocalizationStrings[53], v85); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v84, 0, pTmpBuf, 0, 0, 0); + v86 = v84 + LOBYTE(pFontArrus->uFontHeight) - 2; + v87 = pPlayer->GetRangedAttack(); + sprintf(pTmpBuf, "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[203], v87); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v86, 0, pTmpBuf, 0, 0, 0); + v88 = v86 + LOBYTE(pFontArrus->uFontHeight) - 2; + v89 = pPlayer->GetRangedDamageString(); + sprintf(pTmpBuf, "%s\t100 %s\n\n", pGlobalTXT_LocalizationStrings[53], v89); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v88, 0, pTmpBuf, 0, 0, 0); + a2c = format_4E2E10; + uYc = v88 + 2 * LOBYTE(pFontArrus->uFontHeight) - 4; + v131 = pPlayer->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE); + v90 = pPlayer->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE); + if ( v131 > 99 || v90 > 99 ) + a2c = format_4E2E68; + v91 = v90; + v92 = UI_GetHealthManaStringColor(v131, v90); + sprintf(pTmpBuf, a2c, pGlobalTXT_LocalizationStrings[87], v92, v131, v91); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYc, 0, pTmpBuf, 0, 0, 0); + a2d = format_4E2E10; + uYd = uYc + LOBYTE(pFontArrus->uFontHeight) - 2; + v132 = pPlayer->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR); + v93 = pPlayer->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR); + if ( v132 > 99 || v93 > 99 ) + a2d = format_4E2E68; + v94 = v93; + v95 = UI_GetHealthManaStringColor(v132, v93); + sprintf(pTmpBuf, a2d, pGlobalTXT_LocalizationStrings[6], v95, v132, v94); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYd, 0, pTmpBuf, 0, 0, 0); + a2e = format_4E2E10; + uYe = uYd + LOBYTE(pFontArrus->uFontHeight) - 2; + v133 = pPlayer->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER); + v96 = pPlayer->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER); + if ( v133 > 99 || v96 > 99 ) + a2e = format_4E2E68; + v97 = v96; + v98 = UI_GetHealthManaStringColor(v133, v96); + sprintf(pTmpBuf, a2e, pGlobalTXT_LocalizationStrings[240], v98, v133, v97); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYe, 0, pTmpBuf, 0, 0, 0); + a2f = format_4E2E10; + uYf = uYe + LOBYTE(pFontArrus->uFontHeight) - 2; + v134 = pPlayer->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH); + v99 = pPlayer->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH); + if ( v134 > 99 ) + a2f = format_4E2E68; + v100 = v99; + v101 = UI_GetHealthManaStringColor(v134, v99); + sprintf(pTmpBuf, a2f, pGlobalTXT_LocalizationStrings[70], v101, v134, v100); + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYf, 0, pTmpBuf, 0, 0, 0); + a2g = format_4E2E10; + uYg = uYf + LOBYTE(pFontArrus->uFontHeight) - 2; + v135 = pPlayer->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND); + v102 = pPlayer->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND); + v137 = v102; + if ( v135 > 99 || v102 > 99 ) + a2g = format_4E2E68; + v103 = v102; + v104 = UI_GetHealthManaStringColor(v135, v102); + sprintf(pTmpBuf, a2g, pGlobalTXT_LocalizationStrings[142], v104, v135, v103); + if ( pPlayer->classType == PLAYER_CLASS_LICH && v137 == 200 ) + { + v105 = pGlobalTXT_LocalizationStrings[625]; + v106 = UI_GetHealthManaStringColor(v135, 200); + sprintf(pTmpBuf, format_4E2E00, pGlobalTXT_LocalizationStrings[142], v106, v105); + } + pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYg, 0, pTmpBuf, 0, 0, 0); + a2h = format_4E2E10; + uYh = uYg + LOBYTE(pFontArrus->uFontHeight) - 2; + v136 = pPlayer->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY); + v107 = pPlayer->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY); + v138 = v107; + if ( v136 > 99 || v107 > 99 ) + a2h = format_4E2E68; + v108 = v107; + v109 = UI_GetHealthManaStringColor(v136, v107); + sprintf(pTmpBuf, a2h, pGlobalTXT_LocalizationStrings[29], v109, v136, v108); + if ( pPlayer->classType == PLAYER_CLASS_LICH && v138 == 200 ) + { + v110 = pGlobalTXT_LocalizationStrings[625]; + v111 = UI_GetHealthManaStringColor(v136, 200); + sprintf(pTmpBuf, format_4E2E00, pGlobalTXT_LocalizationStrings[29], v111, v110); + } + return pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYh, 0, pTmpBuf, 0, 0, 0); + } + + //----- (00419100) -------------------------------------------------------- + void FillAwardsData() + { + Player *pPlayer; // esi@1 + + pPlayer = pPlayers[uActiveCharacter]; + memset(&achievedAwardsIndex, 0, 4000); + memset(pTmpBuf2, 0, 0x7D0u); + dword_506544 = 0; + dword_506548 = 0; + awards_count = 0; + dword_50651C = 0; + dword_506528 = 0; + for(int i=0; i<105; ++i) + { + if ( _449B57_test_bit((unsigned char*)&pPlayer->_guilds_member_bits, i) && pAwards[i].pText ) + achievedAwardsIndex[awards_count++] = i; + } + awards_count2 = awards_count; + awards_count = 0; + //sort awards index + if ( awards_count2>0 ) + { + for(int i=0; i + +#include "MM7.h" + +#include "MapInfo.h" +#include "Game.h" +#include "GUIWindow.h" +#include "GUIFont.h" +#include "GUIButton.h" +#include "GUIProgressBar.h" +#include "Party.h" +#include "AudioPlayer.h" +#include "Outdoor.h" +#include "IndoorCamera.h" +#include "Overlays.h" +#include "Monsters.h" +#include "Arcomage.h" +#include "LOD.h" +#include "Actor.h" +#include "Allocator.h" +#include "Events.h" +#include "Viewport.h" +#include "FrameTableInc.h" +#include "Math.h" +#include "SpriteObject.h" +#include "ObjectList.h" +#include "Chest.h" +#include "PaletteManager.h" +#include "DecorationList.h" +#include "SaveLoad.h" +#include "stru123.h" +#include "Time.h" +#include "IconFrameTable.h" +#include "Awards.h" +#include "Autonotes.h" +#include "stru160.h" +#include "stru279.h" +#include "TurnEngine.h" +#include "stru277.h" +#include "Weather.h" +#include "stru272.h" +#include "stru298.h" +#include "StorylineTextTable.h" +#include "Events2D.h" +#include "texts.h" +#include "stru351.h" + +#include "mm7_data.h" + + + +//----- (0041B578) -------------------------------------------------------- +void __cdecl MainMenuUI_LoadFontsAndSomeStuff() + { + pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, + pRenderer->uTargetGBits, + pRenderer->uTargetBBits); + pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, + pRenderer->uTargetGBits, + pRenderer->uTargetBBits); + pPaletteManager->RecalculateAll(); + + for (uint i = 0; i < 480; ++i) + pSRZBufferLineOffsets[i] = 640 * i; + + pRenderer->ResetClip(); + + uTextureID_FONTPAL = pIcons_LOD->LoadTexture("FONTPAL", TEXTURE_16BIT_PALETTE); + pFontArrus = LoadFont("arrus.fnt", "FONTPAL", NULL); + pFontLucida = LoadFont("lucida.fnt", "FONTPAL", NULL); + pFontCreate = LoadFont("create.fnt", "FONTPAL", NULL); + pFontSmallnum = LoadFont("smallnum.fnt", "FONTPAL", NULL); + pFontComic = LoadFont("comic.fnt", "FONTPAL", NULL); + pFontArrus->field_3 = 0; + pFontLucida->field_3 = 0; + pFontCreate->field_3 = 0; + + for (uint i = 0; i < 20; ++i) + pWindowList[i].eWindowType = WINDOW_null; + + uNumVisibleWindows = -1; + memset(pVisibleWindowsIdxs, 0, sizeof(pVisibleWindowsIdxs)); + } + +//----- (0041B690) -------------------------------------------------------- +void __cdecl MainMenuUI_Create() + { + //unsigned int v0; // eax@1 + //unsigned int v1; // eax@1 + //unsigned int v2; // eax@1 + //unsigned int v3; // eax@1 + //unsigned int v4; // eax@1 + //unsigned int v5; // eax@1 + Texture *v6; // ST78_4@1 + //const char *v7; // ST5C_4@1 + unsigned __int8 v8; // al@1 + //Texture *v9; // ST60_4@1 + Texture *v10; // ST78_4@1 + //const char *v11; // ST5C_4@1 + unsigned __int8 v12; // al@1 + //Texture *v13; // ST60_4@1 + unsigned int v14; // eax@1 + Texture *v15; // ST78_4@1 + //const char *v16; // ST5C_4@1 + unsigned __int8 v17; // al@1 + //Texture *v18; // ST60_4@1 + unsigned int uTextureID_ib_td4_A; // eax@1 + Texture *v20; // ST78_4@1 + unsigned __int8 v22; // al@1 + //Texture *v23; // ST60_4@1 + Texture *v24; // eax@1 + //Texture *v25; // esi@1 + //Texture *v26; // ST60_4@1 + //const char *v27; // ST5C_4@1 + unsigned __int8 v28; // al@1 + Texture *v29; // eax@1 + //Texture *v30; // esi@1 + //Texture *v31; // ST60_4@1 + //const char *v32; // ST5C_4@1 + unsigned __int8 v33; // al@1 + + pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeC")); + pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeB")); + pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeA")); + pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchC")); + pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchB")); + pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchA")); + + pTextureIDs_pMapDirs[0] = pIcons_LOD->LoadTexture("MAPDIR8", TEXTURE_16BIT_PALETTE); + pTextureIDs_pMapDirs[1] = pIcons_LOD->LoadTexture("MAPDIR1", TEXTURE_16BIT_PALETTE); + pTextureIDs_pMapDirs[2] = pIcons_LOD->LoadTexture("MAPDIR2", TEXTURE_16BIT_PALETTE); + pTextureIDs_pMapDirs[3] = pIcons_LOD->LoadTexture("MAPDIR3", TEXTURE_16BIT_PALETTE); + pTextureIDs_pMapDirs[4] = pIcons_LOD->LoadTexture("MAPDIR4", TEXTURE_16BIT_PALETTE); + pTextureIDs_pMapDirs[5] = pIcons_LOD->LoadTexture("MAPDIR5", TEXTURE_16BIT_PALETTE); + pTextureIDs_pMapDirs[6] = pIcons_LOD->LoadTexture("MAPDIR6", TEXTURE_16BIT_PALETTE); + pTextureIDs_pMapDirs[7] = pIcons_LOD->LoadTexture("MAPDIR7", TEXTURE_16BIT_PALETTE); + + uTextureID_BarBlue = pIcons_LOD->LoadTexture("ib-statB", TEXTURE_16BIT_PALETTE); + uTextureID_BarGreen = pIcons_LOD->LoadTexture("ib-statG", TEXTURE_16BIT_PALETTE); + uTextureID_BarYellow = pIcons_LOD->LoadTexture("ib-statY", TEXTURE_16BIT_PALETTE); + uTextureID_BarRed = pIcons_LOD->LoadTexture("ib-statR", TEXTURE_16BIT_PALETTE); + uTextureID_mhp_bd = pIcons_LOD->LoadTexture("mhp_bg", TEXTURE_16BIT_PALETTE); + uTextureID_mhp_capl = pIcons_LOD->LoadTexture("mhp_capl", TEXTURE_16BIT_PALETTE); + uTextureID_mhp_capr = pIcons_LOD->LoadTexture("mhp_capr", TEXTURE_16BIT_PALETTE); + uTextureID_mhp_grn = pIcons_LOD->LoadTexture("mhp_grn", TEXTURE_16BIT_PALETTE); + uTextureID_mhp_red = pIcons_LOD->LoadTexture("mhp_red", TEXTURE_16BIT_PALETTE); + uTextureID_mhp_yel = pIcons_LOD->LoadTexture("mhp_yel", TEXTURE_16BIT_PALETTE); + uTextureID_Leather = pIcons_LOD->LoadTexture("LEATHER", TEXTURE_16BIT_PALETTE); + pTexture_Leather = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("ibground", TEXTURE_16BIT_PALETTE)]; + uTextureID_x_x_u = pIcons_LOD->LoadTexture("x_x_u", TEXTURE_16BIT_PALETTE); + uTextureID_BUTTDESC2 = pIcons_LOD->LoadTexture("BUTTESC2", TEXTURE_16BIT_PALETTE); + uTextureID_x_ok_u = pIcons_LOD->LoadTexture("x_ok_u", TEXTURE_16BIT_PALETTE); + uTextureID_BUTTYES2 = pIcons_LOD->LoadTexture("BUTTYES2", TEXTURE_16BIT_PALETTE); + uTextureID_BUTTMAKE = pIcons_LOD->LoadTexture("BUTTMAKE", TEXTURE_16BIT_PALETTE); + uTextureID_BUTTMAKE2 = pIcons_LOD->LoadTexture("BUTTMAKE2", TEXTURE_16BIT_PALETTE); + + pPrimaryWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); + pPrimaryWindow->CreateButton(7u, 8u, 0x1CCu, 0x157u, 1, 0, 0xAu, 0, 0, "", 0); + pPrimaryWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); + pPrimaryWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); + pPrimaryWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); + pPrimaryWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); + pPrimaryWindow->CreateButton(0x18u, 0x194u, 5u, 0x31u, 1, 93, 0, 1u, 0, "", 0); + pPrimaryWindow->CreateButton(0x8Bu, 0x194u, 5u, 0x31u, 1, 93, 0, 2u, 0, "", 0); + pPrimaryWindow->CreateButton(0xFFu, 0x194u, 5u, 0x31u, 1, 93, 0, 3u, 0, "", 0); + pPrimaryWindow->CreateButton(0x172u, 0x194u, 5u, 0x31u, 1, 93, 0, 4u, 0, "", 0); + pPrimaryWindow->CreateButton(0x61u, 0x194u, 5u, 0x31u, 1, 93, 0, 1u, 0, "", 0); + pPrimaryWindow->CreateButton(0xD4u, 0x194u, 5u, 0x31u, 1, 93, 0, 2u, 0, "", 0); + pPrimaryWindow->CreateButton(0x148u, 0x194u, 5u, 0x31u, 1, 93, 0, 3u, 0, "", 0); + pPrimaryWindow->CreateButton(0x1BBu, 0x194u, 5u, 0x31u, 1, 93, 0, 4u, 0, "", 0); + + uTextureID_ib_td1_A = pIcons_LOD->LoadTexture("ib-td1-A", TEXTURE_16BIT_PALETTE); + v6 = (Texture *)(uTextureID_ib_td1_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td1_A] : 0); + v8 = pKeyActionMap->GetActionVKey(INPUT_Quest); + pBtn_Quests = pPrimaryWindow->CreateButton(0x1EBu, 0x161u, v6->uTextureWidth, v6->uTextureHeight, 1, 0, 0xC8u, 0, v8, pGlobalTXT_LocalizationStrings[174], v6, 0); //Quests + + uTextureID_ib_td2_A = pIcons_LOD->LoadTexture("ib-td2-A", TEXTURE_16BIT_PALETTE); + v10 = (Texture *)(uTextureID_ib_td2_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td2_A] : 0); + v12 = pKeyActionMap->GetActionVKey(INPUT_Autonotes); + pBtn_Autonotes = pPrimaryWindow->CreateButton(0x20Fu, 0x161u, v10->uTextureWidth, v10->uTextureHeight, 1, 0, 0xC9u, 0, v12, pGlobalTXT_LocalizationStrings[154], v10, 0);//Autonotes + + v14 = pIcons_LOD->LoadTexture("ib-td3-A", TEXTURE_16BIT_PALETTE); + v15 = (Texture *)(v14 != -1 ? &pIcons_LOD->pTextures[v14] : 0); + v17 = pKeyActionMap->GetActionVKey(INPUT_Mapbook); + pBtn_Maps = pPrimaryWindow->CreateButton(0x222u, 0x161u, v15->uTextureWidth, v15->uTextureHeight, 1, 0, 0xCAu, 0, v17, pGlobalTXT_LocalizationStrings[139], v15, 0); //Maps + + uTextureID_ib_td4_A = pIcons_LOD->LoadTexture("ib-td4-A", TEXTURE_16BIT_PALETTE); + v20 = (Texture *)(uTextureID_ib_td4_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td4_A] : 0); + v22 = pKeyActionMap->GetActionVKey(INPUT_TimeCal); + pBtn_Calendar = pPrimaryWindow->CreateButton(0x23Au, 0x161u, v20->uTextureWidth, v20->uTextureHeight, 1, 0, 0xCBu, 0, v22, + pGlobalTXT_LocalizationStrings[78],//Calendar + v20, 0); + + uTextureID_ib_td5_A = pIcons_LOD->LoadTexture("ib-td5-A", TEXTURE_16BIT_PALETTE); + pBtn_History = pPrimaryWindow->CreateButton(0x258u, 0x169u, + (uTextureID_ib_td5_A != -1 ? pIcons_LOD->pTextures[uTextureID_ib_td5_A].uTextureWidth : 24), + (uTextureID_ib_td5_A != -1 ? pIcons_LOD->pTextures[uTextureID_ib_td5_A].uTextureHeight : 26), + 1, 0, 0xE0u, 0, 0x48u, pGlobalTXT_LocalizationStrings[602],//History + (Texture *)(uTextureID_ib_td5_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td5_A] : 0), 0); + + bFlashAutonotesBook = 0; + bFlashQuestBook = 0; + bFlashHistoryBook = 0; + + v24 = &pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn]; + v28 = pKeyActionMap->GetActionVKey(INPUT_ZoomIn); + pBtn_ZoomIn = pPrimaryWindow->CreateButton(574, 136, v24->uTextureWidth, v24->uTextureHeight, 2, 0, 0x170u, 0, v28, pGlobalTXT_LocalizationStrings[252], // Zoom In + v24, 0); + v29 = &pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut]; + v33 = pKeyActionMap->GetActionVKey(INPUT_ZoomOut); + pBtn_ZoomOut = pPrimaryWindow->CreateButton(519, 136, v29->uTextureWidth, v29->uTextureHeight, 2, 0, 0x16Fu, 0, v33, pGlobalTXT_LocalizationStrings[251], // Zoom Out + v29, 0); + pPrimaryWindow->CreateButton(0x1E1u, 0, 0x99u, 0x43u, 1, 92, 0, 0, 0, "", 0); + pPrimaryWindow->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x86u, 0, 0x35u, "", 0); + pPrimaryWindow->CreateButton(0x231u, 0x95u, 0x40u, 0x4Au, 1, 0, 0x87u, 0, 0x36u, "", 0); + pPrimaryWindow->CreateButton(0x1DCu, 0x142u, 0x4Du, 0x11u, 1, 100, 0, 0, 0, "", 0); + pPrimaryWindow->CreateButton(0x22Bu, 0x142u, 0x4Du, 0x11u, 1, 101, 0, 0, 0, "", 0); + pBtn_CastSpell = pPrimaryWindow->CreateButton(0x1DCu, 0x1C2u, + (uTextureID_Btn_CastSpell != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_CastSpell].uTextureWidth : 24), + (uTextureID_Btn_CastSpell != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_CastSpell].uTextureHeight : 26), + 1, 0, 0x69u, 0, 0x43u, pGlobalTXT_LocalizationStrings[38], + (Texture *)(uTextureID_Btn_CastSpell != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_CastSpell] : 0), + 0); + pBtn_Rest = pPrimaryWindow->CreateButton(0x206u, 0x1C2u, + (uTextureID_Btn_Rest != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_Rest].uTextureWidth : 24), + (uTextureID_Btn_Rest != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_Rest].uTextureHeight : 26), + 1, 0, 0x68u, 0, 0x52u, pGlobalTXT_LocalizationStrings[182], + (Texture *)(uTextureID_Btn_Rest != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_Rest] : 0), 0); + pBtn_QuickReference = pPrimaryWindow->CreateButton(0x230u, 0x1C2u, + (uTextureID_Btn_QuickReference != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_QuickReference].uTextureWidth : 24), + (uTextureID_Btn_QuickReference != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_QuickReference].uTextureHeight : 26), + 1, 0, 0x6Au, 0, 0x5Au, pGlobalTXT_LocalizationStrings[173], + (Texture *)(uTextureID_Btn_QuickReference != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_QuickReference] : 0), 0); + pBtn_GameSettings = pPrimaryWindow->CreateButton(0x25Au, 0x1C2u, + (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureWidth : 24), + (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureHeight : 26), + 1, 0, 0x6Bu, 0, 0, pGlobalTXT_LocalizationStrings[93], + (Texture *)(uTextureID_Btn_GameSettings != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_GameSettings] : 0), 0); + pBtn_NPCLeft = pPrimaryWindow->CreateButton(0x1D5u, 0xB2u, + (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24), + (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26), + 1, 0, 0xBCu, 0, 0, "", + (Texture *)(uTextureID_Btn_NPCLeft != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft] : 0), 0); + pBtn_NPCRight = pPrimaryWindow->CreateButton(0x272u, 0xB2u, + (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureWidth : 24), + (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26), + 1, 0, 0xBCu, 1u, 0, "", + (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0), 0); + LoadPartyBuffIcons(); + } + + //----- (004979D2) -------------------------------------------------------- + MENU_STATE __cdecl CreditsMenu__Loop() + { + char *v0; // eax@5 + char *v1; // edi@5 + FILE *pFile; // eax@5 + unsigned int pSize; // esi@7 + GUIFont *pFont; // edx@9 + GUIFont *pFont2; // ecx@9 + __int16 pHeight; // ax@9 + void *v7; // eax@9 + unsigned int pNumPixels; // ST2C_4@9 + unsigned int teal; // eax@9 + unsigned int v10; // ST2C_4@19 + MSG Msg; // [sp+84h] [bp-B8h]@10 + int v17; // [sp+A0h] [bp-9Ch]@9 + int pX; // [sp+A4h] [bp-98h]@9 + unsigned int pY; // [sp+A8h] [bp-94h]@9 + int v20; // [sp+ACh] [bp-90h]@9 + int a4; // [sp+B0h] [bp-8Ch]@9 + int pColor2; // [sp+F8h] [bp-44h]@9 + int pColor1; // [sp+FCh] [bp-40h]@9 + int a5; // [sp+128h] [bp-14h]@1 + char *pString; // [sp+12Ch] [bp-10h]@9 + char *ptr; // [sp+130h] [bp-Ch]@5 + GUIFont *pFontQuick; // [sp+134h] [bp-8h]@1 + GUIFont *pFontCChar; // [sp+138h] [bp-4h]@1 + RGBTexture pTexture; // [sp+54h] [bp-E8h]@1 + RGBTexture pTexture2; // [sp+100h] [bp-3Ch]@1 + Texture pTexture3; // [sp+Ch] [bp-130h]@5 + + a5 = 0; + pFontQuick = LoadFont("quick.fnt", "FONTPAL", NULL); + pFontCChar = LoadFont("cchar.fnt", "FONTPAL", NULL); + if ( pMessageQueue_50CBD0->uNumMessages ) + pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; + ++pIcons_LOD->uTexturePacksCount; + if ( !pIcons_LOD->uNumPrevLoadedFiles ) + pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; + dword_A74C88 = 0; + pAudioPlayer->PlayMusicTrack(MUSIC_Credits); + pTexture.Load("mm6title.pcx", 0); + v0 = (char *)pEvents_LOD->LoadRaw("credits.txt", 0); + v1 = v0; + ptr = v0; + pFile = pEvents_LOD->FindContainer("credits.txt", 0); + if ( !pFile ) + Abortf(pGlobalTXT_LocalizationStrings[63]); // "Might and Magic VII is having trouble loading files. + // Please re-install to fix this problem. Note: Re-installing will not destroy your save games." + fread(&pTexture3, 1, 0x30, pFile); + pSize = pTexture3.uDecompressedSize; + if ( !pTexture3.uDecompressedSize ) + pSize = pTexture3.uTextureSize; + memset(&pTexture3, 0, 0x48); + pFont = pFontCChar; + pFont2 = pFontQuick; + v1[pSize] = 0; + v20 = 250; + a4 = 440; + pX = 389; + pY = 19; + pTexture2.uWidth = 250; + pHeight = pFont2->GetStringHeight2(pFont, v1, (int)&pX, 0, 1); + pTexture2.uHeight = pHeight + 2 * a4; + pTexture2.uNumPixels = (signed __int16)pTexture2.uWidth * (signed __int16)pTexture2.uHeight; + v7 = pAllocator->AllocNamedChunk(pTexture2.pPixels, 2 * pTexture2.uNumPixels, "scrollermap"); + pNumPixels = pTexture2.uNumPixels; + pTexture2.pPixels = (unsigned __int16 *)v7; + teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu); + fill_pixels_fast(teal, pTexture2.pPixels, pNumPixels); + pTexture2.field_20 = 0; + pTexture2.field_22 = 0; + pColor1 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x70u, 0x8Fu, 0xFEu); + pColor2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xECu, 0xE6u, 0x9Cu); + pString = (char *)operator new(2 * pSize); + strncpy(pString, ptr, pSize); + pString[pSize]=0; + pFontQuick->_44D2FD_prolly_draw_credits_entry(pFontCChar, 0, a4, (signed __int16)pTexture2.uWidth, (signed __int16)pTexture2.uHeight, pColor1, + pColor2, pString, pTexture2.pPixels, (signed __int16)pTexture2.uWidth); + free(pString); + pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, (int)ptr); + pWindow_MainMenu->CreateButton(0, 0, 0, 0, 1, 0, 0x71u, 0, 0x1Bu, "", 0); + pCurrentScreen = SCREEN_CREATORS; + SetCurrentMenuID(MENU_CREDITSPROC); + do + { + while ( PeekMessageA(&Msg, 0, 0, 0, 1) ) + { + if ( Msg.message == 18 ) + Game_DeinitializeAndTerminate(0); + TranslateMessage(&Msg); + DispatchMessageA(&Msg); + } + if ( BYTE1(dword_6BE364_game_settings_1) & 1 ) + { + WaitMessage(); + } + else + { + if (pAsyncMouse) + pAsyncMouse->_46B736_consume_click_lists(1); + pRenderer->BeginScene(); + pRenderer->DrawTextureRGB(0, 0, &pTexture); + pRenderer->Clip(pX, pY, pX + v20, pY + a4); + pRenderer->_4A5D33(pX, pY, 0, a5, &pTexture2); + pRenderer->ResetClip(); + pRenderer->EndScene(); + ++a5; + if ( a5 >= (signed __int16)pTexture2.uHeight ) + SetCurrentMenuID(MENU_MAIN); + pRenderer->Present(); + pCurrentScreen = SCREEN_GAME;//Ritor1: temporarily, must be corrected GUI_MainMenuMessageProc() + GUI_MainMenuMessageProc(); + } + } + while ( GetCurrentMenuID() == MENU_CREDITSPROC ); + pAudioPlayer->_4AA258(1); + pAllocator->FreeChunk(ptr); + pAllocator->FreeChunk(pFontQuick); + pAllocator->FreeChunk(pFontCChar); + pWindow_MainMenu->Release(); + pIcons_LOD->_4114F2(); + pTexture.Release(); + pTexture2.Release(); + return MENU_MAIN; // return MENU_Main + } diff -r f39d5902c85a -r 70c5a87a1307 UIOptions.cpp --- a/UIOptions.cpp Wed Mar 20 17:48:51 2013 +0600 +++ b/UIOptions.cpp Wed Mar 20 17:49:15 2013 +0600 @@ -0,0 +1,421 @@ +#include + +#include "MM7.h" + +#include "MapInfo.h" +#include "Game.h" +#include "GUIWindow.h" +#include "GUIFont.h" +#include "GUIButton.h" +#include "GUIProgressBar.h" +#include "Party.h" +#include "AudioPlayer.h" +#include "Outdoor.h" +#include "IndoorCamera.h" +#include "Overlays.h" +#include "Monsters.h" +#include "Arcomage.h" +#include "LOD.h" +#include "Actor.h" +#include "Allocator.h" +#include "Events.h" +#include "Viewport.h" +#include "FrameTableInc.h" +#include "Math.h" +#include "SpriteObject.h" +#include "ObjectList.h" +#include "Chest.h" +#include "PaletteManager.h" +#include "DecorationList.h" +#include "SaveLoad.h" +#include "stru123.h" +#include "Time.h" +#include "IconFrameTable.h" +#include "Awards.h" +#include "Autonotes.h" +#include "stru160.h" +#include "stru279.h" +#include "TurnEngine.h" +#include "stru277.h" +#include "Weather.h" +#include "stru272.h" +#include "stru298.h" +#include "StorylineTextTable.h" +#include "Events2D.h" +#include "texts.h" +#include "stru351.h" + +#include "mm7_data.h" + + + +//----- (004142D3) -------------------------------------------------------- +char __cdecl GameMenuUI_DrawKeyBindings() + { + unsigned int v0; // ebp@1 + int v1; // ecx@2 + unsigned int v2; // eax@6 + GUIWindow *v3; // edx@6 + signed int v4; // ecx@7 + signed int v5; // eax@8 + const char *v6; // ST0C_4@16 + unsigned int v7; // eax@16 + const char *v8; // ST0C_4@16 + unsigned int v9; // eax@16 + const char *v10; // ST0C_4@16 + unsigned int v11; // eax@16 + const char *v12; // ST0C_4@16 + unsigned int v13; // eax@16 + const char *v14; // ST0C_4@16 + unsigned int v15; // eax@16 + const char *v16; // ST0C_4@16 + unsigned int v17; // eax@16 + const char *v18; // ST0C_4@16 + unsigned int v19; // eax@16 + const char *v20; // ST0C_4@16 + unsigned int v21; // eax@16 + signed int v22; // ebp@16 + const char *v23; // ST0C_4@16 + unsigned int v24; // eax@16 + const char *v25; // ST0C_4@16 + unsigned int v26; // eax@16 + const char *v27; // ST0C_4@16 + unsigned int v28; // eax@16 + const char *v29; // ST0C_4@16 + unsigned int v30; // eax@16 + const char *v31; // ST0C_4@16 + unsigned int v32; // eax@16 + const char *v33; // ST0C_4@17 + unsigned int v34; // eax@17 + const char *v35; // ST0C_4@17 + unsigned int v36; // eax@17 + const char *v37; // ST0C_4@17 + unsigned int v38; // eax@17 + const char *v39; // ST0C_4@17 + unsigned int v40; // eax@17 + const char *v41; // ST0C_4@17 + unsigned int v42; // eax@17 + const char *v43; // ST0C_4@17 + unsigned int v44; // eax@17 + const char *v45; // ST0C_4@17 + unsigned int v46; // eax@17 + const char *v47; // ST0C_4@17 + unsigned int v48; // eax@17 + const char *v49; // ST0C_4@17 + unsigned int v50; // eax@17 + const char *v51; // ST0C_4@17 + unsigned int v52; // eax@17 + const char *v53; // ST0C_4@17 + unsigned int v54; // eax@17 + const char *v55; // ST0C_4@17 + unsigned int v56; // eax@17 + const char *v57; // ST0C_4@17 + unsigned int v58; // eax@17 + unsigned int v59; // eax@18 + int v61; // [sp-14h] [bp-28h]@16 + const char *v62; // [sp-10h] [bp-24h]@16 + int v63; // [sp-Ch] [bp-20h]@16 + int v64; // [sp-8h] [bp-1Ch]@16 + unsigned int v65; // [sp-4h] [bp-18h]@16 + unsigned int a5; // [sp+10h] [bp-4h]@1 + + v0 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); + a5 = v0; + if ( byte_4E28FC ) + { + v1 = dword_507C0C + 15; + dword_507C0C = v1; + if ( v1 == 255 ) + byte_4E28FC = 0; + } + else + { + v1 = dword_507C0C - 15; + dword_507C0C = v1; + if ( v1 == 15 ) + byte_4E28FC = 1; + } + v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v1, 0, 0); + v3 = pGUIWindow_CurrentMenu; + dword_507C08 = v2; + if ( pGUIWindow_CurrentMenu->field_40 == 2 ) + { + pPrevVirtualCidesMapping[dword_506E68] = pKeyActionMap->pPressedKeysBuffer[0]; + memset(&KeyButtonFlagChangesArray, 0, sizeof(KeyButtonFlagChangesArray)); + v4 = 0; + do + { + v5 = 0; + do + { + if ( v4 != v5 && pPrevVirtualCidesMapping[v4] == pPrevVirtualCidesMapping[v5] ) + { + KeyButtonFlagChangesArray[v4] = 1; + KeyButtonFlagChangesArray[v5] = 1; + } + ++v5; + } + while ( v5 < 28 ); + ++v4; + } + while ( v4 < 28 ); + dword_506E68 = -1; + v3->field_40 = 0; + } + pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_Optkb[0] != -1 ? &pIcons_LOD->pTextures[uTextureID_Optkb[0]] : 0)); + if ( KeyboardPageNum == 1 ) + { + pRenderer->DrawTextureIndexed(0x13, 0x12E, (Texture *)(uTextureID_Optkb[3] != -1 ? &pIcons_LOD->pTextures[uTextureID_Optkb[3]] : 0)); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, v0, ascii_4E2D5C, 0, 0, 0); + v6 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[0]); + v7 = sub_414D24(0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, v7, v6, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 163, v0, ascii_4E2D50, 0, 0, 0); + v8 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[1]); + v9 = sub_414D24(1); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 163, v9, v8, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 184, v0, ascii_4E2D48, 0, 0, 0); + v10 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[2]); + v11 = sub_414D24(2); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 184, v11, v10, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 205, v0, ascii_4E2D40, 0, 0, 0); + v12 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[3]); + v13 = sub_414D24(3); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 205, v13, v12, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 226, v0, ascii_4E2D38, 0, 0, 0); + v14 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[4]); + v15 = sub_414D24(4); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 226, v15, v14, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 247, v0, ascii_4E2D30, 0, 0, 0); + v16 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[5]); + v17 = sub_414D24(5); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 247, v17, v16, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 268, v0, ascii_4E2D28, 0, 0, 0); + v18 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[6]); + v19 = sub_414D24(6); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 268, v19, v18, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 142, v0, ascii_4E2D1C, 0, 0, 0); + v20 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[7]); + v21 = sub_414D24(7); + v22 = 350; + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 142, v21, v20, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 163, a5, ascii_4E2D14, 0, 0, 0); + v23 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[8]); + v24 = sub_414D24(8); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 163, v24, v23, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 184, a5, ascii_4E2D0C, 0, 0, 0); + v25 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[9]); + v26 = sub_414D24(9); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 184, v26, v25, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 205, a5, ascii_4E2D04, 0, 0, 0); + v27 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[10]); + v28 = sub_414D24(10); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 205, v28, v27, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 226, a5, ascii_4E2CFC, 0, 0, 0); + v29 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[11]); + v30 = sub_414D24(11); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 226, v30, v29, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 247, a5, ascii_4E2CF0, 0, 0, 0); + v31 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[12]); + v32 = sub_414D24(12); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 247, v32, v31, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 268, a5, ascii_4E2CE8, 0, 0, 0); + v65 = 0; + v64 = 0; + v63 = 0; + v62 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[13]); + v61 = 13; + } + else + { + pRenderer->DrawTextureIndexed(0x7F, 0x12E, (Texture *)(uTextureID_Optkb[4] != -1 ? &pIcons_LOD->pTextures[uTextureID_Optkb[4]] : 0)); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, v0, ascii_4E2CDC, 0, 0, 0); + v33 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[14]); + v34 = sub_414D24(14); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, v34, v33, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 163, v0, ascii_4E2CD4, 0, 0, 0); + v35 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[15]); + v36 = sub_414D24(15); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 163, v36, v35, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 184, v0, ascii_4E2CC8, 0, 0, 0); + v37 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[16]); + v38 = sub_414D24(16); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 184, v38, v37, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 205, v0, ascii_4E2CBC, 0, 0, 0); + v39 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[17]); + v40 = sub_414D24(17); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 205, v40, v39, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 226, v0, ascii_4E2CB0, 0, 0, 0); + v41 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[18]); + v42 = sub_414D24(18); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 226, v42, v41, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 247, v0, ascii_4E2CA4, 0, 0, 0); + v43 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[19]); + v44 = sub_414D24(19); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 247, v44, v43, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 268, v0, ascii_4E2C9C, 0, 0, 0); + v45 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[20]); + v46 = sub_414D24(20); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 268, v46, v45, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 142, v0, ascii_4E2C90, 0, 0, 0); + v47 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[21]); + v48 = sub_414D24(21); + v22 = 350; + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 142, v48, v47, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 163, a5, ascii_4E2C84, 0, 0, 0); + v49 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[22]); + v50 = sub_414D24(22); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 163, v50, v49, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 184, a5, ascii_4E2C7C, 0, 0, 0); + v51 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[23]); + v52 = sub_414D24(23); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 184, v52, v51, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 205, a5, ascii_4E2C70, 0, 0, 0); + v53 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[24]); + v54 = sub_414D24(24); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 205, v54, v53, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 226, a5, ascii_4E2C68, 0, 0, 0); + v55 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[25]); + v56 = sub_414D24(25); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 226, v56, v55, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 247, a5, ascii_4E2C5C, 0, 0, 0); + v57 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[26]); + v58 = sub_414D24(26); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 247, v58, v57, 0, 0, 0); + pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 268, a5, ascii_4E2C54, 0, 0, 0); + v65 = 0; + v64 = 0; + v63 = 0; + v62 = pKeyActionMap->GetVKeyDisplayName(pWindowList_at_506F50_minus1_indexing[0]); + v61 = 27; + } + v59 = sub_414D24(v61); + return pGUIWindow_CurrentMenu->DrawText(pFontLucida, v22, 268, v59, v62, v63, v64, v65); + } + + +//----- (00414D24) -------------------------------------------------------- +unsigned int __thiscall sub_414D24(int _this) + { + int v1; // esi@1 + unsigned int v2; // edi@1 + unsigned int v3; // ebx@1 + unsigned int result; // eax@1 + + v1 = _this; + v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); + v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFu, 0, 0); + result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); + if ( dword_506E68 == v1 ) + { + if ( GetTickCount() % 0x3E8 <= 0x1F4 ) + result = v3; + else + result = v2; + } + else + { + if ( KeyButtonFlagChangesArray[v1] ) + result = dword_507C08; + } + return result; + } +// 506E68: using guessed type int dword_506E68; +// 506E6C: using guessed type __int16 word_506E6C[18]; +// 507C08: using guessed type int dword_507C08; + +//----- (00414D9A) -------------------------------------------------------- +void __cdecl GameMenuUI_DrawVideoOptions() + { + const char *v0; // ST0C_4@3 + unsigned __int16 v1; // ax@3 + int v2; // eax@10 + GUIWindow v3; // [sp+8h] [bp-54h]@3 + + pRenderer->DrawTextureIndexed( + 8u, + 8u, + (Texture *)(uTextureID_507C10 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C10] : 0)); + if ( !pRenderer->bWindowMode && GammaController::IsGammaSupported() ) + { + pRenderer->DrawTextureIndexed( + 17 * uGammaPos + 42, + 162u, + (Texture *)(pTextureIDs_GammaPositions[uGammaPos] != -1 ? &pIcons_LOD->pTextures[pTextureIDs_GammaPositions[uGammaPos]] : 0)); + pRenderer->DrawTextureRGB(0x112u, 0xA9u, &stru_506E40); + v3.uFrameX = 22; + v0 = pGlobalTXT_LocalizationStrings[226]; + v3.uFrameY = 190; + v3.uFrameWidth = 211; + v3.uFrameHeight = 79; + v3.uFrameZ = 232; + v3.uFrameW = 268; + v1 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); + v3.DrawTitleText(pFontSmallnum, 0, 0, v1, v0, 3u); + } + if ( !pRenderer->pRenderD3D ) + { + pRenderer->DrawTextureIndexed( + 0x14u, + 0x119u, + (Texture *)(uTextureID_507C50 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C50] : 0)); + pRenderer->DrawTextureIndexed( + 0x14u, + 0x12Fu, + (Texture *)(uTextureID_507C54 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C54] : 0)); + v2 = uTextureID_507C58; + goto LABEL_12; + } + if ( pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS ) + pRenderer->DrawTextureIndexed( + 0x14u, + 0x119u, + (Texture *)(uTextureID_507C14 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C14] : 0)); + if ( pRenderer->bUseColoredLights ) + pRenderer->DrawTextureIndexed( + 0x14u, + 0x12Fu, + (Texture *)(uTextureID_507C18 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C18] : 0)); + if ( pRenderer->bTinting ) + { + v2 = uTextureID_507C1C; +LABEL_12: + pRenderer->DrawTextureIndexed(0x14u, 0x145u, (Texture *)(v2 != -1 ? &pIcons_LOD->pTextures[v2] : 0)); + } + } + + + +//----- (00414F82) -------------------------------------------------------- +void __cdecl DrawGameOptions() + { + signed int v0; // eax@1 + + pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0)); + pRenderer->DrawTextureIndexed(8, 132, (Texture *)(uTextureID_ControlBG[0] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[0]] : 0)); + v0 = 0; + if ( uTurnSpeed == 128 ) + { + v0 = 2; + } + else + { + if ( uTurnSpeed == 64 ) + v0 = 1; + } + pRenderer->DrawTextureIndexed(BtnTurnCoord[v0], 270, (Texture *)(uTextureID_ControlBG[v0 + 1] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[v0 + 1]] : 0)); + if ( bWalkSound ) + pRenderer->DrawTextureIndexed(20, 303, (Texture *)(uTextureID_ControlBG[21] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[21]] : 0)); + if ( bShowDamage ) + pRenderer->DrawTextureIndexed(128, 303, (Texture *)(uTextureID_ControlBG[22] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[22]] : 0)); + if ( bFlipOnExit ) + pRenderer->DrawTextureIndexed(128, 325, (Texture *)(uTextureID_ControlBG[9] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[9]] : 0)); + if ( bAlwaysRun ) + pRenderer->DrawTextureIndexed(20, 325, (Texture *)(uTextureID_ControlBG[20] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[20]] : 0)); + pRenderer->DrawTextureIndexed(17 * (char)uSoundVolumeMultiplier + 265, 162, + (Texture *)(uTextureID_ControlBG[(char)uSoundVolumeMultiplier + 10] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[(char)uSoundVolumeMultiplier + 10]] : 0)); + pRenderer->DrawTextureIndexed(17 * (char)uMusicVolimeMultiplier + 265, 216, + (Texture *)(uTextureID_ControlBG[(char)uMusicVolimeMultiplier + 10] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[(char)uMusicVolimeMultiplier + 10]] : 0)); + pRenderer->DrawTextureIndexed(17 * (char)uVoicesVolumeMultiplier + 265, 270, + (Texture *)(uTextureID_ControlBG[(char)uVoicesVolumeMultiplier + 10] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[(char)uVoicesVolumeMultiplier + 10]] : 0)); + } \ No newline at end of file diff -r f39d5902c85a -r 70c5a87a1307 UIPartyCreation.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/UIPartyCreation.cpp Wed Mar 20 17:49:15 2013 +0600 @@ -0,0 +1,964 @@ +#include + +#include "MM7.h" + +#include "MapInfo.h" +#include "Game.h" +#include "GUIWindow.h" +#include "GUIFont.h" +#include "GUIButton.h" +#include "GUIProgressBar.h" +#include "Party.h" +#include "AudioPlayer.h" +#include "Outdoor.h" +#include "IndoorCamera.h" +#include "Overlays.h" +#include "Monsters.h" +#include "Arcomage.h" +#include "LOD.h" +#include "Actor.h" +#include "Allocator.h" +#include "Events.h" +#include "Viewport.h" +#include "FrameTableInc.h" +#include "Math.h" +#include "SpriteObject.h" +#include "ObjectList.h" +#include "Chest.h" +#include "PaletteManager.h" +#include "DecorationList.h" +#include "SaveLoad.h" +#include "stru123.h" +#include "Time.h" +#include "IconFrameTable.h" +#include "Awards.h" +#include "Autonotes.h" +#include "stru160.h" +#include "stru279.h" +#include "TurnEngine.h" +#include "stru277.h" +#include "Weather.h" +#include "stru272.h" +#include "stru298.h" +#include "StorylineTextTable.h" +#include "Events2D.h" +#include "texts.h" +#include "stru351.h" + +#include "mm7_data.h" + + + +//----- (004908DE) -------------------------------------------------------- +signed int __cdecl PlayerCreation_Chose4Skills() + { + Player *v0; // esi@1 + signed int v1; // edx@2 + unsigned short *v2; // eax@2 + signed int v3; // ecx@2 + + v0 = pParty->pPlayers;//[0].pActiveSkills; + while ( 1 ) + { + v1 = 0; + v2 = v0->pActiveSkills; + v3 = 37; + do + { + if ( *v2 ) + ++v1; + ++v2; + --v3; + } + while ( v3 ); + if ( v1 < 4 ) + break; + ++v0; + if ( v0 > &pParty->pPlayers[3] ) + return 1; + } + return 0; + } + + + + +//----- (00491CB5) -------------------------------------------------------- +void __cdecl LoadPlayerPortraintsAndVoices() + { + //Texture **v0; // ebx@1 + //int v1; // eax@2 + //int v2; // edi@3 + char *v3; // esi@5 + char *v4; // [sp+10h] [bp-4h]@1 + + pIcons_LOD->pFacesLock = pIcons_LOD->uNumLoadedFiles; + + for (uint i = 0; i < 4; ++i) + for (uint j = 0; j < 56; ++j) + { + sprintf(pTmpBuf, "%s%02d", pPlayerPortraitsNames[pParty->pPlayers[i].uFace], j + 1); + pTextures_PlayerFaces[i][j] = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE); + } + + pTexture_PlayerFaceEradicated = pIcons_LOD->LoadTexturePtr("ERADCATE", TEXTURE_16BIT_PALETTE); + pTexture_PlayerFaceDead = pIcons_LOD->LoadTexturePtr("DEAD", TEXTURE_16BIT_PALETTE); + pTexture_PlayerFaceMask = pIcons_LOD->LoadTexturePtr("FACEMASK", TEXTURE_16BIT_PALETTE); + + if (SoundSetAction[24][0]) + for (uint i = 0; i < 4; ++i) + { + pSoundList->LoadSound(2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[i].uVoiceID) + 4998, 0); + pSoundList->LoadSound(2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[i].uVoiceID) + 4999, 0); + } + } + +//----- (00491DE7) -------------------------------------------------------- +int __fastcall ReloadPlayerPortraits(int a1, int a2) + { + int result; // eax@1 + const char **v3; // ebp@1 + Texture **v4; // ebx@1 + int v5; // esi@2 + + result = 0; + v3 = &pPlayerPortraitsNames[a2]; + v4 = pTextures_PlayerFaces[a1]; + do + { + v5 = result + 1; + sprintf(pTmpBuf, "%s%02d", *v3, result + 1); + pIcons_LOD->ReloadTexture(*v4, pTmpBuf, 2); + result = v5; + ++v4; + } + while ( v5 < 56 ); + return result; + } +//----- (00495B39) -------------------------------------------------------- +void __cdecl PlayerCreationUI_Draw() +{ + const char *uTitleText; // ST10_4@3 + int pTextCenter; // eax@3 + IconFrame *v3; // eax@3 + int v4; // ecx@7 + GUIButton *uPosActiveItem; // edi@12 + int v6; // esi@14 + int uNumLet; // eax@14 + char v8; // al@17 + int v9; // ecx@17 + char v10; // sf@17 + int v11; // ecx@19 + void *v12; // eax@20 + int v13; // ecx@21 + int v14; // ecx@22 + char *v15; // ST14_4@24 + size_t v16; // eax@28 + int v17; // eax@33 + //enum CHARACTER_RACE uNumRace; // eax@35 + int v19; // eax@36 + int v20; // eax@37 + int uNumMight; // eax@44 + unsigned int v24; // eax@44 + int v25; // eax@44 + unsigned int v26; // eax@44 + int v27; // eax@44 + unsigned int v28; // eax@44 + int v29; // eax@44 + unsigned int v30; // eax@44 + int v31; // eax@44 + unsigned int v32; // eax@44 + int v33; // eax@44 + unsigned int v34; // eax@44 + int v35; // eax@44 + unsigned int v36; // eax@44 + enum PLAYER_SKILL_TYPE v37; // eax@44 + enum PLAYER_SKILL_TYPE v39; // eax@44 + enum PLAYER_SKILL_TYPE v41; // eax@44 + const char *v42; // edx@44 + char *v43; // ST1C_4@44 + int v45; // eax@44 + enum PLAYER_SKILL_TYPE v46; // eax@46 + const char *v47; // edx@46 + char *v48; // ST1C_4@46 + int v50; // eax@46 + int v51; // eax@49 + char *v52; // edi@52 + char v53; // al@52 + PLAYER_CLASS_TYPE uClassType; // edi@53 + int v55; // ST0C_4@53 + int v57; // eax@53 + int v61; // ecx@55 + int v64; // ST08_4@57 + int v66; // ecx@57 + int v71; // eax@59 + int v75; // eax@61 + int v80; // eax@63 + int v85; // eax@65 + int v89; // eax@67 + int v94; // eax@69 + enum PLAYER_SKILL_TYPE pSkillId; // edi@72 + size_t pLenText; // eax@72 + signed int v104; // ecx@72 + int pColorText; // ecx@79 + unsigned int v107; // ST0C_4@81 + int pTextY; // ST08_4@81 + int v111; // ST0C_4@82 + signed int v113; // edi@82 + int v114; // ST0C_4@82 + const char *uRaceName; // [sp+0h] [bp-170h]@39 + char pText[200]; // [sp+10h] [bp-160h]@14 + GUIWindow pWindow; // [sp+D8h] [bp-98h]@83 + int v119; // [sp+12Ch] [bp-44h]@18 + size_t v120; // [sp+130h] [bp-40h]@25 + int uY; // [sp+134h] [bp-3Ch]@18 + int v122; // [sp+138h] [bp-38h]@18 + int v123; // [sp+13Ch] [bp-34h]@11 + void *v124; // [sp+140h] [bp-30h]@18 + int uColor1; // [sp+144h] [bp-2Ch]@1 + int v126; // [sp+148h] [bp-28h]@25 + int uColorGreen; // [sp+14Ch] [bp-24h]@1 + int v128; // [sp+150h] [bp-20h]@14 + int v129; // [sp+154h] [bp-1Ch]@18 + int uColorTeal; // [sp+158h] [bp-18h]@1 + int uColorWhite; // [sp+15Ch] [bp-14h]@1 + int uX; // [sp+160h] [bp-10h]@18 + unsigned int v133; // [sp+164h] [bp-Ch]@25 + int pOrder; // [sp+168h] [bp-8h]@14 + //char *Str; // [sp+16Ch] [bp-4h]@18 + //Player *pPlayer; + const char *pSkillName; + + uColor1 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xD1, 0xBB, 0x61); + uColorTeal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xF7, 0xF7); + uColorGreen = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFF, 0); + uColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0xFF); + pRenderer->BeginScene(); + pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX); + uPlayerCreationUI_SkySliderPos = (GetTickCount() % 12800) / 20; + pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos, 2, pTexture_MAKESKY); + pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos - 640, 2, pTexture_MAKESKY); + //if (uPlayerCreationUI_SkySliderPos > 640) + //uPlayerCreationUI_SkySliderPos = 0; + pRenderer->DrawTextureTransparent(0, 0, pTexture_MAKETOP); + uTitleText = pGlobalTXT_LocalizationStrings[51]; + uPlayerCreationUI_SelectedCharacter = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) / 7; + pTextCenter = pFontCChar->AlignText_Center(640, pGlobalTXT_LocalizationStrings[51]); + pGUIWindow_CurrentMenu->DrawText(pFontCChar, pTextCenter + 1, 0, 0, uTitleText, 0, 0, 0); + pRenderer->DrawTextureTransparent(17, 35, pPlayerPortraits[pParty->pPlayers[0].uFace]); + pRenderer->DrawTextureTransparent(176, 35, pPlayerPortraits[pParty->pPlayers[1].uFace]); + pRenderer->DrawTextureTransparent(335, 35, pPlayerPortraits[pParty->pPlayers[2].uFace]); + pRenderer->DrawTextureTransparent(494, 35, pPlayerPortraits[pParty->pPlayers[3].uFace]); + v3 = pIconsFrameTable->GetFrame(uIconID_CharacterFrame, pEventTimer->uStartTime); + if ( uPlayerCreationUI_SelectedCharacter ) + { + switch ( uPlayerCreationUI_SelectedCharacter ) + { + case 1: + v4 = 171; + break; + case 2: + v4 = 329; + break; + case 3: + v4 = 488; + break; + default: + v4 = v123; + break; + } + } + else + { + v4 = 12; + } + + pRenderer->DrawTextureTransparent(v4, 29, &pIcons_LOD->pTextures[v3->uTextureID]); + uPosActiveItem = pGUIWindow_CurrentMenu->GetControl(pGUIWindow_CurrentMenu->pCurrentPosActiveItem); + uPlayerCreationUI_ArrowAnim = 19 - (GetTickCount() % 500) / 25; + pRenderer->DrawTextureTransparent(uPosActiveItem->uZ - 4, uPosActiveItem->uY, pTextures_arrowl[uPlayerCreationUI_ArrowAnim]); + pRenderer->DrawTextureTransparent(uPosActiveItem->uX - 12, uPosActiveItem->uY, pTextures_arrowr[uPlayerCreationUI_ArrowAnim]); + //if (uPlayerCreationUI_ArrowAnim < 0) + // uPlayerCreationUI_ArrowAnim = 18; + v6 = pFontCreate->uFontHeight - 2; + v128 = pFontCreate->uFontHeight - 2; + memset(pText, 0, 200); + strcpy(pText, pGlobalTXT_LocalizationStrings[205]);// "Skills" + uNumLet = strlen(pText) - 1; + pOrder = uNumLet; + if ( uNumLet >= 0 ) + { + while ( 1 ) + { + v8 = toupper((unsigned __int8)pText[uNumLet]); + v9 = pOrder; + v10 = pOrder-- - 1 < 0; + pText[v9] = v8; + if ( v10 ) + break; + uNumLet = pOrder; + } + } + pOrder = 18; + v124 = 0; + uX = 32; + uY = 3 * v6 + 169; + v122 = 5 * v6 + 169; + v123 = 3 * v6 + 311; + v129 = 493; + //pPlayer = pParty->pPlayers; + v119 = 6 * v6 + 169; + //do + + //for ( pPlayer = pParty->pPlayers; (signed int)pPlayer->pName < (signed int)&pParty->pPickedItem.uNumCharges; pPlayer++) + for (int i = 0; i < 4; ++i) + { + auto player = pParty->pPlayers + i; + + //Str = pPlayer->pName; + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pOrder + 73, 100, 0, pClassNames[player->classType], 0, 0, 0); + pRenderer->DrawTextureTransparent(pOrder + 77, 50, pTexture_IC_KNIGHT[player->classType / 4]); + v11 = pGUIWindow_CurrentMenu->field_40; + if ( v11 && (v12 = pGUIWindow_CurrentMenu->ptr_1C, v12 == v124) ) + { + v13 = v11 - 1; + if ( v13 ) + { + v14 = v13 - 1; + if ( v14 ) + { + if ( v14 == 1 ) + { + pGUIWindow_CurrentMenu->field_40 = 0; + pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 124, 0, player->pName, 130, 0); + SetCurrentMenuID(MENU_NAMEPANELESC); + } + } + else + { + pGUIWindow_CurrentMenu->field_40 = 0; + v120 = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); + v126 = 0; + v133 = 0; + if ( strlen((const char *)pKeyActionMap->pPressedKeysBuffer) )//edit name + { + do + { + if ( pKeyActionMap->pPressedKeysBuffer[v133] == ' ' ) + ++v126; + ++v133; + v16 = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); + } + while ( v133 < v16 ); + } + if ( v120 && v126 != v120 ) + strcpy(player->pName, (const char *)pKeyActionMap->pPressedKeysBuffer); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 0x7C, 0, player->pName, 130, 0); + *(short *)&player->field_1988[27] = 1; // + } + } + else + { + v17 = pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, 159 * (int)v12 + 18, 0x7Cu, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 120, 1); + pGUIWindow_CurrentMenu->DrawFlashingInputCursor(159 * (unsigned int)pGUIWindow_CurrentMenu->ptr_1C + v17 + 20, 124, pFontCreate); + } + } + else + { + pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 0x7C, 0, player->pName, 130, 0); + } + switch (player->GetRace()) + { + case 0: uRaceName = pGlobalTXT_LocalizationStrings[99]; break; // "Human" + case 1: uRaceName = pGlobalTXT_LocalizationStrings[103]; break; // "Dwarf" + case 2: uRaceName = pGlobalTXT_LocalizationStrings[106]; break; // "Goblin" + case 3: uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Elf" + }; + strcpy(pTmpBuf, uRaceName); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder + 72, v128 + 12, 0, pTmpBuf, 130, 0); + pTextCenter = pFontCreate->AlignText_Center(0x96, pText); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, uColor1, pText, 0, 0, 0); + uNumMight = player->GetActualMight(); + sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], v129, uNumMight);// "Might" + LOWORD(v24) = player->GetStatColor(0); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, v24, pTmpBuf, 0, 0, 0); + v25 = player->GetActualIntelligence(); + sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], v129, v25);// "Intellect" + LOWORD(v26) = player->GetStatColor(1); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v128 + 169, v26, pTmpBuf, 0, 0, 0); + v27 = player->GetActualWillpower(); + sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], v129, v27);// "Personality" + LOWORD(v28) = player->GetStatColor(2); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * v128 + 169, v28, pTmpBuf, 0, 0, 0); + v29 = player->GetActualEndurance(); + sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], v129, v29);// "Endurance" + LOWORD(v30) = player->GetStatColor(3); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, uY, v30, pTmpBuf, 0, 0, 0); + v31 = player->GetActualAccuracy(); + sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], v129, v31);// "Accuracy" + LOWORD(v32) = player->GetStatColor(4); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * v128 + 169, v32, pTmpBuf, 0, 0, 0); + v33 = player->GetActualSpeed(); + sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], v129, v33);// "Speed" + LOWORD(v34) = player->GetStatColor(5); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v122, v34, pTmpBuf, 0, 0, 0); + v35 = player->GetActualLuck(); + sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], v129, v35);// "Luck" + LOWORD(v36) = player->GetStatColor(6); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v119, v36, pTmpBuf, 0, 0, 0); + v37 = player->GetSkillIdxByOrder(0); + pTextCenter = pFontCreate->AlignText_Center(0x96u, pSkillNames[v37]); + sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v37]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, uColorWhite, pTmpBuf, 0, 0, 0); + v39 = player->GetSkillIdxByOrder(1); + pTextCenter = pFontCreate->AlignText_Center(0x96u, pSkillNames[v39]); + sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v39]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, v128 + 311, uColorWhite, pTmpBuf, 0, 0, 0); + v41 = player->GetSkillIdxByOrder(2); + pTextCenter = pFontCreate->AlignText_Center(150u, pSkillNames[v41]); + sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v41]); + v45 = uColorGreen; + if ( (signed int)v41 >= 37 ) + v45 = uColorTeal; + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * v128 + 311, v45, pTmpBuf, 0, 0, 0); + v46 = player->GetSkillIdxByOrder(3); + pTextCenter = pFontCreate->AlignText_Center(150u, pSkillNames[v46]); + sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v46]); + v50 = uColorGreen; + if ( (signed int)v46 >= 37 ) + v50 = uColorTeal; + pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, v123, v50, pTmpBuf, 0, 0, 0); + //pPlayer++; + v124 = (char *)v124 + 1; + pOrder += 159; + v129 -= 158; + uX += 158; + } + + //while ( (signed int)pPlayer->pName < (signed int)&pParty->pPickedItem.uNumCharges ); + strcpy(pText, pGlobalTXT_LocalizationStrings[41]);// "Class" + v51 = strlen(pText) - 1; + pOrder = v51; + if ( v51 >= 0 ) + { + while ( 1 ) + { + v52 = &pText[v51]; + v53 = toupper((unsigned __int8)pText[v51]); + v10 = pOrder-- - 1 < 0; + *v52 = v53; + if ( v10 ) + break; + v51 = pOrder; + } + } + uClassType = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].classType; + pTextCenter = pFontCreate->AlignText_Center(193u, pText); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 324, 395, uColor1, pText, 0, 0, 0); + v57 = uColorTeal; + if ( uClassType ) + v57 = uColorWhite; + pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[0]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 417, v57, pClassNames[0], 0, 0, 0); + v61 = uColorTeal; + if ( uClassType != PLAYER_CLASS_PALADIN ) + v61 = uColorWhite; + uColorGreen = v128 + 417; + pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[12]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, v128 + 417, v61, pClassNames[12], 0, 0, 0); + v66 = uColorTeal; + if ( uClassType != PLAYER_CLASS_DRUID ) + v66 = uColorWhite; + pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[20]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 2 * v128 + 417, v66, pClassNames[20], 0, 0, 0); + v71 = uColorTeal; + if ( uClassType != PLAYER_CLASS_CLERIC ) + v71 = uColorWhite; + pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[24]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 417, v71, pClassNames[24], 0, 0, 0); + v75 = uColorTeal; + if ( uClassType != PLAYER_CLASS_DRUID) + v75 = uColorWhite; + pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[28]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, uColorGreen, v75, pClassNames[28], 0, 0, 0); + v80 = uColorTeal; + if ( uClassType != PLAYER_CLASS_SORCERER ) + v80 = uColorWhite; + pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[32]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 2 * v128 + 417, v80, pClassNames[32], 0, 0, 0); + v85 = uColorTeal; + if ( uClassType != PLAYER_CLASS_ARCHER ) + v85 = uColorWhite; + pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[16]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 417, v85, pClassNames[16], 0, 0, 0); + v89 = uColorTeal; + if ( uClassType != PLAYER_CLASS_MONK ) + v89 = uColorWhite; + pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[8]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, uColorGreen, v89, pClassNames[8], 0, 0, 0); + v94 = uColorTeal; + if ( uClassType != PLAYER_CLASS_THEIF ) + v94 = uColorWhite; + pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[4]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 2 * v128 + 417, v94, pClassNames[4], 0, 0, 0); + pTextCenter = pFontCreate->AlignText_Center(0xECu, pGlobalTXT_LocalizationStrings[20]); // "Available Skills" + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 37, 395, uColor1, pGlobalTXT_LocalizationStrings[20], 0, 0, 0); + //pOrder = 0; + //do + for (pOrder = 0; pOrder < 9; ++pOrder) + { + pSkillId = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pOrder + 4); + strcpy(pText, pSkillNames[pSkillId]); + pLenText = strlen(pText); + v104 = 0; + if ( (signed int)pLenText > 0 ) + { + if ( pText[v104] == 32 ) + { + pText[v104] = 0; + } + else + { + while ( pText[v104] != 32 ) + //for (v104 = 0; v104 < (signed int)pLenText || pText[v104] != 32; ++v104) + { + ++v104; + if ( v104 >= (signed int)pLenText ) + break; + } + } + } + uColorGreen = -5; + if ( (signed int)v124 > 2 ) + uColorGreen = 0; + pColorText = uColorTeal; + if ( !pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].pActiveSkills[pSkillId] ) + pColorText = uColorWhite; + pTextCenter = pFontCreate->AlignText_Center(100, pText); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, 100 * (pOrder / 3) + pTextCenter + uColorGreen + 17, v128 * (pOrder % 3) + 417, pColorText, pText, 0, 0, 0); + //++pOrder; + } + //while ( pOrder < 9 ); + pTextCenter = pFontCreate->AlignText_Center(0x5C, pGlobalTXT_LocalizationStrings[30]);// "Bonus" + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 533, 394, uColor1, pGlobalTXT_LocalizationStrings[30], 0, 0, 0); + v113 = PlayerCreation_ComputeAttributeBonus(); + sprintf(pTmpBuf, "%d", v113); + pTextCenter = pFontCreate->AlignText_Center(84, pTmpBuf); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 530, 410, uColorWhite, pTmpBuf, 0, 0, 0); + if ( GameUI_StatusBar_TimedStringTimeLeft > GetTickCount() ) + { + pWindow.Hint = pGlobalTXT_LocalizationStrings[412];// "Create Party cannot be completed unless you have assigned all characters 2 extra skills and have spent all of your bonus points." + if ( v113 < 0 ) + pWindow.Hint = pGlobalTXT_LocalizationStrings[413];// "You can't spend more than 50 points." + pWindow.uFrameWidth = 300; + pWindow.uFrameHeight = 100; + pWindow.uFrameX = 170; + pWindow.uFrameY = 140; + pWindow.uFrameZ = 469; + pWindow.uFrameW = 239; + pWindow.DrawMessageBox(0); + } + pRenderer->EndScene(); +} + +//----- (0049695A) -------------------------------------------------------- +void __cdecl PlayerCreationUI_Initialize() +{ + unsigned int v0; // ebx@5 + unsigned int v1; // eax@6 + int v2; // ecx@6 + unsigned int v3; // eax@8 + signed int v4; // ecx@8 + signed int uControlParam; // [sp+10h] [bp-Ch]@7 + unsigned int uControlParama; // [sp+10h] [bp-Ch]@9 + unsigned int uControlParamb; // [sp+10h] [bp-Ch]@11 + unsigned int uControlParamc; // [sp+10h] [bp-Ch]@13 + signed int uControlParamd; // [sp+10h] [bp-Ch]@15 + signed int uX; // [sp+14h] [bp-8h]@5 + unsigned int uXa; // [sp+14h] [bp-8h]@9 + unsigned int uXb; // [sp+14h] [bp-8h]@11 + unsigned int uXc; // [sp+14h] [bp-8h]@13 + signed int uXd; // [sp+14h] [bp-8h]@16 + + if ( pMessageQueue_50CBD0->uNumMessages ) + pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; + pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f); + ++pIcons_LOD->uTexturePacksCount; + if ( !pIcons_LOD->uNumPrevLoadedFiles ) + pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; + pCurrentScreen = SCREEN_PARTY_CREATION; + uPlayerCreationUI_ArrowAnim = 0; + uPlayerCreationUI_SkySliderPos = 0; + uPlayerCreationUI_SelectedCharacter = 0; + v0 = LOBYTE(pFontCreate->uFontHeight) - 2; + pTexture_IC_KNIGHT[0] = pIcons_LOD->LoadTexturePtr("IC_KNIGHT", TEXTURE_16BIT_PALETTE); + pTexture_IC_KNIGHT[1] = pIcons_LOD->LoadTexturePtr("IC_THIEF", TEXTURE_16BIT_PALETTE); + pTexture_IC_KNIGHT[2] = pIcons_LOD->LoadTexturePtr("IC_MONK", TEXTURE_16BIT_PALETTE); + pTexture_IC_KNIGHT[3] = pIcons_LOD->LoadTexturePtr("IC_PALAD", TEXTURE_16BIT_PALETTE); + pTexture_IC_KNIGHT[4] = pIcons_LOD->LoadTexturePtr("IC_ARCH", TEXTURE_16BIT_PALETTE); + pTexture_IC_KNIGHT[5] = pIcons_LOD->LoadTexturePtr("IC_RANGER", TEXTURE_16BIT_PALETTE); + pTexture_IC_KNIGHT[6] = pIcons_LOD->LoadTexturePtr("IC_CLER", TEXTURE_16BIT_PALETTE); + pTexture_IC_KNIGHT[7] = pIcons_LOD->LoadTexturePtr("IC_DRUID", TEXTURE_16BIT_PALETTE); + pTexture_IC_KNIGHT[8] = pIcons_LOD->LoadTexturePtr("IC_SORC", TEXTURE_16BIT_PALETTE); + pTexture_MAKETOP = pIcons_LOD->LoadTexturePtr("MAKETOP", TEXTURE_16BIT_PALETTE); + pTexture_MAKESKY = pIcons_LOD->LoadTexturePtr("MAKESKY", TEXTURE_16BIT_PALETTE); + for(uX=0;uX < 22;++uX ) // load PlayerPortraits texture + { + sprintf(pTmpBuf, "%s01", pPlayerPortraitsNames[uX]); + v1 = pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE); + pPlayerPortraits[uX] = &pIcons_LOD->pTextures[v1]; + + } + pTexture_PlayerFaceMask = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("FACEMASK", TEXTURE_16BIT_PALETTE)]; + pTexture_buttminu = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("buttminu", TEXTURE_16BIT_PALETTE)]; + pTexture_buttplus = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("buttplus", TEXTURE_16BIT_PALETTE)]; + pTexture_pressrigh = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("presrigh", TEXTURE_16BIT_PALETTE)]; + pTexture_presleft = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("presleft", TEXTURE_16BIT_PALETTE)]; + uControlParam = 1; + do + { + sprintf(pTmpBuf, "arrowl%d", uControlParam); + pTextures_arrowl[uControlParam] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)]; + sprintf(pTmpBuf, "arrowr%d", uControlParam); + v3 = pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE); + v4 = uControlParam++; + pTextures_arrowr[v4] = &pIcons_LOD->pTextures[v3]; + } + while ( uControlParam < 20 ); + pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); + uControlParama = 0; + uXa = 8; + do + { + pGUIWindow_CurrentMenu->CreateButton(uXa, 120u, 145u, 25u, 1, 0, 0x3Cu, uControlParama, 0, "", 0); + uXa += 158; + ++uControlParama; + } + while ( (signed int)uXa < 640 ); + pCreationUI_BtnPressLeft[0] = pGUIWindow_CurrentMenu->CreateButton(10, 32, 11, 13, 1, 0, 0xABu, 0, 0, "", pTexture_presleft, 0); + pCreationUI_BtnPressLeft[1] = pGUIWindow_CurrentMenu->CreateButton(169, 32, 11, 13, 1, 0, 0xABu, 1, 0, "", pTexture_presleft, 0); + pCreationUI_BtnPressLeft[2] = pGUIWindow_CurrentMenu->CreateButton(327, 32, 11, 13, 1, 0, 0xABu, 2, 0, "", pTexture_presleft, 0); + pCreationUI_BtnPressLeft[3] = pGUIWindow_CurrentMenu->CreateButton(486, 32, 11, 13, 1, 0, 0xABu, 3, 0, "", pTexture_presleft, 0); + pCreationUI_BtnPressRight[0] = pGUIWindow_CurrentMenu->CreateButton(74, 32, 11, 13, 1, 0, 0xACu, 0, 0, "", pTexture_pressrigh, 0); + pCreationUI_BtnPressRight[1] = pGUIWindow_CurrentMenu->CreateButton(233, 32, 11, 13, 1, 0, 0xACu, 1, 0, "", pTexture_pressrigh, 0); + pCreationUI_BtnPressRight[2] = pGUIWindow_CurrentMenu->CreateButton(391, 32, 11, 13, 1, 0, 0xACu, 2, 0, "", pTexture_pressrigh, 0); + pCreationUI_BtnPressRight[3] = pGUIWindow_CurrentMenu->CreateButton(549, 32, 11, 13, 1, 0, 0xACu, 3, 0, "", pTexture_pressrigh, 0); + pCreationUI_BtnPressLeft2[0] = pGUIWindow_CurrentMenu->CreateButton(10, 103, 11, 13, 1, 0, 0x90u, 0, 0, "", pTexture_presleft, 0); + pCreationUI_BtnPressLeft2[1] = pGUIWindow_CurrentMenu->CreateButton(169, 103, 11, 13, 1, 0, 0x90u, 1, 0, "", pTexture_presleft, 0); + pCreationUI_BtnPressLeft2[2] = pGUIWindow_CurrentMenu->CreateButton(327, 103, 11, 13, 1, 0, 0x90u, 2, 0, "", pTexture_presleft, 0); + pCreationUI_BtnPressLeft2[3] = pGUIWindow_CurrentMenu->CreateButton(486, 103, 11, 13, 1, 0, 0x90u, 3, 0, "", pTexture_presleft, 0); + pCreationUI_BtnPressRight2[0] = pGUIWindow_CurrentMenu->CreateButton(74, 103, 11, 13, 1, 0, 0x91u, 0, 0, "", pTexture_pressrigh, 0); + pCreationUI_BtnPressRight2[1] = pGUIWindow_CurrentMenu->CreateButton(233, 103, 11, 13, 1, 0, 0x91u, 1, 0, "", pTexture_pressrigh, 0); + pCreationUI_BtnPressRight2[2] = pGUIWindow_CurrentMenu->CreateButton(391, 103, 11, 13, 1, 0, 0x91u, 2, 0, "", pTexture_pressrigh, 0); + pCreationUI_BtnPressRight2[3] = pGUIWindow_CurrentMenu->CreateButton(549, 103, 11, 13, 1, 0, 0x91u, 3, 0, "", pTexture_pressrigh, 0); + uControlParamb = 0; + uXb = 8; + do + { + pGUIWindow_CurrentMenu->CreateButton(uXb, 308, 150, v0, 1, 0, 0x48u, uControlParamb, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uXb, v0 + 308, 150, v0, 1, 0, 0x49u, uControlParamb, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uXb, 2 * v0 + 308, 150u, v0, 1, 0, 0x4Au, uControlParamb, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uXb, 3 * v0 + 308, 150u, v0, 1, 0, 0x4Bu, uControlParamb, 0, "", 0); + uXb += 158; + ++uControlParamb; + } + while ( (signed int)uXb < 640 ); + pGUIWindow_CurrentMenu->CreateButton(5u, 21u, 0x99u, 0x16Du, 1, 0, 0x76u, 0, 0x31u, "", 0); + pGUIWindow_CurrentMenu->CreateButton(163u, 21u, 0x99u, 0x16Du, 1, 0, 0x76u, 1u, 0x32u, "", 0); + pGUIWindow_CurrentMenu->CreateButton(321u, 21u, 0x99u, 0x16Du, 1, 0, 0x76u, 2u, 0x33u, "", 0); + pGUIWindow_CurrentMenu->CreateButton(479u, 21u, 0x99u, 0x16Du, 1, 0, 0x76u, 3u, 0x34u, "", 0); + uXc = 23; + uControlParamc = 2; + do + { + pGUIWindow_CurrentMenu->CreateButton(uXc, 169, 120, 20, 1, 0, 0, uControlParamc - 2, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uXc, v0 + 169, 120, 20, 1, 0, 0, uControlParamc - 1, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uXc, 2 * v0 + 169, 120, 20, 1, 0, 0, uControlParamc, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uXc, 3 * v0 + 169, 120, 20, 1, 0, 0, uControlParamc + 1, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uXc, 4 * v0 + 169, 120, 20, 1, 0, 0, uControlParamc + 2, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uXc, 5 * v0 + 169, 120, 20, 1, 0, 0, uControlParamc + 3, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(uXc, 6 * v0 + 169, 120, 20, 1, 0, 0, uControlParamc + 4, 0, "", 0); + uControlParamc += 7; + uXc += 158; + } + while ( (signed int)uControlParamc < 30 ); + pGUIWindow_CurrentMenu->_41D08F(28, 0, 7, 40); + pGUIWindow_CurrentMenu->CreateButton(323, 417, 65, v0, 1, 0, 0x41, 0, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(323, v0 + 417, 65, v0, 1, 0, 0x41, 0xC, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(323, 2 * v0 + 417, 65, v0, 1, 0, 0x41, 0x14, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(388, 417, 65, v0, 1, 0, 0x41, 0x18, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(388, v0 + 417, 65, v0, 1, 0, 0x41, 0x1C, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(388, 2 * v0 + 417, 65, v0, 1, 0, 0x41, 0x20, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(453, 417, 65, v0, 1, 0, 0x41, 0x10, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(453, v0 + 417, 65, v0, 1, 0, 0x41, 8, 0, "", 0); + pGUIWindow_CurrentMenu->CreateButton(453, 2 * v0 + 417, 65, v0, 1, 0, 0x41, 4, 0, "", 0); + uControlParamd = 0; + do + { + uXd = -5; + if ( uControlParamd <= 3 ) + uXd = 0; + pGUIWindow_CurrentMenu->CreateButton(100 * (uControlParamd / 3) + uXd + 17, v0 * (uControlParamd % 3) + 417, 100, v0, 1, 0, 0x40, + uControlParamd, 0, "", 0); + ++uControlParamd; + } + while ( uControlParamd < 9 ); + pPlayerCreationUI_BtnOK = pGUIWindow_CurrentMenu->CreateButton(580, 431, 51, 39, 1, 0, 0x42, 0, 0xD, "", + (Texture *)(uTextureID_BUTTMAKE != -1 ? &pIcons_LOD->pTextures[uTextureID_BUTTMAKE] : 0), 0); + pPlayerCreationUI_BtnReset = pGUIWindow_CurrentMenu->CreateButton(527, 431, 51, 39, 1, 0, 0x43, 0, 0x43, "", + (Texture *)(uTextureID_BUTTMAKE2 != -1 ? &pIcons_LOD->pTextures[uTextureID_BUTTMAKE2] : 0), 0); + pPlayerCreationUI_BtnMinus = pGUIWindow_CurrentMenu->CreateButton(523, 393, 20, 35, 1, 0, 0x3F, 0, 0x2D, "", pTexture_buttminu, 0); + pPlayerCreationUI_BtnPlus = pGUIWindow_CurrentMenu->CreateButton(613, 393, 20, 35, 1, 0, 0x3E, 1, 0x2B, "", pTexture_buttplus, 0); + pFontCChar = LoadFont("cchar.fnt", "FONTPAL", NULL); +} +// 4E28F8: using guessed type int pCurrentScreen; + +//----- (0049750E) -------------------------------------------------------- +void __cdecl DeleteCCharFont() +{ + pAllocator->FreeChunk(pFontCChar); + pFontCChar = 0; +} +//----- (00497526) -------------------------------------------------------- +bool __cdecl PlayerCreationUI_Loop() +{ + //RGBTexture *pTexture; // ebx@1 + UINT v1; // esi@1 + unsigned int v2; // ecx@3 + LONG uMouseX; // edi@6 + LONG uMouseY; // eax@6 + GUIButton *pControlsHead; // edx@6 + //unsigned int pNumMessage; // ecx@7 + int pControlParam; // esi@12 + signed int v8; // edi@30 + int v9; // edx@31 + char *v10; // ebx@37 + Player *v11; // esi@38 + //signed int uSpellBookPageCount; // ecx@40 + int v13; // eax@40 + //signed int uSkillIdx; // eax@45 + int v15; // eax@70 + signed int v16; // ecx@70 + //unsigned int v18; // [sp-4h] [bp-84h]@48 + ItemGen item; // [sp+Ch] [bp-74h]@37 + char v20[32]; // [sp+30h] [bp-50h]@29 + //char v21; // [sp+31h] [bp-4Fh]@29 + //__int16 v22; // [sp+4Dh] [bp-33h]@29 + char v23; // [sp+4Fh] [bp-31h]@29 + MSG Msg; // [sp+50h] [bp-30h]@17 + POINT v25; // [sp+6Ch] [bp-14h]@6 + bool v26; // [sp+74h] [bp-Ch]@1 + //POINT v24; // [sp+78h] [bp-8h]@6 + //Player *pPlayer; + + //pTexture = &pTexture_PCX; + v1 = 0; + v26 = 0; + pTexture_PCX.Release(); + pTexture_PCX.Load("makeme.pcx", 0); + if (pAsyncMouse) + pAsyncMouse->Resume(); + v2 = 6; + pGUIWindow_CurrentMenu->field_40 = 0; +//LABEL_27: + SetCurrentMenuID((MENU_STATE)v2); + while ( GetCurrentMenuID() == MENU_CREATEPARTY ) + { + if ( pAsyncMouse != (void *)v1 ) + pAsyncMouse->_46B736_consume_click_lists(1); + uMouseX = pMouse->GetCursorPos(&v25)->x; + uMouseY = pMouse->GetCursorPos(&v25)->y; + pControlsHead = pGUIWindow_CurrentMenu->pControlsHead; + + //does nothing actually + /*if ( pControlsHead != (GUIButton *)v1 ) + { + pNumMessage = pMessageQueue_50CBD0->uNumMessages; + do + { + if ( uMouseX >= (signed int)pControlsHead->uX && uMouseX <= (signed int)pControlsHead->uZ + && uMouseY >= (signed int)pControlsHead->uY && uMouseY <= (signed int)pControlsHead->uW )//mouse movement + { + pControlParam = pControlsHead->uControlParam; + pMessageQueue_50CBD0->AddMessage((UIMessageType)pControlsHead->field_1C, pControlParam, 0); + v1 = 0; + } + pControlsHead = pControlsHead->pNext; + } + while ( pControlsHead != (GUIButton *)v1 ); + }*/ + + while ( PeekMessageA(&Msg, (HWND)v1, v1, v1, PM_REMOVE) ) + { + if ( Msg.message == WM_QUIT ) + Game_DeinitializeAndTerminate(0); + TranslateMessage(&Msg); + DispatchMessageA(&Msg); + } + if ( BYTE1(dword_6BE364_game_settings_1) & 1 ) + { + WaitMessage(); + } + else + { + PlayerCreationUI_Draw(); + GUI_MainMenuMessageProc(); + pRenderer->BeginScene(); + GUI_UpdateWindows(); + pRenderer->EndScene(); + pRenderer->Present(); + if ( uGameState == 1 ) + { + v26 = 1; + v2 = 0; + //goto LABEL_27; + SetCurrentMenuID((MENU_STATE)v2); + continue; + } + if ( uGameState == 6 ) + { + uGameState = v1; + v2 = 1; + //goto LABEL_27; + SetCurrentMenuID((MENU_STATE)v2); + continue; + } + } + } + pTexture_PCX.Release(); + pGUIWindow_CurrentMenu->Release(); + pIcons_LOD->_4114F2(); + + memset(v20, 0, 32); + do + { + v8 = 0; + do + { + v9 = rand() % 32; + if ( !v20[v9] ) + break; + ++v8; + } + while ( v8 < 10 ); + if ( v8 == 10 ) + { + v9 = 0; + if ( v20[0] ) + { + do + ++v9; + while ( v20[v9] ); + } + } + pParty->field_854[v1++] = v9; + v20[v9] = 1; + } + while ( (signed int)v1 < 32 ); + //v10 = (char *)&pParty->pPlayers[0].sResMagicBase; + + item.Reset(); + //for ( pPlayer = &pParty->pPlayers[0]; pPlayer < &pParty->pPlayers[4]; pPlayer++) + for (uint i = 0; i < 4; ++i) + { + auto player = &pParty->pPlayers[i]; + //v11 = pPlayer; + if (player->classType == PLAYER_CLASS_KNIGHT) + player->sResMagicBase = 10; + //*((short *)v10 + 400) = 0; + player->pPlayerBuffs[22].uExpireTime = 0; + for (uint j = 0; j < 9; j++) + { + if (player->pActiveSkills[PLAYER_SKILL_FIRE + j]) + { + player->lastOpenedSpellbookPage = j; + break; + } + } + pItemsTable->GenerateItem(2, 40, &item); + player->AddItem2(-1, &item); + //uSkillIdx = 0; + //v24.y = 0; + + player->sHealth = player->GetMaxHealth(); + player->sMana = player->GetMaxMana(); + for (uint j = 0; j < 37; ++j) + { + if (!player->pActiveSkills[j]) + continue; + + switch (j) + { + case PLAYER_SKILL_STAFF: player->AddItem(-1, 61); break; + case PLAYER_SKILL_SWORD: player->AddItem(-1, 1); break; + case PLAYER_SKILL_DAGGER: player->AddItem(-1, 15); break; + case PLAYER_SKILL_AXE: player->AddItem(-1, 23); break; + case PLAYER_SKILL_SPEAR: player->AddItem(-1, 31); break; + case PLAYER_SKILL_BOW: player->AddItem(-1, 47); break; + case PLAYER_SKILL_MACE: player->AddItem(-1, 50); break; + case PLAYER_SKILL_BLASTER: assert(false); break; + case PLAYER_SKILL_SHIELD: player->AddItem(-1, 84); break; + case PLAYER_SKILL_LEATHER: player->AddItem(-1, 66); break; + case PLAYER_SKILL_CHAIN: player->AddItem(-1, 71); break; + case PLAYER_SKILL_PLATE: player->AddItem(-1, 76); break; + case PLAYER_SKILL_FIRE: + player->AddItem(-1, 0x191); + player->spellbook.pFireSpellbook.bIsSpellAvailable[0] = true; + break; + case PLAYER_SKILL_AIR: + player->AddItem(-1, 0x19C); + player->spellbook.pAirSpellbook.bIsSpellAvailable[0] = true; + break; + case PLAYER_SKILL_WATER: + player->AddItem(-1, 0x1A7); + player->spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true; + break; + case PLAYER_SKILL_EARTH: + player->AddItem(-1, 0x1B2); + player->spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true; + break; + case PLAYER_SKILL_SPIRIT: + player->AddItem(-1, 0x1BD); + player->spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true; + break; + case PLAYER_SKILL_MIND: + player->AddItem(-1, 0x1C8); + player->spellbook.pMindSpellbook.bIsSpellAvailable[0] = true; + break; + case PLAYER_SKILL_BODY: + player->AddItem(-1, 0x1D3); + player->spellbook.pBodySpellbook.bIsSpellAvailable[0] = true; + break; + case PLAYER_SKILL_LIGHT: + case PLAYER_SKILL_DARK: + case PLAYER_SKILL_DIPLOMACY: + assert(false); + break; + case PLAYER_SKILL_ITEM_ID: + case PLAYER_SKILL_REPAIR: + case PLAYER_SKILL_MEDITATION: + case PLAYER_SKILL_PERCEPTION: + case PLAYER_SKILL_TRAP_DISARM: + case PLAYER_SKILL_LEARNING: + player->AddItem(-1, 0xDC); + player->AddItem(-1, 5 * (rand() % 3 + 40)); + break; + case PLAYER_SKILL_DODGE: player->AddItem(-1, 115); break; + case PLAYER_SKILL_UNARMED: player->AddItem(-1, 110); break; + default: + break; + } + + for (uint k = 0; k < 138; k++) + { + if (&player->pInventoryItems[k]) + player->pInventoryItems[k].SetIdentified(); + } + } + } + + pAudioPlayer->StopChannels(-1, -1); + if (pAsyncMouse) + pAsyncMouse->Suspend(); + return v26; +} \ No newline at end of file diff -r f39d5902c85a -r 70c5a87a1307 UIPopup.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/UIPopup.cpp Wed Mar 20 17:49:15 2013 +0600 @@ -0,0 +1,2316 @@ +#include + +#include "MM7.h" + +#include "MapInfo.h" +#include "Game.h" +#include "GUIWindow.h" +#include "GUIFont.h" +#include "GUIButton.h" +#include "GUIProgressBar.h" +#include "Party.h" +#include "AudioPlayer.h" +#include "Outdoor.h" +#include "IndoorCamera.h" +#include "Overlays.h" +#include "Monsters.h" +#include "Arcomage.h" +#include "LOD.h" +#include "Actor.h" +#include "Allocator.h" +#include "Events.h" +#include "Viewport.h" +#include "FrameTableInc.h" +#include "Math.h" +#include "SpriteObject.h" +#include "ObjectList.h" +#include "Chest.h" +#include "PaletteManager.h" +#include "DecorationList.h" +#include "SaveLoad.h" +#include "stru123.h" +#include "Time.h" +#include "IconFrameTable.h" +#include "Awards.h" +#include "Autonotes.h" +#include "stru160.h" +#include "stru279.h" +#include "TurnEngine.h" +#include "stru277.h" +#include "Weather.h" +#include "stru272.h" +#include "stru298.h" +#include "StorylineTextTable.h" +#include "Events2D.h" +#include "texts.h" +#include "stru351.h" + +#include "mm7_data.h" + +static char static_sub_417BB5_out_string[1200]; // static to a file, not sub actually + +//----- (004151D9) -------------------------------------------------------- +void __fastcall DrawPopupWindow(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight) + { + unsigned int v4; // ebx@1 + Texture *v5; // edi@1 + signed int uTileWidth; // ecx@1 + int v7; // eax@5 + int v8; // ecx@10 + unsigned int v9; // ebx@14 + int v10; // [sp+10h] [bp-28h]@5 + signed int uTileHeight; // [sp+18h] [bp-20h]@1 + int v12; // [sp+1Ch] [bp-1Ch]@7 + int v13; // [sp+20h] [bp-18h]@1 + int a5; // [sp+24h] [bp-14h]@5 + unsigned int a5a; // [sp+24h] [bp-14h]@11 + unsigned int a4; // [sp+28h] [bp-10h]@1 + int uNumXTiles; // [sp+2Ch] [bp-Ch]@3 + unsigned int uNumXTilesa; // [sp+2Ch] [bp-Ch]@6 + unsigned int uNumXTilesb; // [sp+2Ch] [bp-Ch]@11 + unsigned int a2a; // [sp+30h] [bp-8h]@1 + unsigned int v21; // [sp+34h] [bp-4h]@5 + unsigned int v22; // [sp+34h] [bp-4h]@11 + + v4 = uY; + a2a = uX; + a4 = uX + uWidth; + pRenderer->Clip(uX, v4, uX + uWidth, v4 + uHeight); + v5 = (Texture *)(uTextureID_Parchment != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Parchment] : 0); + uTileWidth = (uTextureID_Parchment != -1 ? pIcons_LOD->pTextures[uTextureID_Parchment].uTextureWidth : 24); + v13 = (uTextureID_Parchment != -1 ? pIcons_LOD->pTextures[uTextureID_Parchment].uTextureWidth : 24); + uTileHeight = (uTextureID_Parchment != -1 ? pIcons_LOD->pTextures[uTextureID_Parchment].uTextureHeight : 26); + if ( (uTextureID_Parchment != -1 ? pIcons_LOD->pTextures[uTextureID_Parchment].uTextureWidth : 24) + && (uTextureID_Parchment != -1 ? pIcons_LOD->pTextures[uTextureID_Parchment].uTextureHeight : 26) ) + { + uNumXTiles = (signed int)uWidth / uTileWidth; + if ( (signed int)uWidth % uTileWidth ) + ++uNumXTiles; + a5 = 0; + v21 = v4; + v7 = uNumXTiles + 1; + v10 = uNumXTiles + 1; + do + { + uNumXTilesa = a2a - v13; + if ( v7 > 0 ) + { + v12 = v7; + do + { + uNumXTilesa += v13; + pRenderer->DrawTextureIndexed(uNumXTilesa, v21, v5); + --v12; + } + while ( v12 ); + v7 = v10; + } + v21 += uTileHeight; + v8 = a5++; + } + while ( v8 < (signed int)uHeight / uTileHeight ); + a5a = v4 + uHeight - 32; + pRenderer->DrawTextureTransparent( + a2a, + v4, + (Texture *)(uTextureID_5076AC != -1 ? &pIcons_LOD->pTextures[uTextureID_5076AC] : 0)); + pRenderer->DrawTextureTransparent( + a2a, + a5a, + (Texture *)(uTextureID_5076B4 != -1 ? &pIcons_LOD->pTextures[uTextureID_5076B4] : 0)); + pRenderer->DrawTextureTransparent( + a4 - 32, + v4, + (Texture *)(uTextureID_5076A8 != -1 ? &pIcons_LOD->pTextures[uTextureID_5076A8] : 0)); + pRenderer->DrawTextureTransparent( + a4 - 32, + a5a, + (Texture *)(uTextureID_5076B0 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_5076B0] : 0)); + uNumXTilesb = a2a + 32; + v22 = v4 + uHeight - 10; + if ( (signed int)uWidth > 64 ) + { + pRenderer->Clip(a2a + 32, v4, a4 - 32, v4 + uHeight); + pRenderer->DrawTextureTransparent( + uNumXTilesb, + v4, + (Texture *)(uTextureID_507698 != -1 ? &pIcons_LOD->pTextures[uTextureID_507698] : 0)); + pRenderer->DrawTextureTransparent( + uNumXTilesb, + v22, + (Texture *)(uTextureID_5076A4 != -1 ? &pIcons_LOD->pTextures[uTextureID_5076A4] : 0)); + if ( (signed int)uWidth > 512 ) + { + pRenderer->DrawTextureTransparent( + a2a + 544, + v4, + (Texture *)(uTextureID_507698 != -1 ? &pIcons_LOD->pTextures[uTextureID_507698] : 0)); + pRenderer->DrawTextureTransparent( + a2a + 544, + v22, + (Texture *)(uTextureID_5076A4 != -1 ? &pIcons_LOD->pTextures[uTextureID_5076A4] : 0)); + } + } + v9 = v4 + 32; + if ( (signed int)uHeight > 64 ) + { + pRenderer->Clip(a2a, v9, a4, a5a); + pRenderer->DrawTextureTransparent( + a2a, + v9, + (Texture *)(uTextureID_5076A0 != -1 ? &pIcons_LOD->pTextures[uTextureID_5076A0] : 0)); + pRenderer->DrawTextureTransparent( + a4 - 10, + v9, + (Texture *)(uTextureID_50769C != -1 ? &pIcons_LOD->pTextures[uTextureID_50769C] : 0)); + } + pRenderer->ResetClip(); + } + } + + + +//----- (0041D895) -------------------------------------------------------- +void GameUI_DrawItemInfo( struct ItemGen* inspect_item ) + { + ItemGen *v1; // esi@1 + unsigned int v2; // eax@3 + //char *v3; // edi@5 + //unsigned int v4; // eax@5 + //unsigned int v5; // esi@5 + signed int v6; // eax@5 + int v7; // edx@5 + //unsigned int v9; // eax@12 + char v10; // zf@16 + ItemGen *v11; // eax@16 + ItemGen *v12; // eax@25 + //unsigned int v13; // ecx@32 + //unsigned int v14; // eax@32 + //Render *v15; // edi@33 + const char *v16; // eax@34 + int v17; // eax@36 + int v18; // esi@37 + unsigned __int16 v19; // ax@37 + //char v20; // al@40 + char v21; // al@44 + //char v22; // al@48 + //char v23; // al@51 + int v24; // eax@52 + int v25; // eax@57 + int v26; // eax@60 + int v27; // eax@67 + const char *v28; // edi@69 + int v29; // eax@70 + char v30; // edi@78 + const char *v31; // eax@78 + int v32; // ecx@81 + unsigned int v33; // eax@81 + int v34; // esi@81 + const char *v35; // eax@85 + const char *v36; // eax@87 + unsigned int v37; // eax@109 + unsigned int v38; // eax@109 + int v39; // eax@113 + GUIFont *v40; // edx@113 + signed int v41; // [sp-20h] [bp-298h]@113 + int v42; // [sp-1Ch] [bp-294h]@113 + //char *v43; // [sp-18h] [bp-290h]@46 + unsigned int v44; // [sp-18h] [bp-290h]@113 + //int v45; // [sp-14h] [bp-28Ch]@46 + const char *v46; // [sp-14h] [bp-28Ch]@58 + char *v47; // [sp-14h] [bp-28Ch]@110 + //char *v48; // [sp-10h] [bp-288h]@46 + const char *v49; // [sp-10h] [bp-288h]@56 + char *v50; // [sp-10h] [bp-288h]@58 + int v51; // [sp-10h] [bp-288h]@110 + const char *v52; // [sp-Ch] [bp-284h]@36 + //int v53; // [sp-Ch] [bp-284h]@46 + char *v54; // [sp-Ch] [bp-284h]@56 + int v55; // [sp-Ch] [bp-284h]@58 + int v56; // [sp-Ch] [bp-284h]@110 + unsigned int v57; // [sp-8h] [bp-280h]@36 + //int v58; // [sp-8h] [bp-280h]@46 + int v59; // [sp-8h] [bp-280h]@56 + int v60; // [sp-8h] [bp-280h]@58 + unsigned int v61; // [sp-8h] [bp-280h]@110 + char out_text[300]; // [sp+8h] [bp-270h]@40 + //char Dest[100]; // [sp+6Ch] [bp-20Ch]@40 + //char v64[100]; // [sp+D0h] [bp-1A8h]@40 + char v65[120]; // [sp+134h] [bp-144h]@92 + char Source[40]; // [sp+1ACh] [bp-CCh]@49 + stru351_summoned_item v67; + //int v67; // [sp+1D4h] [bp-A4h]@91 + //int v68; // [sp+1D8h] [bp-A0h]@106 + //int v69; // [sp+1DCh] [bp-9Ch]@101 + //int v70; // [sp+1E0h] [bp-98h]@97 + //int v71; // [sp+1E8h] [bp-90h]@93 + //int v72; // [sp+1ECh] [bp-8Ch]@91 + int var88; // [sp+1F0h] [bp-88h]@1 + Texture *v73; // [sp+1F4h] [bp-84h]@5 + //unsigned int v75; // [sp+1F8h] [bp-80h]@5 + //char *v76; // [sp+1FCh] [bp-7Ch]@5 + int v77; // [sp+200h] [bp-78h]@12 + int v78; // [sp+204h] [bp-74h]@5 + GUIWindow wHintWindow; // [sp+208h] [bp-70h]@2 + POINT a2; // [sp+25Ch] [bp-1Ch]@2 + int v81; // [sp+264h] [bp-14h]@5 + // GUIFont *pFontComic; // [sp+268h] [bp-10h]@1 + PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18 + char* v84; + int v85; + char *Str; // [sp+270h] [bp-8h]@65 + + v1 = inspect_item; + var88 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); + if (!inspect_item->uItemID) + return; + + wHintWindow.Hint = 0; + wHintWindow.uFrameWidth = 384; + wHintWindow.uFrameHeight = 180; + wHintWindow.uFrameY = 40; + if ( pMouse->GetCursorPos(&a2)->x <= 320 ) + v2 = pMouse->GetCursorPos(&a2)->x + 30; + else + v2 = pMouse->GetCursorPos(&a2)->x - wHintWindow.uFrameWidth - 30; + wHintWindow.uFrameX = v2; + auto item_desc = &pItemsTable->pItems[inspect_item->uItemID]; + //v3 = (char *)&pItemsTable->pItems[_this->uItemID].pIconName; + //v76 = v3; + //v4 = pIcons_LOD->LoadTexture(pItemsTable->pItems[_this->uItemID].pIconName, TEXTURE_16BIT_PALETTE); + //v5 = v4; + //v4 *= 72; + //v75 = v4; + //v73 = &pIcons_LOD->pTextures[v4]; + v73 = pIcons_LOD->LoadTexturePtr(item_desc->pIconName, TEXTURE_16BIT_PALETTE); + v6 = 100 - v73->uTextureWidth; + v7 = v73->uTextureHeight; + v78 = v6; + v81 = 144 - v7; + if ( v6 > 0 ) + v78 = v6 >> 1; + if ( v81 <= 0 ) + v81 = 0; + else + v81 >>= 1; + if ( !item_desc->uItemID_Rep_St ) + inspect_item->SetIdentified(); + //v9 = v8->uAttributes; + v77 = 0; + //a2.y = v8->uAttributes & 2; + if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_GOLD) + v77 = inspect_item->uSpecEnchantmentType; + if ( uActiveCharacter ) + { + //try to identify + if (!inspect_item->Identified()) + { + + v11 = inspect_item; + if ( pPlayers[uActiveCharacter]->CanIdentify(inspect_item) == 1 ) + inspect_item->SetIdentified(); + v83 = SPEECH_9; + if ( !inspect_item->Identified() ) + { + ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u);//"Identify Failed" + } + else + { + v83 = SPEECH_8; + if ( inspect_item->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) ) + v83 = SPEECH_7; + } + if ( dword_4E455C ) + { + pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); + dword_4E455C = 0; + } + } + inspect_item->UpdateTempBonus(pParty->uTimePlayed); + if (inspect_item->Broken()) + { + if ( pPlayers[uActiveCharacter]->CanRepair(inspect_item) == 1 ) + inspect_item->uAttributes = inspect_item->uAttributes & 0xFFFFFFFD | 1; + v83 = SPEECH_11; + if ( !inspect_item->Broken() ) + v83 = SPEECH_10; + else + ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u);//"Repair Failed" + if ( dword_4E455C ) + { + pPlayers[uActiveCharacter]->PlaySound(v83, 0); + dword_4E455C = 0; + } + } + } + //v13 = _this->uAttributes; + //v14 = _this->Identified(); + //a2.y = inspect_item->Identified(); + if (inspect_item->Broken()) + { + wHintWindow.DrawMessageBox(0); + //v15 = &; + pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, + wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, + wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); + wHintWindow.uFrameWidth -= 24; + wHintWindow.uFrameHeight -= 12; + wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; + wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; + pRenderer->DrawTransparentRedShade(wHintWindow.uFrameX + v78, v81 + wHintWindow.uFrameY + 30, v73); + if ( inspect_item->Identified()) + v16 = inspect_item->GetIdentifiedName(); + else + v16 = item_desc->pUnidentifiedName; + wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v16, 3u); + v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &wHintWindow, 0, 0); //"Broken Item" + v18 = v17 >> 1; + v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); + wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item" + pRenderer->ResetClip(); + if ( !areWeLoadingTexture ) + { + v73->Release(); + pIcons_LOD->_40F9C5(); + } + return; + } + if (!inspect_item->Identified()) + { + wHintWindow.DrawMessageBox(0); + pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, + wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, + wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); + wHintWindow.uFrameWidth -= 24; + wHintWindow.uFrameHeight -= 12; + wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; + wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; + pRenderer->DrawTextureTransparent(wHintWindow.uFrameX + v78, v81 + wHintWindow.uFrameY + 30, v73); + wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, item_desc->pUnidentifiedName, 3u); + v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &wHintWindow, 0, 0); ///"Not Identified" + v18 = v17 >> 1; + v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); + wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[232], 3); + pRenderer->ResetClip(); + if ( !areWeLoadingTexture ) + { + v73->Release(); + pIcons_LOD->_40F9C5(); + } + return; + } + + sprintfex(out_text, pGlobalTXT_LocalizationStrings[463], item_desc->pUnidentifiedName); //"Type: %s" + out_text[100] = 0; + out_text[200] = 0; + //v20 = item_desc->uEquipType; + switch (item_desc->uEquipType) + { + case EQUIP_ONE_OR_TWO_HANDS: + case EQUIP_TWO_HANDED: + sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[LOCSTR_ATTACK], + (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); //"Damage" + if (item_desc->uDamageMod) + { + char mod[16]; + sprintf(mod, "+%d", (int)item_desc->uDamageMod); + strcat(out_text + 100, mod); + } + break; + + case EQUIP_BOW: + sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], //"Shoot" + (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], //"Damage" + (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); + if (item_desc->uDamageMod) + { + char mod[16]; + sprintf(mod, "+%d", (int)item_desc->uDamageMod); + strcat(out_text + 100, mod); + } + break; + + case EQUIP_ARMOUR: + case EQUIP_SHIELD: + case EQUIP_HELMET: + case EQUIP_BELT: + case EQUIP_CLOAK: + case EQUIP_GAUNTLETS: + case EQUIP_BOOTS: + case EQUIP_RING: + case EQUIP_AMULET: + if (item_desc->uDamageDice) //"Armor" + sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod); + break; + + } + + if ( !v77 ) + { + if (item_desc->uEquipType ==EQUIP_POTION) //this is CORRECT! do not move to switch! + { + if ( inspect_item->uEnchantmentType ) + sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power" + } + else if (item_desc->uEquipType == EQUIP_REAGENT) + { + sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power" + } + + else if ( inspect_item->uEnchantmentType ) + { + sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], + pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->_bonus_strength); //"Special" + } + else if ( inspect_item->uSpecEnchantmentType ) + { + sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], + pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement, inspect_item->_bonus_strength); + } + + else if ( inspect_item->uNumCharges ) + { + sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges" + + } + } + wHintWindow.uFrameWidth -= 12; + v85 = 3; + wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; + wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; + Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8)); + v84 = &out_text[0]; + do + { + if ( *v84 ) + { + v27 = pFontComic->CalcTextHeight(v84, &wHintWindow, 100, 0); + Str += v27 + 3; + } + v84 += 100; + --v85; + } + while ( v85 ); + v28 = item_desc->pDescription; + if ( *v28 ) + { + v29 = pFontSmallnum->CalcTextHeight(v28, &wHintWindow, 100, 0); + Str += v29; + } + wHintWindow.uFrameHeight = v73->uTextureHeight + v81 + 54; + if ( (signed int)Str > (signed int)wHintWindow.uFrameHeight ) + wHintWindow.uFrameHeight = (unsigned int)Str; + if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) + wHintWindow.uFrameHeight += LOBYTE(pFontComic->uFontHeight); + v85 = 0; + if ( pFontArrus->uFontHeight ) + { + wHintWindow.uFrameWidth -= 24; + v30 = pFontArrus->uFontHeight; + v31 = inspect_item->GetIdentifiedName(); + if ( pFontArrus->CalcTextHeight(v31, &wHintWindow, 0, 0) / (signed int)v30 ) + v85 = v30; + wHintWindow.uFrameWidth += 24; + } + wHintWindow.uFrameWidth += 12; + wHintWindow.uFrameHeight += (unsigned int)v85; + wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; + wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; + wHintWindow.DrawMessageBox(0); + //v15 = pRenderer; + pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, + wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); + wHintWindow.uFrameWidth -= 12; + v32 = v73->uTextureHeight; + v33 = wHintWindow.uFrameHeight; + wHintWindow.uFrameHeight -= 12; + wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; + wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; + pRenderer->DrawTextureTransparent( + wHintWindow.uFrameX + v78, + wHintWindow.uFrameY + (signed int)(v33 - v32) / 2, + v73); + + v34 = (int)(v85 + 35); + v85 = 3; + Str = out_text; + do + { + if ( *Str ) + { + wHintWindow.DrawText(pFontComic, 100, v34, 0, Str, 0, 0, 0); + v34 += pFontComic->CalcTextHeight(Str, &wHintWindow, 100, 0) + 3; + } + Str += 100; + --v85; + } + while (v85 ); + v35 = item_desc->pDescription; + if ( *v35 ) + wHintWindow.DrawText(pFontSmallnum, 100, v34, 0, v35, 0, 0, 0); + wHintWindow.uFrameX += 12; + wHintWindow.uFrameWidth -= 24; + v36 = inspect_item->GetIdentifiedName(); + wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v36, 3u); + wHintWindow.uFrameWidth += 24; + wHintWindow.uFrameX -= 12; + if ( v77 ) + { + sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value" + v40 = pFontComic; + v61 = 0; + v56 = 0; + v51 = 0; + v47 = pTmpBuf; + v44 = 0; + v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight); + v41 = 100; + } + else + { + if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) + { + sub_493F79(&v67, inspect_item->uExpireTime - pParty->uTimePlayed); + strcpy(pTmpBuf, "Duration:"); + Str = (char *)(v67.field_18_expire_year - game_starting_year); + if (v67.field_18_expire_year != 1168 ) + { + sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year); + strcat(pTmpBuf, v65); + } + if ( (((v67.field_14_exprie_month || Str) && + ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str) + || v67.field_C_expire_day) + && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || + v67.field_C_expire_day) + || v67.field_8_expire_hour) + && ((sprintf(v65, " %d:hr", v67.field_8_expire_hour), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || + v67.field_C_expire_day || v67.field_8_expire_hour) + || v67.field_4_expire_minute ) + { + sprintf(v65, " %d:mn", v67.field_4_expire_minute); + strcat(pTmpBuf, v65); + } + wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf, 0, 0, 0); + } + v37 = inspect_item->GetValue(); + sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37); + wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf, 0, 0, 0); + v38 = inspect_item->uAttributes; + if ( BYTE1(v38) & 1 ) + { + v61 = 0; + v56 = 0; + v51 = 0; + v47 = pGlobalTXT_LocalizationStrings[187]; //"Stolen" + } + else + { + if ( !(BYTE1(v38) & 2) ) + { + pRenderer->ResetClip(); + if ( !areWeLoadingTexture ) + { + v73->Release(); + pIcons_LOD->_40F9C5(); + } + return; + } + v61 = 0; + v56 = 0; + v51 = 0; + v47 = pGlobalTXT_LocalizationStrings[651]; //"Hardened" + } + LOWORD(v38) = LOWORD(pRenderer->uTargetRMask); + v44 = v38; + v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight); + v39 = pFontComic->GetLineWidth(pTmpBuf); + v40 = pFontComic; + v41 = v39 + 132; + } + wHintWindow.DrawText(v40, v41, v42, v44, v47, v51, v56, v61); + pRenderer->ResetClip(); + if ( !areWeLoadingTexture ) + { + v73->Release(); + pIcons_LOD->_40F9C5(); + } + return; + } +// 4E455C: using guessed type int dword_4E455C; +// 506128: using guessed type int areWeLoadingTexture; + + + +//----- (0041E360) -------------------------------------------------------- +char *__fastcall MonsterPopup_Draw(unsigned int uActorID, GUIWindow *edx0) +{ + unsigned int v2; // esi@1 + Actor *v3; // esi@3 + int v4; // eax@3 + unsigned int v5; // ecx@3 + NPCData *v6; // eax@3 + unsigned __int16 v7; // cx@3 + int v8; // eax@4 + unsigned __int16 v9; // dx@4 + SpriteFrame *v10; // edi@17 + LODSprite *v11; // esi@17 + unsigned int v12; // ecx@17 + Sprite *v13; // edi@18 + int v14; // ecx@18 + int v15; // edx@18 + int v16; // edx@18 + int v17; // eax@18 + unsigned int v18; // ecx@19 + unsigned int v19; // eax@21 + char *v20; // esi@28 + int v21; // edx@29 + unsigned __int16 *v22; // ecx@29 + int v23; // eax@29 + int v24; // eax@32 + int v25; // esi@32 + char *v26; // edx@34 + unsigned __int8 v27; // sf@36 + unsigned __int8 v28; // of@36 + int v29; // esi@40 + char *v30; // ecx@40 + int v31; // eax@40 + int v32; // esi@43 + unsigned __int16 v33; // ax@45 + int v34; // edx@45 + int v35; // eax@45 + int v36; // eax@49 + char *v37; // eax@52 + int v38; // eax@55 + unsigned __int16 v39; // ax@59 + SpellBuff *v40; // eax@60 + int v41; // edi@61 + unsigned int v42; // eax@61 + int v43; // eax@62 + int v44; // eax@63 + signed int v45; // edi@65 + unsigned __int16 v46; // ax@73 + Player *v47; // ecx@77 + unsigned int v48; // eax@85 + GUIFont *v49; // edi@90 + int v50; // edi@90 + SpellBuff *v51; // eax@91 + char *v52; // ecx@98 + char *v53; // ecx@101 + char *v54; // ST0C_4@118 + unsigned int v55; // eax@118 + GUIFont *v56; // edi@124 + unsigned __int8 v57; // al@128 + int v58; // eax@132 + Actor *v59; // ecx@133 + unsigned __int8 v60; // dl@138 + char *v62; // eax@147 + int v63; // eax@152 + char *result; // eax@152 + int v65; // eax@155 + const char *v66; // [sp-10h] [bp-1FCh]@121 + const char *v67; // [sp-10h] [bp-1FCh]@125 + const char *v68; // [sp-10h] [bp-1FCh]@142 + int v69; // [sp-Ch] [bp-1F8h]@121 + char *v70; // [sp-Ch] [bp-1F8h]@125 + char *v71; // [sp-Ch] [bp-1F8h]@142 + char *v72; // [sp-8h] [bp-1F4h]@54 + int v73; // [sp-8h] [bp-1F4h]@79 + int v74; // [sp-8h] [bp-1F4h]@121 + int v75; // [sp-8h] [bp-1F4h]@125 + int v76; // [sp-8h] [bp-1F4h]@142 + size_t v77; // [sp-4h] [bp-1F0h]@54 + unsigned int v78; // [sp-4h] [bp-1F0h]@121 + unsigned int v79; // [sp-4h] [bp-1F0h]@125 + char *v80; // [sp-4h] [bp-1F0h]@142 + char *v81; // [sp-4h] [bp-1F0h]@148 + DDBLTFX Dst; // [sp+Ch] [bp-1E0h]@18 + DDSURFACEDESC2 pDesc; // [sp+70h] [bp-17Ch]@18 + RECT v84; // [sp+ECh] [bp-100h]@26 + char *v85[10]; // [sp+FCh] [bp-F0h]@145 + char *v95[11]; // [sp+124h] [bp-C8h]@127 + RenderBillboardTransform_local0 v106; // [sp+150h] [bp-9Ch]@3 + unsigned int v107; // [sp+1A0h] [bp-4Ch]@18 + unsigned __int16 *v108; // [sp+1A4h] [bp-48h]@34 + unsigned int v109; // [sp+1A8h] [bp-44h]@32 + LPVOID v110; // [sp+1ACh] [bp-40h]@28 + unsigned int v111; // [sp+1B0h] [bp-3Ch]@29 + char **v112; // [sp+1B4h] [bp-38h]@3 + IDirectDrawSurface *v222; // [sp+1B8h] [bp-34h]@18 + unsigned __int8 v114; // [sp+1BFh] [bp-2Dh]@133 + int v115; // [sp+1C0h] [bp-2Ch]@3 + unsigned int v116; // [sp+1C4h] [bp-28h]@18 + int i; // [sp+1C8h] [bp-24h]@18 + Player *a2; // [sp+1CCh] [bp-20h]@28 + int v119; // [sp+1D0h] [bp-1Ch]@18 + SpellBuff *v120; // [sp+1D4h] [bp-18h]@18 + Actor *v121; // [sp+1D8h] [bp-14h]@3 + int a5; // [sp+1DCh] [bp-10h]@3 + GUIWindow *a1; // [sp+1E0h] [bp-Ch]@1 + int v124; // [sp+1E4h] [bp-8h]@18 + char *a4; // [sp+1E8h] [bp-4h]@18 + + a1 = edx0; + v2 = uActorID; + + static Actor pMonsterInfoUI_Doll; + /*if ( !(bMonsterInfoUI_bDollInitialized & 1) ) + { + bMonsterInfoUI_bDollInitialized |= 1u; + Actor::Actor(&pMonsterInfoUI_Doll); + atexit(nullsub_3); + }*/ + v106.uParentBillboardID = -1; + v3 = &pActors[v2]; + v121 = v3; + v4 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xFFu, 0x9Bu); + v5 = v3->sNPC_ID; + a5 = v4; + v6 = GetNPCData(v5); + v7 = v3->pMonsterInfo.uID; + v112 = (char **)v6; + v115 = byte_4E2B70[((signed __int16)v7 - 1) / 3] - 40; + if ( v7 == pMonsterInfoUI_Doll.pMonsterInfo.uID ) + { + v9 = pMonsterInfoUI_Doll.uCurrentActionLength; + } + else + { + memcpy(&pMonsterInfoUI_Doll, v3, sizeof(pMonsterInfoUI_Doll)); + pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; + pMonsterInfoUI_Doll.uCurrentActionTime = 0; + v8 = rand(); + v3 = v121; + v9 = v8 % 256 + 128; + pMonsterInfoUI_Doll.uCurrentActionLength = v8 % 256 + 128; + } + if ( (signed int)pMonsterInfoUI_Doll.uCurrentActionTime > (signed __int16)v9 ) + { + pMonsterInfoUI_Doll.uCurrentActionTime = 0; + if ( pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_Bored || pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_AtkMelee) + { + pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Standing; + pMonsterInfoUI_Doll.uCurrentActionLength = rand() % 128 + 128; + } + else + { + rand(); + pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; + if ( (pMonsterInfoUI_Doll.pMonsterInfo.uID < 115 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 186) + && (pMonsterInfoUI_Doll.pMonsterInfo.uID < 232 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 249) + && rand() % 30 < 100 ) + pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_AtkMelee; + pMonsterInfoUI_Doll.uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength; + } + } + v10 = pSpriteFrameTable->GetFrame( v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation], pMonsterInfoUI_Doll.uCurrentActionTime); + v11 = &pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]];//40 * v10->pHwSpriteIDs[0] + 7218180; + v106.pTarget = pRenderer->pTargetSurface; + v106.pTargetZ = pRenderer->pActiveZBuffer; + v106.uTargetPitch = pRenderer->uTargetSurfacePitch; + v12 = a1->uFrameY + 52; + v106.uViewportX = a1->uFrameX + 13; + v106.uViewportY = v12; + v106.uViewportW = v12 + 128; + v106.uViewportZ = v106.uViewportX + 128; + v106.uScreenSpaceX = (signed int)(v106.uViewportX + 128 + v106.uViewportX) / 2; + v106._screenspace_x_scaler_packedfloat = 65536; + v106._screenspace_y_scaler_packedfloat = 65536; + v106.uScreenSpaceY = v115 + v12 + v11->uHeight; + v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1); + v106.sZValue = 0; + v106.uFlags = 0; + pRenderer->Clip_v2(0, 0, 0x27Fu, 0x1DFu); + pRenderer->Line2D(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, a5); + pRenderer->Line2D( v106.uViewportX + 129, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportW + 1, a5); + pRenderer->Line2D(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, a5); + pRenderer->Line2D(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, a5); + if ( pRenderer->pRenderD3D ) + { + v13 = &pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]]; + v106.uScreenSpaceY = v115 + v106.uViewportY + v13->uBufferHeight; + v222 = (IDirectDrawSurface *)v13->pTextureSurface; + memset(&Dst, 0, 0x64u); + Dst.dwSize = 100; + Dst.dwFillColor = 0; + memset(&pDesc, 0, 0x7Cu); + pDesc.dwSize = 124; + v222->GetSurfaceDesc((LPDDSURFACEDESC)&pDesc); + v14 = v13->uBufferHeight; + v120 = (SpellBuff *)v13->uBufferWidth; + v107 = 0; + v15 = v13->uAreaX; + v119 = (signed int)v120 / 2; + i = 0; + a4 = (char *)(v106.uScreenSpaceX + v15 - (signed int)v120 / 2); + v115 = v13->uAreaY; + v16 = v13->uAreaWidth + (signed int)v120 / 2 + v15 - (int)v120; + v124 = v106.uScreenSpaceY + v115 - v14; + v17 = v13->uAreaHeight + v115 - v14; + v116 = v106.uScreenSpaceX + v16; + v119 = v106.uScreenSpaceY + v17; + if ( (signed int)a4 < (signed int)v106.uViewportX ) + { + v18 = v106.uViewportX - (int)a4; + a4 = (char *)v106.uViewportX; + v107 = v18; + } + if ( v124 < (signed int)v106.uViewportY ) + { + v19 = v106.uViewportY - v124; + v124 = v106.uViewportY; + i = v19; + } + if ( (signed int)v116 > (signed int)v106.uViewportZ ) + v116 = v106.uViewportZ; + if ( v119 > (signed int)v106.uViewportW ) + v119 = v106.uViewportW; + pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, + pRenderer->uTargetBMask | pRenderer->uTargetGMask); + pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, + pRenderer->uTargetBMask | pRenderer->uTargetGMask); + v84.left = v106.uViewportX; + v84.top = v106.uViewportY; + v84.right = v106.uViewportZ; + v84.bottom = v106.uViewportW; + ErrD3D(pRenderer->pBackBuffer4->Blt(&v84, 0, 0, 16778240u, &Dst)); + if ( pRenderer->uTargetGBits == 5 ) + { + memset(&pDesc, 0, 0x7Cu); + pDesc.dwSize = 124; + if ( pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)v222, &pDesc, DDLOCK_WAIT)) + { + v20 = (char *)v124; + v110 = pDesc.lpSurface; + a2 = (Player *)v124; + if ( v124 < v119 ) + { + v111 = 2 * pRenderer->uTargetSurfacePitch; + v21 = (int)a4; + v22 = &pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; + v23 = i - v124; + v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; + v115 = i - v124; + while ( 1 ) + { + v124 = v21; + if ( v21 < (signed int)v116 ) + { + v24 = (int)&v20[v23]; + v25 = v107 - v21; + v109 = v24; + for ( i = v107 - v21; ; v25 = i ) + { + v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / v13->uAreaHeight); + v26 = (char *)v108 + pDesc.dwWidth * (v25 + v124++) / v13->uAreaWidth; + *v22 = *((short *)v110 + (int)v26); + ++v22; + if ( v124 >= (signed int)v116 ) + break; + } + v23 = v115; + } + v22 = (unsigned __int16 *)((char *)v120 + v111); + v20 = (char *)&a2->pConditions[0] + 1; + v28 = __OFSUB__((int)&a2->pConditions[0] + 1, v119); + v27 = (signed int)((char *)&a2->pConditions[0] + -v119 + 1) < 0; + a2 = (Player *)((char *)a2 + 1); + v120 = (SpellBuff *)((char *)v120 + v111); + if ( !(v27 ^ v28) ) + break; + v21 = (int)a4; + } + } + v222->Unlock(0); + } + } + else + { + memset(&pDesc, 0, 0x7Cu); + pDesc.dwSize = 124; + if ( pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)v222, &pDesc, DDLOCK_WAIT) ) + { + v108 = (unsigned __int16 *)pDesc.lpSurface; + a2 = (Player *)v124; + if ( v124 < v119 ) + { + v109 = 2 * pRenderer->uTargetSurfacePitch; + v29 = (int)a4; + v30 = (char *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; + v31 = i - v124; + v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; + v115 = i - v124; + while ( 1 ) + { + v124 = v29; + if ( v29 < (signed int)v116 ) + { + v32 = v107 - (int)a4; + v111 = (unsigned int)((char *)a2 + v31); + for ( i = v107 - (int)a4; ; v32 = i ) + { + v110 = (LPVOID)((pDesc.lPitch >> 1) * pDesc.dwHeight * v111 / v13->uAreaHeight); + v33 = v108[(int)((char *)v110 + pDesc.dwWidth * (v32 + v124) / v13->uAreaWidth)]; + v34 = v33 & 0x1F | 2 * (unsigned __int16)(v108[(int)((char *)v110 + pDesc.dwWidth * (v32 + v124++) / v13->uAreaWidth)] & 0xFFE0); + v35 = v124; + *(short *)v30 = v34; + v30 += 2; + if ( v35 >= (signed int)v116 ) + break; + } + v31 = v115; + } + a2 = (Player *)((char *)a2 + 1); + v30 = (char *)v120 + v109; + v120 = (SpellBuff *)((char *)v120 + v109); + if ( (signed int)a2 >= v119 ) + break; + v29 = (int)a4; + } + } + v222->Unlock(0); + } + } + } + else + { + pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0); + v36 = v10->pHwSpriteIDs[0]; + if ( v36 >= 0 ) + pSprites_LOD->pSpriteHeaders[v36]._4ACC38(&v106, 0); + } + if ( v121->sNPC_ID ) + { + v37 = v112[6]; + if ( v37 ) + { + sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], *v112, aNPCProfessionNames[(signed int)v37]); + } + else + { + v77 = 2000; + v72 = *v112; + } + } + else + { + v38 = v121->dword_000334_unique_name; + v77 = 2000; + if ( v38 ) + v72 = pMonsterStats->pPlaceStrings[v38]; + else + v72 = pMonsterStats->pInfos[v121->pMonsterInfo.uID].pName; + } + if(!v121->sNPC_ID || (v121->sNPC_ID && !v37)) + strncpy(pTmpBuf, v72, v77); + v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); + a1->DrawTitleText(pFontComic, 0, 0xCu, v39, pTmpBuf, 3u); + Actor::DrawHealthBar(v121, a1); + v119 = 0; + pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed; + v115 = 0; + v116 = 0; + i = 0; + v112 = 0; + if ( !uActiveCharacter ) + { + v45 = 1; + } + else + { + LOBYTE(v40) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); + v120 = v40; + if ( !v40 ) + v45 = 1; + else + { + v41 = (unsigned __int8)v40 & 0x3F; + v42 = SkillToMastery((unsigned __int16)v40) - 1; + if ( !v42 ) + { + if ( v41 + 10 >= v121->pMonsterInfo.uLevel ) + { + v45 = 1; + v119 = 1; + } + else + v45 = 1; + } + else + { + v43 = v42 - 1; + if ( !v43 ) + { + if ( 2 * v41 + 10 >= v121->pMonsterInfo.uLevel ) + { + v45 = 1; + v119 = 1; + v116 = 1; + } + else + v45 = 1; + } + else + { + v44 = v43 - 1; + if ( !v44 ) + { + if ( 3 * v41 + 10 >= v121->pMonsterInfo.uLevel ) + { + v45 = 1; + v119 = 1; + v116 = 1; + i = 1; + } + else + { + v45 = 1; + } + } + else + { + if ( v44 != 1 ) + v45 = 1; + else + { + v45 = 1; + v119 = 1; + v116 = 1; + i = 1; + v112 = (char **)1; + } + } + } + } + } + // LABEL_73: + v46 = v121->uAIState; + if ( v46 != 5 && v46 != 4 && !dword_507BF0_is_there_popup_onscreen && v120 ) + { + v47 = pPlayers[uActiveCharacter]; + if ( v119 | v116 | i | (unsigned int)v112 ) + { + if ( v121->pMonsterInfo.uLevel >= v47->uLevel - 5 ) + v73 = SPEECH_105; + else + v73 = SPEECH_104; + } + else + { + v73 = SPEECH_106; + } + v47->PlaySound((PlayerSpeech)v73, 0); + } + } + a2 = pParty->pPlayers; + do + { + LOBYTE(v48) = a2->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); + v111 = v48; + v120 = (SpellBuff *)138; + do + { + if ( (signed int)SkillToMastery(v111) >= 3 ) + v115 = v45; + v120 = (SpellBuff *)((char *)v120 - 1); + } + while ( v120 ); + ++a2; + } + while ( (signed int)a2 < (signed int)pParty->pHirelings ); + v49 = pFontSmallnum; + a2 = (Player *)pFontSmallnum; + a1->DrawText(pFontSmallnum, 12, 196, a5, pGlobalTXT_LocalizationStrings[631], 0, 0, 0); + v50 = LOBYTE(v49->uFontHeight) + 193; + if ( !v115 ) + { + v78 = 0; + v74 = 0; + v69 = 0; + v66 = pGlobalTXT_LocalizationStrings[630]; + a1->DrawText((GUIFont *)a2, 28, v50, a5, v66, v69, v74, v78); + } + else + { + a4 = 0; + v51 = &v121->pActorBuffs[1]; + v222 = 0; + v120 = &v121->pActorBuffs[1]; + do + { + if ( (signed __int64)v51->uExpireTime > 0 ) + { + switch ( (int)v51 ) + { + case 0u: + v124 = 60; + a4 = pGlobalTXT_LocalizationStrings[591]; + break; + case 1u: + v124 = 82; + a4 = pGlobalTXT_LocalizationStrings[649]; + break; + case 2u: + v124 = 92; + a4 = pGlobalTXT_LocalizationStrings[592]; + break; + case 3u: + v124 = 63; + a4 = pGlobalTXT_LocalizationStrings[4]; + break; + case 4u: + v52 = pGlobalTXT_LocalizationStrings[220]; + a4 = v52; + v124 = 81; + break; + case 5u: + v52 = pGlobalTXT_LocalizationStrings[162]; + a4 = v52; + v124 = 81; + break; + case 6u: + v53 = pGlobalTXT_LocalizationStrings[593]; + v124 = 35; + a4 = v53; + break; + case 8u: + v53 = pGlobalTXT_LocalizationStrings[608]; + v124 = 62; + a4 = v53; + break; + case 7u: + case 9u: + a4 = 0; + v124 = 0; + ++v51; + v222 = (IDirectDrawSurface *)((char *)v222 + 1); + v120 = v51; + __debugbreak(); // fix condition + continue; + case 0xAu: + v124 = 47; + a4 = pGlobalTXT_LocalizationStrings[221]; + break; + case 0xBu: + v124 = 66; + a4 = pGlobalTXT_LocalizationStrings[607]; + break; + case 0xCu: + v124 = 85; + a4 = pGlobalTXT_LocalizationStrings[610]; + break; + case 0xDu: + v124 = 86; + a4 = pGlobalTXT_LocalizationStrings[609]; + break; + case 0xEu: + v124 = 17; + a4 = pGlobalTXT_LocalizationStrings[279]; + break; + case 0xFu: + v124 = 38; + a4 = pGlobalTXT_LocalizationStrings[442]; + break; + case 0x10u: + v124 = 46; + a4 = pGlobalTXT_LocalizationStrings[443]; + break; + case 0x11u: + v124 = 51; + a4 = pGlobalTXT_LocalizationStrings[440]; + break; + case 0x12u: + v124 = 5; + a4 = pGlobalTXT_LocalizationStrings[441]; + break; + case 0x13u: + v124 = 95; + a4 = pGlobalTXT_LocalizationStrings[229]; + break; + case 0x14u: + v124 = 73; + a4 = pGlobalTXT_LocalizationStrings[228]; + break; + default: + a4 = 0; + break; + } + if ( a4 ) + { + v54 = a4; + v55 = GetSpellColor(v124); + a1->DrawText((GUIFont *)a2, 28, v50, v55, v54, 0, 0, 0); + v50 = v50 + BYTE5(a2->pConditions[0]) - 3; + v51 = v120; + } + } + + ++v51; + v222 = (IDirectDrawSurface *)((char *)v222 + 1); + v120 = v51; + + __debugbreak(); // fix condition + } + //while ( (signed int)((char *)&v222->lpVtbl + 1) < 22 ); + while (true); + if ( !a4 ) + { + v78 = 0; + v74 = 0; + v69 = 0; + v66 = pGlobalTXT_LocalizationStrings[153]; + a1->DrawText((GUIFont *)a2, 28, v50, a5, v66, v69, v74, v78); + } + } + v56 = pFontSmallnum; + a4 = (char *)v106.uViewportY; + if ( v119 ) + { + sprintf(pTmpBuf, "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, v121->pMonsterInfo.uHP); + a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); + a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; + v79 = v121->pMonsterInfo.uAC; + v75 = 0; + v70 = pGlobalTXT_LocalizationStrings[12]; + v67 = "%s\f%05u\t100%d\n"; + } + else + { + sprintf(pTmpBuf, "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]); + a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); + v79 = (unsigned int)pGlobalTXT_LocalizationStrings[630]; + v75 = 0; + v70 = pGlobalTXT_LocalizationStrings[12]; + a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; + v67 = "%s\f%05u\t100%s\n"; + } + sprintf(pTmpBuf, v67, v70, v75, v79); + a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); + a4 = &a4[LOBYTE(v56->uFontHeight) - 6] + LOBYTE(v56->uFontHeight); + v95[0] = pGlobalTXT_LocalizationStrings[87]; + v95[1] = pGlobalTXT_LocalizationStrings[6]; + v95[2] = pGlobalTXT_LocalizationStrings[240]; + v95[3] = pGlobalTXT_LocalizationStrings[70]; + v95[4] = pGlobalTXT_LocalizationStrings[624]; + v95[5] = pGlobalTXT_LocalizationStrings[138]; + v95[6] = pGlobalTXT_LocalizationStrings[214]; + v95[7] = pGlobalTXT_LocalizationStrings[142]; + v95[8] = pGlobalTXT_LocalizationStrings[29]; + v95[9] = pGlobalTXT_LocalizationStrings[133]; + v95[10] = pGlobalTXT_LocalizationStrings[54]; + if ( v116 ) + { + sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, v95[v121->pMonsterInfo.uAttack1Type]); + a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); + a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; + v57 = v121->pMonsterInfo.uAttack1DamageBonus; + if ( v57 ) + sprintf(pTmpBuf, "%s\f%05u\t080%dd%d+%d\n", pGlobalTXT_LocalizationStrings[53], + 0, v121->pMonsterInfo.uAttack1DamageDiceRolls, v121->pMonsterInfo.uAttack1DamageDiceSides, v57); + else + sprintf(pTmpBuf, "%s\f%05u\t080%dd%d\n", pGlobalTXT_LocalizationStrings[53], + 0, v121->pMonsterInfo.uAttack1DamageDiceRolls, v121->pMonsterInfo.uAttack1DamageDiceSides); + } + else + { + sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]); + a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); + a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; + sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[53], 0, pGlobalTXT_LocalizationStrings[630]); + } + a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); + v58 = LOBYTE(v56->uFontHeight); + a4 = &a4[v58 - 6] + v58; + if ( !i ) + { + v80 = pGlobalTXT_LocalizationStrings[630]; + v76 = 0; + v71 = pGlobalTXT_LocalizationStrings[628]; + v68 = "%s\f%05u\t080%s\n"; + sprintf(pTmpBuf, v68, v71, v76, v80); + a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); + v58 = LOBYTE(v56->uFontHeight); + a4 = &a4[v58 - 3]; + } + else + { + v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[628]; + v59 = v121; + v114 = v121->pMonsterInfo.uSpell1ID; + if ( v114 && v121->pMonsterInfo.uSpell2ID ) + v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[629]; + if ( v114 ) + { + sprintf(pTmpBuf, "%s\f%05u\t060%s\n", v120, 0, pSpellStats->pInfos[v114].pShortName); + a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); + v58 = LOBYTE(v56->uFontHeight); + a4 = &a4[v58 - 3]; + v59 = v121; + } + v60 = v59->pMonsterInfo.uSpell2ID; + if ( v60 ) + { + sprintf(pTmpBuf, "\f%05u\t060%s\n", 0, pSpellStats->pInfos[v60].pShortName); + a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); + v58 = LOBYTE(v56->uFontHeight); + a4 = &a4[v58 - 3]; + v59 = v121; + } + if ( !v59->pMonsterInfo.uSpell1ID && !v59->pMonsterInfo.uSpell2ID ) + { + v80 = pGlobalTXT_LocalizationStrings[153]; + v76 = 0; + v71 = pGlobalTXT_LocalizationStrings[628]; + v68 = "%s\f%05u\t060%s\n"; + sprintf(pTmpBuf, v68, v71, v76, v80); + a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); + v58 = LOBYTE(v56->uFontHeight); + a4 = &a4[v58 - 3]; + } + } + a4 = &a4[v58 - 3]; + a1->DrawText(v56, 150, (int)a4, a5, pGlobalTXT_LocalizationStrings[626], 0, 0, 0); + a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; + v85[0] = pGlobalTXT_LocalizationStrings[87]; + v85[1] = pGlobalTXT_LocalizationStrings[6]; + v85[2] = pGlobalTXT_LocalizationStrings[240]; + v85[3] = pGlobalTXT_LocalizationStrings[70]; + v85[4] = pGlobalTXT_LocalizationStrings[142]; + v85[5] = pGlobalTXT_LocalizationStrings[214]; + v85[6] = pGlobalTXT_LocalizationStrings[29]; + v85[7] = pGlobalTXT_LocalizationStrings[133]; + v85[8] = pGlobalTXT_LocalizationStrings[54]; + v85[9] = pGlobalTXT_LocalizationStrings[624]; + v95[1] = (char *)v121->pMonsterInfo.uResFire; + v95[2] = (char *)v121->pMonsterInfo.uResAir; + v95[3] = (char *)v121->pMonsterInfo.uResWater; + v95[4] = (char *)v121->pMonsterInfo.uResEarth; + v95[5] = (char *)v121->pMonsterInfo.uResMind; + v95[6] = (char *)v121->pMonsterInfo.uResSpirit; + v95[7] = (char *)v121->pMonsterInfo.uResBody; + v95[8] = (char *)v121->pMonsterInfo.uResLight; + v95[9] = (char *)v121->pMonsterInfo.uResPhysical; + v95[10] = (char *)v121->pMonsterInfo.uResDark; + if ( v112 ) + { + v124 = 0; + do + { + v62 = v95[v124+1]; + if ( v62 == (char *)200 ) + { + v81 = pGlobalTXT_LocalizationStrings[625]; + } + else + { + if ( v62 ) + v81 = pGlobalTXT_LocalizationStrings[627]; + else + v81 = pGlobalTXT_LocalizationStrings[153]; + } + sprintf(pTmpBuf, "%s\f%05u\t070%s\n", v85[v124], 0, v81); + a1->DrawText(v56, 170, (int)a4, a5, pTmpBuf, 0, 0, 0); + v63 = LOBYTE(v56->uFontHeight); + v124 += 4; + result = &a4[v63 - 3]; + a4 = result; + } + while ( v124 < 40 ); + } + else + { + i = 0; + do + { + sprintf(pTmpBuf, "%s\f%05u\t070%s\n", v85[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?" + a1->DrawText(v56, 170, (int)a4, a5, pTmpBuf, 0, 0, 0); + v65 = LOBYTE(v56->uFontHeight); + ++i; + result = &a4[v65 - 3]; + a4 = result; + } + while ( i < 10 ); + } + if ( (signed __int64)pParty->pPartyBuffs[3].uExpireTime > 0 ) + { + sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[650], v121->sCurrentHP); + pFontSmallnum->GetLineWidth(pTmpBuf); + result = a1->DrawTitleText(pFontSmallnum, 0, a1->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf, 3); + } + return result; +} + + +//----- (00417BB5) -------------------------------------------------------- +const char *__fastcall CharacterUI_GetSkillDescText(unsigned int uPlayerID, enum PLAYER_SKILL_TYPE uPlayerSkillType) + { + //enum PLAYER_SKILL_TYPE v2; // esi@1 + //unsigned int v3; // ebx@1 + int v4; // edi@1 + int v5; // eax@1 + Player *pPlayer; // ebx@7 + char v7; // al@7 + char v8; // cl@7 + unsigned int v9; // eax@8 + unsigned int v10; // eax@8 + unsigned int v11; // eax@8 + enum PLAYER_SKILL_TYPE v12; // edi@8 + unsigned int v13; // eax@8 + unsigned int v14; // eax@8 + enum PLAYER_SKILL_TYPE v15; // esi@8 + int v16; // edi@8 + char v17; // al@8 + int v18; // ST5C_4@8 + int v19; // ST4C_4@8 + int v20; // ST3C_4@8 + int v21; // ST2C_4@8 + int v22; // ST1C_4@8 + char *v23; // esi@8 + unsigned int v24; // eax@9 + unsigned int v25; // eax@9 + unsigned int v26; // eax@9 + unsigned int v27; // ecx@9 + enum PLAYER_SKILL_TYPE v28; // ebx@9 + unsigned int v29; // eax@9 + char a2[1200]; // [sp+Ch] [bp-538h]@7 + char Source[120]; // [sp+4BCh] [bp-88h]@7 + unsigned __int16 *v33; // [sp+534h] [bp-10h]@1 + int v34; // [sp+538h] [bp-Ch]@1 + unsigned __int16 *v35; // [sp+53Ch] [bp-8h]@1 + //enum PLAYER_SKILL_TYPE v36; // [sp+540h] [bp-4h]@1 + + //v2 = uPlayerSkillType; + //v3 = uPlayerID; + //v36 = uPlayerSkillType; + v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]);// Normal + v34 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]);// Expert + v33 = (unsigned __int16 *)pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]);// Master + v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]);// Grand + v35 = (unsigned __int16 *)v4; + if ( v34 > v4 ) + v35 = (unsigned __int16 *)v34; + if ( (signed int)v33 > (signed int)v35 ) + v35 = v33; + if ( v5 > (signed int)v35 ) + v35 = (unsigned __int16 *)v5; + pPlayer = &pParty->pPlayers[uPlayerID]; + //v33 = &pPlayer->pActiveSkills[uPlayerSkillType]; + v7 = pPlayer->GetActualSkillLevel(uPlayerSkillType); + v8 = pPlayer->pActiveSkills[uPlayerSkillType]; + a2[0] = 0; + Source[0] = 0; + if ( (v8 & 0x3F) == (v7 & 0x3F) ) + { + strcpy(a2, "%s\n\n"); + v24 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 1); + sprintf(Source, "\f%05d", v24); + strcat(a2, Source); + strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); + v25 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 2); + sprintf(Source, "\f%05d", v25); + strcat(a2, Source); + strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); + v26 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 3); + sprintf(Source, "\f%05d", v26); + strcat(a2, Source); + strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); + v27 = pPlayer->classType; + v28 = uPlayerSkillType; + v29 = GetSkillColor(v27, uPlayerSkillType, 4); + sprintf(Source, "\f%05d", v29); + strcat(a2, Source); + strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); + + v23 = static_sub_417BB5_out_string; + sprintf(static_sub_417BB5_out_string, a2, pSkillDesc[v28], pGlobalTXT_LocalizationStrings[431], // Normal + (char *)v35 + 3, v35 + 5, pNormalSkillDesc[v28], pGlobalTXT_LocalizationStrings[433], // Expert + (char *)v35 + 3, v35 + 5, pExpertSkillDesc[v28], pGlobalTXT_LocalizationStrings[432], // Master + (char *)v35 + 3, v35 + 5, pMasterSkillDesc[v28], pGlobalTXT_LocalizationStrings[96], // Grand + (char *)v35 + 3, v35 + 5, pGrandSkillDesc[v28]); + } + else + { + strcpy(a2, "%s\n\n"); + v9 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 1); + sprintf(Source, "\f%05d", v9); + strcat(a2, Source); + strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); + v10 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 2); + sprintf(Source, "\f%05d", v10); + strcat(a2, Source); + strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); + v11 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 3); + sprintf(Source, "\f%05d", v11); + strcat(a2, Source); + strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); + v12 = uPlayerSkillType; + v13 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 4); + sprintf(Source, "\f%05d", v13); + strcat(a2, Source); + strcat(a2, "%s\t%03d:\t%03d%s\t000\n\n"); + v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); + sprintf(Source, "\f%05d", v14); + strcat(a2, Source); + strcat(a2, "%s: +%d"); + v15 = v12; + v16 = (int)(v35 + 5); + v15 = (PLAYER_SKILL_TYPE)((int)v15 * 4); + v34 = (int)((char *)v35 + 3); + v17 = pPlayer->GetActualSkillLevel(uPlayerSkillType); + v18 = *(int *)((char *)pGrandSkillDesc + v15); + v19 = *(int *)((char *)pMasterSkillDesc + v15); + v20 = *(int *)((char *)pExpertSkillDesc + v15); + v21 = *(int *)((char *)pNormalSkillDesc + v15); + v22 = *(int *)((char *)pSkillDesc + v15); + v23 = static_sub_417BB5_out_string; + sprintf( + static_sub_417BB5_out_string, + a2, + v22, + pGlobalTXT_LocalizationStrings[431], + v34, + v16, + v21, + pGlobalTXT_LocalizationStrings[433], + v34, + v16, + v20, + pGlobalTXT_LocalizationStrings[432], + v34, + v16, + v19, + pGlobalTXT_LocalizationStrings[96], + v34, + v16, + v18, + pGlobalTXT_LocalizationStrings[623], + (v17 & 0x3F) - (*(char *)v33 & 0x3F)); + } + return v23; + } + +//----- (00417FE5) -------------------------------------------------------- +char __cdecl CharacterUI_SkillsTab_ShowHint() + { + unsigned int v0; // ecx@1 + unsigned int v1; // eax@1 + GUIButton *i; // esi@6 + const char *v3; // eax@12 + unsigned int pX; // [sp+4h] [bp-8h]@1 + unsigned int pY; // [sp+8h] [bp-4h]@1 + + pMouse->GetClickPos(&pX, &pY); + v0 = pX; + v1 = pY; + if ( (signed int)pX < 24 || (signed int)pX > 455 || (signed int)pY < 18 || (signed int)pY > 36 ) + { + for ( i = pGUIWindow_CurrentMenu->pControlsHead; i; i = i->pNext ) + { + if ( i->uControlID == 121 + && (signed int)v0 >= (signed int)i->uX + && (signed int)v0 <= (signed int)i->uZ + && (signed int)v1 >= (signed int)i->uY + && (signed int)v1 <= (signed int)i->uW ) + { + v3 = CharacterUI_GetSkillDescText(uActiveCharacter - 1, (enum PLAYER_SKILL_TYPE)i->uControlParam); + sub_4179BC_draw_tooltip(pSkillNames[i->uControlParam], v3); + v1 = pY; + v0 = pX; + } + } + } + else + { + LOBYTE(v1) = sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription); + } + return v1; + } + +//----- (00418083) -------------------------------------------------------- +char __cdecl CharacterUI_StatsTab_ShowHint() + { + LONG _x; // esi@1 + Player *_y; // eax@1 + int v2; // edi@1 + __int16 *v3; // ecx@1 + LONG v4; // edx@2 + signed int v5; // edx@4 + char *v6; // ecx@9 + char *v7; // ebx@9 + unsigned int v8; // ebx@15 + unsigned __int64 v9; // kr00_8@15 + char *v10; // ST2C_4@15 + signed int v11; // eax@15 + char *v12; // ecx@17 + char *v13; // eax@20 + Player *v14; // esi@28 + int v15; // ebx@28 + int v16; // eax@33 + POINT a2; // [sp+Ch] [bp-24h]@1 + __int64 v19; // [sp+14h] [bp-1Ch]@15 + char *v20; // [sp+1Ch] [bp-14h]@13 + Player *v21; // [sp+20h] [bp-10h]@13 + unsigned int v22; // [sp+24h] [bp-Ch]@15 + int *v23; // [sp+28h] [bp-8h]@13 + const char *v24; // [sp+2Ch] [bp-4h]@10 + + _x = pMouse->GetCursorPos(&a2)->x; + _y = (Player *)pMouse->GetCursorPos(&a2)->y; + v2 = 0; + v3 = &array_4E2940[0].field_2; + while ( 1 ) + { + v4 = *(v3 - 1); + if ( _x >= v4 ) + { + if ( _x <= v4 + v3[1] ) + { + v5 = *v3; + if ( (signed int)_y >= v5 ) + { + if ( (signed int)_y <= v5 + v3[2] ) + break; + } + } + } + v3 += 4; + ++v2; + if ( (signed int)v3 >= (signed int)&off_4E2A12 ) + return (char)_y; + } + switch ( v2 ) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + LOBYTE(_y) = 4 * v2; + v6 = aAttributeNames[v2]; + v7 = pAttributeDescriptions[v2]; + goto LABEL_46; + case 7: + LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[108]); + v7 = pHealthPointsAttributeDescription; + v24 = pGlobalTXT_LocalizationStrings[108]; + goto LABEL_47; + case 8: + LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[212]); + v7 = pSpellPointsAttributeDescription; + v24 = pGlobalTXT_LocalizationStrings[212]; + goto LABEL_47; + case 9: + LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[12]); + v7 = pArmourClassAttributeDescription; + v24 = pGlobalTXT_LocalizationStrings[12]; + goto LABEL_47; + case 10: + v24 = pGlobalTXT_LocalizationStrings[47]; + strcpy(pTmpBuf2, pPlayerConditionAttributeDescription); + v7 = pTmpBuf2; + v20 = pTmpBuf2; + strcat(pTmpBuf2, "\n"); + + extern unsigned int pConditionImportancyTable[18]; + v23 = (int *)pConditionImportancyTable; + _y = pPlayers[uActiveCharacter]; + v21 = pPlayers[uActiveCharacter]; + do + { + if ( _y->pConditions[*v23] ) + { + strcat(pTmpBuf2, " \n"); + v8 = *v23; + v9 = pParty->uTimePlayed - v21->pConditions[*v23]; + a2.x = LODWORD(pParty->uTimePlayed) - LODWORD(v21->pConditions[*v23]); + a2.y = HIDWORD(v9); + v19 = (signed __int64)((double)*(signed __int64 *)&a2 * 0.234375) / 60 / 60; + v22 = (unsigned int)v19 / 0x18; + v10 = aCharacterConditionNames[v8]; + v19 %= 24i64; + v11 = GetConditionDrawColor(v8); + sprintf(pTmpBuf, &byte_4E2DE8, v11, v10); + strcat(pTmpBuf2, pTmpBuf); + if ( v19 && v19 <= 1 ) + v12 = pGlobalTXT_LocalizationStrings[109]; + else + v12 = pGlobalTXT_LocalizationStrings[110]; + if ( !v22 || (v13 = pGlobalTXT_LocalizationStrings[56], v22 > 1) ) + v13 = pGlobalTXT_LocalizationStrings[57]; + sprintf(pTmpBuf, "%lu %s, %lu %s", v22, v13, v19, v12); + strcat(pTmpBuf2, pTmpBuf); + v7 = v20; + _y = v21; + } + ++v23; + } + while ( (signed int)v23 < (signed int)&unk_4EDF40 ); + goto LABEL_47; + case 11: + LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[172]); + v7 = pFastSpellAttributeDescription; + v24 = pGlobalTXT_LocalizationStrings[172]; + goto LABEL_47; + case 12: + LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[5]); + v7 = pPlayerAgeAttributeDescription; + v24 = pGlobalTXT_LocalizationStrings[5]; + goto LABEL_47; + case 13: + LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[131]); + v7 = pPlayerLevelAttributeDescription; + v24 = pGlobalTXT_LocalizationStrings[131]; + goto LABEL_47; + case 14: + v14 = pPlayers[uActiveCharacter]; + v24 = pGlobalTXT_LocalizationStrings[83]; + v15 = v14->uLevel; + do + { + if ( (signed __int64)v14->uExperience < (unsigned int)sub_4B46F8(v15) ) + break; + ++v15; + } + while ( v15 <= 10000 ); + pTmpBuf[0] = 0; + pTmpBuf2[0] = 0; + if ( v15 > v14->uLevel ) + sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[147], v15); + v16 = sub_4B46F8(v15) - LODWORD(v14->uExperience); + sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[538], v16, v15 + 1); + strcat(pTmpBuf, "\n"); + strcat(pTmpBuf, pTmpBuf2); + LOBYTE(_y) = sprintf(pTmpBuf2, "%s\n \n%s", pPlayerExperienceAttributeDescription, pTmpBuf); + v7 = pTmpBuf2; + goto LABEL_47; + case 15: + LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[587]); + v7 = pAttackBonusAttributeDescription; + v24 = pGlobalTXT_LocalizationStrings[587]; + goto LABEL_47; + case 16: + LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[588]); + v7 = pAttackDamageAttributeDescription; + v24 = pGlobalTXT_LocalizationStrings[588]; + goto LABEL_47; + case 17: + LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[589]); + v7 = pMissleBonusAttributeDescription; + v24 = pGlobalTXT_LocalizationStrings[589]; + goto LABEL_47; + case 18: + LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[590]); + v7 = pMissleDamageAttributeDescription; + v24 = pGlobalTXT_LocalizationStrings[590]; + goto LABEL_47; + case 19: + LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[87]); + v7 = pFireResistanceAttributeDescription; + v24 = pGlobalTXT_LocalizationStrings[87]; + goto LABEL_47; + case 20: + LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[6]); + v7 = pAirResistanceAttributeDescription; + v24 = pGlobalTXT_LocalizationStrings[6]; + goto LABEL_47; + case 21: + LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[240]); + v7 = pWaterResistanceAttributeDescription; + v24 = pGlobalTXT_LocalizationStrings[240]; + goto LABEL_47; + case 22: + LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[70]); + v7 = pEarthResistanceAttributeDescription; + v24 = pGlobalTXT_LocalizationStrings[70]; + goto LABEL_47; + case 23: + LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[142]); + v7 = pMindResistanceAttributeDescription; + v24 = pGlobalTXT_LocalizationStrings[142]; + goto LABEL_47; + case 24: + LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[29]); + v7 = pBodyResistanceAttributeDescription; + v24 = pGlobalTXT_LocalizationStrings[29]; + goto LABEL_47; + case 25: + LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[207]); + v7 = pSkillPointsAttributeDescription; + v24 = pGlobalTXT_LocalizationStrings[207]; + goto LABEL_47; + case 26: + _y = (Player *)(4 * pPlayers[uActiveCharacter]->classType); + v6 = *(char **)((char *)_y->pConditions + (int)pClassNames); + v7 = *(char **)((char *)_y->pConditions + (int)pClassDescriptions); +LABEL_46: + v24 = v6; +LABEL_47: + if ( v24 && v7 ) + LOBYTE(_y) = sub_4179BC_draw_tooltip(v24, v7); + break; + default: + return (char)_y; + } + return (char)_y; + } + + + //----- (00410B28) -------------------------------------------------------- + void __thiscall DrawSpellDescriptionPopup(int spell_index) + { + Player *v1; // edi@1 + SpellInfo *v2; // esi@1 + unsigned int v3; // eax@2 + int v4; // eax@4 + LONG v5; // ecx@4 + int v6; // eax@10 + char *v7; // ST44_4@12 + unsigned __int16 v8; // ax@12 + GUIWindow a1; // [sp+Ch] [bp-68h]@4 + int v10; // [sp+60h] [bp-14h]@1 + POINT a2; // [sp+64h] [bp-10h]@1 + int v12; // [sp+6Ch] [bp-8h]@4 + int v13; // [sp+70h] [bp-4h]@4 + + v1 = pPlayers[uActiveCharacter]; + v10 = spell_index; + v2 = &pSpellStats->pInfos[spell_index + 11 * v1->lastOpenedSpellbookPage + 1]; + if ( pMouse->GetCursorPos(&a2)->y <= 250 ) + v3 = pMouse->GetCursorPos(&a2)->y + 30; + else + v3 = 30; + a1.uFrameY = v3; + a1.uFrameWidth = 328; + a1.uFrameHeight = 68; + a1.uFrameX = 90; + a1.uFrameZ = 417; + a1.uFrameW = v3 + 67; + a1.Hint = 0; + a2.y = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL]); + v13 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_MASTER]); + v12 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT]); + v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_GRAND]); + v5 = a2.y; + if ( v13 > a2.y ) + v5 = v13; + if ( v12 > v5 ) + v5 = v12; + if ( v4 > v5 ) + v5 = v4; + sprintf( pTmpBuf2, + "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s", + v2->pDescription, + pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL], + v5 + 3, v5 + 10, + v2->pBasicSkillDesc, + pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT], + v5 + 3, v5 + 10, + v2->pExpertSkillDesc, + pGlobalTXT_LocalizationStrings[LOCSTR_MASTER], + v5 + 3, v5 + 10, + v2->pMasterSkillDesc, + pGlobalTXT_LocalizationStrings[LOCSTR_GRAND], + v5 + 3, v5 + 10, + v2->pGrandmasterSkillDesc); + v6 = pFontSmallnum->CalcTextHeight(pTmpBuf2, &a1, 0, 0); + a1.uFrameHeight += v6; + if ( (signed int)a1.uFrameHeight < 150 ) + a1.uFrameHeight = 150; + a1.uFrameWidth = 460; + a1.DrawMessageBox(0); + a1.uFrameWidth -= 12; + a1.uFrameHeight -= 12; + v7 = v2->pName; + a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1; + a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1; + v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); + a1.DrawTitleText(pFontArrus, 0x78u, 0xCu, v8, v7, 3u); + a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2, 0, 0, 0); + a1.uFrameWidth = 108; + a1.uFrameZ = a1.uFrameX + 107; + a1.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v1->lastOpenedSpellbookPage + 12], 3u); + sprintf( pTmpBuf, "%s\n%d", pGlobalTXT_LocalizationStrings[LOCSTR_SP_COST], + pSpellDatas[spell_index + 11 * v1->lastOpenedSpellbookPage + 1].mana_per_skill[v1->pActiveSkills[v1->lastOpenedSpellbookPage + PLAYER_SKILL_FIRE]]); + // *(&[0].field_12 //temp_fix field_14 + // + ((unsigned int)LOBYTE(v1->pActiveSkills[v1->lastOpenedSpellbookPage + 12]) >> 6) + // + 10 * (int)((char *)v10 + 11 * v1->lastOpenedSpellbookPage))); + a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf, 3u); + dword_507B00_spell_info_to_draw_in_popup = 0; + } + // 507B00: using guessed type int dword_507B00_spell_info_to_draw_in_popup; + //----- (00416D62) -------------------------------------------------------- + void sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(Vec2_int_ *_this) + { + signed int pPlayerNum; // eax@12 + char *v2; // eax@32 + void *v3; // ecx@52 + unsigned int v4; // eax@59 + int v5; // esi@62 + signed int v6; // esi@64 + signed int v7; // esi@69 + ItemGen *v8; // ecx@70 + unsigned int v9; // eax@72 + unsigned int v10; // eax@76 + char v11; // zf@83 + GUIButton *pButton; // esi@84 + unsigned int v13; // ecx@85 + char *pStr; // edi@85 + signed int pControlID; // eax@92 + int v16; // eax@95 + int v17; // eax@96 + enum PLAYER_SKILL_TYPE v18; // eax@98 + char *pStr2; // eax@99 + unsigned int v20; // eax@108 + unsigned int pSkillId; // eax@109 + const char *pSkillInfo; // eax@111 + //char *v23; // ebx@112 + char *pHint; // edx@113 + unsigned int pColor; // eax@113 + GUIWindow pWindow; // [sp+4h] [bp-74h]@32 + double v27; // [sp+58h] [bp-20h]@33 + struct tagPOINT Point; // [sp+60h] [bp-18h]@6 + char *v29; // [sp+68h] [bp-10h]@33 + float v30; // [sp+6Ch] [bp-Ch]@33 + unsigned int pX; // [sp+70h] [bp-8h]@3 + unsigned int pY; // [sp+74h] [bp-4h]@3 + + if ( pCurrentScreen == SCREEN_VIDEO ) + return; + if ( _this ) + { + pX = _this->x; + pY = _this->y; + } + else + { + pMouse->GetClickPos(&pX, &pY); + } + if ( pRenderer->bWindowMode ) + { + GetCursorPos(&Point); + ScreenToClient(hWnd, &Point); + if ( Point.x < 1 || Point.y < 1 || Point.x > 638 || Point.y > 478 ) + { + back_to_game(); + return; + } + } + + if ( pParty->pPickedItem.uItemID )// + { + //v1 = 0; + //do + for ( pPlayerNum = 0; pPlayerNum < 4; ++pPlayerNum) + { + if ( (signed int)pX > RightClickPortraitXmin[pPlayerNum] && (signed int)pX < RightClickPortraitXmax[pPlayerNum] + && (signed int)pY > 375 && (signed int)pY < 466 ) + { + pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(pPlayerNum + 1, 1); + return; + } + //++v1; + } + //while ( v1 < 4 ); + } + + pEventTimer->Pause(); + + switch(pCurrentScreen) + { + case SCREEN_CASTING: + { + identify_item(); + break; + } + + case SCREEN_CHEST: + { + if ( !pPlayers[uActiveCharacter]->CanAct() ) + { + sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[427],//%s %s + pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);// + pWindow.Hint = pTmpBuf; + pWindow.uFrameWidth = 384; + pWindow.uFrameHeight = 180; + pWindow.uFrameY = 40; + if ( (signed int)pX <= 320 ) + v10 = pX + 30; + else + v10 = pX - 414; + pWindow.uFrameX = v10; + pWindow.DrawMessageBox(0); + } + else + { + v9 = pX + pSRZBufferLineOffsets[pY]; + if ( pRenderer->pActiveZBuffer[v9] & 0xFFFF ) + { + + // __debugbreak(); // invalid indexing will result in invalid object ptr + // v8 = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)pChestWindow->ptr_1C + 18* *((short *)&pChests[0].igChestItems[139].uExpireTime + // + (pRenderer->pActiveZBuffer[v9] & 0xFFFF) + 2662 * (unsigned int)pChestWindow->ptr_1C + 3)); + v10=pChests[pChestWindow->par1C].pInventoryIndices[(pRenderer->pActiveZBuffer[v9] & 0xFFFF)-1]; + v8 =&pChests[pChestWindow->par1C].igChestItems[v10-1]; + GameUI_DrawItemInfo(v8); + } + } + break; + } + case SCREEN_GAME: + { + if (GetCurrentMenuID() > 0) + break; + + if ( (signed int)pY > (signed int)pViewport->uViewportBR_Y ) + { + pWindow.ptr_1C = (void *)((signed int)pX / 118); + if ( (signed int)pX / 118 < 4 ) + { + pWindow.Hint = 0; + pWindow.uFrameWidth = 400; + pWindow.uFrameHeight = 200; + pWindow.uFrameX = 38; + pWindow.uFrameY = 60; + pAudioPlayer->StopChannels(-1, -1); + pWindow.DrawQuickCharRecord(); + } + } + else if ( (signed int)pX > (signed int)pViewport->uViewportBR_X ) + { + if ( (signed int)pY >= 130 ) + { + if ( (signed int)pX >= 476 && (signed int)pX <= 636 && (signed int)pY >= 240 && (signed int)pY <= 300 ) + { + pWindow.Hint = 0; + pWindow.uFrameWidth = 400; + pWindow.uFrameHeight = 200; + pWindow.uFrameX = 38; + pWindow.uFrameY = 60; + pAudioPlayer->StopChannels(-1, -1); + pWindow._41D73D_draw_buff_tooltip(); + } + else if ( (signed int)pX < 485 || (signed int)pX > 548 || (signed int)pY < 156 || (signed int)pY > 229 ) + { + if (!( (signed int)pX < 566 || (signed int)pX > 629 || (signed int)pY < 156 || (signed int)pY > 229 )) + { + pAudioPlayer->StopChannels(-1, -1); + v3 = (void *)1; + } + } + else + { + pAudioPlayer->StopChannels(-1, -1); + v3 = 0; + sub_416B01(v3); + } + } + else + { + pWindow.Hint = _4443D5_GetMinimapRightClickText(); + pWindow.uFrameWidth = 256; + pWindow.uFrameX = 130; + pWindow.uFrameY = 140; + pWindow.uFrameHeight = 64; + pAudioPlayer->StopChannels(-1, -1); + pWindow.DrawMessageBox(0); + } + } + else + { + pWindow.Hint = 0; + pWindow.uFrameWidth = 320; + pWindow.uFrameHeight = 320; + v4 = pX - 350; + if ( (signed int)pX <= 320 ) + v4 = pX + 30; + pWindow.uFrameX = v4; + pWindow.uFrameY = 40; + if ( pRenderer->pRenderD3D ) + LOWORD(v5) = pGame->pVisInstance->get_picked_object_zbuf_val(); + else + v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; + v6 = (unsigned __int16)v5; + if ( (v6 & 7) != OBJECT_Item) + { + if ( (v6 & 7) == OBJECT_Actor) + { + if ( pRenderer->uNumSceneBegins ) + { + pWindow.DrawMessageBox(1); + MonsterPopup_Draw(v6 >> 3, &pWindow); + } + else + { + pRenderer->BeginScene(); + pWindow.DrawMessageBox(1); + MonsterPopup_Draw(v6 >> 3, &pWindow); + pRenderer->EndScene(); + } + } + } + else + { + v7 = v6 >> 3; + if ( ! (pObjectList->pObjects[pSpriteObjects[v7].uObjectDescID].uFlags & 0x10 ) ) + { + v8 = &pSpriteObjects[v7].stru_24; + GameUI_DrawItemInfo(v8); + } + } + } + break; + } + case SCREEN_BOOKS: + { + if ( !dword_506364 + || (signed int)pX < (signed int)pViewport->uViewportTL_X + || (signed int)pX > (signed int)pViewport->uViewportBR_X + || (signed int)pY < (signed int)pViewport->uViewportTL_Y + || (signed int)pY > (signed int)pViewport->uViewportBR_Y + || (v2 = (char *)sub_444564(), (pWindow.Hint = v2) == 0) ) + break; + v30 = (double)(pFontArrus->GetLineWidth(v2) + 32); + v27 = v30 + 6.7553994e15; + v29 = (char *)LODWORD(v27); + pWindow.uFrameWidth = LODWORD(v27); + pWindow.uFrameX = pX + 5; + pWindow.uFrameY = pY + 5; + pWindow.uFrameHeight = 64; + pAudioPlayer->StopChannels(-1, -1); + pWindow.DrawMessageBox(0); + break; + } + case SCREEN_CHARACTERS: + case SCREEN_E: + case SCREEN_F: + { + if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E ) + { + identify_item(); + } + else if ( (signed int)pY >= 345 ) + break; + else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 100 )//2DEvent - CharacerScreenStats + { + CharacterUI_StatsTab_ShowHint(); + } + else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 101 )//2DEvent - CharacerScreenSkills + { + CharacterUI_SkillsTab_ShowHint(); + } + else + { + v11 = pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103;//2DEvent - CharacerScreenInventory + if ( v11 ) + identify_item(); + } + break; + } + case SCREEN_SPELL_BOOK: + { + if ( dword_507B00_spell_info_to_draw_in_popup ) + DrawSpellDescriptionPopup(dword_507B00_spell_info_to_draw_in_popup - 1); + break; + } + case SCREEN_HOUSE: + { + if ( (signed int)pY < 345 && (signed int)pX < 469 ) + sub_4B1A2D();//identify item in inventory + break; + } + + case SCREEN_PARTY_CREATION: + { + pWindow.Hint = 0; + pStr = 0; + for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext) + { + if ( pButton->uButtonType == 1 && pButton->uButtonType != 3 && (signed int)pX > (signed int)pButton->uX && (signed int)pX < (signed int)pButton->uZ + && (signed int)pY > (signed int)pButton->uY && (signed int)pY < (signed int)pButton->uW ) + { + pControlID = pButton->uControlID; + switch ( pControlID ) + { + case 0: //stats info + pWindow.Hint = pAttributeDescriptions[(signed int)pButton->uControlParam % 7]; + pStr = aAttributeNames[(signed int)pButton->uControlParam % 7]; + break; + case 62: //Plus button info + pStr = pGlobalTXT_LocalizationStrings[670];// + pWindow.Hint = pGlobalTXT_LocalizationStrings[671];//" , " + break; + case 63: //Minus button info + pStr = pGlobalTXT_LocalizationStrings[668];// + pWindow.Hint = pGlobalTXT_LocalizationStrings[669];//" , " + break; + case 64: //Available skill button info + v18 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->uControlParam + 4); + pStr = pSkillNames[v18]; + pWindow.Hint = pSkillDesc[v18]; + break; + case 65: //Available Class Info + pWindow.Hint = pClassDescriptions[pButton->uControlParam]; + pStr = pClassNames[pButton->uControlParam]; + break; + case 66: //OK Info + pWindow.Hint = pGlobalTXT_LocalizationStrings[664];// . + pStr = pGlobalTXT_LocalizationStrings[665];// + break; + case 67: //Clear info + pWindow.Hint = pGlobalTXT_LocalizationStrings[666];// . + pStr = pGlobalTXT_LocalizationStrings[667];// + break; + case 118: // Character info + pStr = pParty->pPlayers[pButton->uControlParam].pName; + pWindow.Hint = pClassDescriptions[pParty->pPlayers[pButton->uControlParam].classType]; + break; + } + if ( pControlID > 68 && pControlID <= 75 ) //Sellected skills info + { + pSkillId = pParty->pPlayers[pButton->uControlParam].GetSkillIdxByOrder(pControlID - 72); + pY = 0; + if ( (signed int)pSkillId < 37 ) + { + pSkillInfo = CharacterUI_GetSkillDescText(pButton->uControlParam, (enum PLAYER_SKILL_TYPE)pSkillId); + strcpy(pTmpBuf2, pSkillInfo); + pWindow.Hint = pTmpBuf2; + pStr = pSkillNames[pSkillId]; + } + } + } + } + if ( pWindow.Hint ) + { + pHint = pWindow.Hint; + pWindow.Hint = 0; + pWindow.uFrameWidth = 384; + pWindow.uFrameHeight = 256; + pWindow.uFrameX = 128; + pWindow.uFrameY = 40; + pWindow.uFrameHeight = pFontSmallnum->CalcTextHeight(pHint, &pWindow, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24; + pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; + pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; + pWindow.DrawMessageBox(0); + pWindow.uFrameX += 12; + pWindow.uFrameWidth -= 24; + pWindow.uFrameY += 12; + pWindow.uFrameHeight -= 12; + pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; + pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; + pColor = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B); + sprintf(pTmpBuf, format_4E2D80, pColor, pStr);//"\f%05d%s\f00000\n" + pWindow.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3); + pWindow.DrawText(pFontSmallnum, 1, pFontLucida->uFontHeight, 0, pHint, 0, 0, 0); + } + break; + } + default: + { + break; + } + } + dword_507BF0_is_there_popup_onscreen = 1; + viewparams->bRedrawGameUI = 1; + } \ No newline at end of file diff -r f39d5902c85a -r 70c5a87a1307 UIRest.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/UIRest.cpp Wed Mar 20 17:49:15 2013 +0600 @@ -0,0 +1,304 @@ +#include + +#include "MM7.h" + +#include "MapInfo.h" +#include "Game.h" +#include "GUIWindow.h" +#include "GUIFont.h" +#include "GUIButton.h" +#include "GUIProgressBar.h" +#include "Party.h" +#include "AudioPlayer.h" +#include "Outdoor.h" +#include "IndoorCamera.h" +#include "Overlays.h" +#include "Monsters.h" +#include "Arcomage.h" +#include "LOD.h" +#include "Actor.h" +#include "Allocator.h" +#include "Events.h" +#include "Viewport.h" +#include "FrameTableInc.h" +#include "Math.h" +#include "SpriteObject.h" +#include "ObjectList.h" +#include "Chest.h" +#include "PaletteManager.h" +#include "DecorationList.h" +#include "SaveLoad.h" +#include "stru123.h" +#include "Time.h" +#include "IconFrameTable.h" +#include "Awards.h" +#include "Autonotes.h" +#include "stru160.h" +#include "stru279.h" +#include "TurnEngine.h" +#include "stru277.h" +#include "Weather.h" +#include "stru272.h" +#include "stru298.h" +#include "StorylineTextTable.h" +#include "Events2D.h" +#include "texts.h" +#include "stru351.h" + +#include "mm7_data.h" + + + +//----- (0041F6C1) -------------------------------------------------------- +void __cdecl RestUI_Initialize() + { + Player *v0; // eax@10 + + if ( !dword_506F14 ) + pAudioPlayer->StopChannels(-1, -1); + if ( pCurrentScreen ) + { + pGUIWindow_CurrentMenu->Release(); + pCurrentScreen = SCREEN_GAME; + viewparams->bRedrawGameUI = 1; + } + pEventTimer->Pause(); + if ( dword_506F14 != 2 ) + GUIWindow::Create(518u, 450u, 0, 0, (enum WindowType)90, (int)pBtn_Rest, 0); + _506F18_num_hours_to_sleep = 0; + dword_506F14 = 0; + uRestUI_FoodRequiredToRest = 2; + if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) + uRestUI_FoodRequiredToRest = pOutdoor->GetNumFoodRequiredToRestInCurrentPos( + pParty->vPosition.x, + pParty->vPosition.y, + pParty->vPosition.z); + if ( PartyHasDragon() ) + { + v0 = pParty->pPlayers;//[0].uClass; + while ( v0 <= &pParty->pPlayers[3] ) + { + ++v0; + if ( v0 > &pParty->pPlayers[3] ) + break; + } + if(v0->classType == PLAYER_CLASS_WARLOCK) + ++uRestUI_FoodRequiredToRest; + } + if ( CheckHiredNPCSpeciality(Porter) ) + --uRestUI_FoodRequiredToRest; + if ( CheckHiredNPCSpeciality(QuarterMaster) ) + uRestUI_FoodRequiredToRest -= 2; + if ( CheckHiredNPCSpeciality(Gypsy) ) + --uRestUI_FoodRequiredToRest; + if ( uRestUI_FoodRequiredToRest < 1 ) + uRestUI_FoodRequiredToRest = 1; + if ( !_strcmpi(pCurrentMapName, "d29.blv") && (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 98) ) + uRestUI_FoodRequiredToRest = 0; + ++pIcons_LOD->uTexturePacksCount; + if ( !pIcons_LOD->uNumPrevLoadedFiles ) + pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; + pCurrentScreen = SCREEN_REST; + _507CD4_RestUI_hourglass_anim_controller = 0; + uTextureID_RestUI_restmain = pIcons_LOD->LoadTexture("restmain", TEXTURE_16BIT_PALETTE); + uTextureID_RestUI_restb1 = pIcons_LOD->LoadTexture("restb1", TEXTURE_16BIT_PALETTE); + uTextureID_RestUI_restb2 = pIcons_LOD->LoadTexture("restb2", TEXTURE_16BIT_PALETTE); + uTextureID_RestUI_restb3 = pIcons_LOD->LoadTexture("restb3", TEXTURE_16BIT_PALETTE); + uTextureID_RestUI_restb4 = pIcons_LOD->LoadTexture("restb4", TEXTURE_16BIT_PALETTE); + uTextureID_RestUI_restexit = pIcons_LOD->LoadTexture("restexit", TEXTURE_16BIT_PALETTE); + LoadActualSkyFrame(); + pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, (enum WindowType)16, 0, 0); + pButton_RestUI_Exit = pGUIWindow_CurrentMenu->CreateButton( + 280u, + 297u, + 154u, + 37u, + 1, + 0, + 0xA7u, + 0, + 0, + "", + (Texture *)(uTextureID_RestUI_restexit != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restexit] : 0), + 0); + pButton_RestUI_Main = pGUIWindow_CurrentMenu->CreateButton( + 24u, + 154u, + 225u, + 37u, + 1, + 0, + 0x61u, + 0, + 0x52u, + "", + (Texture *)(uTextureID_RestUI_restb4 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb4] : 0), + 0); + pButton_RestUI_WaitUntilDawn = pGUIWindow_CurrentMenu->CreateButton( + 61u, + 232u, + 154u, + 33u, + 1, + 0, + 0x6Du, + 0, + 0x44u, + "", + (Texture *)(uTextureID_RestUI_restb1 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb1] : 0), + 0); + pButton_RestUI_Wait1Hour = pGUIWindow_CurrentMenu->CreateButton( + 61u, + 264u, + 154u, + 33u, + 1, + 0, + 0x60u, + 0, + 0x48u, + "", + (Texture *)(uTextureID_RestUI_restb2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb2] : 0), + 0); + pButton_RestUI_Wait5Minutes = pGUIWindow_CurrentMenu->CreateButton( + 61u, + 296u, + 154u, + 33u, + 1, + 0, + 0x5Fu, + 0, + 0x4Du, + "", + (Texture *)(uTextureID_RestUI_restb3 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb3] : 0), + 0); + } + +//----- (0041FA01) -------------------------------------------------------- +void __cdecl RestUI_Draw() + { + int v0; // esi@1 + Player **ppPlayers; // ecx@1 + Player *pPlayer; // eax@2 + unsigned int v3; // eax@15 + //char v4; // al@17 + bool v5; // eax@21 + GUIButton Dst; // [sp+8h] [bp-DCh]@19 + //double v7; // [sp+C4h] [bp-20h]@17 + float v8; // [sp+CCh] [bp-18h]@17 + __int64 v9; // [sp+D0h] [bp-14h]@17 + unsigned int v10; // [sp+D8h] [bp-Ch]@9 + __int16 a9[2]; // [sp+DCh] [bp-8h]@1 + int a5; // [sp+E0h] [bp-4h]@1 + + v0 = 0; + a5 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xAu, 0, 0); + *(int *)a9 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE6u, 0xD6u, 0xC1u); + ppPlayers = &pPlayers[1]; + do + { + pPlayer = *ppPlayers; + if ( !(*ppPlayers)->pConditions[14] && !pPlayer->pConditions[16] && pPlayer->sHealth > 0 ) + ++v0; + ++ppPlayers; + } + while ( (signed int)ppPlayers <= (signed int)&pPlayers[4] ); + if ( v0 ) + { + pRenderer->DrawTextureIndexed( + 8u, + 8u, + (Texture *)(uTextureID_RestUI_restmain != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restmain] : 0)); + v10 = pParty->uCurrentHour; + dword_506F1C = pGUIWindow_CurrentMenu->pCurrentPosActiveItem; + if ( (signed int)pParty->uCurrentHour <= 12 ) + { + if ( !v10 ) + v10 = 12; + } + else + { + v10 -= 12; + } + pRenderer->DrawTextureIndexed(16u, 26u, pTexture_RestUI_CurrentSkyFrame); + if ( pTexture_RestUI_CurrentHourglassFrame ) + { + pTexture_RestUI_CurrentHourglassFrame->Release(); + pIcons_LOD->_40F9C5(); + } + v3 = pEventTimer->uTimeElapsed + _507CD4_RestUI_hourglass_anim_controller; + _507CD4_RestUI_hourglass_anim_controller += pEventTimer->uTimeElapsed; + if ( (unsigned int)_507CD4_RestUI_hourglass_anim_controller >= 512 ) + { + v3 = 0; + _507CD4_RestUI_hourglass_anim_controller = 0; + } + v9 = v3; + v8 = (double)v3 / 512.0 * 120.0; + //v7 = v8 + 6.7553994e15; + HIDWORD(v9) = floorf(v8 + 0.5f);//LODWORD(v7); + hourglass_icon_idx = (int)floorf(v8 + 0.5f) % 256 + 1;//LOBYTE(v7) + 1; + //hourglass_icon_idx = v4; + if (hourglass_icon_idx >= 120 ) + { + //v4 = 1; + hourglass_icon_idx = 1; + } + sprintf(pTmpBuf, "hglas%03d", hourglass_icon_idx); + pTexture_RestUI_CurrentHourglassFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE); + pRenderer->DrawTextureIndexed(0x10Bu, 0x9Fu, pTexture_RestUI_CurrentHourglassFrame); + memset(&Dst, 0, 0xBCu); + Dst.uX = 24; + Dst.uY = 154; + Dst.uWidth = 171; + Dst.uHeight = 37; + Dst.uZ = 194; + Dst.uW = 190; + Dst.pParent = pButton_RestUI_WaitUntilDawn->pParent; + Dst.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, a5, *(int **)a9); + Dst.pParent = 0; + sprintf(pTmpBuf, "\r408%d", uRestUI_FoodRequiredToRest); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, 0, 164, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); + pButton_RestUI_WaitUntilDawn->DrawLabel( + pGlobalTXT_LocalizationStrings[237], + pFontCreate, + a5, + *(int **)a9); + pButton_RestUI_Wait1Hour->DrawLabel(pGlobalTXT_LocalizationStrings[239], pFontCreate, a5, *(int **)a9); + pButton_RestUI_Wait5Minutes->DrawLabel(pGlobalTXT_LocalizationStrings[238], pFontCreate, a5, *(int **)a9); + pButton_RestUI_Exit->DrawLabel(pGlobalTXT_LocalizationStrings[81], pFontCreate, a5, *(int **)a9); + memset(&Dst, 0, 0xBCu); + Dst.uX = 45; + Dst.uY = 199; + Dst.uWidth = 185; + Dst.uHeight = 30; + Dst.uZ = 229; + Dst.uW = 228; + Dst.pParent = pButton_RestUI_WaitUntilDawn->pParent; + Dst.DrawLabel(pGlobalTXT_LocalizationStrings[236], pFontCreate, a5, *(int **)a9); + Dst.pParent = 0; + v5 = pParty->uCurrentHour >= 0xC && pParty->uCurrentHour < 0x18; + sprintf(pTmpBuf, "%d:%02d %s", v10, pParty->uCurrentMinute, aAMPMNames[v5]); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, 368, 168, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); + sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[56], pParty->uDaysPlayed + 1); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 190, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); + sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[146], pParty->uCurrentMonth + 1); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 222, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); + sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear); + pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 254, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); + if ( dword_506F14 ) + Sleep6Hours(); + } + else + { + GUIWindow::Create( + pButton_RestUI_Exit->uX, + pButton_RestUI_Exit->uY, + 0, + 0, + (enum WindowType)96, + (int)pButton_RestUI_Exit, + (int)pGlobalTXT_LocalizationStrings[81]); + } + } \ No newline at end of file diff -r f39d5902c85a -r 70c5a87a1307 UISaveLoad.cpp --- a/UISaveLoad.cpp Wed Mar 20 17:48:51 2013 +0600 +++ b/UISaveLoad.cpp Wed Mar 20 17:49:15 2013 +0600 @@ -0,0 +1,267 @@ +#include + +#include "MM7.h" + +#include "MapInfo.h" +#include "Game.h" +#include "GUIWindow.h" +#include "GUIFont.h" +#include "GUIButton.h" +#include "GUIProgressBar.h" +#include "Party.h" +#include "AudioPlayer.h" +#include "Outdoor.h" +#include "IndoorCamera.h" +#include "Overlays.h" +#include "Monsters.h" +#include "Arcomage.h" +#include "LOD.h" +#include "Actor.h" +#include "Allocator.h" +#include "Events.h" +#include "Viewport.h" +#include "FrameTableInc.h" +#include "Math.h" +#include "SpriteObject.h" +#include "ObjectList.h" +#include "Chest.h" +#include "PaletteManager.h" +#include "DecorationList.h" +#include "SaveLoad.h" +#include "stru123.h" +#include "Time.h" +#include "IconFrameTable.h" +#include "Awards.h" +#include "Autonotes.h" +#include "stru160.h" +#include "stru279.h" +#include "TurnEngine.h" +#include "stru277.h" +#include "Weather.h" +#include "stru272.h" +#include "stru298.h" +#include "StorylineTextTable.h" +#include "Events2D.h" +#include "texts.h" +#include "stru351.h" + +#include "mm7_data.h" + + +//----- (004601B7) -------------------------------------------------------- +void GameUI_MainMenu_DoDrawLoad(int a1) +{ + unsigned __int16 v1; // bx@1 + unsigned int v2; // edi@4 + unsigned int v3; // eax@4 + unsigned int v4; // eax@8 + int v5; // edi@8 + unsigned int v6; // eax@8 + unsigned int pMapID; // eax@10 + signed __int64 v8; // qax@10 + unsigned int v9; // ebx@10 + unsigned __int64 v10; // qax@10 + __int64 v11; // qax@10 + char v12; // di@10 + unsigned __int64 v13; // qtt@10 + unsigned int v14; // ecx@10 + __int64 pOurHour; // qax@10 + int v16; // edi@10 + signed int pHour; // ebx@22 + //const char *v18; // ST14_4@32 + int v19; // eax@32 + const char *v20; // ST18_4@32 + int v21; // eax@32 + //const char *v22; // ST14_4@32 + int v23; // eax@32 + const char *pSlotName; // edi@36 + int v25; // eax@43 + GUIWindow pWindow; // [sp+Ch] [bp-78h]@8 + /*unsigned int Dst; // [sp+Ch] [bp-78h]@8 + unsigned int v27; // [sp+10h] [bp-74h]@8 + int v28; // [sp+14h] [bp-70h]@8 + int v29; // [sp+18h] [bp-6Ch]@8 + unsigned int v30; // [sp+1Ch] [bp-68h]@8 + unsigned int v31; // [sp+20h] [bp-64h]@8*/ + int pMinutes; // [sp+60h] [bp-24h]@10 + int pMonthNum; // [sp+68h] [bp-1Ch]@10 + unsigned int pSaveFiles; // [sp+70h] [bp-14h]@10 + __int64 pAMPM2; // [sp+74h] [bp-10h]@10 + int pYear; // [sp+7Ch] [bp-8h]@10 + int a4; // [sp+80h] [bp-4h]@1 + int pFilesID; + + v1 = 255; + a4 = a1; + GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0xFF); + GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B); + pRenderer->BeginScene(); + if ( GetCurrentMenuID() != MENU_SAVELOAD && GetCurrentMenuID() != MENU_LOADINGPROC ) + { + pRenderer->DrawTextureIndexed(8, 8, uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0); + if ( a4 ) + { + v2 = uTextureID_save_up; + v3 = uTextureID_LS_saveU; + } + else + { + v2 = uTextureID_load_up; + v3 = uTextureID_LS_loadU; + } + pRenderer->DrawTextureIndexed(241, 302, (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0)); + pRenderer->DrawTextureIndexed(18, 139, (Texture *)(v2 != -1 ? &pIcons_LOD->pTextures[v2] : 0)); + pRenderer->DrawTextureIndexed(351, 302, (Texture *)(uTextureID_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_u] : 0)); + v1 = 255; + } + if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] ) + { + memset(&pWindow, 0, 0x54); + pWindow.uFrameX = pGUIWindow_CurrentMenu->uFrameX + 240; + v4 = pGUIWindow_CurrentMenu->uFrameY - pFontSmallnum->uFontHeight; + pWindow.uFrameWidth = 220; + v4 += 157; + pWindow.uFrameY = v4; + v5 = pFontSmallnum->uFontHeight; + pWindow.uFrameZ = pWindow.uFrameX + 219; + pWindow.uFrameHeight = v5; + pWindow.uFrameW = v5 + v4 - 1; + v6 = uLoadGameUI_SelectedSlot; + if (pSavegameThumbnails[uLoadGameUI_SelectedSlot].pPixels) + { + pRenderer->DrawTextureRGB(pGUIWindow_CurrentMenu->uFrameX + 276, pGUIWindow_CurrentMenu->uFrameY + 171, pSavegameThumbnails + uLoadGameUI_SelectedSlot); + v6 = uLoadGameUI_SelectedSlot; + } + pMapID = pMapStats->GetMapInfo(pSavegameHeader[v6].pLocationName); + pWindow.DrawTitleText(pFontSmallnum, 0, 0, 0, pMapStats->pInfos[pMapID].pName, 3); + v8 = (signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60; + pMinutes = (int)((signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60) >> 32; + v9 = v8; + v8 /= 60i64; + pAMPM2 = v8; + v10 = (unsigned int)v8 / 24; + pSaveFiles = v10; + v11 = (unsigned int)(v10 / 7); + v12 = v11; + LODWORD(v13) = (unsigned int)v11 >> 2; + HIDWORD(v13) = HIDWORD(v11); + pMonthNum = v13 % 12; + pYear = v13 / 12; + pMinutes = (int)__PAIR__(pMinutes, v9) % 60; + pOurHour = pAMPM2 % 24; + v14 = (unsigned __int64)(pAMPM2 % 24) >> 32; + LODWORD(pAMPM2) = pAMPM2 % 24; + HIDWORD(pOurHour) = pSaveFiles % 28; + pYear += game_starting_year; + v16 = v12 & 3; + pWindow.uFrameY = pGUIWindow_CurrentMenu->uFrameY + 261; + HIDWORD(pAMPM2) = v14 == 0 && ((signed int)v14 > 0 || (unsigned int)pOurHour >= 12) + && (signed int)v14 <= 0 && (v14 != 0 || (unsigned int)pOurHour < 24); + if ( v14 != 0 || (signed int)v14 <= 0 && (unsigned int)pOurHour <= 12 ) + { + if ( !(v14 | (unsigned int)pOurHour) ) + { + pSaveFiles = 0; + pHour = 12; + goto LABEL_23; + } + } + else + { + v14 = (__PAIR__(v14, (unsigned int)pOurHour) - 12) >> 32; + LODWORD(pOurHour) = pOurHour - 12; + } + pHour = pOurHour; + pSaveFiles = v14; +LABEL_23: + auto day = aDayNames[HIDWORD(pOurHour) % 7]; + auto ampm = aAMPMNames[HIDWORD(pAMPM2)]; + auto month = aMonthNames[pMonthNum]; + //sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", _d, v17, (int)32, _a, 3, _m, pFilesID); + sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", day, pHour, pMinutes, ampm, 7 * v16 + HIDWORD(pOurHour) % 7 + 1, month, pYear); + pWindow.DrawTitleText(pFontSmallnum, 0, 0, 0, pTmpBuf, 3u); + v1 = 255; + } + if ( pGUIWindow_CurrentMenu->field_40 == 2 ) + { + pGUIWindow_CurrentMenu->field_40 = 0; + strcpy((char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot, (const char *)pKeyActionMap->pPressedKeysBuffer); + /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) + { + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)83; + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; + *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; + ++pMessageQueue_50CBD0->uNumMessages; + }*/ + pMessageQueue_50CBD0->AddMessage(UIMSG_SaveGame, 0, 0); + } + else + { + if ( pGUIWindow_CurrentMenu->field_40 == 3 ) + pGUIWindow_CurrentMenu->field_40 = 0; + } + if (GetCurrentMenuID() == MENU_LOADINGPROC) + { + //v18 = pGlobalTXT_LocalizationStrings[135]; + v19 = pFontSmallnum->AlignText_Center(0xBA, pGlobalTXT_LocalizationStrings[135]);//"" + pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v19 + 25, 220, 0, pGlobalTXT_LocalizationStrings[135], 0, 0, 0); + v20 = (const char *)(pSavegameHeader + uLoadGameUI_SelectedSlot); + v21 = pFontSmallnum->AlignText_Center(0xBA, (const char *)pSavegameHeader + 100 * uLoadGameUI_SelectedSlot); + pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, v21 + 25, 0x106, 0, v20, 185, 0); + //v22 = pGlobalTXT_LocalizationStrings[165]; + v23 = pFontSmallnum->AlignText_Center(0xBA, pGlobalTXT_LocalizationStrings[165]);//", " + pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v23 + 25, 304, 0, pGlobalTXT_LocalizationStrings[165], 0, 0, 0); + } + else + { + if ( a4 ) + pSaveFiles = 40; + else + pSaveFiles = uNumSavegameFiles; + a4 = 199; + pFilesID = pSaveListPosition; + pSlotName = (const char *)(&pSavegameHeader[pSaveListPosition]);//draw name for save slot + do + { + if ( pFilesID >= (signed int)pSaveFiles ) + break; + short clr; + HIDWORD(pAMPM2) = clr = (pFilesID == uLoadGameUI_SelectedSlot ? GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v1, v1, 0x64) : 0); + if ( pGUIWindow_CurrentMenu->field_40 != 1 || pFilesID != uLoadGameUI_SelectedSlot ) + { + pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, 0x1B, a4, clr, pSlotName, 185, 0); + } + else + { + v25 = pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, 0x1B, a4, clr, (const char *)pKeyActionMap->pPressedKeysBuffer, 175, 1); + pGUIWindow_CurrentMenu->DrawFlashingInputCursor(v25 + 27, a4, pFontSmallnum); + } + a4 += 21; + ++pFilesID; + pSlotName += 100; + } + while ( a4 < 346 ); + } + pRenderer->EndScene(); +} +// 6A0C9C: using guessed type int dword_6A0C9C; + +//----- (004606F7) -------------------------------------------------------- +void __cdecl GameUI_MainMenu_DrawLoad() +{ + GameUI_MainMenu_DoDrawLoad(0); +} + +//----- (004606FE) -------------------------------------------------------- +void __cdecl sub_4606FE() +{ + GameUI_MainMenu_DoDrawLoad(1); +} + + +void __cdecl FreeSavegameThumbnails() + { + for (int i = 0; i < 40; ++i) + //pAllocator->FreeChunk(pSavegameThumbnails[i].pPixels); + pSavegameThumbnails[i].Release(); + } diff -r f39d5902c85a -r 70c5a87a1307 UITransition.cpp diff -r f39d5902c85a -r 70c5a87a1307 UiGame.cpp --- a/UiGame.cpp Wed Mar 20 17:48:51 2013 +0600 +++ b/UiGame.cpp Wed Mar 20 17:49:15 2013 +0600 @@ -0,0 +1,2046 @@ +#include + +#include "MM7.h" + +#include "MapInfo.h" +#include "Game.h" +#include "GUIWindow.h" +#include "GUIFont.h" +#include "GUIButton.h" +#include "GUIProgressBar.h" +#include "Party.h" +#include "AudioPlayer.h" +#include "Outdoor.h" +#include "IndoorCamera.h" +#include "Overlays.h" +#include "Monsters.h" +#include "Arcomage.h" +#include "LOD.h" +#include "Actor.h" +#include "Allocator.h" +#include "Events.h" +#include "Viewport.h" +#include "FrameTableInc.h" +#include "Math.h" +#include "SpriteObject.h" +#include "ObjectList.h" +#include "Chest.h" +#include "PaletteManager.h" +#include "DecorationList.h" +#include "PlayerFrameTable.h" +#include "SaveLoad.h" +#include "stru123.h" +#include "Time.h" +#include "IconFrameTable.h" +#include "Awards.h" +#include "Autonotes.h" +#include "stru160.h" +#include "stru279.h" +#include "TurnEngine.h" +#include "stru277.h" +#include "Weather.h" +#include "stru272.h" +#include "stru298.h" +#include "StorylineTextTable.h" +#include "Events2D.h" +#include "texts.h" +#include "stru351.h" + +#include "mm7_data.h" + + + + +//----- (0041AD6E) -------------------------------------------------------- +void __cdecl GameUI_DrawRightPanelItems() +{ + if (GameUI_RightPanel_BookFlashTimer > pParty->uTimePlayed) + GameUI_RightPanel_BookFlashTimer = 0; + + if (pParty->uTimePlayed - GameUI_RightPanel_BookFlashTimer > 128) + { + GameUI_RightPanel_BookFlashTimer = pParty->uTimePlayed; + byte_50697C = byte_50697C == 0; + if ( byte_50697C && pCurrentScreen != SCREEN_REST ) + { + if ( bFlashQuestBook ) + pRenderer->DrawTextureTransparent(493, 355, pIcons_LOD->GetTexture(uTextureID_ib_td1_A)); + if ( bFlashAutonotesBook ) + pRenderer->DrawTextureTransparent(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A)); + if ( bFlashHistoryBook ) + pRenderer->DrawTextureTransparent(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A)); + } + else + { + pRenderer->DrawTextureRGB(468u, 0, pTexture_RightFrame); + DrawHiredNPCs(); + } + } +} + +//----- (0041AEBB) -------------------------------------------------------- +void __cdecl GameUI_DrawFoodAndGold() +{ + int v2; // esi@2 + + if ( uGameState != GAME_STATE_FINAL_WINDOW ) + { + v2 = sub_44100D() != 0 ? 381 : 322; + sprintf(pTmpBuf, "\r087%lu", pParty->uNumFoodRations); + pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow); + sprintf(pTmpBuf, "\r028%lu", pParty->uNumGold); + pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow); + } +} + +//----- (0041AF52) -------------------------------------------------------- +void Actor::DrawHealthBar(Actor *a1, GUIWindow *a2) +{ + unsigned int v2; // eax@1 + GUIWindow *v3; // edi@1 + unsigned int v4; // esi@1 + signed int v5; // ebx@4 + double v6; // st7@5 + unsigned int v7; // eax@6 + unsigned int v8; // ebx@10 + unsigned int v9; // [sp+14h] [bp-Ch]@4 + unsigned int v10; // [sp+1Ch] [bp-4h]@4 + + v2 = a1->pMonsterInfo.uHP; + v3 = a2; + v4 = 25; + if ( (signed int)v2 > 25 ) + { + v4 = 200; + if ( (signed int)v2 < 200 ) + v4 = a1->pMonsterInfo.uHP; + } + v5 = a1->sCurrentHP; + v10 = v4; + v9 = uTextureID_mhp_grn; + if ( v5 < (signed int)v2 ) + { + v6 = (double)(signed int)v2; + v10 = (signed __int64)((double)(signed int)v4 / (double)(signed int)v2 * (double)a1->sCurrentHP); + if ( v5 <= (signed int)(signed __int64)(0.34 * v6) ) + { + v7 = uTextureID_mhp_red; + v9 = v7; + } + else if ( v5 <= (signed int)(signed __int64)(v6 * 0.67) ) + { + v7 = uTextureID_mhp_yel; + v9 = v7; + } + } + v8 = a2->uFrameX + (signed int)(a2->uFrameWidth - v4) / 2; + pRenderer->Clip(v8, a2->uFrameY + 32, v8 + v4, a2->uFrameY + 52); + pRenderer->DrawTextureIndexed( + v8, + v3->uFrameY + 32, + (Texture *)(uTextureID_mhp_bd != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_mhp_bd] : 0)); + pRenderer->Clip(v8, v3->uFrameY + 32, v8 + v10, v3->uFrameY + 52); + pRenderer->DrawTextureIndexed( + v8, + v3->uFrameY + 34, + (Texture *)(v9 != -1 ? (int)&pIcons_LOD->pTextures[v9] : 0)); + pRenderer->ResetClip(); + pRenderer->DrawTextureIndexed( + v8 - 5, + v3->uFrameY + 32, + (Texture *)(uTextureID_mhp_capl != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_mhp_capl] : 0)); + pRenderer->DrawTextureIndexed( + v8 + v4, + v3->uFrameY + 32, + (Texture *)(uTextureID_mhp_capr != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_mhp_capr] : 0)); +} + +//----- (0041B0C9) -------------------------------------------------------- +void __cdecl GameUI_DrawLifeManaBars() +{ + Texture *v0; // ebx@1 + Player *v1; // ecx@2 + float v2; // ST38_4@3 + double v3; // st7@3 + signed __int64 v4; // qax@6 + Player *v5; // ecx@24 + float v6; // ST30_4@25 + double v7; // st7@25 + bool v8; // ST38_4@27 + Texture *v9; // [sp-4h] [bp-30h]@10 + Texture *v10; // [sp+Ch] [bp-20h]@1 + Player *v11; // [sp+10h] [bp-1Ch]@2 + int v12; // [sp+10h] [bp-1Ch]@24 + Texture *v13; // [sp+14h] [bp-18h]@1 + Texture *v14; // [sp+18h] [bp-14h]@1 + float v15; // [sp+1Ch] [bp-10h]@1 + signed int v16; // [sp+24h] [bp-8h]@1 + signed int v17; // [sp+28h] [bp-4h]@8 + + v0 = (Texture *)(uTextureID_BarGreen != -1 ? &pIcons_LOD->pTextures[uTextureID_BarGreen] : 0); + v14 = (Texture *)(uTextureID_BarYellow != -1 ? &pIcons_LOD->pTextures[uTextureID_BarYellow] : 0); + v13 = (Texture *)(uTextureID_BarRed != -1 ? &pIcons_LOD->pTextures[uTextureID_BarRed] : 0); + v16 = 0; + v10 = (Texture *)(uTextureID_BarBlue != -1 ? &pIcons_LOD->pTextures[uTextureID_BarBlue] : 0); + v15 = (double)(uTextureID_BarGreen != -1 ? pIcons_LOD->pTextures[uTextureID_BarGreen].uTextureHeight : 26); + do + { + v1 = &pParty->pPlayers[v16]; + v11 = v1; + if ( v1->sHealth > 0 ) + { + v11 = &pParty->pPlayers[v16]; + v2 = (double)v1->sHealth; + v3 = v2 / (double)v1->GetMaxHealth(); + if( v3 > 0.5 ) + { + if ( v3 > 1.0 ) + v3 = 1.0; + v4 = (signed __int64)((1.0 - v3) * v15); + if ( v16 == 2 || v16 == 3 ) + v17 = 2; + else + v17 = 0; + pRenderer->Clip( + v17 + pHealthBarPos[v16], + v4 + 402, + v17 + pHealthBarPos[v16] + v0->uTextureWidth, + v0->uTextureHeight + 402); + v9 = v0; + } + else if ( v3 > 0.25 ) + { + if ( v16 == 2 || v16 == 3 ) + v17 = 2; + else + v17 = 0; + pRenderer->Clip( + v17 + pHealthBarPos[v16], + (unsigned __int64)(signed __int64)((1.0 - v3) * v15) + 402, + v17 + pHealthBarPos[v16] + v14->uTextureWidth, + v14->uTextureHeight + 402); + v9 = v14; + } + else if ( v3 > 0.0 ) + { + if ( v16 == 2 || v16 == 3 ) + v17 = 2; + else + v17 = 0; + pRenderer->Clip( + v17 + pHealthBarPos[v16], + (unsigned __int64)(signed __int64)((1.0 - v3) * v15) + 402, + v17 + pHealthBarPos[v16] + v13->uTextureWidth, + v13->uTextureHeight + 402); + v9 = v13; + } + if( v3 > 0.0 ) + { + pRenderer->DrawTextureIndexed(v17 + pHealthBarPos[v16], 0x192u, v9); + pRenderer->ResetClip(); + } + } + v5 = v11; + v12 = v11->sMana; + if ( v12 > 0 ) + { + v6 = (double)v12; + v7 = v6 / (double)v5->GetMaxMana(); + if ( v7 > 1.0 ) + v7 = 1.0; + v8 = v16 == 2; + pRenderer->Clip( + (v16 == 2) + pManaBarPos[v16], + (unsigned __int64)(signed __int64)((1.0 - v7) * v15) + 402, + v8 + pManaBarPos[v16] + v10->uTextureWidth, + v10->uTextureHeight + 402); + pRenderer->DrawTextureIndexed(v8 + pManaBarPos[v16], 0x192u, v10); + pRenderer->ResetClip(); + } + ++v16; + } + while ( v16 < 4 ); +} + +//----- (0041B3B6) -------------------------------------------------------- +void __cdecl draw_right_panel() +{ + pRenderer->DrawTextureTransparent( + pViewport->uViewportBR_X, + 0, + (Texture *)(uTextureID_right_panel != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_right_panel] : 0)); +} + +//----- (0041B3E2) -------------------------------------------------------- +void __cdecl GameUI_DrawRightPanelFrames() +{ + pRenderer->DrawTextureRGB(0, 0, pTexture_TopFrame); + pRenderer->DrawTextureRGB(0, 8u, pTexture_LeftFrame); + pRenderer->DrawTextureRGB(468u, 0, pTexture_RightFrame); + pRenderer->DrawTextureRGB(0, 352u, pTexture_BottomFrame); + GameUI_DrawFoodAndGold(); + GameUI_DrawRightPanelItems(); +} + +//----- (0041B438) -------------------------------------------------------- +GUIButton *__fastcall GUI_HandleHotkey(unsigned __int8 uHotkey) +{ + char v1; // al@1 + int v2; // esi@1 + char v3; // dl@1 + GUIWindow *v4; // ecx@2 + GUIButton *result; // eax@2 + int v6; // edx@12 + + v1 = toupper(uHotkey); + v2 = uNumVisibleWindows; + v3 = v1; + if ( uNumVisibleWindows >= 0 ) + { + while ( 2 ) + { + v4 = &pWindowList[pVisibleWindowsIdxs[v2] - 1]; + for ( result = v4->pControlsHead; result; result = result->pNext ) + { + if ( result->uHotkey == v3 ) + { + v6 = result->uControlParam; + pMessageQueue_50CBD0->AddMessage((UIMessageType)result->uControlID, v6, 0); + /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) + { + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)result->uControlID; + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v6; + *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; + ++pMessageQueue_50CBD0->uNumMessages; + }*/ + return result; + } + } + if ( v4->uFrameX || v4->uFrameY || !(v4->uFrameWidth == 640 & v4->uFrameHeight == 480) ) + { + --v2; + if ( v2 >= 0 ) + continue; + } + break; + } + } + return 0; +} +// 5075E0: using guessed type int pVisibleWindowsIdxs[20]; + +//----- (0041B4E1) -------------------------------------------------------- +int __fastcall GUI_ReplaceHotkey(unsigned __int8 uOldHotkey, unsigned __int8 uNewHotkey, char bFirstCall) +{ + unsigned __int8 v3; // bl@1 + int result; // eax@1 + int i; // edx@2 + GUIButton *j; // ecx@3 + int k; // edx@7 + GUIButton *l; // ecx@8 + unsigned __int8 v9; // [sp+4h] [bp-8h]@1 + char v10; // [sp+8h] [bp-4h]@1 + + v3 = uNewHotkey; + v10 = toupper(uOldHotkey); + result = toupper(v3); + v9 = result; + if ( bFirstCall ) + { + for ( i = uNumVisibleWindows; i >= 0; --i ) + { + result = 84 * pVisibleWindowsIdxs[i]; + //for ( j = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); j; j = j->pNext ) + for ( j = pWindowList[pVisibleWindowsIdxs[i] - 1].pControlsHead; j; j = j->pNext ) + j->field_28 = 0; + } + } + for ( k = uNumVisibleWindows; k >= 0; --k ) + { + result = 84 * pVisibleWindowsIdxs[k]; + //for ( l = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); l; l = l->pNext ) + for ( l = pWindowList[pVisibleWindowsIdxs[k] - 1].pControlsHead; l; l = l->pNext ) + { + LOBYTE(result) = v10; + if ( l->uHotkey == v10 ) + { + if ( !l->field_28 ) + { + LOBYTE(result) = v9; + l->field_28 = 1; + l->uHotkey = v9; + } + } + } + } + return result; +} + + + +//----- (0041C047) -------------------------------------------------------- +void __cdecl GameUI_DrawStatusBar_2() + { + unsigned int v0; // eax@1 + char *v1; // edx@2 + unsigned int v2; // ST18_4@5 + const char *v3; // ST0C_4@5 + unsigned int v4; // ST08_4@5 + int v5; // eax@5 + + pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); + if ( GameUI_StatusBar_TimedStringTimeLeft ) + { + v1 = GameUI_StatusBar_TimedString; + } + else + { + if ( !pStatusBarString[0] ) + return; + v1 = pStatusBarString; + } + LOWORD(v0) = uGameUIFontShadow; + v2 = v0; + LOWORD(v0) = uGameUIFontMain; + v3 = v1; + v4 = v0; + v5 = pFontLucida->AlignText_Center(0x1C2u, v1); + pPrimaryWindow->DrawText(pFontLucida, v5 + 11, 357, v4, v3, 0, 0, v2); + } + +//----- (0041C0B8) -------------------------------------------------------- +void __thiscall sub_41C0B8_set_status_string(const char *pStr) + { + const char *v1; // esi@1 + int i; // eax@7 + int j; // eax@11 + + v1 = pStr; + if ( pStr && strcmp(pStr, "test") && !IsBadStringPtrA(v1, 1u) && (*v1 || GameUI_StatusBar_TimedStringTimeLeft) ) + { + if ( GameUI_StatusBar_TimedStringTimeLeft ) + { + for ( i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); + i > 450; + i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString) ) + byte_5C3427[strlen(GameUI_StatusBar_TimedString)] = 0; + } + else + { + strcpy(pStatusBarString, v1); + for ( j = pFontLucida->GetLineWidth(pStatusBarString); + j > 450; + j = pFontLucida->GetLineWidth(pStatusBarString) ) + GameUI_StatusBar_TimedString[strlen(pStatusBarString) + 199] = 0; + } + } + } + +//----- (0041C179) -------------------------------------------------------- +void __cdecl GameUI_DrawStatusBar() + { + unsigned int v0; // ebp@1 + char *v1; // edi@5 + int v2; // eax@5 + unsigned int v3; // esi@5 + size_t v4; // eax@6 + GUIFont *v5; // ecx@6 + int v6; // eax@9 + size_t v7; // eax@10 + GUIFont *v8; // ecx@10 + char v9; // zf@12 + unsigned int v10; // ST08_4@13 + int v11; // eax@13 + + v0 = uGameUIFontShadow; + if ( pStatusBarString[0] || GameUI_StatusBar_TimedStringTimeLeft || bForceDrawStatusBar ) + { + pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); + if ( GameUI_StatusBar_TimedStringTimeLeft ) + { + v1 = GameUI_StatusBar_TimedString; + v2 = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); + v3 = 450; + while ( v2 > 450 ) + { + v4 = strlen(GameUI_StatusBar_TimedString); + v5 = pFontLucida; + byte_5C3427[v4] = 0; + v2 = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); + } + } + else + { + v1 = pStatusBarString; + v6 = pFontLucida->GetLineWidth(pStatusBarString); + v3 = 450; + while ( v6 > 450 ) + { + v7 = strlen(pStatusBarString); + v8 = pFontLucida; + GameUI_StatusBar_TimedString[v7 + 199] = 0; + v6 = pFontLucida->GetLineWidth(pStatusBarString); + } + } + v9 = *v1 == 0; + bForceDrawStatusBar = 0; + if ( !v9 ) + { + v10 = uGameUIFontMain; + v11 = pFontLucida->AlignText_Center(v3, v1); + pPrimaryWindow->DrawText(pFontLucida, v11 + 11, 357, v10, v1, 0, 0, v0); + } + } + } +// 5C35BC: using guessed type int bForceDrawStatusBar; + + +//----- (00420EFF) -------------------------------------------------------- +void __cdecl GameUI_WritePointedObjectStatusString() +{ + int v1; // ebx@6 + GUIWindow *pWindow; // edi@7 + GUIButton *pButton; // ecx@11 + Player *pPlayer; // eax@19 + char v5; // cl@19 + unsigned int v6; // eax@19 + int v7; // ecx@19 + __int16 v8; // fps@23 + unsigned __int8 v9; // c0@23 + unsigned __int8 v10; // c3@23 + enum UIMessageType pMessageType1; // esi@24 + int v12; // edx@25 + char *v13; // ecx@28 + int v14; // eax@41 + ItemGen *pItemGen; // ecx@44 + int v16; // ecx@46 + const char *v17; // eax@49 + signed int v18; // eax@55 + signed int v19; // ecx@63 + BLVFace *pFace; // eax@69 + __int16 v21; // ax@70 + const char *v22; // eax@72 + LevelDecoration *v23; // ecx@75 + LevelDecoration *v24; // esi@75 + __int16 v25; // ax@75 + const char *v26; // ecx@79 + Actor *pActor; // ecx@82 + char *v28; // esi@82 + int v29; // eax@82 + signed int v30; // ecx@88 + const char *v31; // eax@91 + __int16 v32; // fps@109 + //unsigned __int8 v33; // c0@109 + //unsigned __int8 v34; // c3@109 + enum UIMessageType pMessageType2; // esi@110 + int v36; // edx@111 + enum UIMessageType pMessageType3; // edx@117 + int v38; // ecx@118 + const char *v39; // [sp-8h] [bp-E8h]@20 + char *v40; // [sp-8h] [bp-E8h]@83 + int v41; // [sp-4h] [bp-E4h]@20 + char Str1[200]; // [sp+Ch] [bp-D4h]@129 + unsigned int pX; // [sp+D4h] [bp-Ch]@1 + unsigned int pY; // [sp+D8h] [bp-8h]@1 + unsigned int v45; // [sp+DCh] [bp-4h]@21 + + v13 = nullptr; + + pMouse->uPointingObjectID = 0; + pMouse->GetClickPos(&pX, &pY); + if ( pX < 0 || (signed int)pX > 639 || pY < 0 || (signed int)pY > 479 )//( (pX & 0x80000000u) != 0 || (signed int)pX > 639 || (pY & 0x80000000u) != 0 || (signed int)pY > 479 ) + return; + if (pCurrentScreen == SCREEN_GAME) + { + if ( (signed int)pX > 467 || (signed int)pY > 351 ) + goto _click_on_game_ui; + if ( pRenderer->pRenderD3D ) + { + v18 = pGame->pVisInstance->get_picked_object_zbuf_val(); + if ( (signed int)pX < (signed int)pViewport->uScreen_TL_X + || (signed int)pX > (signed int)pViewport->uScreen_BR_X + || (signed int)pY < (signed int)pViewport->uScreen_TL_Y + || (signed int)pY > (signed int)pViewport->uScreen_BR_Y ) + v18 = -1; + if ( v18 == -1 ) + //goto LABEL_61; + { + pMouse->uPointingObjectID = 0; + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } + } + else + { + v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; + } + pMouse->uPointingObjectID = (unsigned __int16)v18; + v19 = (signed int)(unsigned __int16)v18 >> 3; + if ( (v18 & 7) == OBJECT_Item ) + { + v30 = v19; + if ( pObjectList->pObjects[pSpriteObjects[v30].uObjectDescID].uFlags & 0x10 ) + //goto LABEL_73; + { + pMouse->uPointingObjectID = 0; + //goto LABEL_50; + uLastPointedObjectID = 1; + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } + if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID ) + { + v22 = pSpriteObjects[v30].stru_24.GetDisplayName(); +//LABEL_93: + v26 = v22; + //goto LABEL_87; + sub_41C0B8_set_status_string(v26); + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } + v31 = pSpriteObjects[v30].stru_24.GetDisplayName(); + v28 = pTmpBuf; + sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[470], v31);// "Get %s" + } + else + { + if ( (v18 & 7) != OBJECT_Actor ) + { + if ( (v18 & 7) == OBJECT_Decoration ) + { + v23 = &pLevelDecorations[v19]; + v24 = v23; + v25 = v23->field_16_event_id; + if ( !v25 ) + { + if ( v23->IsInteractive() ) + v26 = pNPCTopics[stru_5E4C90._decor_events[v24->_idx_in_stru123 - 75] + 379].pTopic; + else + v26 = pDecorationList->pDecorations[v24->uDecorationDescID].field_20; + //goto LABEL_87; + sub_41C0B8_set_status_string(v26); + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } + v22 = GetEventHintString(v25); + if ( !v22 ) + //goto _return; + { + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } + //goto LABEL_93; + v26 = v22; + //goto LABEL_87; + sub_41C0B8_set_status_string(v26); + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } + if ( (v18 & 7) == OBJECT_BModel) + { + if ( v18 < (signed int)0x2000000u ) + { + if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) + { + v21 = pOutdoor->pBModels[(signed int)(unsigned __int16)v18 >> 9].pFaces[v19 & 0x3F].sCogTriggeredID; + //goto LABEL_71; + if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) + //goto LABEL_73; + { + pMouse->uPointingObjectID = 0; + //goto LABEL_50; + uLastPointedObjectID = 1; + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } + //goto LABEL_93; + v26 = v22; + //goto LABEL_87; + sub_41C0B8_set_status_string(v26); + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } + pFace = &pIndoor->pFaces[v19]; + if ( BYTE3(pFace->uAttributes) & 6 ) + { + v21 = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID; +//LABEL_71: + if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) + //goto LABEL_73; + { + pMouse->uPointingObjectID = 0; + //goto LABEL_50; + uLastPointedObjectID = 1; + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } + //goto LABEL_93; + v26 = v22; + //goto LABEL_87; + sub_41C0B8_set_status_string(v26); + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } + } +//LABEL_73: + pMouse->uPointingObjectID = 0; + //goto LABEL_50; + uLastPointedObjectID = 1; + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } +//LABEL_61: + pMouse->uPointingObjectID = 0; + //goto _return; + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } + if ( v18 >= 335544320 ) + //goto LABEL_61; + { + pMouse->uPointingObjectID = 0; + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } + pActor = &pActors[v19]; + v28 = pTmpBuf; + v29 = pActor->dword_000334_unique_name; + if ( v29 ) + v40 = pMonsterStats->pPlaceStrings[v29]; + else + v40 = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].pName; + strncpy(pTmpBuf, v40, 0x7D0u); + } + v26 = v28; +//LABEL_87: + sub_41C0B8_set_status_string(v26); + //goto _return; + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } + v1 = uNumVisibleWindows; + if ( uNumVisibleWindows > 0 ) + { + while ( 1 ) // some other fullscreen ui + { + pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1]; + if ( (signed int)pX >= (signed int)pWindow->uFrameX + && (signed int)pX <= (signed int)pWindow->uFrameZ + && (signed int)pY >= (signed int)pWindow->uFrameY + && (signed int)pY <= (signed int)pWindow->uFrameW ) + { + for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) + { + if ( !pButton ) + break; + if ( pButton->uButtonType == 1 ) + { + if ( (signed int)pX >= (signed int)pButton->uX + && (signed int)pX <= (signed int)pButton->uZ + && (signed int)pY >= (signed int)pButton->uY + && (signed int)pY <= (signed int)pButton->uW ) + { + //LABEL_24: + pMessageType1 = (UIMessageType)pButton->field_1C; + if ( pMessageType1 ) + { + v12 = pButton->uControlParam; + pMessageQueue_50CBD0->AddMessage(pMessageType1, v12, 0); + /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) + { + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1; + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12; + *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; + //LABEL_27: + ++pMessageQueue_50CBD0->uNumMessages; + }*/ + } + //LABEL_28: + v13 = pButton->pButtonName; + //_set_status_and_ret: + sub_41C0B8_set_status_string(v13); + //LABEL_131: + uLastPointedObjectID = 1; + return; + } + } + else + { + if ( pButton->uButtonType == 2 ) + { + v45 = pX - pButton->uX; + v45 = pY - pButton->uY; + if ( (double)(signed int)pButton->uWidth != 0.0 ) + { + if ( (double)(signed int)pButton->uHeight != 0.0 ) + { + //UNDEF(v8); + //if ( v9 | v10 ) + //goto LABEL_24; + //{ + pMessageType1 = (UIMessageType)pButton->field_1C; + if ( pMessageType1 ) + { + v12 = pButton->uControlParam; + pMessageQueue_50CBD0->AddMessage(pMessageType1, v12, 0); + /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) + { + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1; + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12; + *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; + ++pMessageQueue_50CBD0->uNumMessages; + }*/ + } + v13 = pButton->pButtonName; + sub_41C0B8_set_status_string(v13); + uLastPointedObjectID = 1; + return; + //} + } + } + } + else // click on skill + { + if ( pButton->uButtonType == 3 + && (signed int)pX >= (signed int)pButton->uX + && (signed int)pX <= (signed int)pButton->uZ + && (signed int)pY >= (signed int)pButton->uY + && (signed int)pY <= (signed int)pButton->uW ) + { + //LABEL_19: + pPlayer = pPlayers[uActiveCharacter]; + v5 = LOBYTE(pPlayer->pActiveSkills[pButton->uControlParam]); + v6 = pPlayer->uSkillPoints; + v7 = (v5 & 0x3F) + 1; + if ( v6 < v7 ) + { + v41 = v7 - v6; + v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" + } + else + { + v41 = v7; + v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" + } + sprintf(Str1, v39, v41); + v13 = Str1; + //goto _set_status_and_ret; + sub_41C0B8_set_status_string(v13); + uLastPointedObjectID = 1; + return; + } + } + } + } + } + if ( pWindow->uFrameHeight == 480 ) + break; + --v1; + if ( v1 <= 0 ) + { + break; + } + } + } + if ( uNumVisibleWindows <= 0 || (uNumVisibleWindows > 0 && pWindow->uFrameHeight != 480 && v1 <= 0)) + { + if ( pCurrentScreen == SCREEN_CHEST ) + { + sub_42038D(); + //goto _return; + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } + if ( pCurrentScreen == SCREEN_HOUSE ) + { + if ( dialog_menu_id != 2 + || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0) + || v16 == -65536 ) + //goto _return; + { + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } + pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 4); +//LABEL_49: + v17 = pItemGen->GetDisplayName(); + sub_41C0B8_set_status_string(v17); +//LABEL_50: + uLastPointedObjectID = 1; +//_return: + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } + if ( (signed int)pY < 350 ) + { + v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; + if ( v14 == 0 || v14 == -65536 || (unsigned int)v14 >= 0x1388 ) + //goto _return; + { + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } + pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v14-1]; + //goto LABEL_49; + v17 = pItemGen->GetDisplayName(); + sub_41C0B8_set_status_string(v17); + uLastPointedObjectID = 1; + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } +_click_on_game_ui: + if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX + && (signed int)pX <= (signed int)pWindowList[0].uFrameZ + && (signed int)pY >= (signed int)pWindowList[0].uFrameY + && (signed int)pY <= (signed int)pWindowList[0].uFrameW ) + { + for ( pButton = pWindowList[0].pControlsHead; pButton != (GUIButton *)0; pButton = pButton->pNext ) + { + if ( pButton->uButtonType == 1 ) + { + if ( (signed int)pX >= (signed int)pButton->uX + && (signed int)pX <= (signed int)pButton->uZ + && (signed int)pY >= (signed int)pButton->uY + && (signed int)pY <= (signed int)pButton->uW ) + { + pMessageType3 = (UIMessageType)pButton->field_1C; + if ( pMessageType3 == 0 ) // For books + //goto LABEL_28; + { + v13 = pButton->pButtonName; + sub_41C0B8_set_status_string(v13); + uLastPointedObjectID = 1; + return; + } + v38 = pButton->uControlParam; + /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) + { + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType3; + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v38; + *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; + ++pMessageQueue_50CBD0->uNumMessages; + }*/ + pMessageQueue_50CBD0->AddMessage(pMessageType3, v38, 0); + //goto LABEL_131; + uLastPointedObjectID = 1; + return; + } + } + else + { + if ( pButton->uButtonType == 2 ) + { + v45 = pX - pButton->uX; + v45 = pY - pButton->uY; + + if (pX >= pButton->uX && pX <= pButton->uZ && + pY >= pButton->uY && pY <= pButton->uW) + if ( (double)(signed int)pButton->uWidth != 0.0 ) + { + if ( (double)(signed int)pButton->uHeight != 0.0 ) + { + //UNDEF(v32); + //if ( v33 | v34 ) + //{ + pMessageType2 = (UIMessageType)pButton->field_1C; + if ( pMessageType2 != 0 ) + { + v36 = pButton->uControlParam; + if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) + { + pMessageQueue_50CBD0->AddMessage(pMessageType2, v36, 0); + /*pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType2; + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v36; + *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; + //goto LABEL_27; + ++pMessageQueue_50CBD0->uNumMessages;*/ + v13 = pButton->pButtonName; + sub_41C0B8_set_status_string(v13); + uLastPointedObjectID = 1; + return; + } + } + //goto LABEL_28; + v13 = pButton->pButtonName; + sub_41C0B8_set_status_string(v13); + uLastPointedObjectID = 1; + return; + //} + } + } + } + else + { + if ( pButton->uButtonType == 3 + && (signed int)pX >= (signed int)pButton->uX + && (signed int)pX <= (signed int)pButton->uZ + && (signed int)pY >= (signed int)pButton->uY + && (signed int)pY <= (signed int)pButton->uW ) + //goto LABEL_19; + { + pPlayer = pPlayers[uActiveCharacter]; + v5 = LOBYTE(pPlayer->pActiveSkills[pButton->uControlParam]); + v6 = pPlayer->uSkillPoints; + v7 = (v5 & 0x3F) + 1; + if ( v6 < v7 ) + { + v41 = v7 - v6; + v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" + } + else + { + v41 = v7; + v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" + } + sprintf(Str1, v39, v41); + v13 = Str1; + //goto _set_status_and_ret; + sub_41C0B8_set_status_string(v13); + uLastPointedObjectID = 1; + return; + } + } + } + } + } + pMouse->uPointingObjectID = sub_46A99B(); + //goto _return; + if ( pMouse->uPointingObjectID == 0 ) + { + if ( uLastPointedObjectID != 0 ) + { + pStatusBarString[0] = 0; + bForceDrawStatusBar = 1; + } + } + uLastPointedObjectID = pMouse->uPointingObjectID; + return; + } +} + + +//----- (0044158F) -------------------------------------------------------- +void __cdecl GameUI_DrawCharacterSelectionFrame() + { + if ( uActiveCharacter ) + pRenderer->DrawTextureTransparent( + pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9, + 0x17Cu, + &pIcons_LOD->pTextures[dword_50C98C]); + } + +//----- (004415C5) -------------------------------------------------------- +void LoadPartyBuffIcons() + { + for (uint i = 0; i < 14; ++i) + { + char filename[200]; + sprintf(filename, "isn-%02d", i + 1); + pTextureIDs_PartyBuffIcons[i] = pIcons_LOD->LoadTexture(filename, TEXTURE_16BIT_PALETTE); + } + + uIconIdx_FlySpell = pIconsFrameTable->FindIcon("spell21"); + uIconIdx_WaterWalk = pIconsFrameTable->FindIcon("spell27"); + } + +//----- (0044162D) -------------------------------------------------------- +void __cdecl GameUI_DrawPartySpells() + { + unsigned int v0; // ebp@1 + //signed int v1; // edi@1 + //int v2; // eax@2 + //int v3; // ecx@5 + //__int16 *v4; // ebx@25 + //Player *v5; // edi@26 + //unsigned int v6; // [sp-4h] [bp-1Ch]@11 + Texture *v7; // [sp-4h] [bp-1Ch]@12 + //unsigned int v8; // [sp-4h] [bp-1Ch]@20 + Texture *v9; // [sp-4h] [bp-1Ch]@21 + //Player **v10; // [sp+10h] [bp-8h]@25 + + v0 = (signed __int64)((double)GetTickCount() * 0.050000001); + //v1 = 0; + for (uint i = 0; i < 14; ++i) + { + //v2 = byte_4E5DD8[v1]; + if (pParty->pPartyBuffs[byte_4E5DD8[i]].uExpireTime) + { + auto tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]); + //v3 = pTextureIDs_PartyBuffIcons[i]; + if (tex) + pRenderer->_4A65CC(pPartySpellbuffsUI_XYs[i][0], + pPartySpellbuffsUI_XYs[i][1], tex, tex, + v0 + 20 * pPartySpellbuffsUI_smthns[i], 0, 63); + } + //++v1; + } + //while ( v1 < 14 ); + + if (pCurrentScreen == SCREEN_GAME || pCurrentScreen == SCREEN_NPC_DIALOGUE) + { + if (pParty->FlyActive()) + { + if ( pParty->bFlying ) + v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID]; + else + v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID]; + if ( pRenderer->pRenderD3D ) + pRenderer->DrawTextureIndexed(8u, 8u, v7); + else + pRenderer->DrawTextureTransparent(8u, 8u, v7); + } + if (pParty->WaterWalkActive()) + { + if ( pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER) + v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID]; + else + v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID]; + if ( pRenderer->pRenderD3D ) + pRenderer->DrawTextureIndexed(396u, 8u, v9); + else + pRenderer->DrawTextureTransparent(396u, 8u, v9); + } + } + + for (uint i = 0; i < 4; ++i) + { + auto player = pParty->pPlayers + i; + + if (player->pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime) + pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 427, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Hammerhands)); + if (player->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime) + pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 393, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Bless)); + if (player->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime) + pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation)); + if (player->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime) + pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection)); + } + } + + +//----- (00421626) -------------------------------------------------------- +GUIWindow *GameUI_InitializeCharacterWindow(unsigned int _this) +{ + unsigned int v1; // edi@1 + GUIWindow *pWindow; // edi@3 + + ++pIcons_LOD->uTexturePacksCount; + v1 = _this; + if ( !pIcons_LOD->uNumPrevLoadedFiles ) + pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; + pEventTimer->Pause(); + pAudioPlayer->StopChannels(-1, -1); + bRingsShownInCharScreen = 0; + CharacterUI_LoadPaperdollTextures(); + pCurrentScreen = v1; + pWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_CharacterRecord, uActiveCharacter, 0); + pCharacterScreen_StatsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 12, pViewport->uViewportTL_Y + 308, + (papredoll_dbrds[9] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[9]].uTextureWidth : 24), + (papredoll_dbrds[9] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[9]].uTextureHeight : 26), + 1, 0, 0x73u, 0, 0x53u, pGlobalTXT_LocalizationStrings[216],// Stats + (Texture *)(papredoll_dbrds[10] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[10]] : 0), + papredoll_dbrds[9] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[9]] : 0, 0); + pCharacterScreen_SkillsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 102, pViewport->uViewportTL_Y + 308, + (papredoll_dbrds[7] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[7]].uTextureWidth : 24), + (papredoll_dbrds[7] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[7]].uTextureHeight : 26), + 1, 0, 0x72u, 0, 0x4Bu, pGlobalTXT_LocalizationStrings[205],//Skills + (Texture *)(papredoll_dbrds[8] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[8]] : 0), + papredoll_dbrds[7] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[7]] : 0, 0); + pCharacterScreen_InventoryBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 192, pViewport->uViewportTL_Y + 308, + (papredoll_dbrds[5] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[5]].uTextureWidth : 24), + (papredoll_dbrds[5] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[5]].uTextureHeight : 26), + 1, 0, 0x74u, 0, 0x49u, pGlobalTXT_LocalizationStrings[120], //Inventory + (Texture *)(papredoll_dbrds[6] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[6]] : 0), + papredoll_dbrds[5] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[5]] : 0, 0); + pCharacterScreen_AwardsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 282, pViewport->uViewportTL_Y + 308, + (papredoll_dbrds[3] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[3]].uTextureWidth : 24), + (papredoll_dbrds[3] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[3]].uTextureHeight : 26), + 1, 0, 0x75u, 0, 0x41u, pGlobalTXT_LocalizationStrings[22], //Awards + (Texture *)(papredoll_dbrds[4] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[4]] : 0), + papredoll_dbrds[3] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[3]] : 0, 0); + pCharacterScreen_ExitBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 371, pViewport->uViewportTL_Y + 308, + (papredoll_dbrds[1] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[1]].uTextureWidth : 24), + (papredoll_dbrds[1] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[1]].uTextureHeight : 26), + 1, 0, 0xA8u, 0, 0, pGlobalTXT_LocalizationStrings[79],//Exit + (Texture *)(papredoll_dbrds[2] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[2]] : 0), + papredoll_dbrds[1] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[1]] : 0, 0); + pWindow->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, 0x78u, 0, 0, "", 0); + pCharacterScreen_DetalizBtn = pWindow->CreateButton(0x258u, 0x12Cu, 0x1Eu, 0x1Eu, 1, 0, 0x55u, 0, 0, pGlobalTXT_LocalizationStrings[64], 0); + pCharacterScreen_DollBtn = pWindow->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, 0x85u, 0, 0, "", 0); + pWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); + pWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); + pWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); + pWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); + pWindow->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); + FillAwardsData(); + return pWindow; +} + + +//----- (004921C1) -------------------------------------------------------- +void GameUI_DrawPortraits(unsigned int _this) + { + Texture *pFace; // eax@10 + unsigned int v7; // eax@17 + PlayerFrame *pFrame; // eax@21 + unsigned int v9; // eax@27 + bool v10; // eax@33 + bool v11; // edi@40 + bool v12; // edx@43 + bool v13; // ecx@46 + int v16; // eax@57 + int v19; // eax@62 + Texture *pPortrait; // [sp-4h] [bp-1Ch]@27 + unsigned int v22; // [sp+14h] [bp-4h]@1 + + v22 = _this; + if ( qword_A750D8 ) + { + qword_A750D8 -= (signed int)pMiscTimer->uTimeElapsed; + if ( qword_A750D8 <= 0 ) + { + if ( pPlayers[word_A750E2]->CanAct() ) + pPlayers[word_A750E2]->PlaySound((PlayerSpeech)word_A750E0, 0); + qword_A750D8 = 0i64; + } + } + + for (uint i = 0; i < 4; ++i) + { + auto pPlayer = pParty->pPlayers + i; + + if (pPlayer->Eradicated()) + { + pFace = pTexture_PlayerFaceEradicated; + pPortrait = pFace; + v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i]; + if ( pParty->pPartyBuffs[11].uExpireTime ) + pRenderer->_4A6E7E(v9, 0x183u, pPortrait); + else + pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, pPortrait); + auto _v1 = 0; + v10 = pPlayer->pPlayerBuffs[14].uExpireTime > 0; + if (pPlayer->pPlayerBuffs[1].uExpireTime > 0) + _v1 = 1; + v11 = pPlayer->pPlayerBuffs[8].uExpireTime > 0; + v12 = pPlayer->pPlayerBuffs[7].uExpireTime > 0; + v13 = pPlayer->pPlayerBuffs[13].uExpireTime > 0; + if ( v13 | v12 | v11 | _v1 | v10 ) + sub_441A4E(i); + continue; + } + if (pPlayer->Dead()) + { + pFace = pTexture_PlayerFaceDead; + pPortrait = pFace; + v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i]; + if ( pParty->pPartyBuffs[11].uExpireTime ) + pRenderer->_4A6E7E(v9, 0x183u, pPortrait); + else + pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, pPortrait); + auto _v1 = 0; + v10 = pPlayer->pPlayerBuffs[14].uExpireTime > 0; + if (pPlayer->pPlayerBuffs[1].uExpireTime > 0) + _v1 = 1; + v11 = pPlayer->pPlayerBuffs[8].uExpireTime > 0; + v12 = pPlayer->pPlayerBuffs[7].uExpireTime > 0; + v13 = pPlayer->pPlayerBuffs[13].uExpireTime > 0; + if ( v13 | v12 | v11 | _v1 | v10 ) + sub_441A4E(i); + continue; + } + v7 = 0; + for (uint j = 0; j < pPlayerFrameTable->uNumFrames; ++j) + if (pPlayerFrameTable->pFrames[j].expression == pPlayer->expression) + { + v7 = j; + break; + } + if ( v7 == 0 ) + v7 = 1; + if (pPlayer->expression == CHARACTER_EXPRESSION_21) + pFrame = pPlayerFrameTable->GetFrameBy_y(&pPlayer->_expression21_frameset, &pPlayer->_expression21_animtime, pMiscTimer->uTimeElapsed); + else + pFrame = pPlayerFrameTable->GetFrameBy_x(v7, pPlayer->uExpressionTimePassed); + if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || v22 ) + { + pPlayer->field_1AA2 = pFrame->uTextureID - 1; + pFace = (Texture *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture *)pTextures_PlayerFaces[i][pFrame->uTextureID]; + pPortrait = pFace; + v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i]; + if ( pParty->pPartyBuffs[11].uExpireTime ) + pRenderer->_4A6E7E(v9, 0x183u, pPortrait); + else + pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, pPortrait); + auto _v1 = 0; + v10 = pPlayer->pPlayerBuffs[14].uExpireTime > 0; + if (pPlayer->pPlayerBuffs[1].uExpireTime > 0) + _v1 = 1; + v11 = pPlayer->pPlayerBuffs[8].uExpireTime > 0; + v12 = pPlayer->pPlayerBuffs[7].uExpireTime > 0; + v13 = pPlayer->pPlayerBuffs[13].uExpireTime > 0; + if ( v13 | v12 | v11 | _v1 | v10 ) + sub_441A4E(i); + continue; + } + } + if ( pParty->bTurnBasedModeOn == 1 ) + { + if ( pTurnEngine->field_4 != 1 ) + { + if ( (pTurnEngine->pQueue[0].uPackedID & 7) == OBJECT_Player) + { + //v14 = 0; + if ( pTurnEngine->uActorQueueSize > 0 ) + { + //v15 = (char *)pTurnEngine->pQueue; + for (uint i = 0; i < pTurnEngine->uActorQueueSize; ++i) + { + auto pElem = pTurnEngine->pQueue + i; + + if ( (pElem->uPackedID & 7) != OBJECT_Player) + break; + v16 = dword_5079D0; + if ( pParty->uFlags & 0x10 ) + { + v16 = dword_5079CC; + } + else + { + if ( pParty->uFlags & 0x20 ) + v16 = dword_5079C8; + } + pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[pElem->uPackedID >> 3] - 4, + 0x181u, (Texture *)(v16 != -1 ? &pIcons_LOD->pTextures[v16] : 0)); + } + } + } + } + } + else + { + for (uint i = 0; i < 4; ++i) + { + auto pPlayer = pParty->pPlayers + i; + if (pPlayer->CanAct() && !pPlayer->uTimeToRecovery) + { + v19 = dword_5079D0; + if ( pParty->uFlags & 0x10 ) + { + v19 = dword_5079CC; + } + else + { + if ( pParty->uFlags & 0x20 ) + v19 = dword_5079C8; + } + pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] - 4, + 0x181u, (Texture *)(v19 != -1 ? &pIcons_LOD->pTextures[v19] : 0)); + } + } + } + } + + //----- (00441D38) -------------------------------------------------------- +void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap) +{ + int uHeight; // ebx@6 + __int16 v11; // cx@11 + unsigned int v14; // ebx@23 + int v15; // eax@23 + __int16 v17; // di@30 + double v18; // st7@30 + float v19; // ST38_4@30 + double v20; // st7@30 + double v21; // st6@30 + double v22; // st5@33 + signed int v27; // eax@37 + unsigned __int16 *v28; // ecx@37 + signed int v29; // edi@40 + //signed int v33; // ebx@50 + //unsigned int v34; // eax@50 + //signed int v35; // ecx@50 + //unsigned __int16 v36; // di@66 + int v37; // edi@72 + int v38; // ebx@72 + __int16 v39; // ax@87 + int v40; // edi@91 + int v41; // ebx@91 + unsigned int v42; // eax@101 + unsigned int v43; // ebx@101 + unsigned int v44; // ST30_4@101 + char *v45; // ebx@106 + int v46; // edi@108 + int v47; // eax@108 + unsigned int v48; // ebx@114 + unsigned int v49; // ST64_4@114 + unsigned int v51; // [sp-10h] [bp-64h]@79 + unsigned int v52; // [sp-10h] [bp-64h]@100 + unsigned int v53; // [sp-Ch] [bp-60h]@79 + unsigned int v54; // [sp-Ch] [bp-60h]@100 + unsigned int v55; // [sp-8h] [bp-5Ch]@77 + unsigned int v56; // [sp-8h] [bp-5Ch]@100 + //signed int v57; // [sp-4h] [bp-58h]@54 + unsigned __int16 v58; // [sp-4h] [bp-58h]@77 + unsigned __int16 v59; // [sp-4h] [bp-58h]@100 + unsigned __int16 v60; // [sp+10h] [bp-44h]@66 + unsigned int v61; // [sp+10h] [bp-44h]@85 + unsigned int v63; // [sp+14h] [bp-40h]@85 + unsigned int v65; // [sp+18h] [bp-3Ch]@85 + unsigned int lPitch; // [sp+20h] [bp-34h]@1 + unsigned int lPitcha; // [sp+20h] [bp-34h]@23 + char *lPitchb; // [sp+20h] [bp-34h]@106 + unsigned int v69; // [sp+24h] [bp-30h]@23 + signed int v70; // [sp+24h] [bp-30h]@37 + unsigned __int16 uBlue; // [sp+28h] [bp-2Ch]@1 + signed int uBluea; // [sp+28h] [bp-2Ch]@37 + int v73; // [sp+2Ch] [bp-28h]@30 + int v76; // [sp+34h] [bp-20h]@91 + int v77; // [sp+34h] [bp-20h]@108 + int v79; // [sp+38h] [bp-1Ch]@72 + char *a2c; // [sp+40h] [bp-14h]@68 + signed int uCenterY; // [sp+48h] [bp-Ch]@1 + signed int uCenterX; // [sp+4Ch] [bp-8h]@1 + signed int uWidth; // [sp+5Ch] [bp+8h]@30 + signed int uZe; // [sp+5Ch] [bp+8h]@67 + signed int uZf; // [sp+5Ch] [bp+8h]@85 + signed int uZg; // [sp+5Ch] [bp+8h]@105 + unsigned int uWa; // [sp+60h] [bp+Ch]@23 + float uWb; // [sp+60h] [bp+Ch]@30 + unsigned int uWd; // [sp+60h] [bp+Ch]@95 + float uZooma; // [sp+64h] [bp+10h]@117 + unsigned int flagsb; // [sp+68h] [bp+14h]@66 + Actor *flagsc; // [sp+68h] [bp+14h]@86 + unsigned int flagsd; // [sp+68h] [bp+14h]@105 + + uCenterX = (uX + uZ) / 2; + uCenterY = (uY + uW) / 2; + lPitch = pRenderer->uTargetSurfacePitch; + GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0); + uBlue = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu); + auto bWizardEyeActive = pParty->WizardEyeActive(); + auto uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel(); + if (CheckHiredNPCSpeciality(Cartographer)) + { + bWizardEyeActive = true; + uWizardEyeSkillLevel = 2; + } + pRenderer->Clip_v2(uX, uY, uZ - 1, uW - 1); + uHeight = uW - uY; + uWidth = uZ - uX; + + if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) + { + v17 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2; + auto pMapLod0 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0; + auto pPal = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16; + v73 = (1 << (v17 + 16)) / (signed int)uZoom; + v18 = (double)(1 << (16 - v17)); + v19 = v18; + v20 = (double)(pParty->vPosition.x + 32768) / v18; + v21 = (double)(32768 - pParty->vPosition.y) / v19; + uWb = v21; + switch (uZoom) + { + case 512: + { + v20 = v20 - (double)(uWidth / 2); + v22 = (double)(uHeight / 2); + uWb = v21 - v22; + } + break; + + case 1024: + { + v20 = v20 - (double)(uWidth / 4); + v22 = (double)(uHeight / 4); + uWb = v21 - v22; + } + break; + + case 2048: + { + v20 = v20 - (double)(uWidth / 8); + v22 = (double)(uHeight / 8); + uWb = v21 - v22; + } + break; + + default: assert(false); + } + assert(sizeof(pOdmMinimap) == 137 * 117 * sizeof(short)); + + v70 = floorf(v20 * 65536.0 + 0.5f);//LODWORD(v24); + uBluea = floorf(uWb * 65536.0 + 0.5f);//LODWORD(v25); + v27 = uBluea >> 16; + v28 = &pRenderer->pTargetSurface[uX + uY * lPitch]; + if (pMapLod0 && bRedrawOdmMinimap) + { + assert(uWidth == 137 && uHeight == 117); + //auto pMinimap = (unsigned __int16 *)pOdmMinimap; + + auto mapWidth = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; + + v29 = v70 >> 16; + + for (int y = 0; y < uHeight; ++y) + { + auto pMapLod0Line = &pMapLod0[v27 * mapWidth]; + for (int x = 0; x < uWidth; ++x) + { + //*pMinimap++ = pPal[pMapLod0Line[v29]]; + pOdmMinimap[y][x] = pPal[pMapLod0Line[v29]]; + v29 = (v70 + x * v73) >> 16; + } + + v29 = v70 >> 16; + v28 += 137 - uWidth; + uBluea += v73; + v27 = uBluea >> 16; + } + } + + for (int y = 0; y < 117; ++y) + { + for (int x = 0; x < 137; ++x) + { + *v28++ = pOdmMinimap[y][x]; + } + v28 += lPitch - 137; + } + uNumBlueFacesInBLVMinimap = 0; + } + else + { + pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF); + uNumBlueFacesInBLVMinimap = 0; + + for (uint i = 0; i < pIndoor->pMapOutlines->uNumOutlines; ++i) + { + auto pOutline = &pIndoor->pMapOutlines->pOutlines[i]; + + auto pFace1 = pIndoor->pFaces + pOutline->uFace1ID; + auto pFace2 = pIndoor->pFaces + pOutline->uFace2ID; + //v9 = pIndoor->pFaces[pMapVertex->uFace1ID].uAttributes; + //v10 = pIndoor->pFaces[pMapVertex->uFace2ID].uAttributes; + if (pFace1->Visible() && pFace2->Visible()) + { + v11 = pOutline->uFlags; + if ( v11 & 1 ) + goto LABEL_15; + if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80u != 0 ) + goto LABEL_ABC; + + } + continue; + +LABEL_ABC: + pOutline->uFlags = v11 | 1; + pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8); + +LABEL_15: + //v12 = &pIndoor->pFaces[pOutline->uFace1ID]; + if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 && + (pFace1->uAttributes & 0x2000000 || pFace2->uAttributes & 0x2000000) && + (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID)) + { + if (uNumBlueFacesInBLVMinimap < 49) + pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i; + } + else + { + auto _a = (uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x); + auto _b = ((unsigned int)((unsigned __int64)_a >> 16) << 16); + auto _c = ((signed int)(_b - uZoom * pParty->vPosition.x) >> 16); + v69 = uCenterX + _c; + v69 = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); + lPitcha = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); + uWa = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); + v14 = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); + v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; + if ( v15 > 100 ) + v15 = 100; + pRenderer->Line2D(v69, lPitcha, uWa, v14, viewparams->pPalette[-v15 + 200]); + } + } + + + for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i) + { + //v16 = (uint *)&pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[uZb]]; + auto pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]]; + pRenderer->Line2D(uCenterX + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom + * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) + - uZoom * pParty->vPosition.x) >> 16), + uCenterY + - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom + * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) + - uZoom * pParty->vPosition.y) >> 16), + uCenterX + + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom + * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) + - uZoom * pParty->vPosition.x) >> 16), + uCenterY + - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom + * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) + - uZoom * pParty->vPosition.y) >> 16), + uBlue); + } + } + + + assert(pParty->sRotationY >= 0); + float angle = (pParty->sRotationY % 2048) / 2048.0f; + const float two_pi = 2.0f * 3.14159f; + + uint arrow_idx = floorf(0.5f + 7 * angle); + pRenderer->DrawTextureTransparent(uCenterX - 3, uCenterY - 3, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[arrow_idx])); + + flagsb = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu); + v60 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0); + if (bWizardEyeActive) + { + uZe = 0; + //for (uint i = 0; i < uNumSpriteObjects; ++i) + if (uNumSpriteObjects > 0) + { + a2c = (char *)&pSpriteObjects[0].uObjectDescID; + while ( 1 ) + { + if ( !*((short *)a2c - 1) + || !*(short *)a2c + || uWizardEyeSkillLevel == 1 + || (v37 = ((unsigned __int64)((*(int *)(a2c + 2) - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16) + + uCenterX, + v79 = (unsigned __int64)((*(int *)(a2c + 6) - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16, + v38 = uCenterY - v79, + v37 < pRenderer->field_1C_clipx) + || v37 > pRenderer->field_24_width + || v38 < pRenderer->field_20_clipy + || v38 > pRenderer->field_28_height ) + goto LABEL_83; + if ( pObjectList->pObjects[*(short *)a2c].uFlags & 0x10 ) + break; + if ( (signed int)uZoom > 512 ) + { + pRenderer->Line2D(v37 - 1, v38 - 1, v37 - 1, v38 + 1, flagsb); + pRenderer->Line2D(v37, v38 - 2, v37, v38 + 1, flagsb); + pRenderer->Line2D(v37 + 1, v38 - 1, v37 + 1, v38 + 1, flagsb); + pRenderer->Line2D(v37 - 2, v38, v37 - 2, v38 + 1, flagsb); + v37 += 2; + v58 = flagsb; + v55 = v38 + 1; + goto LABEL_81; + } + pRenderer->Line2D(v37 - 1, v38 - 1, v37 - 1, uCenterY - v79, flagsb); + v58 = flagsb; + v55 = uCenterY - v79; + v53 = v37; + v51 = v38 - 1; +LABEL_82: + pRenderer->Line2D(v37, v51, v53, v55, v58); +LABEL_83: + ++uZe; + a2c += 112; + if ( uZe >= (signed int)uNumSpriteObjects ) + { + goto LABEL_85; + } + } + v58 = v60; + v55 = uCenterY - v79; +LABEL_81: + v53 = v37; + v51 = uCenterY - v79; + goto LABEL_82; + } +LABEL_85: + v63 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 0, 0); + v61 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 255, 0); + v65 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 0); + uZf = 0; + if ( (signed int)uNumActors > 0 ) + { + flagsc = pActors;//[0].uAIState; + do + { + v39 = flagsc->uAIState; + if ( flagsc->uAIState != 11 && v39 != 19 && (v39 == 5 || BYTE1(flagsc->uAttributes) & 0x80) ) + { + v40 = ((unsigned __int64)(( flagsc->vPosition.x - pParty->vPosition.x) + * (signed __int64)(signed int)uZoom) >> 16) + + uCenterX; + v76 = (unsigned __int64)(( flagsc->vPosition.y - pParty->vPosition.y) + * (signed __int64)(signed int)uZoom) >> 16; + v41 = uCenterY - v76; + if ( v40 >= pRenderer->field_1C_clipx ) + { + if ( v40 <= pRenderer->field_24_width && v41 >= pRenderer->field_20_clipy && v41 <= pRenderer->field_28_height ) + { + uWd = v61; + if ( BYTE3(flagsc->uAttributes) & 1 ) + uWd = v63; + if ( flagsc->uAIState == 5 ) + uWd = v65; + if ( (signed int)uZoom > 1024 ) + { + pRenderer->Line2D(v40 - 1, v41 - 2, v40 - 1, v41 + 2, uWd); + pRenderer->Line2D(v40, v41 - 2, v40, v41 + 2, uWd); + pRenderer->Line2D(v40 + 1, v41 - 2, v40 + 1, v41 + 2, uWd); + v42 = v41 + 1; + v43 = v41 - 1; + v44 = v42; + pRenderer->Line2D(v40 - 2, v43, v40 - 2, v42, uWd); + v40 += 2; + v59 = uWd; + v56 = v44; + v54 = v40; + v52 = v43; + } + else + { + pRenderer->Line2D(v40 - 1, v41 - 1, v40 - 1, uCenterY - v76, uWd); + v59 = uWd; + v56 = uCenterY - v76; + v54 = v40; + v52 = v41 - 1; + } + pRenderer->Line2D(v40, v52, v54, v56, v59); + } + } + } + ++uZf; + ++flagsc; + } + while ( uZf < (signed int)uNumActors ); + } + } + flagsd = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 255); + uZg = 0; + if ( (signed int)uNumLevelDecorations > 0 ) + { + v45 = (char *)&pLevelDecorations[0].vPosition; + lPitchb = (char *)&pLevelDecorations[0].vPosition; + do + { + if ( *(v45 - 2) & 8 ) + { + v46 = ((unsigned __int64)((*(int *)v45 - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16) + + uCenterX; + v77 = (unsigned __int64)((*((int *)v45 + 1) - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16; + v47 = uCenterY - v77; + if ( v46 >= pRenderer->field_1C_clipx ) + { + if ( v46 <= pRenderer->field_24_width && v47 >= pRenderer->field_20_clipy && v47 <= pRenderer->field_28_height ) + { + if ( (signed int)uZoom > 512 ) + { + v48 = v47 + 1; + v49 = v47 - 1; + pRenderer->Line2D(v46 - 1, v47 - 1, v46 - 1, v47 + 1, flagsd); + pRenderer->Line2D(v46, v49, v46, v48, flagsd); + pRenderer->Line2D(v46 + 1, v49, v46 + 1, v48, flagsd); + v45 = lPitchb; + } + else + { + pRenderer->Line2D(v46, uCenterY - v77, v46, uCenterY - v77, flagsd); + } + } + } + } + ++uZg; + v45 += 32; + lPitchb = v45; + } + while ( uZg < (signed int)uNumLevelDecorations ); + } + pRenderer->DrawTextureTransparent(0x1D4u, 0, (Texture *)(dword_5079D8 != -1 ? &pIcons_LOD->pTextures[dword_5079D8] : 0)); + uZooma = (double)pParty->sRotationY * 0.1171875; + //v50 = uZooma + 6.7553994e15; + pRenderer->Clip(541, 0, 567, 480); + pRenderer->DrawTextureIndexed(floorf(uZooma + 0.5f) + 285, 136, (Texture *)(dword_5079B4 != -1 ? &pIcons_LOD->pTextures[dword_5079B4] : 0)); + pRenderer->ResetClip(); +} + +//----- (00441498) -------------------------------------------------------- +void __cdecl GameUI_DrawTorchlightAndWizardEye() + { + if (pCurrentScreen == SCREEN_GAME + || pCurrentScreen == SCREEN_MENU + || pCurrentScreen == SCREEN_OPTIONS + || pCurrentScreen == SCREEN_REST + || pCurrentScreen == SCREEN_SPELL_BOOK + || pCurrentScreen == SCREEN_CHEST + || pCurrentScreen == SCREEN_SAVEGAME + || pCurrentScreen == SCREEN_LOADGAME + || pCurrentScreen == SCREEN_F + || pCurrentScreen == SCREEN_BOOKS + || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) + { + if (pParty->TorchlightActive()) + { + auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time()); + pRenderer->DrawTextureTransparent(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID)); + } + if (pParty->WizardEyeActive()) + { + auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time()); + pRenderer->DrawTextureTransparent(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID)); + } + } + } +// 4E28F8: using guessed type int pCurrentScreen; + + +//----- (00491F87) -------------------------------------------------------- +void __cdecl DrawHiredNPCs() +{ + //int v6; // eax@15 + char v7; // al@17 + unsigned int v8; // eax@18 + int v9; // esi@18 + int v10; // eax@18 + unsigned int v11; // eax@19 + unsigned int v12; // esi@19 + unsigned int v13; // eax@23 + IconFrame *v14; // eax@24 + unsigned int v15; // eax@26 + char pContainer[20]; // [sp+Ch] [bp-30h]@18 + unsigned int v17; // [sp+20h] [bp-1Ch]@19 + signed int uFrameID; // [sp+24h] [bp-18h]@19 + //int i; // [sp+28h] [bp-14h]@15 + unsigned int v20; // [sp+2Ch] [bp-10h]@20 + unsigned int v21; // [sp+30h] [bp-Ch]@19 + int v22; // [sp+34h] [bp-8h]@2 + unsigned __int8 v23; // [sp+3Bh] [bp-1h]@2 + + if ( bNoNPCHiring != 1 ) + { + v23 = 0; + v22 = 0; + /*for (uint i = 0; i < 2; ++i) + { + if (pParty->pHirelings[i].pName) + pTmpBuf[v22++] = i; + }*/ + if (pParty->pHirelings[0].pName) + pTmpBuf[v22++] = 0; + if (pParty->pHirelings[1].pName) + pTmpBuf[v22++] = 1; + + for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i) + { + if (pNPCStats->pNewNPCData[i].uFlags & 128) + { + if (!pParty->pHirelings[0].pName || strcmp(pNPCStats->pNewNPCData[i].pName, pParty->pHirelings[0].pName)) + { + if (!pParty->pHirelings[1].pName || strcmp(pNPCStats->pNewNPCData[i].pName, pParty->pHirelings[1].pName)) + pTmpBuf[v22++] = i + 2; + } + } + } + + //v6 = (unsigned __int8)pParty->field_709; + for ( int i = (unsigned __int8)pParty->field_709; i < v22 && v23 < 2; i++ ) + { + v7 = pTmpBuf[i]; + if ( (unsigned __int8)v7 >= 2 ) + { + sprintf(pContainer, "NPC%03d", pNPCStats->pNPCData[(unsigned __int8)v7 + 499].uPortraitID); + v15 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[v23], pHiredNPCsIconsOffsetsY[v23], (Texture *)(v15 != -1 ? &pIcons_LOD->pTextures[v15] : 0)); + } + else + { + sprintf(pContainer, "NPC%03d", pParty->pHirelings[(unsigned __int8)v7].uPortraitID); + v8 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); + v9 = v23; + pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[v9], pHiredNPCsIconsOffsetsY[v9], (Texture *)(v8 != -1 ? &pIcons_LOD->pTextures[v8] : 0)); + v10 = (unsigned __int8)pTmpBuf[i]; + if ( pParty->pHirelings[v10].evt_A == 1 ) + { + uFrameID = pParty->pHirelings[v10].evt_B; + v11 = pHiredNPCsIconsOffsetsX[v9]; + v12 = pHiredNPCsIconsOffsetsY[v9]; + v17 = v11; + v21 = 0; + if ( (signed int)pIconsFrameTable->uNumIcons <= 0 ) + { +LABEL_23: + v13 = 0; + } + else + { + v20 = 0; + while ( _strcmpi("spell96", pIconsFrameTable->pIcons[v20 / 0x20].pAnimationName) ) + { + ++v21; + v20 += 32; + if ( (signed int)v21 >= (signed int)pIconsFrameTable->uNumIcons ) + goto LABEL_23; + } + v13 = v21; + } + v14 = pIconsFrameTable->GetFrame(v13, uFrameID); + pRenderer->DrawTextureTransparent(v17, v12, &pIcons_LOD->pTextures[v14->uTextureID]); + } + } + ++v23; + } + } +} +// 6BE3C5: using guessed type char bNoNPCHiring; + diff -r f39d5902c85a -r 70c5a87a1307 mm7_1.cpp --- a/mm7_1.cpp Wed Mar 20 17:48:51 2013 +0600 +++ b/mm7_1.cpp Wed Mar 20 17:49:15 2013 +0600 @@ -67,12 +67,6 @@ -void __cdecl FreeSavegameThumbnails() -{ - for (int i = 0; i < 40; ++i) - //pAllocator->FreeChunk(pSavegameThumbnails[i].pPixels); - pSavegameThumbnails[i].Release(); -} //----- (004196A0) -------------------------------------------------------- @@ -112,680 +106,7 @@ // 50698C: using guessed type int dword_50698C; // 507CC0: using guessed type int dword_507CC0; -//----- (00419719) -------------------------------------------------------- -char __fastcall CharacterUI_SkillsTab_Draw(unsigned int uPlayerID) -{ - unsigned int v1; // esi@1 - Player *pPlayer; // ebp@1 - unsigned int v3; // eax@1 - signed int v4; // ecx@1 - int v5; // edi@3 - GUIWindow *v6; // ecx@3 - int v7; // eax@4 - GUIButton *v8; // edx@5 - int v9; // eax@7 - unsigned int v10; // ecx@9 - unsigned __int16 v11; // ax@9 - int v12; // eax@9 - unsigned __int8 v13; // cf@12 - unsigned __int8 v14; // zf@12 - unsigned int v15; // eax@12 - char *v16; // ecx@22 - GUIWindow *v17; // ecx@33 - int v18; // edx@34 - GUIButton *v19; // eax@35 - int v20; // edx@37 - unsigned __int16 v21; // cx@39 - unsigned int v22; // eax@39 - int v23; // edi@39 - unsigned int v24; // eax@42 - char v25; // sf@52 - char *v26; // ecx@52 - int v27; // edi@63 - GUIWindow *v28; // ecx@63 - int v29; // edx@64 - GUIButton *v30; // eax@65 - int v31; // edx@67 - unsigned int v32; // ecx@69 - int v33; // eax@69 - unsigned int v34; // eax@72 - char *v35; // ecx@82 - GUIWindow *v36; // ecx@93 - int v37; // edx@94 - GUIButton *v38; // eax@94 - int v39; // edx@97 - unsigned __int16 v40; // cx@99 - unsigned int v41; // eax@99 - int v42; // edi@99 - unsigned int v43; // eax@102 - char *v44; // ecx@112 - char *v46; // [sp-Ch] [bp-4Ch]@19 - char *v47; // [sp-Ch] [bp-4Ch]@49 - char *v48; // [sp-Ch] [bp-4Ch]@79 - char *v49; // [sp-Ch] [bp-4Ch]@109 - unsigned int v50; // [sp-8h] [bp-48h]@19 - unsigned int v51; // [sp-8h] [bp-48h]@49 - unsigned int v52; // [sp-8h] [bp-48h]@79 - unsigned int v53; // [sp-8h] [bp-48h]@109 - int v54; // [sp-4h] [bp-44h]@19 - int v55; // [sp-4h] [bp-44h]@49 - int v56; // [sp-4h] [bp-44h]@79 - int v57; // [sp-4h] [bp-44h]@109 - unsigned int v58; // [sp+10h] [bp-30h]@9 - unsigned int v59; // [sp+10h] [bp-30h]@39 - unsigned int v60; // [sp+10h] [bp-30h]@69 - unsigned int v61; // [sp+10h] [bp-30h]@99 - int v62; // [sp+14h] [bp-2Ch]@4 - int v63; // [sp+14h] [bp-2Ch]@34 - int v64; // [sp+14h] [bp-2Ch]@64 - int v65; // [sp+14h] [bp-2Ch]@94 - signed int i; // [sp+18h] [bp-28h]@4 - signed int v67; // [sp+18h] [bp-28h]@34 - signed int v68; // [sp+18h] [bp-28h]@64 - signed int v69; // [sp+18h] [bp-28h]@94 - int v70; // [sp+1Ch] [bp-24h]@3 - int v71; // [sp+1Ch] [bp-24h]@33 - int v72; // [sp+1Ch] [bp-24h]@63 - int v73; // [sp+1Ch] [bp-24h]@93 - int uY; // [sp+20h] [bp-20h]@9 - int uYa; // [sp+20h] [bp-20h]@33 - int uYb; // [sp+20h] [bp-20h]@69 - int uYc; // [sp+20h] [bp-20h]@93 - unsigned int a5; // [sp+24h] [bp-1Ch]@1 - unsigned int v79; // [sp+28h] [bp-18h]@1 - int *v80; // [sp+2Ch] [bp-14h]@3 - int *v81; // [sp+2Ch] [bp-14h]@33 - int *v82; // [sp+2Ch] [bp-14h]@63 - int *v83; // [sp+2Ch] [bp-14h]@93 - unsigned int v84; // [sp+30h] [bp-10h]@1 - int v85; // [sp+34h] [bp-Ch]@1 - unsigned int v86; // [sp+38h] [bp-8h]@1 - unsigned __int16 v87; // [sp+3Ch] [bp-4h]@9 - char *v88; // [sp+3Ch] [bp-4h]@24 - char *v89; // [sp+3Ch] [bp-4h]@54 - unsigned __int16 v90; // [sp+3Ch] [bp-4h]@69 - char *v91; // [sp+3Ch] [bp-4h]@84 - char *v92; // [sp+3Ch] [bp-4h]@114 - v1 = uPlayerID; - a5 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v84 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xAFu, 0xFFu); - v85 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem; - v86 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0); - v79 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); - pPlayer = &pParty->pPlayers[v1-1]; - v3 = pIcons_LOD->LoadTexture("fr_skill", TEXTURE_16BIT_PALETTE); - pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0)); - v4 = v79; - if ( !pPlayer->uSkillPoints ) - v4 = 65535; - sprintf( - pTmpBuf, - "%s \f%05d%s\f00000\r177%s: \f%05d%d\f00000", - pGlobalTXT_LocalizationStrings[206], // Skills for - a5, - pPlayer->pName, - pGlobalTXT_LocalizationStrings[207], // Skill Points - v4, - pPlayer->uSkillPoints); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0); - v5 = 2 * LOBYTE(pFontLucida->uFontHeight) + 13;// Weapons, Level - sprintf(pTmpBuf, "%s\r400%s", pGlobalTXT_LocalizationStrings[242], pGlobalTXT_LocalizationStrings[131]); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, v5, a5, pTmpBuf, 0, 0, 0); - v6 = pGUIWindow_CurrentMenu; - v70 = 0; - v80 = pWeaponSkills; - do - { - v62 = *v80; - v7 = 0; - for ( i = 0; i < (signed int)v6->uNumControls; v7 = i++ + 1 ) - { - v8 = v6->pControlsHead; - if ( v7 > 0 ) - { - do - { - v8 = v8->pNext; - --v7; - } - while ( v7 ); - } - v9 = v8->field_1C; - if ( SBYTE1(v9) >= 0 ) - continue; - BYTE1(v9) &= 0x7Fu; - if ( v9 != v62 ) - continue; - v5 = v8->uY; - v10 = pPlayer->uSkillPoints; - ++v70; - v11 = pPlayer->pActiveSkills[v62]; - v87 = pPlayer->pActiveSkills[v62]; - v12 = v11 & 0x3F; - v58 = 0; - uY = v12; - if ( v10 >= v12 + 1 ) - v58 = v84; - if ( v85 == i ) - { - v13 = v10 < v12; - v14 = v10 == v12; - v15 = v86; - if ( !(v13 | v14) ) - v15 = v79; - v58 = v15; - } - else - { - v15 = v58; - } - if ( HIBYTE(v87) & 1 ) - { - if ( !v15 ) - v15 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v54 = uY; - v50 = v58; - v46 = pGlobalTXT_LocalizationStrings[96]; - } - else - { - if ( !(v87 & 0xC0) ) - { - sprintf(pTmpBuf, "%s\r400%2d", pSkillNames[v62], uY); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 24, v5, v58, pTmpBuf, 0, 0, 0); - v6 = pGUIWindow_CurrentMenu; - continue; - } - v16 = pGlobalTXT_LocalizationStrings[432]; - if ( (v87 & 0x80u) == 0 ) - v16 = pGlobalTXT_LocalizationStrings[433]; - v88 = v16; - if ( !v15 ) - v15 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v54 = uY; - v50 = v58; - v46 = v88; - } - sprintf(pTmpBuf, "%s ", pSkillNames[v62], v15, v46, v50, v54); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 24, v5, v58, pTmpBuf, 0, 0, 0); - v6 = pGUIWindow_CurrentMenu; - } - ++v80; - } - while ( v80 <= &pWeaponSkills[8]); - if ( !v70 ) - { - v5 = v5 + LOBYTE(pFontLucida->uFontHeight) - 3; - v6->DrawText(pFontLucida, 24, v5, 0, pGlobalTXT_LocalizationStrings[153], 0, 0, 0); - } - uYa = v5 + 2 * LOBYTE(pFontLucida->uFontHeight) - 10; - sprintf(pTmpBuf, "%s\r400%s", pGlobalTXT_LocalizationStrings[138], pGlobalTXT_LocalizationStrings[131]); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, uYa, a5, pTmpBuf, 0, 0, 0); - v17 = pGUIWindow_CurrentMenu; - v71 = 0; - v81 = pMagicSkills; - do - { - v18 = 0; - v67 = 0; - v63 = *v81; - while ( v67 < (signed int)v17->uNumControls ) - { - v19 = v17->pControlsHead; - if ( v18 > 0 ) - { - do - { - v19 = v19->pNext; - --v18; - } - while ( v18 ); - } - v20 = v19->field_1C; - if ( SBYTE1(v20) >= 0 || (BYTE1(v20) &= 0x7Fu, v20 != v63) ) - { - v18 = v67++ + 1; - continue; - } - ++v71; - uYa = v19->uY; - v21 = pPlayer->pActiveSkills[v63]; - v22 = pPlayer->uSkillPoints; - v23 = pPlayer->pActiveSkills[v63] & 0x3F; - v59 = 0; - if ( v22 >= v23 + 1 ) - v59 = v84; - if ( v85 == v67 ) - { - v13 = v22 < v23; - v14 = v22 == v23; - v24 = v86; - if ( !(v13 | v14) ) - v24 = v79; - v59 = v24; - } - else - { - v24 = v59; - } - if ( HIBYTE(v21) & 1 ) - { - if ( !v24 ) - v24 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v55 = v23; - v51 = v59; - v47 = pGlobalTXT_LocalizationStrings[96]; - } - else - { - if ( !(v21 & 0xC0) ) - { - sprintf(pTmpBuf, "%s\r400%2d", pSkillNames[v63], v23); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 24, uYa, v59, pTmpBuf, 0, 0, 0); - v17 = pGUIWindow_CurrentMenu; - v18 = v67++ + 1; - continue; - } - v25 = (v21 & 0x80u) != 0; - v26 = pGlobalTXT_LocalizationStrings[432]; - if ( !v25 ) - v26 = pGlobalTXT_LocalizationStrings[433]; - v89 = v26; - if ( !v24 ) - v24 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v55 = v23; - v51 = v59; - v47 = v89; - } - sprintf(pTmpBuf, "%s ", pSkillNames[v63], v24, v47, v51, v55); -//LABEL_58: - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 24, uYa, v59, pTmpBuf, 0, 0, 0); - v17 = pGUIWindow_CurrentMenu; -//LABEL_59: - v18 = v67++ + 1; - } - ++v81; - } - while ( v81 <= &pMagicSkills[8]); - if ( !v71 ) - v17->DrawText( - pFontLucida, - 24, - LOBYTE(pFontLucida->uFontHeight) + uYa - 3, - 0, - pGlobalTXT_LocalizationStrings[153], - 0, - 0, - 0); - v27 = 2 * LOBYTE(pFontLucida->uFontHeight) + 13; - sprintf(pTmpBuf, "%s\r177%s", pGlobalTXT_LocalizationStrings[11], pGlobalTXT_LocalizationStrings[131]); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 248, v27, a5, pTmpBuf, 0, 0, 0); - v28 = pGUIWindow_CurrentMenu; - v72 = 0; - v82 = pArmorSkills; - do - { - v29 = 0; - v68 = 0; - v64 = *v82; - while ( v68 < (signed int)v28->uNumControls ) - { - v30 = v28->pControlsHead; - if ( v29 > 0 ) - { - do - { - v30 = v30->pNext; - --v29; - } - while ( v29 ); - } - v31 = v30->field_1C; - if ( SBYTE1(v31) >= 0 || (BYTE1(v31) &= 0x7Fu, v31 != v64) ) - { - v29 = v68++ + 1; - continue; - } - v27 = v30->uY; - ++v72; - v60 = 0; - v90 = pPlayer->pActiveSkills[v64]; - v32 = pPlayer->uSkillPoints; - v33 = pPlayer->pActiveSkills[v64] & 0x3F; - uYb = v33; - if ( v32 >= v33 + 1 ) - v60 = v84; - if ( v85 == v68 ) - { - v13 = v32 < v33; - v14 = v32 == v33; - v34 = v86; - if ( !(v13 | v14) ) - v34 = v79; - v60 = v34; - } - else - { - v34 = v60; - } - if ( (pPlayer->pActiveSkills[v64] >> 8) & 1 ) - { - if ( !v34 ) - v34 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v56 = uYb; - v52 = v60; - v48 = pGlobalTXT_LocalizationStrings[96]; - } - else - { - if ( !(v90 & 0xC0) ) - { - sprintf(pTmpBuf, "%s\r177%2d", pSkillNames[v64], uYb); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 248, v27, v60, pTmpBuf, 0, 0, 0); - v28 = pGUIWindow_CurrentMenu; - v29 = v68++ + 1; - continue; - } - v35 = pGlobalTXT_LocalizationStrings[432]; - if ( (v90 & 0x80u) == 0 ) - v35 = pGlobalTXT_LocalizationStrings[433]; - v91 = v35; - if ( !v34 ) - v34 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v56 = uYb; - v52 = v60; - v48 = v91; - } - sprintf(pTmpBuf, "%s ", pSkillNames[v64], v34, v48, v52, v56); -//LABEL_88: - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 248, v27, v60, pTmpBuf, 0, 0, 0); - v28 = pGUIWindow_CurrentMenu; -//LABEL_89: - v29 = v68++ + 1; - } - ++v82; - } - while ( v82 <= &pArmorSkills[4]); - if ( !v72 ) - { - v27 = v27 + LOBYTE(pFontLucida->uFontHeight) - 3; - v28->DrawText(pFontLucida, 248, v27, 0, pGlobalTXT_LocalizationStrings[153], 0, 0, 0); - } - uYc = v27 + 2 * LOBYTE(pFontLucida->uFontHeight) - 10; - sprintf(pTmpBuf, "%s\r177%s", pGlobalTXT_LocalizationStrings[143], pGlobalTXT_LocalizationStrings[131]); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 248, uYc, a5, pTmpBuf, 0, 0, 0); - v36 = pGUIWindow_CurrentMenu; - v73 = 0; - v83 = pMiscSkills; - do - { - v37 = 0; - v69 = 0; - v38 = (GUIButton *)*v83; - v65 = *v83; - while ( v69 < (signed int)v36->uNumControls ) - { - v38 = v36->pControlsHead; - if ( v37 > 0 ) - { - do - { - v38 = v38->pNext; - --v37; - } - while ( v37 ); - } - v39 = v38->field_1C; - if ( SBYTE1(v39) >= 0 || (BYTE1(v39) &= 0x7Fu, v39 != v65) ) - { - //goto LABEL_119; - v37 = v69++ + 1; - continue; - } - ++v73; - uYc = v38->uY; - v40 = pPlayer->pActiveSkills[v65]; - v41 = pPlayer->uSkillPoints; - v42 = pPlayer->pActiveSkills[v65] & 0x3F; - v61 = 0; - if ( v41 >= v42 + 1 ) - v61 = v84; - if ( v85 == v69 ) - { - v13 = v41 < v42; - v14 = v41 == v42; - v43 = v86; - if ( !(v13 | v14) ) - v43 = v79; - v61 = v43; - } - else - { - v43 = v61; - } - if ( HIBYTE(v40) & 1 ) - { - if ( !v43 ) - v43 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v57 = v42; - v53 = v61; - v49 = pGlobalTXT_LocalizationStrings[96]; - } - else - { - if ( !(v40 & 0xC0) ) - { - sprintf(pTmpBuf, "%s\r177%2d", pSkillNames[v65], v42); - LOBYTE(v38) = pGUIWindow_CurrentMenu->DrawText(pFontLucida, 248, uYc, v61, pTmpBuf, 0, 0, 0); - v36 = pGUIWindow_CurrentMenu; - v37 = v69++ + 1; - continue; - } - v25 = (v40 & 0x80u) != 0; - v44 = pGlobalTXT_LocalizationStrings[432]; - if ( !v25 ) - v44 = pGlobalTXT_LocalizationStrings[433]; - v92 = v44; - if ( !v43 ) - v43 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v57 = v42; - v53 = v61; - v49 = v92; - } - sprintf(pTmpBuf, "%s ", pSkillNames[v65], v43, v49, v53, v57); - LOBYTE(v38) = pGUIWindow_CurrentMenu->DrawText(pFontLucida, 248, uYc, v61, pTmpBuf, 0, 0, 0); - v36 = pGUIWindow_CurrentMenu; - v37 = v69++ + 1; - } - ++v83; - } - while ( v83 <= &pMiscSkills[11]); - if ( !v73 ) - LOBYTE(v38) = v36->DrawText( - pFontLucida, - 248, - LOBYTE(pFontLucida->uFontHeight) + uYc - 3, - 0, - pGlobalTXT_LocalizationStrings[153], - 0, - 0, - 0); - return (char)v38; -} - -//----- (0041A000) -------------------------------------------------------- -void CharacterUI_AwardsTab_Draw( unsigned int uPlayerID ) - { - //unsigned int v1; // esi@1 - unsigned int v2; // ebx@1 - unsigned int award_texture_id; // eax@1 - unsigned int result; // eax@1 - int v5; // eax@15 - char *v6; // ebx@15 - int v7; // eax@23 - int v8; // eax@24 - int v9; // eax@25 - int v10; // eax@27 - int v11; // eax@32 - int v12; // eax@33 - int v13; // eax@34 - signed int v14; // eax@43 - unsigned int v15; // eax@43 - int v16; // eax@43 - int v17; // [sp-4h] [bp-D4h]@16 - char Source[100]; // [sp+Ch] [bp-C4h]@1 - GUIWindow a1; // [sp+70h] [bp-60h]@1 - unsigned int v20; // [sp+C4h] [bp-Ch]@15 - int v21; // [sp+C8h] [bp-8h]@14 - int v22; // [sp+CCh] [bp-4h]@40 - - auto player = &pParty->pPlayers[uPlayerID - 1]; - //v1 = uPlayerID; - v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - award_texture_id = pIcons_LOD->LoadTexture("fr_award", TEXTURE_16BIT_PALETTE); - pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(award_texture_id != -1 ? &pIcons_LOD->pTextures[award_texture_id] : 0)); - sprintfex(pTmpBuf, "%s \f%05d", pGlobalTXT_LocalizationStrings[LOCSTR_AVARDS_FOR], v2); - sprintfex(Source, pGlobalTXT_LocalizationStrings[LOCSTR_S_THE_S], player->pName, pClassNames[player->classType]); - strcat(pTmpBuf, Source); - strcat(pTmpBuf, "\f00000"); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0); - result = dword_506528; - a1.uFrameX = 12; - a1.uFrameY = 48; - a1.uFrameWidth = 424; - a1.uFrameHeight = 290; - a1.uFrameZ = 435; - a1.uFrameW = 337; - if ( dword_506544 && awards_count + dword_506528 < awards_count2 ) - result = dword_506528++ + 1; - if ( dword_506548 && result ) - { - --result; - dword_506528 = result; - } - if ( dword_50651C < 0 ) - { - result += awards_count; - dword_506528 = result; - if ( (signed int)(awards_count + result) > awards_count2 ) - { - result = awards_count2 - awards_count; - dword_506528 = result; - } - } - else if ( dword_50651C > 0 ) - { - result -= awards_count; - dword_506528 = result; - if ( (result & 0x80000000u) != 0 ) - { - result = 0; - dword_506528 = result; - } - } -//LABEL_14: - dword_506544 = 0; - dword_506548 = 0; - awards_count = 0; - dword_50651C = 0; - v21 = result; - if ( (signed int)result < awards_count2 ) - { - while ( 1 ) - { - v5 = achievedAwardsIndex[v21]; - v20 = achievedAwardsIndex[v21]; - v6 = (char *)pAwards[v20].pText;//(char *)dword_723E80_award_related[v20 / 4]; - if ( v5 != 1 ) - { - if (!( (v5 < 85 || v5 > 91) && (v5 < 103 || v5 > 104) )) - { - if ( v5 > 89 ) - { - if ( v5 == 90 ) - { - v10 = (unsigned __int8)pParty->uNumArenaKnightWins; - v22 = v10; - } - else if ( v5 == 91 ) - { - v10 = (unsigned __int8)pParty->uNumArenaLordWins; - v22 = v10; - } - else if ( v5 == 103 ) - { - v10 = pParty->field_874; - v22 = v10; - } - else if ( v5 == 104 ) - { - v10 = pParty->field_878; - v22 = v10; - } - } - else - { - if ( v5 == 89 ) - { - v10 = (unsigned __int8)pParty->uNumArenaSquireWins; - v22 = v10; - } - else if ( v5 == 85 ) - { - v10 = pParty->uNumDeaths; - v22 = v10; - } - else if ( v5 == 86 ) - { - v10 = pParty->uNumBountiesCollected; - v22 = v10; - } - else if ( v5 == 87 ) - { - v10 = pParty->uNumPrisonTerms; - v22 = v10; - } - else if ( v5 == 88) - { - v10 = (unsigned __int8)pParty->uNumArenaPageWins; - v22 = v10; - } - } - v17 = v22; - sprintf(pTmpBuf, v6, v17); - v6 = pTmpBuf; - } - } - else - { - v17 = pParty->uFine; - sprintf(pTmpBuf, v6, v17); - v6 = pTmpBuf; - } - v14 = pAwards[v20].uSort;//dword_723E84[v20 / 4]; - ++awards_count; - v15 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat( - pAwardsTextColors[3 * v14 % 6], - pAwardsTextColors[3 * v14 % 6 + 1], - pAwardsTextColors[3 * v14 % 6 + 2]); - a1.DrawText(pFontArrus, 0, 0, v15, v6, 0, 0, 0); - v16 = pFontArrus->CalcTextHeight(v6, &a1, 0, 0); - result = v16 + a1.uFrameY + 4; - if ( (signed int)result <= (signed int)a1.uFrameHeight ) - { - ++v21; - a1.uFrameY = result; - result = v21; - if ( v21 < awards_count2 ) - continue; - } - return; - } - - } - return; -} // 50651C: using guessed type int dword_50651C; // 506520: using guessed type int dword_506520; // 506524: using guessed type int dword_506524; @@ -795,1101 +116,11 @@ // 723E80: using guessed type int dword_723E80_award_related[]; // 723E84: using guessed type int dword_723E84[]; -//----- (0041A2C1) -------------------------------------------------------- -unsigned int __fastcall GetSizeInInventorySlots(unsigned int uNumPixels) -{ - if ( (signed int)uNumPixels < 14 ) - uNumPixels = 14; - return ((signed int)(uNumPixels - 14) >> 5) + 1; -} - -//----- (0041A2D1) -------------------------------------------------------- -void __fastcall CharacterUI_InventoryTab_Draw(unsigned int uPlayerID, char a2) -{ - Player *pPlayer; // esi@1 - char v3; // bl@1 - unsigned int v4; // eax@2 - ItemGen *pItem; // ebx@5 - unsigned int v6; // eax@6 - Texture *v7; // esi@6 - __int16 v8; // ax@6 - signed int v9; // edi@6 - signed int v10; // ecx@6 - signed int v11; // edx@6 - signed int v12; // eax@11 - int v13; // eax@13 - signed int v14; // edx@13 - int v15; // eax@13 - unsigned int v16; // ebx@15 - unsigned int v17; // edi@15 - Texture *pTexture; // ebx@24 - double v19; // st7@26 - const char *v20; // [sp-8h] [bp-40h]@20 - Player *pPlayer2; // [sp+14h] [bp-24h]@1 - int uTextureId; // [sp+18h] [bp-20h]@6 - int *v23; // [sp+1Ch] [bp-1Ch]@1 - int v24; // [sp+20h] [bp-18h]@5 - ItemGen *pItem2; // [sp+24h] [bp-14h]@5 - int v26; // [sp+28h] [bp-10h]@3 - unsigned int uCellID; // [sp+2Ch] [bp-Ch]@3 - unsigned int uCellX; // [sp+30h] [bp-8h]@5 - unsigned int uCellY; // [sp+34h] [bp-4h]@5 - - v23 = pRenderer->pActiveZBuffer; - pPlayer = pPlayers[uPlayerID]; - v3 = a2; - pPlayer2 = pPlayers[uPlayerID]; - pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_507958 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507958] : 0)); - if ( v3 ) - { - v4 = pIcons_LOD->LoadTexture("fr_strip", TEXTURE_16BIT_PALETTE); - pRenderer->DrawTextureIndexed(8u, 0x131u, (Texture *)(v4 != -1 ? (int)&pIcons_LOD->pTextures[v4] : 0)); - } - uCellID = 0; - v26 = (int)pPlayer->pInventoryIndices; - do - { - if ( *(int *)v26 > 0 ) - { - v24 = *(int *)v26 - 1; - uCellY = 32 * (uCellID / 14) + 17; - pItem = &pPlayer->pInventoryItems[v24]; - uCellX = 32 * (uCellID % 14) + 14; - pItem2 = pItem; - if ( pItem->uItemID ) - { - v6 = pIcons_LOD->LoadTexture(pItemsTable->pItems[pItem->uItemID].pIconName, TEXTURE_16BIT_PALETTE); - uTextureId = v6; - v7 = (Texture *)(v6 != -1 ? (int)&pIcons_LOD->pTextures[v6] : 0); - v8 = (v6 != -1 ? pIcons_LOD->pTextures[v6].uTextureWidth : 24); - v9 = v7->uTextureHeight; - v10 = v7->uTextureWidth; - v11 = v7->uTextureWidth; - if ( v10 < 14 ) - v11 = 14; - if ( (v11 - 14) >> 5 == 0 && v8 < 32 ) - uCellX += (32 - v10) / 2; - v12 = v7->uTextureWidth; - if ( v10 < 14 ) - v12 = 14; - v13 = v12 - 14; - v14 = v7->uTextureHeight; - LOBYTE(v13) = v13 & 0xE0; - v15 = v13 + 32; - if ( v9 < 14 ) - v14 = 14; - v16 = pItem->uAttributes; - v17 = uCellX + ((v15 - v10) >> 1) + pSRZBufferLineOffsets[uCellY + ((((v14 - 14) & 0xFFFFFFE0) - v9 + 32) >> 1)]; - if ( !(v16 & 0xF0) ) - { - if (pItem->Identified() || pCurrentScreen != SCREEN_HOUSE ) - { - if (pItem->Broken()) - pRenderer->DrawTransparentRedShade(uCellX, uCellY, v7); - else - pRenderer->DrawTextureTransparent(uCellX, uCellY, v7); - } - else - { - pRenderer->DrawTransparentGreenShade(uCellX, uCellY, v7); - } - ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); - pPlayer = pPlayer2; - //goto LABEL_34; - ++uCellID; - v26 += 4; - continue; - } - if ( (unsigned __int8)(v16 & 0xF0) != 16 ) - { - if ( (unsigned __int8)(v16 & 0xF0) == 32 ) - { - v20 = "sp28a"; - pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - LOBYTE(pItem2->uAttributes) &= 0xFu; - ptr_50C9A4 = 0; - } - v19 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255); - ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); - pPlayer = pPlayer2; - //goto LABEL_34; - ++uCellID; - v26 += 4; - continue; - } - if ( (unsigned __int8)(v16 & 0xF0) == 64 ) - { - v20 = "sp30a"; - pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - LOBYTE(pItem2->uAttributes) &= 0xFu; - ptr_50C9A4 = 0; - } - v19 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255); - ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); - pPlayer = pPlayer2; - //goto LABEL_34; - ++uCellID; - v26 += 4; - continue; - } - if ( (unsigned __int8)(v16 & 0xF0) == 128 ) - { - v20 = "sp91a"; - pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - LOBYTE(pItem2->uAttributes) &= 0xFu; - ptr_50C9A4 = 0; - } - v19 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255); - ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); - pPlayer = pPlayer2; - //goto LABEL_34; - ++uCellID; - v26 += 4; - continue; - } - } - v20 = "sptext01"; - pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - LOBYTE(pItem2->uAttributes) &= 0xFu; - ptr_50C9A4 = 0; - } - v19 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255); - ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); - pPlayer = pPlayer2; - } - } -//LABEL_34: - ++uCellID; - v26 += 4; - } - while ( uCellID < 126 ); -} - -//----- (0041A556) -------------------------------------------------------- -void __cdecl draw_leather() -{ - pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_Leather)); -} - -//----- (0041A57E) -------------------------------------------------------- -void QuickRefDraw() -{ - unsigned int v0; // ebx@1 - //unsigned int v1; // eax@1 - Player *pPlayer; // ebp@2 - int v3; // eax@6 - int v4; // edi@6 - unsigned int v5; // eax@7 - unsigned int v6; // edi@9 - unsigned int v7; // edi@11 - signed int v8; // eax@13 - unsigned int v9; // eax@13 - unsigned int v10; // edi@13 - int v11; // eax@15 - unsigned int v12; // eax@15 - unsigned int v13; // edi@15 - int v14; // eax@17 - int v15; // ST18_4@17 - int v16; // ebx@17 - int v17; // eax@17 - unsigned int v18; // eax@17 - unsigned int v19; // edi@17 - int v20; // eax@19 - unsigned int v21; // edi@19 - char *v22; // eax@21 - unsigned int v23; // edi@21 - int v24; // eax@23 - unsigned int v25; // edi@23 - char *v26; // eax@25 - unsigned int v27; // edi@25 - int v28; // ecx@27 - char *v29; // eax@27 - signed int v30; // edx@27 - unsigned int v31; // edi@31 - unsigned int v32; // edi@33 - const char *v33; // ST10_4@35 - unsigned int v34; // eax@35 - unsigned int v35; // edi@35 - unsigned __int8 v36; // al@37 - char *v37; // eax@38 - int v38; // eax@41 - signed int v39; // edi@42 - char *v40; // eax@45 - unsigned int v41; // eax@45 - signed int v43; // [sp+10h] [bp-1Ch]@1 - unsigned int v44; // [sp+14h] [bp-18h]@2 - int v45; // [sp+18h] [bp-14h]@1 - unsigned int v46; // [sp+1Ch] [bp-10h]@1 - unsigned int v47; // [sp+20h] [bp-Ch]@1 - unsigned int v48; // [sp+24h] [bp-8h]@33 - //unsigned int v49; // [sp+28h] [bp-4h]@1 - v0 = 0; - v47 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - //v49 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0); - v46 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); - //v1 = pIcons_LOD->LoadTexture("quikref", TEXTURE_16BIT_PALETTE); - pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("quikref", TEXTURE_16BIT_PALETTE)); - v43 = 0; - v45 = LOBYTE(pFontArrus->uFontHeight) + 1; - do - { - pPlayer = &pParty->pPlayers[v43]; - v44 = 94 * v43 + 89; - if ( v43 == v0 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x12u, v0, pGlobalTXT_LocalizationStrings[149], 60, v0);//Name - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 94 * v43 + 89, 0x12u, v47, pPlayer->pName, 84, v0); - if ( v43 == v0 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x2Fu, v0, pGlobalTXT_LocalizationStrings[131], 60, v0); //. - v3 = pPlayer->GetActualLevel(); - sprintf(pTmpBuf, "%lu", v3); - v4 = pPlayer->GetBaseLevel(); - if ( pPlayer->GetActualLevel() <= v4 ) - v5 = pPlayer->GetExperienceDisplayColor(); - else - v5 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, v0); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, 0x2Fu, v5, pTmpBuf, 84, v0); - v6 = v45 + 47; - if ( v43 == v0 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v45 + 47, v0, pGlobalTXT_LocalizationStrings[41], 60, v0);// - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v6, v0, pClassNames[pPlayer->classType], 84, v0); - v7 = v45 + v6; - if ( v43 == v0 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v7, v0, pGlobalTXT_LocalizationStrings[107], 60, v0);//. - sprintf(pTmpBuf, "%d", pPlayer->sHealth); - v8 = pPlayer->GetMaxHealth(); - v9 = UI_GetHealthManaStringColor(pPlayer->sHealth, v8); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v7, v9, pTmpBuf, 84, v0); - v10 = v45 + v7; - if ( v43 == v0 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v10, v0, pGlobalTXT_LocalizationStrings[209], 60, v0);// - sprintf(pTmpBuf, "%d", pPlayer->sMana); - v11 = pPlayer->GetMaxMana(); - v12 = UI_GetHealthManaStringColor(pPlayer->sMana, v11); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v10, v12, pTmpBuf, 84, v0); - v13 = v45 + v10; - if ( v43 == v0 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v13, v0, pGlobalTXT_LocalizationStrings[0], 60, v0);// - v14 = pPlayer->GetActualAC(); - sprintf(pTmpBuf, "%d", v14); - v15 = v0; - v16 = pPlayer->GetBaseAC(); - v17 = pPlayer->GetActualAC(); - v18 = UI_GetHealthManaStringColor(v17, v16); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v13, v18, pTmpBuf, 84, v15); - v0 = 0; - v19 = v45 + v13; - if ( !v43 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v19, 0, pGlobalTXT_LocalizationStrings[18], 60, 0);// - v20 = pPlayer->GetActualAttack(0); - sprintf(pTmpBuf, "%+d", v20); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v19, 0, pTmpBuf, 84, 0); - v21 = v45 + v19; - if ( !v43 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v21, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//. - v22 = pPlayer->GetMeleeDamageString(); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v21, 0, v22, 84, 0); - v23 = v45 + v21; - if ( !v43 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v23, 0, pGlobalTXT_LocalizationStrings[203], 60, 0);// - v24 = pPlayer->GetRangedAttack(); - sprintf(pTmpBuf, "%+d", v24); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v23, 0, pTmpBuf, 84, 0); - v25 = v45 + v23; - if ( !v43 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v25, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//. - v26 = pPlayer->GetRangedDamageString(); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v25, 0, v26, 84, 0); - v27 = v45 + v25; - if ( !v43 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v27, 0, pGlobalTXT_LocalizationStrings[205], 60, 0);// - v28 = 0; - v29 = (char *)pPlayer->pActiveSkills; - v30 = 36; - do - { - if ( *(short *)v29 ) - ++v28; - v29 += 2; - --v30; - } - while ( v30 ); - sprintf(pTmpBuf, "%lu", v28); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v27, 0, pTmpBuf, 84, 0); - v31 = v45 + v27; - if ( !v43 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v31, 0, pGlobalTXT_LocalizationStrings[168], 60, 0);// - sprintf(pTmpBuf, "%lu", pPlayer->uSkillPoints); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v31, pPlayer->uSkillPoints != 0 ? v46 : 0, pTmpBuf, 84, 0); - v32 = v45 + v31; - v48 = pPlayer->GetMajorConditionIdx(); - if ( !v43 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v32, 0, pGlobalTXT_LocalizationStrings[45], 60, 0);//. - v33 = aCharacterConditionNames[v48]; - v34 = GetConditionDrawColor(v48); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v32, v34, v33, 84, 0); - v35 = v45 + v32; - if ( !v43 ) - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v35, 0, pGlobalTXT_LocalizationStrings[170], 60, 0);//.. - v36 = pPlayer->uQuickSpell; - if ( v36 ) - v37 = pSpellStats->pInfos[v36].pShortName; - else - v37 = pGlobalTXT_LocalizationStrings[153];// - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v35, 0, v37, 84, 0); - ++v43; - } - while ( v43 < 4 ); - v38 = GetPartyReputation(); - if ( v38 >= 0 ) - { - if ( v38 <= 5 ) - v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0xFF); - else - v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0, 0); - } - else - v39 = v46; - - v40 = GetReputationString(v38); - sprintf(pTmpBuf, "%s: \f%05d%s\f00000", pGlobalTXT_LocalizationStrings[180], v39, v40);//Reputation - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 22, 323, 0, pTmpBuf, 0, 0, 0); - v41 = pParty->GetPartyFame(); - sprintf(pTmpBuf, "\r261%s: %d", pGlobalTXT_LocalizationStrings[84], v41);// Fame - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 0, 323, 0, pTmpBuf, 0, 0, 0); -} - -//----- (0041ABFD) -------------------------------------------------------- -void __thiscall CharacterUI_CharacterScreen_Draw(unsigned int uPlayerIdx) -{ - unsigned int v1; // edi@1 - unsigned int v2; // eax@6 - Texture *pTexture; // ecx@6 - GUIButton *pButton; // eax@6 - unsigned int v5; // eax@7 - unsigned int v6; // eax@10 - unsigned int v7; // eax@11 - - v1 = uPlayerIdx; - if ( uPlayerIdx ) - { - pRenderer->ClearZBuffer(0, 479); - switch ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] ) - { - case WINDOW_CharacterWindow_Stats: // stats - sub_4196A0(); - sub_419379(); - CharacterUI_StatsTab_Draw(v1); - v7 = pIcons_LOD->LoadTexture("ib-cd1-d", TEXTURE_16BIT_PALETTE); - pTexture = (Texture *)(v7 != -1 ? (int)&pIcons_LOD->pTextures[v7] : 0); - pButton = pCharacterScreen_StatsBtn; - pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture); - break; - case WINDOW_CharacterWindow_Skills: // skills - if ( dword_507CC0 != uActiveCharacter ) - { - sub_4196A0(); - CharacterUI_SkillScreen_Draw(); - } - sub_419379(); - CharacterUI_SkillsTab_Draw(v1); - v6 = pIcons_LOD->LoadTexture("ib-cd2-d", TEXTURE_16BIT_PALETTE); - pTexture = (Texture *)(v6 != -1 ? (int)&pIcons_LOD->pTextures[v6] : 0); - pButton = pCharacterScreen_SkillsBtn; - pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture); - break; - case WINDOW_CharacterWindow_Awards: // awards - sub_4196A0(); - sub_419379(); - sub_419220(); - CharacterUI_AwardsTab_Draw(v1); - v5 = pIcons_LOD->LoadTexture("ib-cd4-d", TEXTURE_16BIT_PALETTE); - pTexture = (Texture *)(v5 != -1 ? (int)&pIcons_LOD->pTextures[v5] : 0); - pButton = pCharacterScreen_AwardsBtn; - pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture); - break; - case WINDOW_CharacterWindow_Inventory: // inventory and other - sub_4196A0(); - sub_419379(); - CharacterUI_InventoryTab_Draw(v1, 0); - v2 = pIcons_LOD->LoadTexture("ib-cd3-d", TEXTURE_16BIT_PALETTE); - pTexture = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0); - pButton = pCharacterScreen_InventoryBtn; - pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture); - break; - default: - break; - } - if ( bRingsShownInCharScreen ) - CharacterUI_DrawPaperdollWithRingOverlay(v1); - else - CharacterUI_DrawPaperdoll(v1); - } -} - -//----- (0041AD6E) -------------------------------------------------------- -void __cdecl GameUI_DrawRightPanelItems() -{ - if (GameUI_RightPanel_BookFlashTimer > pParty->uTimePlayed) - GameUI_RightPanel_BookFlashTimer = 0; - - if (pParty->uTimePlayed - GameUI_RightPanel_BookFlashTimer > 128) - { - GameUI_RightPanel_BookFlashTimer = pParty->uTimePlayed; - byte_50697C = byte_50697C == 0; - if ( byte_50697C && pCurrentScreen != SCREEN_REST ) - { - if ( bFlashQuestBook ) - pRenderer->DrawTextureTransparent(493, 355, pIcons_LOD->GetTexture(uTextureID_ib_td1_A)); - if ( bFlashAutonotesBook ) - pRenderer->DrawTextureTransparent(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A)); - if ( bFlashHistoryBook ) - pRenderer->DrawTextureTransparent(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A)); - } - else - { - pRenderer->DrawTextureRGB(468u, 0, pTexture_RightFrame); - DrawHiredNPCs(); - } - } -} - -//----- (0041AEBB) -------------------------------------------------------- -void __cdecl GameUI_DrawFoodAndGold() -{ - int v2; // esi@2 - - if ( uGameState != GAME_STATE_FINAL_WINDOW ) - { - v2 = sub_44100D() != 0 ? 381 : 322; - sprintf(pTmpBuf, "\r087%lu", pParty->uNumFoodRations); - pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow); - sprintf(pTmpBuf, "\r028%lu", pParty->uNumGold); - pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow); - } -} - -//----- (0041AF52) -------------------------------------------------------- -void Actor::DrawHealthBar(Actor *a1, GUIWindow *a2) -{ - unsigned int v2; // eax@1 - GUIWindow *v3; // edi@1 - unsigned int v4; // esi@1 - signed int v5; // ebx@4 - double v6; // st7@5 - unsigned int v7; // eax@6 - unsigned int v8; // ebx@10 - unsigned int v9; // [sp+14h] [bp-Ch]@4 - unsigned int v10; // [sp+1Ch] [bp-4h]@4 - - v2 = a1->pMonsterInfo.uHP; - v3 = a2; - v4 = 25; - if ( (signed int)v2 > 25 ) - { - v4 = 200; - if ( (signed int)v2 < 200 ) - v4 = a1->pMonsterInfo.uHP; - } - v5 = a1->sCurrentHP; - v10 = v4; - v9 = uTextureID_mhp_grn; - if ( v5 < (signed int)v2 ) - { - v6 = (double)(signed int)v2; - v10 = (signed __int64)((double)(signed int)v4 / (double)(signed int)v2 * (double)a1->sCurrentHP); - if ( v5 <= (signed int)(signed __int64)(0.34 * v6) ) - { - v7 = uTextureID_mhp_red; - v9 = v7; - } - else if ( v5 <= (signed int)(signed __int64)(v6 * 0.67) ) - { - v7 = uTextureID_mhp_yel; - v9 = v7; - } - } - v8 = a2->uFrameX + (signed int)(a2->uFrameWidth - v4) / 2; - pRenderer->Clip(v8, a2->uFrameY + 32, v8 + v4, a2->uFrameY + 52); - pRenderer->DrawTextureIndexed( - v8, - v3->uFrameY + 32, - (Texture *)(uTextureID_mhp_bd != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_mhp_bd] : 0)); - pRenderer->Clip(v8, v3->uFrameY + 32, v8 + v10, v3->uFrameY + 52); - pRenderer->DrawTextureIndexed( - v8, - v3->uFrameY + 34, - (Texture *)(v9 != -1 ? (int)&pIcons_LOD->pTextures[v9] : 0)); - pRenderer->ResetClip(); - pRenderer->DrawTextureIndexed( - v8 - 5, - v3->uFrameY + 32, - (Texture *)(uTextureID_mhp_capl != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_mhp_capl] : 0)); - pRenderer->DrawTextureIndexed( - v8 + v4, - v3->uFrameY + 32, - (Texture *)(uTextureID_mhp_capr != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_mhp_capr] : 0)); -} - -//----- (0041B0C9) -------------------------------------------------------- -void __cdecl GameUI_DrawLifeManaBars() -{ - Texture *v0; // ebx@1 - Player *v1; // ecx@2 - float v2; // ST38_4@3 - double v3; // st7@3 - signed __int64 v4; // qax@6 - Player *v5; // ecx@24 - float v6; // ST30_4@25 - double v7; // st7@25 - bool v8; // ST38_4@27 - Texture *v9; // [sp-4h] [bp-30h]@10 - Texture *v10; // [sp+Ch] [bp-20h]@1 - Player *v11; // [sp+10h] [bp-1Ch]@2 - int v12; // [sp+10h] [bp-1Ch]@24 - Texture *v13; // [sp+14h] [bp-18h]@1 - Texture *v14; // [sp+18h] [bp-14h]@1 - float v15; // [sp+1Ch] [bp-10h]@1 - signed int v16; // [sp+24h] [bp-8h]@1 - signed int v17; // [sp+28h] [bp-4h]@8 - - v0 = (Texture *)(uTextureID_BarGreen != -1 ? &pIcons_LOD->pTextures[uTextureID_BarGreen] : 0); - v14 = (Texture *)(uTextureID_BarYellow != -1 ? &pIcons_LOD->pTextures[uTextureID_BarYellow] : 0); - v13 = (Texture *)(uTextureID_BarRed != -1 ? &pIcons_LOD->pTextures[uTextureID_BarRed] : 0); - v16 = 0; - v10 = (Texture *)(uTextureID_BarBlue != -1 ? &pIcons_LOD->pTextures[uTextureID_BarBlue] : 0); - v15 = (double)(uTextureID_BarGreen != -1 ? pIcons_LOD->pTextures[uTextureID_BarGreen].uTextureHeight : 26); - do - { - v1 = &pParty->pPlayers[v16]; - v11 = v1; - if ( v1->sHealth > 0 ) - { - v11 = &pParty->pPlayers[v16]; - v2 = (double)v1->sHealth; - v3 = v2 / (double)v1->GetMaxHealth(); - if( v3 > 0.5 ) - { - if ( v3 > 1.0 ) - v3 = 1.0; - v4 = (signed __int64)((1.0 - v3) * v15); - if ( v16 == 2 || v16 == 3 ) - v17 = 2; - else - v17 = 0; - pRenderer->Clip( - v17 + pHealthBarPos[v16], - v4 + 402, - v17 + pHealthBarPos[v16] + v0->uTextureWidth, - v0->uTextureHeight + 402); - v9 = v0; - } - else if ( v3 > 0.25 ) - { - if ( v16 == 2 || v16 == 3 ) - v17 = 2; - else - v17 = 0; - pRenderer->Clip( - v17 + pHealthBarPos[v16], - (unsigned __int64)(signed __int64)((1.0 - v3) * v15) + 402, - v17 + pHealthBarPos[v16] + v14->uTextureWidth, - v14->uTextureHeight + 402); - v9 = v14; - } - else if ( v3 > 0.0 ) - { - if ( v16 == 2 || v16 == 3 ) - v17 = 2; - else - v17 = 0; - pRenderer->Clip( - v17 + pHealthBarPos[v16], - (unsigned __int64)(signed __int64)((1.0 - v3) * v15) + 402, - v17 + pHealthBarPos[v16] + v13->uTextureWidth, - v13->uTextureHeight + 402); - v9 = v13; - } - if( v3 > 0.0 ) - { - pRenderer->DrawTextureIndexed(v17 + pHealthBarPos[v16], 0x192u, v9); - pRenderer->ResetClip(); - } - } - v5 = v11; - v12 = v11->sMana; - if ( v12 > 0 ) - { - v6 = (double)v12; - v7 = v6 / (double)v5->GetMaxMana(); - if ( v7 > 1.0 ) - v7 = 1.0; - v8 = v16 == 2; - pRenderer->Clip( - (v16 == 2) + pManaBarPos[v16], - (unsigned __int64)(signed __int64)((1.0 - v7) * v15) + 402, - v8 + pManaBarPos[v16] + v10->uTextureWidth, - v10->uTextureHeight + 402); - pRenderer->DrawTextureIndexed(v8 + pManaBarPos[v16], 0x192u, v10); - pRenderer->ResetClip(); - } - ++v16; - } - while ( v16 < 4 ); -} - -//----- (0041B3B6) -------------------------------------------------------- -void __cdecl draw_right_panel() -{ - pRenderer->DrawTextureTransparent( - pViewport->uViewportBR_X, - 0, - (Texture *)(uTextureID_right_panel != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_right_panel] : 0)); -} - -//----- (0041B3E2) -------------------------------------------------------- -void __cdecl GameUI_DrawRightPanelFrames() -{ - pRenderer->DrawTextureRGB(0, 0, pTexture_TopFrame); - pRenderer->DrawTextureRGB(0, 8u, pTexture_LeftFrame); - pRenderer->DrawTextureRGB(468u, 0, pTexture_RightFrame); - pRenderer->DrawTextureRGB(0, 352u, pTexture_BottomFrame); - GameUI_DrawFoodAndGold(); - GameUI_DrawRightPanelItems(); -} - -//----- (0041B438) -------------------------------------------------------- -GUIButton *__fastcall GUI_HandleHotkey(unsigned __int8 uHotkey) -{ - char v1; // al@1 - int v2; // esi@1 - char v3; // dl@1 - GUIWindow *v4; // ecx@2 - GUIButton *result; // eax@2 - int v6; // edx@12 - - v1 = toupper(uHotkey); - v2 = uNumVisibleWindows; - v3 = v1; - if ( uNumVisibleWindows >= 0 ) - { - while ( 2 ) - { - v4 = &pWindowList[pVisibleWindowsIdxs[v2] - 1]; - for ( result = v4->pControlsHead; result; result = result->pNext ) - { - if ( result->uHotkey == v3 ) - { - v6 = result->uControlParam; - pMessageQueue_50CBD0->AddMessage((UIMessageType)result->uControlID, v6, 0); - /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)result->uControlID; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v6; - *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - ++pMessageQueue_50CBD0->uNumMessages; - }*/ - return result; - } - } - if ( v4->uFrameX || v4->uFrameY || !(v4->uFrameWidth == 640 & v4->uFrameHeight == 480) ) - { - --v2; - if ( v2 >= 0 ) - continue; - } - break; - } - } - return 0; -} // 5075E0: using guessed type int pVisibleWindowsIdxs[20]; -//----- (0041B4E1) -------------------------------------------------------- -int __fastcall GUI_ReplaceHotkey(unsigned __int8 uOldHotkey, unsigned __int8 uNewHotkey, char bFirstCall) -{ - unsigned __int8 v3; // bl@1 - int result; // eax@1 - int i; // edx@2 - GUIButton *j; // ecx@3 - int k; // edx@7 - GUIButton *l; // ecx@8 - unsigned __int8 v9; // [sp+4h] [bp-8h]@1 - char v10; // [sp+8h] [bp-4h]@1 - v3 = uNewHotkey; - v10 = toupper(uOldHotkey); - result = toupper(v3); - v9 = result; - if ( bFirstCall ) - { - for ( i = uNumVisibleWindows; i >= 0; --i ) - { - result = 84 * pVisibleWindowsIdxs[i]; - //for ( j = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); j; j = j->pNext ) - for ( j = pWindowList[pVisibleWindowsIdxs[i] - 1].pControlsHead; j; j = j->pNext ) - j->field_28 = 0; - } - } - for ( k = uNumVisibleWindows; k >= 0; --k ) - { - result = 84 * pVisibleWindowsIdxs[k]; - //for ( l = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); l; l = l->pNext ) - for ( l = pWindowList[pVisibleWindowsIdxs[k] - 1].pControlsHead; l; l = l->pNext ) - { - LOBYTE(result) = v10; - if ( l->uHotkey == v10 ) - { - if ( !l->field_28 ) - { - LOBYTE(result) = v9; - l->field_28 = 1; - l->uHotkey = v9; - } - } - } - } - return result; -} -// 5075E0: using guessed type int pVisibleWindowsIdxs[20]; - -//----- (0041B578) -------------------------------------------------------- -void __cdecl MainMenuUI_LoadFontsAndSomeStuff() -{ - pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, - pRenderer->uTargetGBits, - pRenderer->uTargetBBits); - pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, - pRenderer->uTargetGBits, - pRenderer->uTargetBBits); - pPaletteManager->RecalculateAll(); - - for (uint i = 0; i < 480; ++i) - pSRZBufferLineOffsets[i] = 640 * i; - - pRenderer->ResetClip(); - - uTextureID_FONTPAL = pIcons_LOD->LoadTexture("FONTPAL", TEXTURE_16BIT_PALETTE); - pFontArrus = LoadFont("arrus.fnt", "FONTPAL", NULL); - pFontLucida = LoadFont("lucida.fnt", "FONTPAL", NULL); - pFontCreate = LoadFont("create.fnt", "FONTPAL", NULL); - pFontSmallnum = LoadFont("smallnum.fnt", "FONTPAL", NULL); - pFontComic = LoadFont("comic.fnt", "FONTPAL", NULL); - pFontArrus->field_3 = 0; - pFontLucida->field_3 = 0; - pFontCreate->field_3 = 0; - - for (uint i = 0; i < 20; ++i) - pWindowList[i].eWindowType = WINDOW_null; - - uNumVisibleWindows = -1; - memset(pVisibleWindowsIdxs, 0, sizeof(pVisibleWindowsIdxs)); -} - -//----- (0041B690) -------------------------------------------------------- -void __cdecl MainMenuUI_Create() -{ - //unsigned int v0; // eax@1 - //unsigned int v1; // eax@1 - //unsigned int v2; // eax@1 - //unsigned int v3; // eax@1 - //unsigned int v4; // eax@1 - //unsigned int v5; // eax@1 - Texture *v6; // ST78_4@1 - //const char *v7; // ST5C_4@1 - unsigned __int8 v8; // al@1 - //Texture *v9; // ST60_4@1 - Texture *v10; // ST78_4@1 - //const char *v11; // ST5C_4@1 - unsigned __int8 v12; // al@1 - //Texture *v13; // ST60_4@1 - unsigned int v14; // eax@1 - Texture *v15; // ST78_4@1 - //const char *v16; // ST5C_4@1 - unsigned __int8 v17; // al@1 - //Texture *v18; // ST60_4@1 - unsigned int uTextureID_ib_td4_A; // eax@1 - Texture *v20; // ST78_4@1 - unsigned __int8 v22; // al@1 - //Texture *v23; // ST60_4@1 - Texture *v24; // eax@1 - //Texture *v25; // esi@1 - //Texture *v26; // ST60_4@1 - //const char *v27; // ST5C_4@1 - unsigned __int8 v28; // al@1 - Texture *v29; // eax@1 - //Texture *v30; // esi@1 - //Texture *v31; // ST60_4@1 - //const char *v32; // ST5C_4@1 - unsigned __int8 v33; // al@1 - - pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeC")); - pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeB")); - pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeA")); - pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchC")); - pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchB")); - pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchA")); - - pTextureIDs_pMapDirs[0] = pIcons_LOD->LoadTexture("MAPDIR8", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[1] = pIcons_LOD->LoadTexture("MAPDIR1", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[2] = pIcons_LOD->LoadTexture("MAPDIR2", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[3] = pIcons_LOD->LoadTexture("MAPDIR3", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[4] = pIcons_LOD->LoadTexture("MAPDIR4", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[5] = pIcons_LOD->LoadTexture("MAPDIR5", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[6] = pIcons_LOD->LoadTexture("MAPDIR6", TEXTURE_16BIT_PALETTE); - pTextureIDs_pMapDirs[7] = pIcons_LOD->LoadTexture("MAPDIR7", TEXTURE_16BIT_PALETTE); - - uTextureID_BarBlue = pIcons_LOD->LoadTexture("ib-statB", TEXTURE_16BIT_PALETTE); - uTextureID_BarGreen = pIcons_LOD->LoadTexture("ib-statG", TEXTURE_16BIT_PALETTE); - uTextureID_BarYellow = pIcons_LOD->LoadTexture("ib-statY", TEXTURE_16BIT_PALETTE); - uTextureID_BarRed = pIcons_LOD->LoadTexture("ib-statR", TEXTURE_16BIT_PALETTE); - uTextureID_mhp_bd = pIcons_LOD->LoadTexture("mhp_bg", TEXTURE_16BIT_PALETTE); - uTextureID_mhp_capl = pIcons_LOD->LoadTexture("mhp_capl", TEXTURE_16BIT_PALETTE); - uTextureID_mhp_capr = pIcons_LOD->LoadTexture("mhp_capr", TEXTURE_16BIT_PALETTE); - uTextureID_mhp_grn = pIcons_LOD->LoadTexture("mhp_grn", TEXTURE_16BIT_PALETTE); - uTextureID_mhp_red = pIcons_LOD->LoadTexture("mhp_red", TEXTURE_16BIT_PALETTE); - uTextureID_mhp_yel = pIcons_LOD->LoadTexture("mhp_yel", TEXTURE_16BIT_PALETTE); - uTextureID_Leather = pIcons_LOD->LoadTexture("LEATHER", TEXTURE_16BIT_PALETTE); - pTexture_Leather = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("ibground", TEXTURE_16BIT_PALETTE)]; - uTextureID_x_x_u = pIcons_LOD->LoadTexture("x_x_u", TEXTURE_16BIT_PALETTE); - uTextureID_BUTTDESC2 = pIcons_LOD->LoadTexture("BUTTESC2", TEXTURE_16BIT_PALETTE); - uTextureID_x_ok_u = pIcons_LOD->LoadTexture("x_ok_u", TEXTURE_16BIT_PALETTE); - uTextureID_BUTTYES2 = pIcons_LOD->LoadTexture("BUTTYES2", TEXTURE_16BIT_PALETTE); - uTextureID_BUTTMAKE = pIcons_LOD->LoadTexture("BUTTMAKE", TEXTURE_16BIT_PALETTE); - uTextureID_BUTTMAKE2 = pIcons_LOD->LoadTexture("BUTTMAKE2", TEXTURE_16BIT_PALETTE); - - pPrimaryWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); - pPrimaryWindow->CreateButton(7u, 8u, 0x1CCu, 0x157u, 1, 0, 0xAu, 0, 0, "", 0); - pPrimaryWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); - pPrimaryWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); - pPrimaryWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); - pPrimaryWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); - pPrimaryWindow->CreateButton(0x18u, 0x194u, 5u, 0x31u, 1, 93, 0, 1u, 0, "", 0); - pPrimaryWindow->CreateButton(0x8Bu, 0x194u, 5u, 0x31u, 1, 93, 0, 2u, 0, "", 0); - pPrimaryWindow->CreateButton(0xFFu, 0x194u, 5u, 0x31u, 1, 93, 0, 3u, 0, "", 0); - pPrimaryWindow->CreateButton(0x172u, 0x194u, 5u, 0x31u, 1, 93, 0, 4u, 0, "", 0); - pPrimaryWindow->CreateButton(0x61u, 0x194u, 5u, 0x31u, 1, 93, 0, 1u, 0, "", 0); - pPrimaryWindow->CreateButton(0xD4u, 0x194u, 5u, 0x31u, 1, 93, 0, 2u, 0, "", 0); - pPrimaryWindow->CreateButton(0x148u, 0x194u, 5u, 0x31u, 1, 93, 0, 3u, 0, "", 0); - pPrimaryWindow->CreateButton(0x1BBu, 0x194u, 5u, 0x31u, 1, 93, 0, 4u, 0, "", 0); - - uTextureID_ib_td1_A = pIcons_LOD->LoadTexture("ib-td1-A", TEXTURE_16BIT_PALETTE); - v6 = (Texture *)(uTextureID_ib_td1_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td1_A] : 0); - v8 = pKeyActionMap->GetActionVKey(INPUT_Quest); - pBtn_Quests = pPrimaryWindow->CreateButton(0x1EBu, 0x161u, v6->uTextureWidth, v6->uTextureHeight, 1, 0, 0xC8u, 0, v8, pGlobalTXT_LocalizationStrings[174], v6, 0); //Quests - - uTextureID_ib_td2_A = pIcons_LOD->LoadTexture("ib-td2-A", TEXTURE_16BIT_PALETTE); - v10 = (Texture *)(uTextureID_ib_td2_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td2_A] : 0); - v12 = pKeyActionMap->GetActionVKey(INPUT_Autonotes); - pBtn_Autonotes = pPrimaryWindow->CreateButton(0x20Fu, 0x161u, v10->uTextureWidth, v10->uTextureHeight, 1, 0, 0xC9u, 0, v12, pGlobalTXT_LocalizationStrings[154], v10, 0);//Autonotes - - v14 = pIcons_LOD->LoadTexture("ib-td3-A", TEXTURE_16BIT_PALETTE); - v15 = (Texture *)(v14 != -1 ? &pIcons_LOD->pTextures[v14] : 0); - v17 = pKeyActionMap->GetActionVKey(INPUT_Mapbook); - pBtn_Maps = pPrimaryWindow->CreateButton(0x222u, 0x161u, v15->uTextureWidth, v15->uTextureHeight, 1, 0, 0xCAu, 0, v17, pGlobalTXT_LocalizationStrings[139], v15, 0); //Maps - - uTextureID_ib_td4_A = pIcons_LOD->LoadTexture("ib-td4-A", TEXTURE_16BIT_PALETTE); - v20 = (Texture *)(uTextureID_ib_td4_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td4_A] : 0); - v22 = pKeyActionMap->GetActionVKey(INPUT_TimeCal); - pBtn_Calendar = pPrimaryWindow->CreateButton(0x23Au, 0x161u, v20->uTextureWidth, v20->uTextureHeight, 1, 0, 0xCBu, 0, v22, - pGlobalTXT_LocalizationStrings[78],//Calendar - v20, 0); - - uTextureID_ib_td5_A = pIcons_LOD->LoadTexture("ib-td5-A", TEXTURE_16BIT_PALETTE); - pBtn_History = pPrimaryWindow->CreateButton(0x258u, 0x169u, - (uTextureID_ib_td5_A != -1 ? pIcons_LOD->pTextures[uTextureID_ib_td5_A].uTextureWidth : 24), - (uTextureID_ib_td5_A != -1 ? pIcons_LOD->pTextures[uTextureID_ib_td5_A].uTextureHeight : 26), - 1, 0, 0xE0u, 0, 0x48u, pGlobalTXT_LocalizationStrings[602],//History - (Texture *)(uTextureID_ib_td5_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td5_A] : 0), 0); - - bFlashAutonotesBook = 0; - bFlashQuestBook = 0; - bFlashHistoryBook = 0; - - v24 = &pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn]; - v28 = pKeyActionMap->GetActionVKey(INPUT_ZoomIn); - pBtn_ZoomIn = pPrimaryWindow->CreateButton(574, 136, v24->uTextureWidth, v24->uTextureHeight, 2, 0, 0x170u, 0, v28, pGlobalTXT_LocalizationStrings[252], // Zoom In - v24, 0); - v29 = &pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut]; - v33 = pKeyActionMap->GetActionVKey(INPUT_ZoomOut); - pBtn_ZoomOut = pPrimaryWindow->CreateButton(519, 136, v29->uTextureWidth, v29->uTextureHeight, 2, 0, 0x16Fu, 0, v33, pGlobalTXT_LocalizationStrings[251], // Zoom Out - v29, 0); - pPrimaryWindow->CreateButton(0x1E1u, 0, 0x99u, 0x43u, 1, 92, 0, 0, 0, "", 0); - pPrimaryWindow->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x86u, 0, 0x35u, "", 0); - pPrimaryWindow->CreateButton(0x231u, 0x95u, 0x40u, 0x4Au, 1, 0, 0x87u, 0, 0x36u, "", 0); - pPrimaryWindow->CreateButton(0x1DCu, 0x142u, 0x4Du, 0x11u, 1, 100, 0, 0, 0, "", 0); - pPrimaryWindow->CreateButton(0x22Bu, 0x142u, 0x4Du, 0x11u, 1, 101, 0, 0, 0, "", 0); - pBtn_CastSpell = pPrimaryWindow->CreateButton(0x1DCu, 0x1C2u, - (uTextureID_Btn_CastSpell != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_CastSpell].uTextureWidth : 24), - (uTextureID_Btn_CastSpell != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_CastSpell].uTextureHeight : 26), - 1, 0, 0x69u, 0, 0x43u, pGlobalTXT_LocalizationStrings[38], - (Texture *)(uTextureID_Btn_CastSpell != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_CastSpell] : 0), - 0); - pBtn_Rest = pPrimaryWindow->CreateButton(0x206u, 0x1C2u, - (uTextureID_Btn_Rest != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_Rest].uTextureWidth : 24), - (uTextureID_Btn_Rest != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_Rest].uTextureHeight : 26), - 1, 0, 0x68u, 0, 0x52u, pGlobalTXT_LocalizationStrings[182], - (Texture *)(uTextureID_Btn_Rest != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_Rest] : 0), 0); - pBtn_QuickReference = pPrimaryWindow->CreateButton(0x230u, 0x1C2u, - (uTextureID_Btn_QuickReference != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_QuickReference].uTextureWidth : 24), - (uTextureID_Btn_QuickReference != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_QuickReference].uTextureHeight : 26), - 1, 0, 0x6Au, 0, 0x5Au, pGlobalTXT_LocalizationStrings[173], - (Texture *)(uTextureID_Btn_QuickReference != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_QuickReference] : 0), 0); - pBtn_GameSettings = pPrimaryWindow->CreateButton(0x25Au, 0x1C2u, - (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureWidth : 24), - (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureHeight : 26), - 1, 0, 0x6Bu, 0, 0, pGlobalTXT_LocalizationStrings[93], - (Texture *)(uTextureID_Btn_GameSettings != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_GameSettings] : 0), 0); - pBtn_NPCLeft = pPrimaryWindow->CreateButton(0x1D5u, 0xB2u, - (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24), - (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26), - 1, 0, 0xBCu, 0, 0, "", - (Texture *)(uTextureID_Btn_NPCLeft != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft] : 0), 0); - pBtn_NPCRight = pPrimaryWindow->CreateButton(0x272u, 0xB2u, - (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureWidth : 24), - (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26), - 1, 0, 0xBCu, 1u, 0, "", - (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0), 0); - LoadPartyBuffIcons(); -} - - -//----- (0041C047) -------------------------------------------------------- -void __cdecl GameUI_DrawStatusBar_2() -{ - unsigned int v0; // eax@1 - char *v1; // edx@2 - unsigned int v2; // ST18_4@5 - const char *v3; // ST0C_4@5 - unsigned int v4; // ST08_4@5 - int v5; // eax@5 - - pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); - if ( GameUI_StatusBar_TimedStringTimeLeft ) - { - v1 = GameUI_StatusBar_TimedString; - } - else - { - if ( !pStatusBarString[0] ) - return; - v1 = pStatusBarString; - } - LOWORD(v0) = uGameUIFontShadow; - v2 = v0; - LOWORD(v0) = uGameUIFontMain; - v3 = v1; - v4 = v0; - v5 = pFontLucida->AlignText_Center(0x1C2u, v1); - pPrimaryWindow->DrawText(pFontLucida, v5 + 11, 357, v4, v3, 0, 0, v2); -} - -//----- (0041C0B8) -------------------------------------------------------- -void __thiscall sub_41C0B8_set_status_string(const char *pStr) -{ - const char *v1; // esi@1 - int i; // eax@7 - int j; // eax@11 - - v1 = pStr; - if ( pStr && strcmp(pStr, "test") && !IsBadStringPtrA(v1, 1u) && (*v1 || GameUI_StatusBar_TimedStringTimeLeft) ) - { - if ( GameUI_StatusBar_TimedStringTimeLeft ) - { - for ( i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); - i > 450; - i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString) ) - byte_5C3427[strlen(GameUI_StatusBar_TimedString)] = 0; - } - else - { - strcpy(pStatusBarString, v1); - for ( j = pFontLucida->GetLineWidth(pStatusBarString); - j > 450; - j = pFontLucida->GetLineWidth(pStatusBarString) ) - GameUI_StatusBar_TimedString[strlen(pStatusBarString) + 199] = 0; - } - } -} - -//----- (0041C179) -------------------------------------------------------- -void __cdecl GameUI_DrawStatusBar() -{ - unsigned int v0; // ebp@1 - char *v1; // edi@5 - int v2; // eax@5 - unsigned int v3; // esi@5 - size_t v4; // eax@6 - GUIFont *v5; // ecx@6 - int v6; // eax@9 - size_t v7; // eax@10 - GUIFont *v8; // ecx@10 - char v9; // zf@12 - unsigned int v10; // ST08_4@13 - int v11; // eax@13 - - v0 = uGameUIFontShadow; - if ( pStatusBarString[0] || GameUI_StatusBar_TimedStringTimeLeft || bForceDrawStatusBar ) - { - pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); - if ( GameUI_StatusBar_TimedStringTimeLeft ) - { - v1 = GameUI_StatusBar_TimedString; - v2 = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); - v3 = 450; - while ( v2 > 450 ) - { - v4 = strlen(GameUI_StatusBar_TimedString); - v5 = pFontLucida; - byte_5C3427[v4] = 0; - v2 = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); - } - } - else - { - v1 = pStatusBarString; - v6 = pFontLucida->GetLineWidth(pStatusBarString); - v3 = 450; - while ( v6 > 450 ) - { - v7 = strlen(pStatusBarString); - v8 = pFontLucida; - GameUI_StatusBar_TimedString[v7 + 199] = 0; - v6 = pFontLucida->GetLineWidth(pStatusBarString); - } - } - v9 = *v1 == 0; - bForceDrawStatusBar = 0; - if ( !v9 ) - { - v10 = uGameUIFontMain; - v11 = pFontLucida->AlignText_Center(v3, v1); - pPrimaryWindow->DrawText(pFontLucida, v11 + 11, 357, v10, v1, 0, 0, v0); - } - } -} -// 5C35BC: using guessed type int bForceDrawStatusBar; //----- (0041CD4F) -------------------------------------------------------- @@ -2242,1274 +473,10 @@ } -//----- (0041D895) -------------------------------------------------------- -void GameUI_DrawItemInfo( struct ItemGen* inspect_item ) - { - ItemGen *v1; // esi@1 - unsigned int v2; // eax@3 - //char *v3; // edi@5 - //unsigned int v4; // eax@5 - //unsigned int v5; // esi@5 - signed int v6; // eax@5 - int v7; // edx@5 - //unsigned int v9; // eax@12 - char v10; // zf@16 - ItemGen *v11; // eax@16 - ItemGen *v12; // eax@25 - //unsigned int v13; // ecx@32 - //unsigned int v14; // eax@32 - //Render *v15; // edi@33 - const char *v16; // eax@34 - int v17; // eax@36 - int v18; // esi@37 - unsigned __int16 v19; // ax@37 - //char v20; // al@40 - char v21; // al@44 - //char v22; // al@48 - //char v23; // al@51 - int v24; // eax@52 - int v25; // eax@57 - int v26; // eax@60 - int v27; // eax@67 - const char *v28; // edi@69 - int v29; // eax@70 - char v30; // edi@78 - const char *v31; // eax@78 - int v32; // ecx@81 - unsigned int v33; // eax@81 - int v34; // esi@81 - const char *v35; // eax@85 - const char *v36; // eax@87 - unsigned int v37; // eax@109 - unsigned int v38; // eax@109 - int v39; // eax@113 - GUIFont *v40; // edx@113 - signed int v41; // [sp-20h] [bp-298h]@113 - int v42; // [sp-1Ch] [bp-294h]@113 - //char *v43; // [sp-18h] [bp-290h]@46 - unsigned int v44; // [sp-18h] [bp-290h]@113 - //int v45; // [sp-14h] [bp-28Ch]@46 - const char *v46; // [sp-14h] [bp-28Ch]@58 - char *v47; // [sp-14h] [bp-28Ch]@110 - //char *v48; // [sp-10h] [bp-288h]@46 - const char *v49; // [sp-10h] [bp-288h]@56 - char *v50; // [sp-10h] [bp-288h]@58 - int v51; // [sp-10h] [bp-288h]@110 - const char *v52; // [sp-Ch] [bp-284h]@36 - //int v53; // [sp-Ch] [bp-284h]@46 - char *v54; // [sp-Ch] [bp-284h]@56 - int v55; // [sp-Ch] [bp-284h]@58 - int v56; // [sp-Ch] [bp-284h]@110 - unsigned int v57; // [sp-8h] [bp-280h]@36 - //int v58; // [sp-8h] [bp-280h]@46 - int v59; // [sp-8h] [bp-280h]@56 - int v60; // [sp-8h] [bp-280h]@58 - unsigned int v61; // [sp-8h] [bp-280h]@110 - char out_text[300]; // [sp+8h] [bp-270h]@40 - //char Dest[100]; // [sp+6Ch] [bp-20Ch]@40 - //char v64[100]; // [sp+D0h] [bp-1A8h]@40 - char v65[120]; // [sp+134h] [bp-144h]@92 - char Source[40]; // [sp+1ACh] [bp-CCh]@49 - stru351_summoned_item v67; - //int v67; // [sp+1D4h] [bp-A4h]@91 - //int v68; // [sp+1D8h] [bp-A0h]@106 - //int v69; // [sp+1DCh] [bp-9Ch]@101 - //int v70; // [sp+1E0h] [bp-98h]@97 - //int v71; // [sp+1E8h] [bp-90h]@93 - //int v72; // [sp+1ECh] [bp-8Ch]@91 - int var88; // [sp+1F0h] [bp-88h]@1 - Texture *v73; // [sp+1F4h] [bp-84h]@5 - //unsigned int v75; // [sp+1F8h] [bp-80h]@5 - //char *v76; // [sp+1FCh] [bp-7Ch]@5 - int v77; // [sp+200h] [bp-78h]@12 - int v78; // [sp+204h] [bp-74h]@5 - GUIWindow wHintWindow; // [sp+208h] [bp-70h]@2 - POINT a2; // [sp+25Ch] [bp-1Ch]@2 - int v81; // [sp+264h] [bp-14h]@5 - // GUIFont *pFontComic; // [sp+268h] [bp-10h]@1 - PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18 - char* v84; - int v85; - char *Str; // [sp+270h] [bp-8h]@65 - - v1 = inspect_item; - var88 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - if (!inspect_item->uItemID) - return; - - wHintWindow.Hint = 0; - wHintWindow.uFrameWidth = 384; - wHintWindow.uFrameHeight = 180; - wHintWindow.uFrameY = 40; - if ( pMouse->GetCursorPos(&a2)->x <= 320 ) - v2 = pMouse->GetCursorPos(&a2)->x + 30; - else - v2 = pMouse->GetCursorPos(&a2)->x - wHintWindow.uFrameWidth - 30; - wHintWindow.uFrameX = v2; - auto item_desc = &pItemsTable->pItems[inspect_item->uItemID]; - //v3 = (char *)&pItemsTable->pItems[_this->uItemID].pIconName; - //v76 = v3; - //v4 = pIcons_LOD->LoadTexture(pItemsTable->pItems[_this->uItemID].pIconName, TEXTURE_16BIT_PALETTE); - //v5 = v4; - //v4 *= 72; - //v75 = v4; - //v73 = &pIcons_LOD->pTextures[v4]; - v73 = pIcons_LOD->LoadTexturePtr(item_desc->pIconName, TEXTURE_16BIT_PALETTE); - v6 = 100 - v73->uTextureWidth; - v7 = v73->uTextureHeight; - v78 = v6; - v81 = 144 - v7; - if ( v6 > 0 ) - v78 = v6 >> 1; - if ( v81 <= 0 ) - v81 = 0; - else - v81 >>= 1; - if ( !item_desc->uItemID_Rep_St ) - inspect_item->SetIdentified(); - //v9 = v8->uAttributes; - v77 = 0; - //a2.y = v8->uAttributes & 2; - if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_GOLD) - v77 = inspect_item->uSpecEnchantmentType; - if ( uActiveCharacter ) - { - //try to identify - if (!inspect_item->Identified()) - { - - v11 = inspect_item; - if ( pPlayers[uActiveCharacter]->CanIdentify(inspect_item) == 1 ) - inspect_item->SetIdentified(); - v83 = SPEECH_9; - if ( !inspect_item->Identified() ) - { - ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u);//"Identify Failed" - } - else - { - v83 = SPEECH_8; - if ( inspect_item->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) ) - v83 = SPEECH_7; - } - if ( dword_4E455C ) - { - pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); - dword_4E455C = 0; - } - } - inspect_item->UpdateTempBonus(pParty->uTimePlayed); - if (inspect_item->Broken()) - { - if ( pPlayers[uActiveCharacter]->CanRepair(inspect_item) == 1 ) - inspect_item->uAttributes = inspect_item->uAttributes & 0xFFFFFFFD | 1; - v83 = SPEECH_11; - if ( !inspect_item->Broken() ) - v83 = SPEECH_10; - else - ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u);//"Repair Failed" - if ( dword_4E455C ) - { - pPlayers[uActiveCharacter]->PlaySound(v83, 0); - dword_4E455C = 0; - } - } - } - //v13 = _this->uAttributes; - //v14 = _this->Identified(); - //a2.y = inspect_item->Identified(); - if (inspect_item->Broken()) - { - wHintWindow.DrawMessageBox(0); - //v15 = &; - pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, - wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, - wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); - wHintWindow.uFrameWidth -= 24; - wHintWindow.uFrameHeight -= 12; - wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; - wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; - pRenderer->DrawTransparentRedShade(wHintWindow.uFrameX + v78, v81 + wHintWindow.uFrameY + 30, v73); - if ( inspect_item->Identified()) - v16 = inspect_item->GetIdentifiedName(); - else - v16 = item_desc->pUnidentifiedName; - wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v16, 3u); - v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &wHintWindow, 0, 0); //"Broken Item" - v18 = v17 >> 1; - v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); - wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item" - pRenderer->ResetClip(); - if ( !areWeLoadingTexture ) - { - v73->Release(); - pIcons_LOD->_40F9C5(); - } - return; - } - if (!inspect_item->Identified()) - { - wHintWindow.DrawMessageBox(0); - pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, - wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, - wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); - wHintWindow.uFrameWidth -= 24; - wHintWindow.uFrameHeight -= 12; - wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; - wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; - pRenderer->DrawTextureTransparent(wHintWindow.uFrameX + v78, v81 + wHintWindow.uFrameY + 30, v73); - wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, item_desc->pUnidentifiedName, 3u); - v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &wHintWindow, 0, 0); ///"Not Identified" - v18 = v17 >> 1; - v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); - wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[232], 3); - pRenderer->ResetClip(); - if ( !areWeLoadingTexture ) - { - v73->Release(); - pIcons_LOD->_40F9C5(); - } - return; - } - - sprintfex(out_text, pGlobalTXT_LocalizationStrings[463], item_desc->pUnidentifiedName); //"Type: %s" - out_text[100] = 0; - out_text[200] = 0; - //v20 = item_desc->uEquipType; - switch (item_desc->uEquipType) - { - case EQUIP_ONE_OR_TWO_HANDS: - case EQUIP_TWO_HANDED: - sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[LOCSTR_ATTACK], - (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); //"Damage" - if (item_desc->uDamageMod) - { - char mod[16]; - sprintf(mod, "+%d", (int)item_desc->uDamageMod); - strcat(out_text + 100, mod); - } - break; - - case EQUIP_BOW: - sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], //"Shoot" - (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], //"Damage" - (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); - if (item_desc->uDamageMod) - { - char mod[16]; - sprintf(mod, "+%d", (int)item_desc->uDamageMod); - strcat(out_text + 100, mod); - } - break; - - case EQUIP_ARMOUR: - case EQUIP_SHIELD: - case EQUIP_HELMET: - case EQUIP_BELT: - case EQUIP_CLOAK: - case EQUIP_GAUNTLETS: - case EQUIP_BOOTS: - case EQUIP_RING: - case EQUIP_AMULET: - if (item_desc->uDamageDice) //"Armor" - sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod); - break; - - } - - if ( !v77 ) - { - if (item_desc->uEquipType ==EQUIP_POTION) //this is CORRECT! do not move to switch! - { - if ( inspect_item->uEnchantmentType ) - sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power" - } - else if (item_desc->uEquipType == EQUIP_REAGENT) - { - sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power" - } - - else if ( inspect_item->uEnchantmentType ) - { - sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], - pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->_bonus_strength); //"Special" - } - else if ( inspect_item->uSpecEnchantmentType ) - { - sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], - pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement, inspect_item->_bonus_strength); - } - - else if ( inspect_item->uNumCharges ) - { - sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges" - - } - } - wHintWindow.uFrameWidth -= 12; - v85 = 3; - wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; - wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; - Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8)); - v84 = &out_text[0]; - do - { - if ( *v84 ) - { - v27 = pFontComic->CalcTextHeight(v84, &wHintWindow, 100, 0); - Str += v27 + 3; - } - v84 += 100; - --v85; - } - while ( v85 ); - v28 = item_desc->pDescription; - if ( *v28 ) - { - v29 = pFontSmallnum->CalcTextHeight(v28, &wHintWindow, 100, 0); - Str += v29; - } - wHintWindow.uFrameHeight = v73->uTextureHeight + v81 + 54; - if ( (signed int)Str > (signed int)wHintWindow.uFrameHeight ) - wHintWindow.uFrameHeight = (unsigned int)Str; - if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) - wHintWindow.uFrameHeight += LOBYTE(pFontComic->uFontHeight); - v85 = 0; - if ( pFontArrus->uFontHeight ) - { - wHintWindow.uFrameWidth -= 24; - v30 = pFontArrus->uFontHeight; - v31 = inspect_item->GetIdentifiedName(); - if ( pFontArrus->CalcTextHeight(v31, &wHintWindow, 0, 0) / (signed int)v30 ) - v85 = v30; - wHintWindow.uFrameWidth += 24; - } - wHintWindow.uFrameWidth += 12; - wHintWindow.uFrameHeight += (unsigned int)v85; - wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; - wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; - wHintWindow.DrawMessageBox(0); - //v15 = pRenderer; - pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, - wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); - wHintWindow.uFrameWidth -= 12; - v32 = v73->uTextureHeight; - v33 = wHintWindow.uFrameHeight; - wHintWindow.uFrameHeight -= 12; - wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; - wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; - pRenderer->DrawTextureTransparent( - wHintWindow.uFrameX + v78, - wHintWindow.uFrameY + (signed int)(v33 - v32) / 2, - v73); - - v34 = (int)(v85 + 35); - v85 = 3; - Str = out_text; - do - { - if ( *Str ) - { - wHintWindow.DrawText(pFontComic, 100, v34, 0, Str, 0, 0, 0); - v34 += pFontComic->CalcTextHeight(Str, &wHintWindow, 100, 0) + 3; - } - Str += 100; - --v85; - } - while (v85 ); - v35 = item_desc->pDescription; - if ( *v35 ) - wHintWindow.DrawText(pFontSmallnum, 100, v34, 0, v35, 0, 0, 0); - wHintWindow.uFrameX += 12; - wHintWindow.uFrameWidth -= 24; - v36 = inspect_item->GetIdentifiedName(); - wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v36, 3u); - wHintWindow.uFrameWidth += 24; - wHintWindow.uFrameX -= 12; - if ( v77 ) - { - sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value" - v40 = pFontComic; - v61 = 0; - v56 = 0; - v51 = 0; - v47 = pTmpBuf; - v44 = 0; - v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight); - v41 = 100; - } - else - { - if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) - { - sub_493F79(&v67, inspect_item->uExpireTime - pParty->uTimePlayed); - strcpy(pTmpBuf, "Duration:"); - Str = (char *)(v67.field_18_expire_year - game_starting_year); - if (v67.field_18_expire_year != 1168 ) - { - sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year); - strcat(pTmpBuf, v65); - } - if ( (((v67.field_14_exprie_month || Str) && - ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str) - || v67.field_C_expire_day) - && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || - v67.field_C_expire_day) - || v67.field_8_expire_hour) - && ((sprintf(v65, " %d:hr", v67.field_8_expire_hour), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || - v67.field_C_expire_day || v67.field_8_expire_hour) - || v67.field_4_expire_minute ) - { - sprintf(v65, " %d:mn", v67.field_4_expire_minute); - strcat(pTmpBuf, v65); - } - wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf, 0, 0, 0); - } - v37 = inspect_item->GetValue(); - sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37); - wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf, 0, 0, 0); - v38 = inspect_item->uAttributes; - if ( BYTE1(v38) & 1 ) - { - v61 = 0; - v56 = 0; - v51 = 0; - v47 = pGlobalTXT_LocalizationStrings[187]; //"Stolen" - } - else - { - if ( !(BYTE1(v38) & 2) ) - { - pRenderer->ResetClip(); - if ( !areWeLoadingTexture ) - { - v73->Release(); - pIcons_LOD->_40F9C5(); - } - return; - } - v61 = 0; - v56 = 0; - v51 = 0; - v47 = pGlobalTXT_LocalizationStrings[651]; //"Hardened" - } - LOWORD(v38) = LOWORD(pRenderer->uTargetRMask); - v44 = v38; - v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight); - v39 = pFontComic->GetLineWidth(pTmpBuf); - v40 = pFontComic; - v41 = v39 + 132; - } - wHintWindow.DrawText(v40, v41, v42, v44, v47, v51, v56, v61); - pRenderer->ResetClip(); - if ( !areWeLoadingTexture ) - { - v73->Release(); - pIcons_LOD->_40F9C5(); - } - return; -} -// 4E455C: using guessed type int dword_4E455C; -// 506128: using guessed type int areWeLoadingTexture; -//----- (0041E360) -------------------------------------------------------- -char *__fastcall MonsterPopup_Draw(unsigned int uActorID, GUIWindow *edx0) -{ - unsigned int v2; // esi@1 - Actor *v3; // esi@3 - int v4; // eax@3 - unsigned int v5; // ecx@3 - NPCData *v6; // eax@3 - unsigned __int16 v7; // cx@3 - int v8; // eax@4 - unsigned __int16 v9; // dx@4 - SpriteFrame *v10; // edi@17 - LODSprite *v11; // esi@17 - unsigned int v12; // ecx@17 - Sprite *v13; // edi@18 - int v14; // ecx@18 - int v15; // edx@18 - int v16; // edx@18 - int v17; // eax@18 - unsigned int v18; // ecx@19 - unsigned int v19; // eax@21 - char *v20; // esi@28 - int v21; // edx@29 - unsigned __int16 *v22; // ecx@29 - int v23; // eax@29 - int v24; // eax@32 - int v25; // esi@32 - char *v26; // edx@34 - unsigned __int8 v27; // sf@36 - unsigned __int8 v28; // of@36 - int v29; // esi@40 - char *v30; // ecx@40 - int v31; // eax@40 - int v32; // esi@43 - unsigned __int16 v33; // ax@45 - int v34; // edx@45 - int v35; // eax@45 - int v36; // eax@49 - char *v37; // eax@52 - int v38; // eax@55 - unsigned __int16 v39; // ax@59 - SpellBuff *v40; // eax@60 - int v41; // edi@61 - unsigned int v42; // eax@61 - int v43; // eax@62 - int v44; // eax@63 - signed int v45; // edi@65 - unsigned __int16 v46; // ax@73 - Player *v47; // ecx@77 - unsigned int v48; // eax@85 - GUIFont *v49; // edi@90 - int v50; // edi@90 - SpellBuff *v51; // eax@91 - char *v52; // ecx@98 - char *v53; // ecx@101 - char *v54; // ST0C_4@118 - unsigned int v55; // eax@118 - GUIFont *v56; // edi@124 - unsigned __int8 v57; // al@128 - int v58; // eax@132 - Actor *v59; // ecx@133 - unsigned __int8 v60; // dl@138 - char *v62; // eax@147 - int v63; // eax@152 - char *result; // eax@152 - int v65; // eax@155 - const char *v66; // [sp-10h] [bp-1FCh]@121 - const char *v67; // [sp-10h] [bp-1FCh]@125 - const char *v68; // [sp-10h] [bp-1FCh]@142 - int v69; // [sp-Ch] [bp-1F8h]@121 - char *v70; // [sp-Ch] [bp-1F8h]@125 - char *v71; // [sp-Ch] [bp-1F8h]@142 - char *v72; // [sp-8h] [bp-1F4h]@54 - int v73; // [sp-8h] [bp-1F4h]@79 - int v74; // [sp-8h] [bp-1F4h]@121 - int v75; // [sp-8h] [bp-1F4h]@125 - int v76; // [sp-8h] [bp-1F4h]@142 - size_t v77; // [sp-4h] [bp-1F0h]@54 - unsigned int v78; // [sp-4h] [bp-1F0h]@121 - unsigned int v79; // [sp-4h] [bp-1F0h]@125 - char *v80; // [sp-4h] [bp-1F0h]@142 - char *v81; // [sp-4h] [bp-1F0h]@148 - DDBLTFX Dst; // [sp+Ch] [bp-1E0h]@18 - DDSURFACEDESC2 pDesc; // [sp+70h] [bp-17Ch]@18 - RECT v84; // [sp+ECh] [bp-100h]@26 - char *v85[10]; // [sp+FCh] [bp-F0h]@145 - char *v95[11]; // [sp+124h] [bp-C8h]@127 - RenderBillboardTransform_local0 v106; // [sp+150h] [bp-9Ch]@3 - unsigned int v107; // [sp+1A0h] [bp-4Ch]@18 - unsigned __int16 *v108; // [sp+1A4h] [bp-48h]@34 - unsigned int v109; // [sp+1A8h] [bp-44h]@32 - LPVOID v110; // [sp+1ACh] [bp-40h]@28 - unsigned int v111; // [sp+1B0h] [bp-3Ch]@29 - char **v112; // [sp+1B4h] [bp-38h]@3 - IDirectDrawSurface *v222; // [sp+1B8h] [bp-34h]@18 - unsigned __int8 v114; // [sp+1BFh] [bp-2Dh]@133 - int v115; // [sp+1C0h] [bp-2Ch]@3 - unsigned int v116; // [sp+1C4h] [bp-28h]@18 - int i; // [sp+1C8h] [bp-24h]@18 - Player *a2; // [sp+1CCh] [bp-20h]@28 - int v119; // [sp+1D0h] [bp-1Ch]@18 - SpellBuff *v120; // [sp+1D4h] [bp-18h]@18 - Actor *v121; // [sp+1D8h] [bp-14h]@3 - int a5; // [sp+1DCh] [bp-10h]@3 - GUIWindow *a1; // [sp+1E0h] [bp-Ch]@1 - int v124; // [sp+1E4h] [bp-8h]@18 - char *a4; // [sp+1E8h] [bp-4h]@18 - - a1 = edx0; - v2 = uActorID; - static Actor pMonsterInfoUI_Doll; - /*if ( !(bMonsterInfoUI_bDollInitialized & 1) ) - { - bMonsterInfoUI_bDollInitialized |= 1u; - Actor::Actor(&pMonsterInfoUI_Doll); - atexit(nullsub_3); - }*/ - v106.uParentBillboardID = -1; - v3 = &pActors[v2]; - v121 = v3; - v4 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xFFu, 0x9Bu); - v5 = v3->sNPC_ID; - a5 = v4; - v6 = GetNPCData(v5); - v7 = v3->pMonsterInfo.uID; - v112 = (char **)v6; - v115 = byte_4E2B70[((signed __int16)v7 - 1) / 3] - 40; - if ( v7 == pMonsterInfoUI_Doll.pMonsterInfo.uID ) - { - v9 = pMonsterInfoUI_Doll.uCurrentActionLength; - } - else - { - memcpy(&pMonsterInfoUI_Doll, v3, sizeof(pMonsterInfoUI_Doll)); - pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; - pMonsterInfoUI_Doll.uCurrentActionTime = 0; - v8 = rand(); - v3 = v121; - v9 = v8 % 256 + 128; - pMonsterInfoUI_Doll.uCurrentActionLength = v8 % 256 + 128; - } - if ( (signed int)pMonsterInfoUI_Doll.uCurrentActionTime > (signed __int16)v9 ) - { - pMonsterInfoUI_Doll.uCurrentActionTime = 0; - if ( pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_Bored || pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_AtkMelee) - { - pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Standing; - pMonsterInfoUI_Doll.uCurrentActionLength = rand() % 128 + 128; - } - else - { - rand(); - pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; - if ( (pMonsterInfoUI_Doll.pMonsterInfo.uID < 115 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 186) - && (pMonsterInfoUI_Doll.pMonsterInfo.uID < 232 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 249) - && rand() % 30 < 100 ) - pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_AtkMelee; - pMonsterInfoUI_Doll.uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength; - } - } - v10 = pSpriteFrameTable->GetFrame( v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation], pMonsterInfoUI_Doll.uCurrentActionTime); - v11 = &pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]];//40 * v10->pHwSpriteIDs[0] + 7218180; - v106.pTarget = pRenderer->pTargetSurface; - v106.pTargetZ = pRenderer->pActiveZBuffer; - v106.uTargetPitch = pRenderer->uTargetSurfacePitch; - v12 = a1->uFrameY + 52; - v106.uViewportX = a1->uFrameX + 13; - v106.uViewportY = v12; - v106.uViewportW = v12 + 128; - v106.uViewportZ = v106.uViewportX + 128; - v106.uScreenSpaceX = (signed int)(v106.uViewportX + 128 + v106.uViewportX) / 2; - v106._screenspace_x_scaler_packedfloat = 65536; - v106._screenspace_y_scaler_packedfloat = 65536; - v106.uScreenSpaceY = v115 + v12 + v11->uHeight; - v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1); - v106.sZValue = 0; - v106.uFlags = 0; - pRenderer->Clip_v2(0, 0, 0x27Fu, 0x1DFu); - pRenderer->Line2D(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, a5); - pRenderer->Line2D( v106.uViewportX + 129, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportW + 1, a5); - pRenderer->Line2D(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, a5); - pRenderer->Line2D(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, a5); - if ( pRenderer->pRenderD3D ) - { - v13 = &pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]]; - v106.uScreenSpaceY = v115 + v106.uViewportY + v13->uBufferHeight; - v222 = (IDirectDrawSurface *)v13->pTextureSurface; - memset(&Dst, 0, 0x64u); - Dst.dwSize = 100; - Dst.dwFillColor = 0; - memset(&pDesc, 0, 0x7Cu); - pDesc.dwSize = 124; - v222->GetSurfaceDesc((LPDDSURFACEDESC)&pDesc); - v14 = v13->uBufferHeight; - v120 = (SpellBuff *)v13->uBufferWidth; - v107 = 0; - v15 = v13->uAreaX; - v119 = (signed int)v120 / 2; - i = 0; - a4 = (char *)(v106.uScreenSpaceX + v15 - (signed int)v120 / 2); - v115 = v13->uAreaY; - v16 = v13->uAreaWidth + (signed int)v120 / 2 + v15 - (int)v120; - v124 = v106.uScreenSpaceY + v115 - v14; - v17 = v13->uAreaHeight + v115 - v14; - v116 = v106.uScreenSpaceX + v16; - v119 = v106.uScreenSpaceY + v17; - if ( (signed int)a4 < (signed int)v106.uViewportX ) - { - v18 = v106.uViewportX - (int)a4; - a4 = (char *)v106.uViewportX; - v107 = v18; - } - if ( v124 < (signed int)v106.uViewportY ) - { - v19 = v106.uViewportY - v124; - v124 = v106.uViewportY; - i = v19; - } - if ( (signed int)v116 > (signed int)v106.uViewportZ ) - v116 = v106.uViewportZ; - if ( v119 > (signed int)v106.uViewportW ) - v119 = v106.uViewportW; - pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, - pRenderer->uTargetBMask | pRenderer->uTargetGMask); - pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, - pRenderer->uTargetBMask | pRenderer->uTargetGMask); - v84.left = v106.uViewportX; - v84.top = v106.uViewportY; - v84.right = v106.uViewportZ; - v84.bottom = v106.uViewportW; - ErrD3D(pRenderer->pBackBuffer4->Blt(&v84, 0, 0, 16778240u, &Dst)); - if ( pRenderer->uTargetGBits == 5 ) - { - memset(&pDesc, 0, 0x7Cu); - pDesc.dwSize = 124; - if ( pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)v222, &pDesc, DDLOCK_WAIT)) - { - v20 = (char *)v124; - v110 = pDesc.lpSurface; - a2 = (Player *)v124; - if ( v124 < v119 ) - { - v111 = 2 * pRenderer->uTargetSurfacePitch; - v21 = (int)a4; - v22 = &pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; - v23 = i - v124; - v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; - v115 = i - v124; - while ( 1 ) - { - v124 = v21; - if ( v21 < (signed int)v116 ) - { - v24 = (int)&v20[v23]; - v25 = v107 - v21; - v109 = v24; - for ( i = v107 - v21; ; v25 = i ) - { - v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / v13->uAreaHeight); - v26 = (char *)v108 + pDesc.dwWidth * (v25 + v124++) / v13->uAreaWidth; - *v22 = *((short *)v110 + (int)v26); - ++v22; - if ( v124 >= (signed int)v116 ) - break; - } - v23 = v115; - } - v22 = (unsigned __int16 *)((char *)v120 + v111); - v20 = (char *)&a2->pConditions[0] + 1; - v28 = __OFSUB__((int)&a2->pConditions[0] + 1, v119); - v27 = (signed int)((char *)&a2->pConditions[0] + -v119 + 1) < 0; - a2 = (Player *)((char *)a2 + 1); - v120 = (SpellBuff *)((char *)v120 + v111); - if ( !(v27 ^ v28) ) - break; - v21 = (int)a4; - } - } - v222->Unlock(0); - } - } - else - { - memset(&pDesc, 0, 0x7Cu); - pDesc.dwSize = 124; - if ( pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)v222, &pDesc, DDLOCK_WAIT) ) - { - v108 = (unsigned __int16 *)pDesc.lpSurface; - a2 = (Player *)v124; - if ( v124 < v119 ) - { - v109 = 2 * pRenderer->uTargetSurfacePitch; - v29 = (int)a4; - v30 = (char *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; - v31 = i - v124; - v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; - v115 = i - v124; - while ( 1 ) - { - v124 = v29; - if ( v29 < (signed int)v116 ) - { - v32 = v107 - (int)a4; - v111 = (unsigned int)((char *)a2 + v31); - for ( i = v107 - (int)a4; ; v32 = i ) - { - v110 = (LPVOID)((pDesc.lPitch >> 1) * pDesc.dwHeight * v111 / v13->uAreaHeight); - v33 = v108[(int)((char *)v110 + pDesc.dwWidth * (v32 + v124) / v13->uAreaWidth)]; - v34 = v33 & 0x1F | 2 * (unsigned __int16)(v108[(int)((char *)v110 + pDesc.dwWidth * (v32 + v124++) / v13->uAreaWidth)] & 0xFFE0); - v35 = v124; - *(short *)v30 = v34; - v30 += 2; - if ( v35 >= (signed int)v116 ) - break; - } - v31 = v115; - } - a2 = (Player *)((char *)a2 + 1); - v30 = (char *)v120 + v109; - v120 = (SpellBuff *)((char *)v120 + v109); - if ( (signed int)a2 >= v119 ) - break; - v29 = (int)a4; - } - } - v222->Unlock(0); - } - } - } - else - { - pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0); - v36 = v10->pHwSpriteIDs[0]; - if ( v36 >= 0 ) - pSprites_LOD->pSpriteHeaders[v36]._4ACC38(&v106, 0); - } - if ( v121->sNPC_ID ) - { - v37 = v112[6]; - if ( v37 ) - { - sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], *v112, aNPCProfessionNames[(signed int)v37]); - } - else - { - v77 = 2000; - v72 = *v112; - } - } - else - { - v38 = v121->dword_000334_unique_name; - v77 = 2000; - if ( v38 ) - v72 = pMonsterStats->pPlaceStrings[v38]; - else - v72 = pMonsterStats->pInfos[v121->pMonsterInfo.uID].pName; - } - if(!v121->sNPC_ID || (v121->sNPC_ID && !v37)) - strncpy(pTmpBuf, v72, v77); - v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - a1->DrawTitleText(pFontComic, 0, 0xCu, v39, pTmpBuf, 3u); - Actor::DrawHealthBar(v121, a1); - v119 = 0; - pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed; - v115 = 0; - v116 = 0; - i = 0; - v112 = 0; - if ( !uActiveCharacter ) - { - v45 = 1; - } - else - { - LOBYTE(v40) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); - v120 = v40; - if ( !v40 ) - v45 = 1; - else - { - v41 = (unsigned __int8)v40 & 0x3F; - v42 = SkillToMastery((unsigned __int16)v40) - 1; - if ( !v42 ) - { - if ( v41 + 10 >= v121->pMonsterInfo.uLevel ) - { - v45 = 1; - v119 = 1; - } - else - v45 = 1; - } - else - { - v43 = v42 - 1; - if ( !v43 ) - { - if ( 2 * v41 + 10 >= v121->pMonsterInfo.uLevel ) - { - v45 = 1; - v119 = 1; - v116 = 1; - } - else - v45 = 1; - } - else - { - v44 = v43 - 1; - if ( !v44 ) - { - if ( 3 * v41 + 10 >= v121->pMonsterInfo.uLevel ) - { - v45 = 1; - v119 = 1; - v116 = 1; - i = 1; - } - else - { - v45 = 1; - } - } - else - { - if ( v44 != 1 ) - v45 = 1; - else - { - v45 = 1; - v119 = 1; - v116 = 1; - i = 1; - v112 = (char **)1; - } - } - } - } - } - // LABEL_73: - v46 = v121->uAIState; - if ( v46 != 5 && v46 != 4 && !dword_507BF0_is_there_popup_onscreen && v120 ) - { - v47 = pPlayers[uActiveCharacter]; - if ( v119 | v116 | i | (unsigned int)v112 ) - { - if ( v121->pMonsterInfo.uLevel >= v47->uLevel - 5 ) - v73 = SPEECH_105; - else - v73 = SPEECH_104; - } - else - { - v73 = SPEECH_106; - } - v47->PlaySound((PlayerSpeech)v73, 0); - } - } - a2 = pParty->pPlayers; - do - { - LOBYTE(v48) = a2->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); - v111 = v48; - v120 = (SpellBuff *)138; - do - { - if ( (signed int)SkillToMastery(v111) >= 3 ) - v115 = v45; - v120 = (SpellBuff *)((char *)v120 - 1); - } - while ( v120 ); - ++a2; - } - while ( (signed int)a2 < (signed int)pParty->pHirelings ); - v49 = pFontSmallnum; - a2 = (Player *)pFontSmallnum; - a1->DrawText(pFontSmallnum, 12, 196, a5, pGlobalTXT_LocalizationStrings[631], 0, 0, 0); - v50 = LOBYTE(v49->uFontHeight) + 193; - if ( !v115 ) - { - v78 = 0; - v74 = 0; - v69 = 0; - v66 = pGlobalTXT_LocalizationStrings[630]; - a1->DrawText((GUIFont *)a2, 28, v50, a5, v66, v69, v74, v78); - } - else - { - a4 = 0; - v51 = &v121->pActorBuffs[1]; - v222 = 0; - v120 = &v121->pActorBuffs[1]; - do - { - if ( (signed __int64)v51->uExpireTime > 0 ) - { - switch ( (int)v51 ) - { - case 0u: - v124 = 60; - a4 = pGlobalTXT_LocalizationStrings[591]; - break; - case 1u: - v124 = 82; - a4 = pGlobalTXT_LocalizationStrings[649]; - break; - case 2u: - v124 = 92; - a4 = pGlobalTXT_LocalizationStrings[592]; - break; - case 3u: - v124 = 63; - a4 = pGlobalTXT_LocalizationStrings[4]; - break; - case 4u: - v52 = pGlobalTXT_LocalizationStrings[220]; - a4 = v52; - v124 = 81; - break; - case 5u: - v52 = pGlobalTXT_LocalizationStrings[162]; - a4 = v52; - v124 = 81; - break; - case 6u: - v53 = pGlobalTXT_LocalizationStrings[593]; - v124 = 35; - a4 = v53; - break; - case 8u: - v53 = pGlobalTXT_LocalizationStrings[608]; - v124 = 62; - a4 = v53; - break; - case 7u: - case 9u: - a4 = 0; - v124 = 0; - ++v51; - v222 = (IDirectDrawSurface *)((char *)v222 + 1); - v120 = v51; - __debugbreak(); // fix condition - continue; - case 0xAu: - v124 = 47; - a4 = pGlobalTXT_LocalizationStrings[221]; - break; - case 0xBu: - v124 = 66; - a4 = pGlobalTXT_LocalizationStrings[607]; - break; - case 0xCu: - v124 = 85; - a4 = pGlobalTXT_LocalizationStrings[610]; - break; - case 0xDu: - v124 = 86; - a4 = pGlobalTXT_LocalizationStrings[609]; - break; - case 0xEu: - v124 = 17; - a4 = pGlobalTXT_LocalizationStrings[279]; - break; - case 0xFu: - v124 = 38; - a4 = pGlobalTXT_LocalizationStrings[442]; - break; - case 0x10u: - v124 = 46; - a4 = pGlobalTXT_LocalizationStrings[443]; - break; - case 0x11u: - v124 = 51; - a4 = pGlobalTXT_LocalizationStrings[440]; - break; - case 0x12u: - v124 = 5; - a4 = pGlobalTXT_LocalizationStrings[441]; - break; - case 0x13u: - v124 = 95; - a4 = pGlobalTXT_LocalizationStrings[229]; - break; - case 0x14u: - v124 = 73; - a4 = pGlobalTXT_LocalizationStrings[228]; - break; - default: - a4 = 0; - break; - } - if ( a4 ) - { - v54 = a4; - v55 = GetSpellColor(v124); - a1->DrawText((GUIFont *)a2, 28, v50, v55, v54, 0, 0, 0); - v50 = v50 + BYTE5(a2->pConditions[0]) - 3; - v51 = v120; - } - } - ++v51; - v222 = (IDirectDrawSurface *)((char *)v222 + 1); - v120 = v51; - - __debugbreak(); // fix condition - } - //while ( (signed int)((char *)&v222->lpVtbl + 1) < 22 ); - while (true); - if ( !a4 ) - { - v78 = 0; - v74 = 0; - v69 = 0; - v66 = pGlobalTXT_LocalizationStrings[153]; - a1->DrawText((GUIFont *)a2, 28, v50, a5, v66, v69, v74, v78); - } - } - v56 = pFontSmallnum; - a4 = (char *)v106.uViewportY; - if ( v119 ) - { - sprintf(pTmpBuf, "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, v121->pMonsterInfo.uHP); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; - v79 = v121->pMonsterInfo.uAC; - v75 = 0; - v70 = pGlobalTXT_LocalizationStrings[12]; - v67 = "%s\f%05u\t100%d\n"; - } - else - { - sprintf(pTmpBuf, "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - v79 = (unsigned int)pGlobalTXT_LocalizationStrings[630]; - v75 = 0; - v70 = pGlobalTXT_LocalizationStrings[12]; - a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; - v67 = "%s\f%05u\t100%s\n"; - } - sprintf(pTmpBuf, v67, v70, v75, v79); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - a4 = &a4[LOBYTE(v56->uFontHeight) - 6] + LOBYTE(v56->uFontHeight); - v95[0] = pGlobalTXT_LocalizationStrings[87]; - v95[1] = pGlobalTXT_LocalizationStrings[6]; - v95[2] = pGlobalTXT_LocalizationStrings[240]; - v95[3] = pGlobalTXT_LocalizationStrings[70]; - v95[4] = pGlobalTXT_LocalizationStrings[624]; - v95[5] = pGlobalTXT_LocalizationStrings[138]; - v95[6] = pGlobalTXT_LocalizationStrings[214]; - v95[7] = pGlobalTXT_LocalizationStrings[142]; - v95[8] = pGlobalTXT_LocalizationStrings[29]; - v95[9] = pGlobalTXT_LocalizationStrings[133]; - v95[10] = pGlobalTXT_LocalizationStrings[54]; - if ( v116 ) - { - sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, v95[v121->pMonsterInfo.uAttack1Type]); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; - v57 = v121->pMonsterInfo.uAttack1DamageBonus; - if ( v57 ) - sprintf(pTmpBuf, "%s\f%05u\t080%dd%d+%d\n", pGlobalTXT_LocalizationStrings[53], - 0, v121->pMonsterInfo.uAttack1DamageDiceRolls, v121->pMonsterInfo.uAttack1DamageDiceSides, v57); - else - sprintf(pTmpBuf, "%s\f%05u\t080%dd%d\n", pGlobalTXT_LocalizationStrings[53], - 0, v121->pMonsterInfo.uAttack1DamageDiceRolls, v121->pMonsterInfo.uAttack1DamageDiceSides); - } - else - { - sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; - sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[53], 0, pGlobalTXT_LocalizationStrings[630]); - } - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - v58 = LOBYTE(v56->uFontHeight); - a4 = &a4[v58 - 6] + v58; - if ( !i ) - { - v80 = pGlobalTXT_LocalizationStrings[630]; - v76 = 0; - v71 = pGlobalTXT_LocalizationStrings[628]; - v68 = "%s\f%05u\t080%s\n"; - sprintf(pTmpBuf, v68, v71, v76, v80); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - v58 = LOBYTE(v56->uFontHeight); - a4 = &a4[v58 - 3]; - } - else - { - v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[628]; - v59 = v121; - v114 = v121->pMonsterInfo.uSpell1ID; - if ( v114 && v121->pMonsterInfo.uSpell2ID ) - v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[629]; - if ( v114 ) - { - sprintf(pTmpBuf, "%s\f%05u\t060%s\n", v120, 0, pSpellStats->pInfos[v114].pShortName); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - v58 = LOBYTE(v56->uFontHeight); - a4 = &a4[v58 - 3]; - v59 = v121; - } - v60 = v59->pMonsterInfo.uSpell2ID; - if ( v60 ) - { - sprintf(pTmpBuf, "\f%05u\t060%s\n", 0, pSpellStats->pInfos[v60].pShortName); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - v58 = LOBYTE(v56->uFontHeight); - a4 = &a4[v58 - 3]; - v59 = v121; - } - if ( !v59->pMonsterInfo.uSpell1ID && !v59->pMonsterInfo.uSpell2ID ) - { - v80 = pGlobalTXT_LocalizationStrings[153]; - v76 = 0; - v71 = pGlobalTXT_LocalizationStrings[628]; - v68 = "%s\f%05u\t060%s\n"; - sprintf(pTmpBuf, v68, v71, v76, v80); - a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); - v58 = LOBYTE(v56->uFontHeight); - a4 = &a4[v58 - 3]; - } - } - a4 = &a4[v58 - 3]; - a1->DrawText(v56, 150, (int)a4, a5, pGlobalTXT_LocalizationStrings[626], 0, 0, 0); - a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; - v85[0] = pGlobalTXT_LocalizationStrings[87]; - v85[1] = pGlobalTXT_LocalizationStrings[6]; - v85[2] = pGlobalTXT_LocalizationStrings[240]; - v85[3] = pGlobalTXT_LocalizationStrings[70]; - v85[4] = pGlobalTXT_LocalizationStrings[142]; - v85[5] = pGlobalTXT_LocalizationStrings[214]; - v85[6] = pGlobalTXT_LocalizationStrings[29]; - v85[7] = pGlobalTXT_LocalizationStrings[133]; - v85[8] = pGlobalTXT_LocalizationStrings[54]; - v85[9] = pGlobalTXT_LocalizationStrings[624]; - v95[1] = (char *)v121->pMonsterInfo.uResFire; - v95[2] = (char *)v121->pMonsterInfo.uResAir; - v95[3] = (char *)v121->pMonsterInfo.uResWater; - v95[4] = (char *)v121->pMonsterInfo.uResEarth; - v95[5] = (char *)v121->pMonsterInfo.uResMind; - v95[6] = (char *)v121->pMonsterInfo.uResSpirit; - v95[7] = (char *)v121->pMonsterInfo.uResBody; - v95[8] = (char *)v121->pMonsterInfo.uResLight; - v95[9] = (char *)v121->pMonsterInfo.uResPhysical; - v95[10] = (char *)v121->pMonsterInfo.uResDark; - if ( v112 ) - { - v124 = 0; - do - { - v62 = v95[v124+1]; - if ( v62 == (char *)200 ) - { - v81 = pGlobalTXT_LocalizationStrings[625]; - } - else - { - if ( v62 ) - v81 = pGlobalTXT_LocalizationStrings[627]; - else - v81 = pGlobalTXT_LocalizationStrings[153]; - } - sprintf(pTmpBuf, "%s\f%05u\t070%s\n", v85[v124], 0, v81); - a1->DrawText(v56, 170, (int)a4, a5, pTmpBuf, 0, 0, 0); - v63 = LOBYTE(v56->uFontHeight); - v124 += 4; - result = &a4[v63 - 3]; - a4 = result; - } - while ( v124 < 40 ); - } - else - { - i = 0; - do - { - sprintf(pTmpBuf, "%s\f%05u\t070%s\n", v85[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?" - a1->DrawText(v56, 170, (int)a4, a5, pTmpBuf, 0, 0, 0); - v65 = LOBYTE(v56->uFontHeight); - ++i; - result = &a4[v65 - 3]; - a4 = result; - } - while ( i < 10 ); - } - if ( (signed __int64)pParty->pPartyBuffs[3].uExpireTime > 0 ) - { - sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[650], v121->sCurrentHP); - pFontSmallnum->GetLineWidth(pTmpBuf); - result = a1->DrawTitleText(pFontSmallnum, 0, a1->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf, 3); - } - return result; -} //----- (0041F54A) -------------------------------------------------------- void __cdecl LoadActualSkyFrame() @@ -3569,259 +536,7 @@ viewparams->bRedrawGameUI = 1; } -//----- (0041F6C1) -------------------------------------------------------- -void __cdecl RestUI_Initialize() -{ - Player *v0; // eax@10 - if ( !dword_506F14 ) - pAudioPlayer->StopChannels(-1, -1); - if ( pCurrentScreen ) - { - pGUIWindow_CurrentMenu->Release(); - pCurrentScreen = SCREEN_GAME; - viewparams->bRedrawGameUI = 1; - } - pEventTimer->Pause(); - if ( dword_506F14 != 2 ) - GUIWindow::Create(518u, 450u, 0, 0, (enum WindowType)90, (int)pBtn_Rest, 0); - _506F18_num_hours_to_sleep = 0; - dword_506F14 = 0; - uRestUI_FoodRequiredToRest = 2; - if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) - uRestUI_FoodRequiredToRest = pOutdoor->GetNumFoodRequiredToRestInCurrentPos( - pParty->vPosition.x, - pParty->vPosition.y, - pParty->vPosition.z); - if ( PartyHasDragon() ) - { - v0 = pParty->pPlayers;//[0].uClass; - while ( v0 <= &pParty->pPlayers[3] ) - { - ++v0; - if ( v0 > &pParty->pPlayers[3] ) - break; - } - if(v0->classType == PLAYER_CLASS_WARLOCK) - ++uRestUI_FoodRequiredToRest; - } - if ( CheckHiredNPCSpeciality(Porter) ) - --uRestUI_FoodRequiredToRest; - if ( CheckHiredNPCSpeciality(QuarterMaster) ) - uRestUI_FoodRequiredToRest -= 2; - if ( CheckHiredNPCSpeciality(Gypsy) ) - --uRestUI_FoodRequiredToRest; - if ( uRestUI_FoodRequiredToRest < 1 ) - uRestUI_FoodRequiredToRest = 1; - if ( !_strcmpi(pCurrentMapName, "d29.blv") && (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 98) ) - uRestUI_FoodRequiredToRest = 0; - ++pIcons_LOD->uTexturePacksCount; - if ( !pIcons_LOD->uNumPrevLoadedFiles ) - pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; - pCurrentScreen = SCREEN_REST; - _507CD4_RestUI_hourglass_anim_controller = 0; - uTextureID_RestUI_restmain = pIcons_LOD->LoadTexture("restmain", TEXTURE_16BIT_PALETTE); - uTextureID_RestUI_restb1 = pIcons_LOD->LoadTexture("restb1", TEXTURE_16BIT_PALETTE); - uTextureID_RestUI_restb2 = pIcons_LOD->LoadTexture("restb2", TEXTURE_16BIT_PALETTE); - uTextureID_RestUI_restb3 = pIcons_LOD->LoadTexture("restb3", TEXTURE_16BIT_PALETTE); - uTextureID_RestUI_restb4 = pIcons_LOD->LoadTexture("restb4", TEXTURE_16BIT_PALETTE); - uTextureID_RestUI_restexit = pIcons_LOD->LoadTexture("restexit", TEXTURE_16BIT_PALETTE); - LoadActualSkyFrame(); - pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, (enum WindowType)16, 0, 0); - pButton_RestUI_Exit = pGUIWindow_CurrentMenu->CreateButton( - 280u, - 297u, - 154u, - 37u, - 1, - 0, - 0xA7u, - 0, - 0, - "", - (Texture *)(uTextureID_RestUI_restexit != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restexit] : 0), - 0); - pButton_RestUI_Main = pGUIWindow_CurrentMenu->CreateButton( - 24u, - 154u, - 225u, - 37u, - 1, - 0, - 0x61u, - 0, - 0x52u, - "", - (Texture *)(uTextureID_RestUI_restb4 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb4] : 0), - 0); - pButton_RestUI_WaitUntilDawn = pGUIWindow_CurrentMenu->CreateButton( - 61u, - 232u, - 154u, - 33u, - 1, - 0, - 0x6Du, - 0, - 0x44u, - "", - (Texture *)(uTextureID_RestUI_restb1 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb1] : 0), - 0); - pButton_RestUI_Wait1Hour = pGUIWindow_CurrentMenu->CreateButton( - 61u, - 264u, - 154u, - 33u, - 1, - 0, - 0x60u, - 0, - 0x48u, - "", - (Texture *)(uTextureID_RestUI_restb2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb2] : 0), - 0); - pButton_RestUI_Wait5Minutes = pGUIWindow_CurrentMenu->CreateButton( - 61u, - 296u, - 154u, - 33u, - 1, - 0, - 0x5Fu, - 0, - 0x4Du, - "", - (Texture *)(uTextureID_RestUI_restb3 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb3] : 0), - 0); -} - -//----- (0041FA01) -------------------------------------------------------- -void __cdecl RestUI_Draw() -{ - int v0; // esi@1 - Player **ppPlayers; // ecx@1 - Player *pPlayer; // eax@2 - unsigned int v3; // eax@15 - //char v4; // al@17 - bool v5; // eax@21 - GUIButton Dst; // [sp+8h] [bp-DCh]@19 - //double v7; // [sp+C4h] [bp-20h]@17 - float v8; // [sp+CCh] [bp-18h]@17 - __int64 v9; // [sp+D0h] [bp-14h]@17 - unsigned int v10; // [sp+D8h] [bp-Ch]@9 - __int16 a9[2]; // [sp+DCh] [bp-8h]@1 - int a5; // [sp+E0h] [bp-4h]@1 - - v0 = 0; - a5 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xAu, 0, 0); - *(int *)a9 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE6u, 0xD6u, 0xC1u); - ppPlayers = &pPlayers[1]; - do - { - pPlayer = *ppPlayers; - if ( !(*ppPlayers)->pConditions[14] && !pPlayer->pConditions[16] && pPlayer->sHealth > 0 ) - ++v0; - ++ppPlayers; - } - while ( (signed int)ppPlayers <= (signed int)&pPlayers[4] ); - if ( v0 ) - { - pRenderer->DrawTextureIndexed( - 8u, - 8u, - (Texture *)(uTextureID_RestUI_restmain != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restmain] : 0)); - v10 = pParty->uCurrentHour; - dword_506F1C = pGUIWindow_CurrentMenu->pCurrentPosActiveItem; - if ( (signed int)pParty->uCurrentHour <= 12 ) - { - if ( !v10 ) - v10 = 12; - } - else - { - v10 -= 12; - } - pRenderer->DrawTextureIndexed(16u, 26u, pTexture_RestUI_CurrentSkyFrame); - if ( pTexture_RestUI_CurrentHourglassFrame ) - { - pTexture_RestUI_CurrentHourglassFrame->Release(); - pIcons_LOD->_40F9C5(); - } - v3 = pEventTimer->uTimeElapsed + _507CD4_RestUI_hourglass_anim_controller; - _507CD4_RestUI_hourglass_anim_controller += pEventTimer->uTimeElapsed; - if ( (unsigned int)_507CD4_RestUI_hourglass_anim_controller >= 512 ) - { - v3 = 0; - _507CD4_RestUI_hourglass_anim_controller = 0; - } - v9 = v3; - v8 = (double)v3 / 512.0 * 120.0; - //v7 = v8 + 6.7553994e15; - HIDWORD(v9) = floorf(v8 + 0.5f);//LODWORD(v7); - hourglass_icon_idx = (int)floorf(v8 + 0.5f) % 256 + 1;//LOBYTE(v7) + 1; - //hourglass_icon_idx = v4; - if (hourglass_icon_idx >= 120 ) - { - //v4 = 1; - hourglass_icon_idx = 1; - } - sprintf(pTmpBuf, "hglas%03d", hourglass_icon_idx); - pTexture_RestUI_CurrentHourglassFrame = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE); - pRenderer->DrawTextureIndexed(0x10Bu, 0x9Fu, pTexture_RestUI_CurrentHourglassFrame); - memset(&Dst, 0, 0xBCu); - Dst.uX = 24; - Dst.uY = 154; - Dst.uWidth = 171; - Dst.uHeight = 37; - Dst.uZ = 194; - Dst.uW = 190; - Dst.pParent = pButton_RestUI_WaitUntilDawn->pParent; - Dst.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, a5, *(int **)a9); - Dst.pParent = 0; - sprintf(pTmpBuf, "\r408%d", uRestUI_FoodRequiredToRest); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, 0, 164, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); - pButton_RestUI_WaitUntilDawn->DrawLabel( - pGlobalTXT_LocalizationStrings[237], - pFontCreate, - a5, - *(int **)a9); - pButton_RestUI_Wait1Hour->DrawLabel(pGlobalTXT_LocalizationStrings[239], pFontCreate, a5, *(int **)a9); - pButton_RestUI_Wait5Minutes->DrawLabel(pGlobalTXT_LocalizationStrings[238], pFontCreate, a5, *(int **)a9); - pButton_RestUI_Exit->DrawLabel(pGlobalTXT_LocalizationStrings[81], pFontCreate, a5, *(int **)a9); - memset(&Dst, 0, 0xBCu); - Dst.uX = 45; - Dst.uY = 199; - Dst.uWidth = 185; - Dst.uHeight = 30; - Dst.uZ = 229; - Dst.uW = 228; - Dst.pParent = pButton_RestUI_WaitUntilDawn->pParent; - Dst.DrawLabel(pGlobalTXT_LocalizationStrings[236], pFontCreate, a5, *(int **)a9); - Dst.pParent = 0; - v5 = pParty->uCurrentHour >= 0xC && pParty->uCurrentHour < 0x18; - sprintf(pTmpBuf, "%d:%02d %s", v10, pParty->uCurrentMinute, aAMPMNames[v5]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, 368, 168, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); - sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[56], pParty->uDaysPlayed + 1); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 190, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); - sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[146], pParty->uCurrentMonth + 1); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 222, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); - sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 254, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); - if ( dword_506F14 ) - Sleep6Hours(); - } - else - { - GUIWindow::Create( - pButton_RestUI_Exit->uX, - pButton_RestUI_Exit->uY, - 0, - 0, - (enum WindowType)96, - (int)pButton_RestUI_Exit, - (int)pGlobalTXT_LocalizationStrings[81]); - } -} //----- (0042038D) -------------------------------------------------------- @@ -4008,740 +723,6 @@ } } -//----- (00420EFF) -------------------------------------------------------- -void __cdecl GameUI_WritePointedObjectStatusString() -{ - int v1; // ebx@6 - GUIWindow *pWindow; // edi@7 - GUIButton *pButton; // ecx@11 - Player *pPlayer; // eax@19 - char v5; // cl@19 - unsigned int v6; // eax@19 - int v7; // ecx@19 - __int16 v8; // fps@23 - unsigned __int8 v9; // c0@23 - unsigned __int8 v10; // c3@23 - enum UIMessageType pMessageType1; // esi@24 - int v12; // edx@25 - char *v13; // ecx@28 - int v14; // eax@41 - ItemGen *pItemGen; // ecx@44 - int v16; // ecx@46 - const char *v17; // eax@49 - signed int v18; // eax@55 - signed int v19; // ecx@63 - BLVFace *pFace; // eax@69 - __int16 v21; // ax@70 - const char *v22; // eax@72 - LevelDecoration *v23; // ecx@75 - LevelDecoration *v24; // esi@75 - __int16 v25; // ax@75 - const char *v26; // ecx@79 - Actor *pActor; // ecx@82 - char *v28; // esi@82 - int v29; // eax@82 - signed int v30; // ecx@88 - const char *v31; // eax@91 - __int16 v32; // fps@109 - //unsigned __int8 v33; // c0@109 - //unsigned __int8 v34; // c3@109 - enum UIMessageType pMessageType2; // esi@110 - int v36; // edx@111 - enum UIMessageType pMessageType3; // edx@117 - int v38; // ecx@118 - const char *v39; // [sp-8h] [bp-E8h]@20 - char *v40; // [sp-8h] [bp-E8h]@83 - int v41; // [sp-4h] [bp-E4h]@20 - char Str1[200]; // [sp+Ch] [bp-D4h]@129 - unsigned int pX; // [sp+D4h] [bp-Ch]@1 - unsigned int pY; // [sp+D8h] [bp-8h]@1 - unsigned int v45; // [sp+DCh] [bp-4h]@21 - - v13 = nullptr; - - pMouse->uPointingObjectID = 0; - pMouse->GetClickPos(&pX, &pY); - if ( pX < 0 || (signed int)pX > 639 || pY < 0 || (signed int)pY > 479 )//( (pX & 0x80000000u) != 0 || (signed int)pX > 639 || (pY & 0x80000000u) != 0 || (signed int)pY > 479 ) - return; - if (pCurrentScreen == SCREEN_GAME) - { - if ( (signed int)pX > 467 || (signed int)pY > 351 ) - goto _click_on_game_ui; - if ( pRenderer->pRenderD3D ) - { - v18 = pGame->pVisInstance->get_picked_object_zbuf_val(); - if ( (signed int)pX < (signed int)pViewport->uScreen_TL_X - || (signed int)pX > (signed int)pViewport->uScreen_BR_X - || (signed int)pY < (signed int)pViewport->uScreen_TL_Y - || (signed int)pY > (signed int)pViewport->uScreen_BR_Y ) - v18 = -1; - if ( v18 == -1 ) - //goto LABEL_61; - { - pMouse->uPointingObjectID = 0; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - } - else - { - v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; - } - pMouse->uPointingObjectID = (unsigned __int16)v18; - v19 = (signed int)(unsigned __int16)v18 >> 3; - if ( (v18 & 7) == OBJECT_Item ) - { - v30 = v19; - if ( pObjectList->pObjects[pSpriteObjects[v30].uObjectDescID].uFlags & 0x10 ) - //goto LABEL_73; - { - pMouse->uPointingObjectID = 0; - //goto LABEL_50; - uLastPointedObjectID = 1; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID ) - { - v22 = pSpriteObjects[v30].stru_24.GetDisplayName(); -//LABEL_93: - v26 = v22; - //goto LABEL_87; - sub_41C0B8_set_status_string(v26); - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - v31 = pSpriteObjects[v30].stru_24.GetDisplayName(); - v28 = pTmpBuf; - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[470], v31);// "Get %s" - } - else - { - if ( (v18 & 7) != OBJECT_Actor ) - { - if ( (v18 & 7) == OBJECT_Decoration ) - { - v23 = &pLevelDecorations[v19]; - v24 = v23; - v25 = v23->field_16_event_id; - if ( !v25 ) - { - if ( v23->IsInteractive() ) - v26 = pNPCTopics[stru_5E4C90._decor_events[v24->_idx_in_stru123 - 75] + 379].pTopic; - else - v26 = pDecorationList->pDecorations[v24->uDecorationDescID].field_20; - //goto LABEL_87; - sub_41C0B8_set_status_string(v26); - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - v22 = GetEventHintString(v25); - if ( !v22 ) - //goto _return; - { - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - //goto LABEL_93; - v26 = v22; - //goto LABEL_87; - sub_41C0B8_set_status_string(v26); - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - if ( (v18 & 7) == OBJECT_BModel) - { - if ( v18 < (signed int)0x2000000u ) - { - if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) - { - v21 = pOutdoor->pBModels[(signed int)(unsigned __int16)v18 >> 9].pFaces[v19 & 0x3F].sCogTriggeredID; - //goto LABEL_71; - if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) - //goto LABEL_73; - { - pMouse->uPointingObjectID = 0; - //goto LABEL_50; - uLastPointedObjectID = 1; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - //goto LABEL_93; - v26 = v22; - //goto LABEL_87; - sub_41C0B8_set_status_string(v26); - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - pFace = &pIndoor->pFaces[v19]; - if ( BYTE3(pFace->uAttributes) & 6 ) - { - v21 = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID; -//LABEL_71: - if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) - //goto LABEL_73; - { - pMouse->uPointingObjectID = 0; - //goto LABEL_50; - uLastPointedObjectID = 1; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - //goto LABEL_93; - v26 = v22; - //goto LABEL_87; - sub_41C0B8_set_status_string(v26); - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - } -//LABEL_73: - pMouse->uPointingObjectID = 0; - //goto LABEL_50; - uLastPointedObjectID = 1; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } -//LABEL_61: - pMouse->uPointingObjectID = 0; - //goto _return; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - if ( v18 >= 335544320 ) - //goto LABEL_61; - { - pMouse->uPointingObjectID = 0; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - pActor = &pActors[v19]; - v28 = pTmpBuf; - v29 = pActor->dword_000334_unique_name; - if ( v29 ) - v40 = pMonsterStats->pPlaceStrings[v29]; - else - v40 = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].pName; - strncpy(pTmpBuf, v40, 0x7D0u); - } - v26 = v28; -//LABEL_87: - sub_41C0B8_set_status_string(v26); - //goto _return; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - v1 = uNumVisibleWindows; - if ( uNumVisibleWindows > 0 ) - { - while ( 1 ) // some other fullscreen ui - { - pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1]; - if ( (signed int)pX >= (signed int)pWindow->uFrameX - && (signed int)pX <= (signed int)pWindow->uFrameZ - && (signed int)pY >= (signed int)pWindow->uFrameY - && (signed int)pY <= (signed int)pWindow->uFrameW ) - { - for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) - { - if ( !pButton ) - break; - if ( pButton->uButtonType == 1 ) - { - if ( (signed int)pX >= (signed int)pButton->uX - && (signed int)pX <= (signed int)pButton->uZ - && (signed int)pY >= (signed int)pButton->uY - && (signed int)pY <= (signed int)pButton->uW ) - { - //LABEL_24: - pMessageType1 = (UIMessageType)pButton->field_1C; - if ( pMessageType1 ) - { - v12 = pButton->uControlParam; - pMessageQueue_50CBD0->AddMessage(pMessageType1, v12, 0); - /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12; - *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - //LABEL_27: - ++pMessageQueue_50CBD0->uNumMessages; - }*/ - } - //LABEL_28: - v13 = pButton->pButtonName; - //_set_status_and_ret: - sub_41C0B8_set_status_string(v13); - //LABEL_131: - uLastPointedObjectID = 1; - return; - } - } - else - { - if ( pButton->uButtonType == 2 ) - { - v45 = pX - pButton->uX; - v45 = pY - pButton->uY; - if ( (double)(signed int)pButton->uWidth != 0.0 ) - { - if ( (double)(signed int)pButton->uHeight != 0.0 ) - { - //UNDEF(v8); - //if ( v9 | v10 ) - //goto LABEL_24; - //{ - pMessageType1 = (UIMessageType)pButton->field_1C; - if ( pMessageType1 ) - { - v12 = pButton->uControlParam; - pMessageQueue_50CBD0->AddMessage(pMessageType1, v12, 0); - /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12; - *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - ++pMessageQueue_50CBD0->uNumMessages; - }*/ - } - v13 = pButton->pButtonName; - sub_41C0B8_set_status_string(v13); - uLastPointedObjectID = 1; - return; - //} - } - } - } - else // click on skill - { - if ( pButton->uButtonType == 3 - && (signed int)pX >= (signed int)pButton->uX - && (signed int)pX <= (signed int)pButton->uZ - && (signed int)pY >= (signed int)pButton->uY - && (signed int)pY <= (signed int)pButton->uW ) - { - //LABEL_19: - pPlayer = pPlayers[uActiveCharacter]; - v5 = LOBYTE(pPlayer->pActiveSkills[pButton->uControlParam]); - v6 = pPlayer->uSkillPoints; - v7 = (v5 & 0x3F) + 1; - if ( v6 < v7 ) - { - v41 = v7 - v6; - v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" - } - else - { - v41 = v7; - v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" - } - sprintf(Str1, v39, v41); - v13 = Str1; - //goto _set_status_and_ret; - sub_41C0B8_set_status_string(v13); - uLastPointedObjectID = 1; - return; - } - } - } - } - } - if ( pWindow->uFrameHeight == 480 ) - break; - --v1; - if ( v1 <= 0 ) - { - break; - } - } - } - if ( uNumVisibleWindows <= 0 || (uNumVisibleWindows > 0 && pWindow->uFrameHeight != 480 && v1 <= 0)) - { - if ( pCurrentScreen == SCREEN_CHEST ) - { - sub_42038D(); - //goto _return; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - if ( pCurrentScreen == SCREEN_HOUSE ) - { - if ( dialog_menu_id != 2 - || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0) - || v16 == -65536 ) - //goto _return; - { - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 4); -//LABEL_49: - v17 = pItemGen->GetDisplayName(); - sub_41C0B8_set_status_string(v17); -//LABEL_50: - uLastPointedObjectID = 1; -//_return: - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - if ( (signed int)pY < 350 ) - { - v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; - if ( v14 == 0 || v14 == -65536 || (unsigned int)v14 >= 0x1388 ) - //goto _return; - { - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } - pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v14-1]; - //goto LABEL_49; - v17 = pItemGen->GetDisplayName(); - sub_41C0B8_set_status_string(v17); - uLastPointedObjectID = 1; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } -_click_on_game_ui: - if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX - && (signed int)pX <= (signed int)pWindowList[0].uFrameZ - && (signed int)pY >= (signed int)pWindowList[0].uFrameY - && (signed int)pY <= (signed int)pWindowList[0].uFrameW ) - { - for ( pButton = pWindowList[0].pControlsHead; pButton != (GUIButton *)0; pButton = pButton->pNext ) - { - if ( pButton->uButtonType == 1 ) - { - if ( (signed int)pX >= (signed int)pButton->uX - && (signed int)pX <= (signed int)pButton->uZ - && (signed int)pY >= (signed int)pButton->uY - && (signed int)pY <= (signed int)pButton->uW ) - { - pMessageType3 = (UIMessageType)pButton->field_1C; - if ( pMessageType3 == 0 ) // For books - //goto LABEL_28; - { - v13 = pButton->pButtonName; - sub_41C0B8_set_status_string(v13); - uLastPointedObjectID = 1; - return; - } - v38 = pButton->uControlParam; - /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType3; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v38; - *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - ++pMessageQueue_50CBD0->uNumMessages; - }*/ - pMessageQueue_50CBD0->AddMessage(pMessageType3, v38, 0); - //goto LABEL_131; - uLastPointedObjectID = 1; - return; - } - } - else - { - if ( pButton->uButtonType == 2 ) - { - v45 = pX - pButton->uX; - v45 = pY - pButton->uY; - - if (pX >= pButton->uX && pX <= pButton->uZ && - pY >= pButton->uY && pY <= pButton->uW) - if ( (double)(signed int)pButton->uWidth != 0.0 ) - { - if ( (double)(signed int)pButton->uHeight != 0.0 ) - { - //UNDEF(v32); - //if ( v33 | v34 ) - //{ - pMessageType2 = (UIMessageType)pButton->field_1C; - if ( pMessageType2 != 0 ) - { - v36 = pButton->uControlParam; - if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->AddMessage(pMessageType2, v36, 0); - /*pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType2; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v36; - *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - //goto LABEL_27; - ++pMessageQueue_50CBD0->uNumMessages;*/ - v13 = pButton->pButtonName; - sub_41C0B8_set_status_string(v13); - uLastPointedObjectID = 1; - return; - } - } - //goto LABEL_28; - v13 = pButton->pButtonName; - sub_41C0B8_set_status_string(v13); - uLastPointedObjectID = 1; - return; - //} - } - } - } - else - { - if ( pButton->uButtonType == 3 - && (signed int)pX >= (signed int)pButton->uX - && (signed int)pX <= (signed int)pButton->uZ - && (signed int)pY >= (signed int)pButton->uY - && (signed int)pY <= (signed int)pButton->uW ) - //goto LABEL_19; - { - pPlayer = pPlayers[uActiveCharacter]; - v5 = LOBYTE(pPlayer->pActiveSkills[pButton->uControlParam]); - v6 = pPlayer->uSkillPoints; - v7 = (v5 & 0x3F) + 1; - if ( v6 < v7 ) - { - v41 = v7 - v6; - v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" - } - else - { - v41 = v7; - v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" - } - sprintf(Str1, v39, v41); - v13 = Str1; - //goto _set_status_and_ret; - sub_41C0B8_set_status_string(v13); - uLastPointedObjectID = 1; - return; - } - } - } - } - } - pMouse->uPointingObjectID = sub_46A99B(); - //goto _return; - if ( pMouse->uPointingObjectID == 0 ) - { - if ( uLastPointedObjectID != 0 ) - { - pStatusBarString[0] = 0; - bForceDrawStatusBar = 1; - } - } - uLastPointedObjectID = pMouse->uPointingObjectID; - return; - } -} - - -//----- (00421626) -------------------------------------------------------- -GUIWindow *GameUI_InitializeCharacterWindow(unsigned int _this) -{ - unsigned int v1; // edi@1 - GUIWindow *pWindow; // edi@3 - - ++pIcons_LOD->uTexturePacksCount; - v1 = _this; - if ( !pIcons_LOD->uNumPrevLoadedFiles ) - pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; - pEventTimer->Pause(); - pAudioPlayer->StopChannels(-1, -1); - bRingsShownInCharScreen = 0; - CharacterUI_LoadPaperdollTextures(); - pCurrentScreen = v1; - pWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_CharacterRecord, uActiveCharacter, 0); - pCharacterScreen_StatsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 12, pViewport->uViewportTL_Y + 308, - (papredoll_dbrds[9] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[9]].uTextureWidth : 24), - (papredoll_dbrds[9] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[9]].uTextureHeight : 26), - 1, 0, 0x73u, 0, 0x53u, pGlobalTXT_LocalizationStrings[216],// Stats - (Texture *)(papredoll_dbrds[10] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[10]] : 0), - papredoll_dbrds[9] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[9]] : 0, 0); - pCharacterScreen_SkillsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 102, pViewport->uViewportTL_Y + 308, - (papredoll_dbrds[7] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[7]].uTextureWidth : 24), - (papredoll_dbrds[7] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[7]].uTextureHeight : 26), - 1, 0, 0x72u, 0, 0x4Bu, pGlobalTXT_LocalizationStrings[205],//Skills - (Texture *)(papredoll_dbrds[8] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[8]] : 0), - papredoll_dbrds[7] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[7]] : 0, 0); - pCharacterScreen_InventoryBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 192, pViewport->uViewportTL_Y + 308, - (papredoll_dbrds[5] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[5]].uTextureWidth : 24), - (papredoll_dbrds[5] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[5]].uTextureHeight : 26), - 1, 0, 0x74u, 0, 0x49u, pGlobalTXT_LocalizationStrings[120], //Inventory - (Texture *)(papredoll_dbrds[6] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[6]] : 0), - papredoll_dbrds[5] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[5]] : 0, 0); - pCharacterScreen_AwardsBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 282, pViewport->uViewportTL_Y + 308, - (papredoll_dbrds[3] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[3]].uTextureWidth : 24), - (papredoll_dbrds[3] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[3]].uTextureHeight : 26), - 1, 0, 0x75u, 0, 0x41u, pGlobalTXT_LocalizationStrings[22], //Awards - (Texture *)(papredoll_dbrds[4] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[4]] : 0), - papredoll_dbrds[3] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[3]] : 0, 0); - pCharacterScreen_ExitBtn = pWindow->CreateButton(pViewport->uViewportTL_X + 371, pViewport->uViewportTL_Y + 308, - (papredoll_dbrds[1] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[1]].uTextureWidth : 24), - (papredoll_dbrds[1] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[1]].uTextureHeight : 26), - 1, 0, 0xA8u, 0, 0, pGlobalTXT_LocalizationStrings[79],//Exit - (Texture *)(papredoll_dbrds[2] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[2]] : 0), - papredoll_dbrds[1] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[1]] : 0, 0); - pWindow->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, 0x78u, 0, 0, "", 0); - pCharacterScreen_DetalizBtn = pWindow->CreateButton(0x258u, 0x12Cu, 0x1Eu, 0x1Eu, 1, 0, 0x55u, 0, 0, pGlobalTXT_LocalizationStrings[64], 0); - pCharacterScreen_DollBtn = pWindow->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, 0x85u, 0, 0, "", 0); - pWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); - pWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); - pWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); - pWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); - pWindow->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); - FillAwardsData(); - return pWindow; -} - //----- (004219BE) -------------------------------------------------------- diff -r f39d5902c85a -r 70c5a87a1307 mm7_2.cpp --- a/mm7_2.cpp Wed Mar 20 17:48:51 2013 +0600 +++ b/mm7_2.cpp Wed Mar 20 17:49:15 2013 +0600 @@ -7616,215 +7616,6 @@ -//----- (004601B7) -------------------------------------------------------- -void GameUI_MainMenu_DoDrawLoad(int a1) -{ - unsigned __int16 v1; // bx@1 - unsigned int v2; // edi@4 - unsigned int v3; // eax@4 - unsigned int v4; // eax@8 - int v5; // edi@8 - unsigned int v6; // eax@8 - unsigned int pMapID; // eax@10 - signed __int64 v8; // qax@10 - unsigned int v9; // ebx@10 - unsigned __int64 v10; // qax@10 - __int64 v11; // qax@10 - char v12; // di@10 - unsigned __int64 v13; // qtt@10 - unsigned int v14; // ecx@10 - __int64 pOurHour; // qax@10 - int v16; // edi@10 - signed int pHour; // ebx@22 - //const char *v18; // ST14_4@32 - int v19; // eax@32 - const char *v20; // ST18_4@32 - int v21; // eax@32 - //const char *v22; // ST14_4@32 - int v23; // eax@32 - const char *pSlotName; // edi@36 - int v25; // eax@43 - GUIWindow pWindow; // [sp+Ch] [bp-78h]@8 - /*unsigned int Dst; // [sp+Ch] [bp-78h]@8 - unsigned int v27; // [sp+10h] [bp-74h]@8 - int v28; // [sp+14h] [bp-70h]@8 - int v29; // [sp+18h] [bp-6Ch]@8 - unsigned int v30; // [sp+1Ch] [bp-68h]@8 - unsigned int v31; // [sp+20h] [bp-64h]@8*/ - int pMinutes; // [sp+60h] [bp-24h]@10 - int pMonthNum; // [sp+68h] [bp-1Ch]@10 - unsigned int pSaveFiles; // [sp+70h] [bp-14h]@10 - __int64 pAMPM2; // [sp+74h] [bp-10h]@10 - int pYear; // [sp+7Ch] [bp-8h]@10 - int a4; // [sp+80h] [bp-4h]@1 - int pFilesID; - - v1 = 255; - a4 = a1; - GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0xFF); - GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B); - pRenderer->BeginScene(); - if ( GetCurrentMenuID() != MENU_SAVELOAD && GetCurrentMenuID() != MENU_LOADINGPROC ) - { - pRenderer->DrawTextureIndexed(8, 8, uTextureID_loadsave != -1 ? &pIcons_LOD->pTextures[uTextureID_loadsave] : 0); - if ( a4 ) - { - v2 = uTextureID_save_up; - v3 = uTextureID_LS_saveU; - } - else - { - v2 = uTextureID_load_up; - v3 = uTextureID_LS_loadU; - } - pRenderer->DrawTextureIndexed(241, 302, (Texture *)(v3 != -1 ? &pIcons_LOD->pTextures[v3] : 0)); - pRenderer->DrawTextureIndexed(18, 139, (Texture *)(v2 != -1 ? &pIcons_LOD->pTextures[v2] : 0)); - pRenderer->DrawTextureIndexed(351, 302, (Texture *)(uTextureID_x_u != -1 ? &pIcons_LOD->pTextures[uTextureID_x_u] : 0)); - v1 = 255; - } - if ( pSavegameUsedSlots[uLoadGameUI_SelectedSlot] ) - { - memset(&pWindow, 0, 0x54); - pWindow.uFrameX = pGUIWindow_CurrentMenu->uFrameX + 240; - v4 = pGUIWindow_CurrentMenu->uFrameY - pFontSmallnum->uFontHeight; - pWindow.uFrameWidth = 220; - v4 += 157; - pWindow.uFrameY = v4; - v5 = pFontSmallnum->uFontHeight; - pWindow.uFrameZ = pWindow.uFrameX + 219; - pWindow.uFrameHeight = v5; - pWindow.uFrameW = v5 + v4 - 1; - v6 = uLoadGameUI_SelectedSlot; - if (pSavegameThumbnails[uLoadGameUI_SelectedSlot].pPixels) - { - pRenderer->DrawTextureRGB(pGUIWindow_CurrentMenu->uFrameX + 276, pGUIWindow_CurrentMenu->uFrameY + 171, pSavegameThumbnails + uLoadGameUI_SelectedSlot); - v6 = uLoadGameUI_SelectedSlot; - } - pMapID = pMapStats->GetMapInfo(pSavegameHeader[v6].pLocationName); - pWindow.DrawTitleText(pFontSmallnum, 0, 0, 0, pMapStats->pInfos[pMapID].pName, 3); - v8 = (signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60; - pMinutes = (int)((signed __int64)(pSavegameHeader[uLoadGameUI_SelectedSlot].uWordTime * 0.234375) / 60) >> 32; - v9 = v8; - v8 /= 60i64; - pAMPM2 = v8; - v10 = (unsigned int)v8 / 24; - pSaveFiles = v10; - v11 = (unsigned int)(v10 / 7); - v12 = v11; - LODWORD(v13) = (unsigned int)v11 >> 2; - HIDWORD(v13) = HIDWORD(v11); - pMonthNum = v13 % 12; - pYear = v13 / 12; - pMinutes = (int)__PAIR__(pMinutes, v9) % 60; - pOurHour = pAMPM2 % 24; - v14 = (unsigned __int64)(pAMPM2 % 24) >> 32; - LODWORD(pAMPM2) = pAMPM2 % 24; - HIDWORD(pOurHour) = pSaveFiles % 28; - pYear += game_starting_year; - v16 = v12 & 3; - pWindow.uFrameY = pGUIWindow_CurrentMenu->uFrameY + 261; - HIDWORD(pAMPM2) = v14 == 0 && ((signed int)v14 > 0 || (unsigned int)pOurHour >= 12) - && (signed int)v14 <= 0 && (v14 != 0 || (unsigned int)pOurHour < 24); - if ( v14 != 0 || (signed int)v14 <= 0 && (unsigned int)pOurHour <= 12 ) - { - if ( !(v14 | (unsigned int)pOurHour) ) - { - pSaveFiles = 0; - pHour = 12; - goto LABEL_23; - } - } - else - { - v14 = (__PAIR__(v14, (unsigned int)pOurHour) - 12) >> 32; - LODWORD(pOurHour) = pOurHour - 12; - } - pHour = pOurHour; - pSaveFiles = v14; -LABEL_23: - auto day = aDayNames[HIDWORD(pOurHour) % 7]; - auto ampm = aAMPMNames[HIDWORD(pAMPM2)]; - auto month = aMonthNames[pMonthNum]; - //sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", _d, v17, (int)32, _a, 3, _m, pFilesID); - sprintf(pTmpBuf, "%s %d:%02d%s\n%d %s %d", day, pHour, pMinutes, ampm, 7 * v16 + HIDWORD(pOurHour) % 7 + 1, month, pYear); - pWindow.DrawTitleText(pFontSmallnum, 0, 0, 0, pTmpBuf, 3u); - v1 = 255; - } - if ( pGUIWindow_CurrentMenu->field_40 == 2 ) - { - pGUIWindow_CurrentMenu->field_40 = 0; - strcpy((char *)&pSavegameHeader + 100 * uLoadGameUI_SelectedSlot, (const char *)pKeyActionMap->pPressedKeysBuffer); - /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)83; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; - *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - ++pMessageQueue_50CBD0->uNumMessages; - }*/ - pMessageQueue_50CBD0->AddMessage(UIMSG_SaveGame, 0, 0); - } - else - { - if ( pGUIWindow_CurrentMenu->field_40 == 3 ) - pGUIWindow_CurrentMenu->field_40 = 0; - } - if (GetCurrentMenuID() == MENU_LOADINGPROC) - { - //v18 = pGlobalTXT_LocalizationStrings[135]; - v19 = pFontSmallnum->AlignText_Center(0xBA, pGlobalTXT_LocalizationStrings[135]);//"" - pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v19 + 25, 220, 0, pGlobalTXT_LocalizationStrings[135], 0, 0, 0); - v20 = (const char *)(pSavegameHeader + uLoadGameUI_SelectedSlot); - v21 = pFontSmallnum->AlignText_Center(0xBA, (const char *)pSavegameHeader + 100 * uLoadGameUI_SelectedSlot); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, v21 + 25, 0x106, 0, v20, 185, 0); - //v22 = pGlobalTXT_LocalizationStrings[165]; - v23 = pFontSmallnum->AlignText_Center(0xBA, pGlobalTXT_LocalizationStrings[165]);//", " - pGUIWindow_CurrentMenu->DrawText(pFontSmallnum, v23 + 25, 304, 0, pGlobalTXT_LocalizationStrings[165], 0, 0, 0); - } - else - { - if ( a4 ) - pSaveFiles = 40; - else - pSaveFiles = uNumSavegameFiles; - a4 = 199; - pFilesID = pSaveListPosition; - pSlotName = (const char *)(&pSavegameHeader[pSaveListPosition]);//draw name for save slot - do - { - if ( pFilesID >= (signed int)pSaveFiles ) - break; - short clr; - HIDWORD(pAMPM2) = clr = (pFilesID == uLoadGameUI_SelectedSlot ? GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v1, v1, 0x64) : 0); - if ( pGUIWindow_CurrentMenu->field_40 != 1 || pFilesID != uLoadGameUI_SelectedSlot ) - { - pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, 0x1B, a4, clr, pSlotName, 185, 0); - } - else - { - v25 = pGUIWindow_CurrentMenu->DrawTextInRect(pFontSmallnum, 0x1B, a4, clr, (const char *)pKeyActionMap->pPressedKeysBuffer, 175, 1); - pGUIWindow_CurrentMenu->DrawFlashingInputCursor(v25 + 27, a4, pFontSmallnum); - } - a4 += 21; - ++pFilesID; - pSlotName += 100; - } - while ( a4 < 346 ); - } - pRenderer->EndScene(); -} -// 6A0C9C: using guessed type int dword_6A0C9C; - -//----- (004606F7) -------------------------------------------------------- -void __cdecl GameUI_MainMenu_DrawLoad() -{ - GameUI_MainMenu_DoDrawLoad(0); -} - -//----- (004606FE) -------------------------------------------------------- -void __cdecl sub_4606FE() -{ - GameUI_MainMenu_DoDrawLoad(1); -} //----- (00460706) -------------------------------------------------------- void TryLoadLevelFromLOD() diff -r f39d5902c85a -r 70c5a87a1307 mm7_3.cpp --- a/mm7_3.cpp Wed Mar 20 17:48:51 2013 +0600 +++ b/mm7_3.cpp Wed Mar 20 17:49:15 2013 +0600 @@ -11642,132 +11642,7 @@ } // 4E28F8: using guessed type int pCurrentScreen; -//----- (00441498) -------------------------------------------------------- -void __cdecl GameUI_DrawTorchlightAndWizardEye() -{ - if (pCurrentScreen == SCREEN_GAME - || pCurrentScreen == SCREEN_MENU - || pCurrentScreen == SCREEN_OPTIONS - || pCurrentScreen == SCREEN_REST - || pCurrentScreen == SCREEN_SPELL_BOOK - || pCurrentScreen == SCREEN_CHEST - || pCurrentScreen == SCREEN_SAVEGAME - || pCurrentScreen == SCREEN_LOADGAME - || pCurrentScreen == SCREEN_F - || pCurrentScreen == SCREEN_BOOKS - || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) - { - if (pParty->TorchlightActive()) - { - auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time()); - pRenderer->DrawTextureTransparent(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID)); - } - if (pParty->WizardEyeActive()) - { - auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time()); - pRenderer->DrawTextureTransparent(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID)); - } - } -} -// 4E28F8: using guessed type int pCurrentScreen; - -//----- (0044158F) -------------------------------------------------------- -void __cdecl GameUI_DrawCharacterSelectionFrame() -{ - if ( uActiveCharacter ) - pRenderer->DrawTextureTransparent( - pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9, - 0x17Cu, - &pIcons_LOD->pTextures[dword_50C98C]); -} - -//----- (004415C5) -------------------------------------------------------- -void LoadPartyBuffIcons() -{ - for (uint i = 0; i < 14; ++i) - { - char filename[200]; - sprintf(filename, "isn-%02d", i + 1); - pTextureIDs_PartyBuffIcons[i] = pIcons_LOD->LoadTexture(filename, TEXTURE_16BIT_PALETTE); - } - - uIconIdx_FlySpell = pIconsFrameTable->FindIcon("spell21"); - uIconIdx_WaterWalk = pIconsFrameTable->FindIcon("spell27"); -} - -//----- (0044162D) -------------------------------------------------------- -void __cdecl GameUI_DrawPartySpells() -{ - unsigned int v0; // ebp@1 - //signed int v1; // edi@1 - //int v2; // eax@2 - //int v3; // ecx@5 - //__int16 *v4; // ebx@25 - //Player *v5; // edi@26 - //unsigned int v6; // [sp-4h] [bp-1Ch]@11 - Texture *v7; // [sp-4h] [bp-1Ch]@12 - //unsigned int v8; // [sp-4h] [bp-1Ch]@20 - Texture *v9; // [sp-4h] [bp-1Ch]@21 - //Player **v10; // [sp+10h] [bp-8h]@25 - - v0 = (signed __int64)((double)GetTickCount() * 0.050000001); - //v1 = 0; - for (uint i = 0; i < 14; ++i) - { - //v2 = byte_4E5DD8[v1]; - if (pParty->pPartyBuffs[byte_4E5DD8[i]].uExpireTime) - { - auto tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]); - //v3 = pTextureIDs_PartyBuffIcons[i]; - if (tex) - pRenderer->_4A65CC(pPartySpellbuffsUI_XYs[i][0], - pPartySpellbuffsUI_XYs[i][1], tex, tex, - v0 + 20 * pPartySpellbuffsUI_smthns[i], 0, 63); - } - //++v1; - } - //while ( v1 < 14 ); - - if (pCurrentScreen == SCREEN_GAME || pCurrentScreen == SCREEN_NPC_DIALOGUE) - { - if (pParty->FlyActive()) - { - if ( pParty->bFlying ) - v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID]; - else - v7 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID]; - if ( pRenderer->pRenderD3D ) - pRenderer->DrawTextureIndexed(8u, 8u, v7); - else - pRenderer->DrawTextureTransparent(8u, 8u, v7); - } - if (pParty->WaterWalkActive()) - { - if ( pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER) - v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID]; - else - v9 = &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID]; - if ( pRenderer->pRenderD3D ) - pRenderer->DrawTextureIndexed(396u, 8u, v9); - else - pRenderer->DrawTextureTransparent(396u, 8u, v9); - } - } - - for (uint i = 0; i < 4; ++i) - { - auto player = pParty->pPlayers + i; - - if (player->pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime) - pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 427, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Hammerhands)); - if (player->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime) - pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 393, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Bless)); - if (player->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime) - pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation)); - if (player->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime) - pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection)); - } -} + //----- (00441A4E) -------------------------------------------------------- __int16 __fastcall sub_441A4E(int a1) @@ -11846,931 +11721,6 @@ -//----- (00441D38) -------------------------------------------------------- -void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap) -{ - int uHeight; // ebx@6 - __int16 v11; // cx@11 - unsigned int v14; // ebx@23 - int v15; // eax@23 - __int16 v17; // di@30 - double v18; // st7@30 - float v19; // ST38_4@30 - double v20; // st7@30 - double v21; // st6@30 - double v22; // st5@33 - signed int v27; // eax@37 - unsigned __int16 *v28; // ecx@37 - signed int v29; // edi@40 - //signed int v33; // ebx@50 - //unsigned int v34; // eax@50 - //signed int v35; // ecx@50 - //unsigned __int16 v36; // di@66 - int v37; // edi@72 - int v38; // ebx@72 - __int16 v39; // ax@87 - int v40; // edi@91 - int v41; // ebx@91 - unsigned int v42; // eax@101 - unsigned int v43; // ebx@101 - unsigned int v44; // ST30_4@101 - char *v45; // ebx@106 - int v46; // edi@108 - int v47; // eax@108 - unsigned int v48; // ebx@114 - unsigned int v49; // ST64_4@114 - unsigned int v51; // [sp-10h] [bp-64h]@79 - unsigned int v52; // [sp-10h] [bp-64h]@100 - unsigned int v53; // [sp-Ch] [bp-60h]@79 - unsigned int v54; // [sp-Ch] [bp-60h]@100 - unsigned int v55; // [sp-8h] [bp-5Ch]@77 - unsigned int v56; // [sp-8h] [bp-5Ch]@100 - //signed int v57; // [sp-4h] [bp-58h]@54 - unsigned __int16 v58; // [sp-4h] [bp-58h]@77 - unsigned __int16 v59; // [sp-4h] [bp-58h]@100 - unsigned __int16 v60; // [sp+10h] [bp-44h]@66 - unsigned int v61; // [sp+10h] [bp-44h]@85 - unsigned int v63; // [sp+14h] [bp-40h]@85 - unsigned int v65; // [sp+18h] [bp-3Ch]@85 - unsigned int lPitch; // [sp+20h] [bp-34h]@1 - unsigned int lPitcha; // [sp+20h] [bp-34h]@23 - char *lPitchb; // [sp+20h] [bp-34h]@106 - unsigned int v69; // [sp+24h] [bp-30h]@23 - signed int v70; // [sp+24h] [bp-30h]@37 - unsigned __int16 uBlue; // [sp+28h] [bp-2Ch]@1 - signed int uBluea; // [sp+28h] [bp-2Ch]@37 - int v73; // [sp+2Ch] [bp-28h]@30 - int v76; // [sp+34h] [bp-20h]@91 - int v77; // [sp+34h] [bp-20h]@108 - int v79; // [sp+38h] [bp-1Ch]@72 - char *a2c; // [sp+40h] [bp-14h]@68 - signed int uCenterY; // [sp+48h] [bp-Ch]@1 - signed int uCenterX; // [sp+4Ch] [bp-8h]@1 - signed int uWidth; // [sp+5Ch] [bp+8h]@30 - signed int uZe; // [sp+5Ch] [bp+8h]@67 - signed int uZf; // [sp+5Ch] [bp+8h]@85 - signed int uZg; // [sp+5Ch] [bp+8h]@105 - unsigned int uWa; // [sp+60h] [bp+Ch]@23 - float uWb; // [sp+60h] [bp+Ch]@30 - unsigned int uWd; // [sp+60h] [bp+Ch]@95 - float uZooma; // [sp+64h] [bp+10h]@117 - unsigned int flagsb; // [sp+68h] [bp+14h]@66 - Actor *flagsc; // [sp+68h] [bp+14h]@86 - unsigned int flagsd; // [sp+68h] [bp+14h]@105 - - uCenterX = (uX + uZ) / 2; - uCenterY = (uY + uW) / 2; - lPitch = pRenderer->uTargetSurfacePitch; - GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0); - uBlue = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu); - auto bWizardEyeActive = pParty->WizardEyeActive(); - auto uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel(); - if (CheckHiredNPCSpeciality(Cartographer)) - { - bWizardEyeActive = true; - uWizardEyeSkillLevel = 2; - } - pRenderer->Clip_v2(uX, uY, uZ - 1, uW - 1); - uHeight = uW - uY; - uWidth = uZ - uX; - - if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) - { - v17 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2; - auto pMapLod0 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0; - auto pPal = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16; - v73 = (1 << (v17 + 16)) / (signed int)uZoom; - v18 = (double)(1 << (16 - v17)); - v19 = v18; - v20 = (double)(pParty->vPosition.x + 32768) / v18; - v21 = (double)(32768 - pParty->vPosition.y) / v19; - uWb = v21; - switch (uZoom) - { - case 512: - { - v20 = v20 - (double)(uWidth / 2); - v22 = (double)(uHeight / 2); - uWb = v21 - v22; - } - break; - - case 1024: - { - v20 = v20 - (double)(uWidth / 4); - v22 = (double)(uHeight / 4); - uWb = v21 - v22; - } - break; - - case 2048: - { - v20 = v20 - (double)(uWidth / 8); - v22 = (double)(uHeight / 8); - uWb = v21 - v22; - } - break; - - default: assert(false); - } - assert(sizeof(pOdmMinimap) == 137 * 117 * sizeof(short)); - - v70 = floorf(v20 * 65536.0 + 0.5f);//LODWORD(v24); - uBluea = floorf(uWb * 65536.0 + 0.5f);//LODWORD(v25); - v27 = uBluea >> 16; - v28 = &pRenderer->pTargetSurface[uX + uY * lPitch]; - if (pMapLod0 && bRedrawOdmMinimap) - { - assert(uWidth == 137 && uHeight == 117); - //auto pMinimap = (unsigned __int16 *)pOdmMinimap; - - auto mapWidth = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; - - v29 = v70 >> 16; - - for (int y = 0; y < uHeight; ++y) - { - auto pMapLod0Line = &pMapLod0[v27 * mapWidth]; - for (int x = 0; x < uWidth; ++x) - { - //*pMinimap++ = pPal[pMapLod0Line[v29]]; - pOdmMinimap[y][x] = pPal[pMapLod0Line[v29]]; - v29 = (v70 + x * v73) >> 16; - } - - v29 = v70 >> 16; - v28 += 137 - uWidth; - uBluea += v73; - v27 = uBluea >> 16; - } - } - - for (int y = 0; y < 117; ++y) - { - for (int x = 0; x < 137; ++x) - { - *v28++ = pOdmMinimap[y][x]; - } - v28 += lPitch - 137; - } - uNumBlueFacesInBLVMinimap = 0; - } - else - { - pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF); - uNumBlueFacesInBLVMinimap = 0; - - for (uint i = 0; i < pIndoor->pMapOutlines->uNumOutlines; ++i) - { - auto pOutline = &pIndoor->pMapOutlines->pOutlines[i]; - - auto pFace1 = pIndoor->pFaces + pOutline->uFace1ID; - auto pFace2 = pIndoor->pFaces + pOutline->uFace2ID; - //v9 = pIndoor->pFaces[pMapVertex->uFace1ID].uAttributes; - //v10 = pIndoor->pFaces[pMapVertex->uFace2ID].uAttributes; - if (pFace1->Visible() && pFace2->Visible()) - { - v11 = pOutline->uFlags; - if ( v11 & 1 ) - goto LABEL_15; - if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80u != 0 ) - goto LABEL_ABC; - - } - continue; - -LABEL_ABC: - pOutline->uFlags = v11 | 1; - pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8); - -LABEL_15: - //v12 = &pIndoor->pFaces[pOutline->uFace1ID]; - if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 && - (pFace1->uAttributes & 0x2000000 || pFace2->uAttributes & 0x2000000) && - (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID)) - { - if (uNumBlueFacesInBLVMinimap < 49) - pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i; - } - else - { - auto _a = (uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x); - auto _b = ((unsigned int)((unsigned __int64)_a >> 16) << 16); - auto _c = ((signed int)(_b - uZoom * pParty->vPosition.x) >> 16); - v69 = uCenterX + _c; - v69 = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); - lPitcha = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); - uWa = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); - v14 = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); - v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; - if ( v15 > 100 ) - v15 = 100; - pRenderer->Line2D(v69, lPitcha, uWa, v14, viewparams->pPalette[-v15 + 200]); - } - } - - - for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i) - { - //v16 = (uint *)&pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[uZb]]; - auto pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]]; - pRenderer->Line2D(uCenterX + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom - * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) - - uZoom * pParty->vPosition.x) >> 16), - uCenterY - - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom - * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) - - uZoom * pParty->vPosition.y) >> 16), - uCenterX - + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom - * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) - - uZoom * pParty->vPosition.x) >> 16), - uCenterY - - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom - * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) - - uZoom * pParty->vPosition.y) >> 16), - uBlue); - } - } - - - assert(pParty->sRotationY >= 0); - float angle = (pParty->sRotationY % 2048) / 2048.0f; - const float two_pi = 2.0f * 3.14159f; - - uint arrow_idx = floorf(0.5f + 7 * angle); - pRenderer->DrawTextureTransparent(uCenterX - 3, uCenterY - 3, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[arrow_idx])); - - flagsb = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xFFu); - v60 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0); - if (bWizardEyeActive) - { - uZe = 0; - //for (uint i = 0; i < uNumSpriteObjects; ++i) - if (uNumSpriteObjects > 0) - { - a2c = (char *)&pSpriteObjects[0].uObjectDescID; - while ( 1 ) - { - if ( !*((short *)a2c - 1) - || !*(short *)a2c - || uWizardEyeSkillLevel == 1 - || (v37 = ((unsigned __int64)((*(int *)(a2c + 2) - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16) - + uCenterX, - v79 = (unsigned __int64)((*(int *)(a2c + 6) - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16, - v38 = uCenterY - v79, - v37 < pRenderer->field_1C_clipx) - || v37 > pRenderer->field_24_width - || v38 < pRenderer->field_20_clipy - || v38 > pRenderer->field_28_height ) - goto LABEL_83; - if ( pObjectList->pObjects[*(short *)a2c].uFlags & 0x10 ) - break; - if ( (signed int)uZoom > 512 ) - { - pRenderer->Line2D(v37 - 1, v38 - 1, v37 - 1, v38 + 1, flagsb); - pRenderer->Line2D(v37, v38 - 2, v37, v38 + 1, flagsb); - pRenderer->Line2D(v37 + 1, v38 - 1, v37 + 1, v38 + 1, flagsb); - pRenderer->Line2D(v37 - 2, v38, v37 - 2, v38 + 1, flagsb); - v37 += 2; - v58 = flagsb; - v55 = v38 + 1; - goto LABEL_81; - } - pRenderer->Line2D(v37 - 1, v38 - 1, v37 - 1, uCenterY - v79, flagsb); - v58 = flagsb; - v55 = uCenterY - v79; - v53 = v37; - v51 = v38 - 1; -LABEL_82: - pRenderer->Line2D(v37, v51, v53, v55, v58); -LABEL_83: - ++uZe; - a2c += 112; - if ( uZe >= (signed int)uNumSpriteObjects ) - { - goto LABEL_85; - } - } - v58 = v60; - v55 = uCenterY - v79; -LABEL_81: - v53 = v37; - v51 = uCenterY - v79; - goto LABEL_82; - } -LABEL_85: - v63 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 0, 0); - v61 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 255, 0); - v65 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 0); - uZf = 0; - if ( (signed int)uNumActors > 0 ) - { - flagsc = pActors;//[0].uAIState; - do - { - v39 = flagsc->uAIState; - if ( flagsc->uAIState != 11 && v39 != 19 && (v39 == 5 || BYTE1(flagsc->uAttributes) & 0x80) ) - { - v40 = ((unsigned __int64)(( flagsc->vPosition.x - pParty->vPosition.x) - * (signed __int64)(signed int)uZoom) >> 16) - + uCenterX; - v76 = (unsigned __int64)(( flagsc->vPosition.y - pParty->vPosition.y) - * (signed __int64)(signed int)uZoom) >> 16; - v41 = uCenterY - v76; - if ( v40 >= pRenderer->field_1C_clipx ) - { - if ( v40 <= pRenderer->field_24_width && v41 >= pRenderer->field_20_clipy && v41 <= pRenderer->field_28_height ) - { - uWd = v61; - if ( BYTE3(flagsc->uAttributes) & 1 ) - uWd = v63; - if ( flagsc->uAIState == 5 ) - uWd = v65; - if ( (signed int)uZoom > 1024 ) - { - pRenderer->Line2D(v40 - 1, v41 - 2, v40 - 1, v41 + 2, uWd); - pRenderer->Line2D(v40, v41 - 2, v40, v41 + 2, uWd); - pRenderer->Line2D(v40 + 1, v41 - 2, v40 + 1, v41 + 2, uWd); - v42 = v41 + 1; - v43 = v41 - 1; - v44 = v42; - pRenderer->Line2D(v40 - 2, v43, v40 - 2, v42, uWd); - v40 += 2; - v59 = uWd; - v56 = v44; - v54 = v40; - v52 = v43; - } - else - { - pRenderer->Line2D(v40 - 1, v41 - 1, v40 - 1, uCenterY - v76, uWd); - v59 = uWd; - v56 = uCenterY - v76; - v54 = v40; - v52 = v41 - 1; - } - pRenderer->Line2D(v40, v52, v54, v56, v59); - } - } - } - ++uZf; - ++flagsc; - } - while ( uZf < (signed int)uNumActors ); - } - } - flagsd = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(255, 255, 255); - uZg = 0; - if ( (signed int)uNumLevelDecorations > 0 ) - { - v45 = (char *)&pLevelDecorations[0].vPosition; - lPitchb = (char *)&pLevelDecorations[0].vPosition; - do - { - if ( *(v45 - 2) & 8 ) - { - v46 = ((unsigned __int64)((*(int *)v45 - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16) - + uCenterX; - v77 = (unsigned __int64)((*((int *)v45 + 1) - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16; - v47 = uCenterY - v77; - if ( v46 >= pRenderer->field_1C_clipx ) - { - if ( v46 <= pRenderer->field_24_width && v47 >= pRenderer->field_20_clipy && v47 <= pRenderer->field_28_height ) - { - if ( (signed int)uZoom > 512 ) - { - v48 = v47 + 1; - v49 = v47 - 1; - pRenderer->Line2D(v46 - 1, v47 - 1, v46 - 1, v47 + 1, flagsd); - pRenderer->Line2D(v46, v49, v46, v48, flagsd); - pRenderer->Line2D(v46 + 1, v49, v46 + 1, v48, flagsd); - v45 = lPitchb; - } - else - { - pRenderer->Line2D(v46, uCenterY - v77, v46, uCenterY - v77, flagsd); - } - } - } - } - ++uZg; - v45 += 32; - lPitchb = v45; - } - while ( uZg < (signed int)uNumLevelDecorations ); - } - pRenderer->DrawTextureTransparent(0x1D4u, 0, (Texture *)(dword_5079D8 != -1 ? &pIcons_LOD->pTextures[dword_5079D8] : 0)); - uZooma = (double)pParty->sRotationY * 0.1171875; - //v50 = uZooma + 6.7553994e15; - pRenderer->Clip(541, 0, 567, 480); - pRenderer->DrawTextureIndexed(floorf(uZooma + 0.5f) + 285, 136, (Texture *)(dword_5079B4 != -1 ? &pIcons_LOD->pTextures[dword_5079B4] : 0)); - pRenderer->ResetClip(); -} - - -//----- (00442955) -------------------------------------------------------- -void DrawBook_Map_sub( unsigned int tl_x, unsigned int tl_y, unsigned int br_x, int br_y, int _48074 ) - { - int v5; // ebx@1 - int v6; // edi@1 - BLVMapOutlines *v7; // eax@8 - unsigned __int8 v8; // zf@8 - unsigned __int8 v9; // sf@8 - int v10; // esi@10 - unsigned int v11; // edx@11 - __int16 v12; // cx@12 - signed int v13; // eax@15 - int v14; // eax@16 - Vec3_short_ *v15; // ecx@16 - int v16; // edx@16 - int v17; // ecx@16 - Vec3_short_ *v18; // eax@16 - int v19; // ecx@16 - int v20; // eax@16 - signed int v21; // esi@18 - int v22; // ecx@21 - BLVMapOutline *v23; // ecx@21 - Vec3_short_ *v24; // edx@21 - Vec3_short_ *v25; // eax@21 - int v26; // ecx@21 - unsigned __int16 *v27; // edi@21 - int v28; // edx@21 - int v29; // eax@21 - double v30; // st7@23 - signed __int64 v31; // qax@23 - unsigned short *v32; // edx@23 - int textr_width; // esi@23 - signed int v34; // eax@23 - signed int v35; // ecx@23 - int v36; // esi@27 - int v37; // ecx@27 - int v38; // edx@31 - unsigned int v39; // eax@33 - short *v40; // esi@33 - short *v41; // edi@33 - unsigned __int8 v42; // cf@33 - unsigned int v43; // ecx@33 - short *v44; // edi@33 - short *v45; // esi@33 - int v46; // ecx@33 - signed int v47; // esi@38 - signed int v48; // ecx@38 - int v49; // eax@38 - signed int v50; // edx@55 - unsigned int v51; // ecx@55 - int result; // eax@72 - int v53; // eax@75 - int v54; // esi@75 - int v55; // eax@75 - __int16 v56; // si@85 - double v57; // st7@85 - int v58; // ebx@85 - signed __int64 v59; // qax@85 - signed int v60; // edi@85 - signed __int64 v61; // qax@85 - signed int v62; // ebx@85 - signed int v63; // esi@85 - int v64; // eax@87 - unsigned int v65; // ebx@95 - unsigned short *v66; // edx@95 - unsigned __int16 *v67; // esi@96 - int v68; // edi@98 - unsigned __int16 v69; // cx@99 - unsigned int v70; // [sp-10h] [bp-48074h]@80 - unsigned int v71; // [sp-Ch] [bp-48070h]@80 - unsigned int v72; // [sp-8h] [bp-4806Ch]@80 - signed int v73; // [sp-4h] [bp-48068h]@59 - unsigned __int16 v74; // [sp-4h] [bp-48068h]@79 - unsigned short map_texture_16[147456]; // [sp+Ch] [bp-48058h]@23 - int v76; // [sp+4800Ch] [bp-58h]@23 - unsigned __int16 *v77; // [sp+48010h] [bp-54h]@27 - unsigned __int16 *pPalette_16; // [sp+48014h] [bp-50h]@23 - unsigned int surfPitch; // [sp+48018h] [bp-4Ch]@1 - - int v81; // [sp+48020h] [bp-44h]@23 - unsigned __int16* render16_data; - unsigned char* texture8_data; - unsigned char* curr_line; - int scale_increment; - int scaled_posX; - int scaled_posY; - int stepX_r; - int stepY_r; - - - unsigned int teal; // [sp+48028h] [bp-3Ch]@8 - int v84; // [sp+4802Ch] [bp-38h]@1 - int screenCenter_X; // [sp+48030h] [bp-34h]@1 - int v86; // [sp+48034h] [bp-30h]@1 - int v87; // [sp+48038h] [bp-2Ch]@16 - unsigned int v88; // [sp+4803Ch] [bp-28h]@16 - int black; // [sp+48040h] [bp-24h]@8 - int screenCenterY; // [sp+48044h] [bp-20h]@1 - unsigned int i; // [sp+48048h] [bp-1Ch]@9 - unsigned int screenHeight; // [sp+4804Ch] [bp-18h]@16 - unsigned __int16 *v93; // [sp+48050h] [bp-14h]@16 - signed int screenWidth; // [sp+48054h] [bp-10h]@8 - unsigned int v95; // [sp+48058h] [bp-Ch]@16 - int v96; // [sp+4805Ch] [bp-8h]@10 - const void *v97; // [sp+48060h] [bp-4h]@16 - unsigned short *a4a; // [sp+4806Ch] [bp+8h]@85 - int a5a; // [sp+48070h] [bp+Ch]@86 - - tl_x = tl_x; - tl_y = tl_y; - screenCenter_X = (signed int)(tl_x + br_x) >> 1; - screenCenterY = (signed int)(tl_y + br_y) >> 1; - surfPitch = pRenderer->uTargetSurfacePitch; - pRenderer->Clip_v2(tl_x, tl_y, br_x, br_y); - v5 = viewparams->field_2C; - v6 = viewparams->sViewCenterX; - v86 = viewparams->sViewCenterX; - v84 = viewparams->sViewCenterY; - if ( viewparams->field_2C != 384 ) - { - if ( viewparams->field_2C == 768 ) - { - if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) - v5 = 680; - } - } - else - { - v6 = viewparams->field_38; - v86 = viewparams->field_38; - v84 = viewparams->field_3A; - if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) - v5 = viewparams->field_2C - 34; - } - if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) - { - screenWidth = br_x - tl_x + 1; - screenHeight = br_y - tl_y + 1; - render16_data = &pRenderer->pTargetSurface[tl_x + tl_y * surfPitch]; - texture8_data = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0; - pPalette_16 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16; - scale_increment = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / v5; - - v30 = (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2)); - - - teal = (unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16; - v97 = (const void *)((unsigned int)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30) << 16); - - v32 = map_texture_16; - textr_width = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; - stepY_r = (int)(signed __int64)((double)(- v84 - 22528 / (v5 / 384)+ 32768) / v30) << 16; - v81 = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30); - black = (signed __int16)(signed __int64)((double)(v6 - 22528 / (v5 / 384) + 32768) / v30); - - v76 = textr_width; - scaled_posY = stepY_r >> 16; - //nearest neiborhood scaling - if ( texture8_data) - { - for(uint i=0; i>16; - map_texture_16[i*screenWidth+j]=pPalette_16[*(curr_line+scaled_posX)]; - stepX_r+=scale_increment; - } - stepY_r+=scale_increment; - scaled_posY=stepY_r>>16; - } - } - //move visible square to render - for(uint i=0; i 0 ) - { - memcpy((void*)&render16_data[surfPitch*i],(void*)&map_texture_16[i*screenWidth], screenWidth*2); - } - } - } - else - { - black = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0); - teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu); - v7 = pIndoor->pMapOutlines; - uNumBlueFacesInBLVMinimap = 0; - v8 = pIndoor->pMapOutlines->uNumOutlines == 0; - v9 = pIndoor->pMapOutlines->uNumOutlines < 0; - screenWidth = 0; - if ( !(v9 | v8) ) - { - i = 0; - do - { - v10 = (int)((char *)v7 + i + 4); - v96 = pIndoor->pFaces[*(short *)((char *)v7 + i + 8)].uAttributes; - if ( !(BYTE1(v96) & 0x20 || (v11 = pIndoor->pFaces[*(short *)((char *)v7 + i + 10)].uAttributes, BYTE1(v11) & 0x20) )) - { - v12 = *(short *)((char *)v7 + i + 14); - if ( !(v12 & 1) ) - { - if ( !(!(v96 & 0x80) && (v11 & 0x80u) == 0 )) - { - v96 = (signed int)screenWidth >> 3; - v13 = screenWidth; - *(short *)(v10 + 10) = v12 | 1; - pIndoor->_visible_outlines[v96] |= 1 << (7 - v13 % 8); - } - } - if ( (!(v12 & 1) && !(!(v96 & 0x80) && (v11 & 0x80u) == 0 )) || v12 & 1) - { - v14 = *(short *)v10; - v88 = v5; - v15 = &pIndoor->pVertices[v14]; - v16 = v15->x; - v17 = v15->y - v84; - v93 = (unsigned __int16 *)(v16 - v6); - screenHeight = v17; - v18 = &pIndoor->pVertices[*(short *)(v10 + 2)]; - v19 = v18->x; - v20 = v18->y - v84; - v95 = v19 - v6; - v97 = (const void *)v20; - v88 = (unsigned __int64)((v16 - v6) * (signed __int64)v5) >> 16; - v87 = (unsigned __int64)((signed int)screenHeight * (signed __int64)v5) >> 16; - v93 = (unsigned __int16 *)((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16); - screenHeight = (unsigned __int64)(v20 * (signed __int64)v5) >> 16; - pRenderer->Line2D( - screenCenter_X + v88, - screenCenterY - v87, - screenCenter_X + ((unsigned __int64)((v19 - v6) * (signed __int64)v5) >> 16), - screenCenterY - screenHeight, - black); - v7 = pIndoor->pMapOutlines; - } - } - ++screenWidth; - i += 12; - } - while ( screenWidth < (signed int)v7->uNumOutlines ); - } - v21 = 0; - if ( (signed int)uNumBlueFacesInBLVMinimap > 0 ) - { - while ( 1 ) - { - v22 = pBlueFacesInBLVMinimapIDs[v21]; - v87 = v5; - v23 = &v7->pOutlines[v22]; - v24 = &pIndoor->pVertices[v23->uVertex1ID]; - v25 = &pIndoor->pVertices[v23->uVertex2ID]; - v26 = v25->x; - v27 = (unsigned __int16 *)(v24->x - v86); - v28 = v24->y - v84; - v29 = v25->y - v84; - v93 = v27; - screenHeight = v28; - v97 = (const void *)v29; - v87 = (unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16; - v88 = (unsigned __int64)(v28 * (signed __int64)v5) >> 16; - i = (unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16; - v95 = (unsigned __int64)(v29 * (signed __int64)v5) >> 16; - pRenderer->Line2D( - screenCenter_X + ((unsigned __int64)((signed int)v27 * (signed __int64)v5) >> 16), - screenCenterY - v88, - screenCenter_X + ((unsigned __int64)((v26 - v86) * (signed __int64)v5) >> 16), - screenCenterY - v95, - teal); - ++v21; - if ( v21 >= (signed int)uNumBlueFacesInBLVMinimap ) - break; - v7 = pIndoor->pMapOutlines; - } - v6 = v86; - } - } - v47 = ((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + screenCenter_X - 3; - v81 = pParty->vPosition.y - v84; - v97 = (const void *)((unsigned __int64)((pParty->vPosition.y - v84) * (signed __int64)v5) >> 16); - v48 = 1; - v49 = screenCenterY - (int)v97 - 3; - if ( v47 >= (signed int)tl_x ) - { - if ( v47 > (signed int)br_x ) - { - if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + screenCenter_X - 6) > (signed int)br_x ) - v48 = 0; - v47 = br_x; - } - } - else - { - if ( (signed int)(((unsigned __int64)((pParty->vPosition.x - v6) * (signed __int64)v5) >> 16) + screenCenter_X) < (signed int)tl_x ) - v48 = 0; - v47 = tl_x; - } - if ( v49 >= (signed int)tl_y ) - { - if ( v49 > br_y ) - { - if ( screenCenterY - (signed int)v97 - 6 > br_y ) - v48 = 0; - v49 = br_y; - } - } - else - { - if ( screenCenterY - (signed int)v97 < (signed int)tl_y ) - v48 = 0; - v49 = tl_y; - } - if ( v48 == 1 ) - { - v50 = 0; - v51 = pParty->sRotationY & stru_5C6E00->uDoublePiMask; - if ( (signed int)(pParty->sRotationY & stru_5C6E00->uDoublePiMask) >= 128 ) - { - if ( (signed int)v51 > 384 ) - { - if ( (signed int)v51 >= 640 ) - { - if ( (signed int)v51 > 896 ) - { - if ( (signed int)v51 >= 1152 ) - { - if ( (signed int)v51 > 1408 ) - { - if ( (signed int)v51 >= 1664 ) - { - if ( (signed int)v51 <= 1920 ) - v73 = 7; - } - else - { - v73 = 6; - } - } - else - { - v73 = 5; - } - } - else - { - v73 = 4; - } - } - else - { - v73 = 3; - } - } - else - { - v73 = 2; - } - if( (signed int)v51 <=1920) - v50 = v73; - } - else - v50 = 1; - } - pRenderer->DrawTransparentRedShade(v47, v49, (Texture *)(pTextureIDs_pMapDirs[v50] != -1 ? (int)&pIcons_LOD->pTextures[pTextureIDs_pMapDirs[v50]] : 0)); - } - result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); - v95 = 0; - v86 = result; - if ( (signed int)uNumLevelDecorations > 0 ) - { - screenWidth = (unsigned int)&pLevelDecorations[0].vPosition; - do - { - if ( *(char *)(screenWidth - 2) & 8 ) - { - v53 = *(int *)(screenWidth + 4) - v84; - v93 = (unsigned __int16 *)(*(int *)screenWidth - v6); - screenHeight = v53; - v54 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + screenCenter_X; - v97 = (const void *)((unsigned __int64)(v53 * (signed __int64)v5) >> 16); - v55 = screenCenterY - (int)v97; - if ( v54 >= pRenderer->field_1C_clipx ) - { - if ( v54 <= pRenderer->field_24_width && v55 >= pRenderer->field_20_clipy && v55 <= pRenderer->field_28_height ) - { - v74 = v86; - if ( v5 > 512 ) - { - v96 = v55 + 1; - black = v55 - 1; - pRenderer->Line2D(v54 - 1, v55 - 1, v54 - 1, v55 + 1, v86); - pRenderer->Line2D(v54, black, v54, v96, v86); - ++v54; - v74 = v86; - v72 = v96; - v71 = v54; - v70 = black; - } - else - { - v72 = screenCenterY - (int)v97; - v71 = ((unsigned __int64)((signed int)v93 * (signed __int64)v5) >> 16) + screenCenter_X; - v70 = screenCenterY - (int)v97; - } - pRenderer->Line2D(v54, v70, v71, v72, v74); - } - } - } - ++v95; - result = v95; - screenWidth += 32; - } - while ( (signed int)v95 < (signed int)uNumLevelDecorations ); - } - if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) - { - screenCenterY = br_x - tl_x + 1; - v95 = br_y - tl_y + 1; - v77 = &pRenderer->pTargetSurface[tl_x + tl_y * surfPitch]; - v56 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2; - black = (1 << (v56 + 16)) / v5; - v57 = (double)(1 << (16 - v56)); - v58 = 22528 / (v5 / 384); - v59 = (signed __int64)((double)(v6 - v58 + 32768) / v57); - v60 = (int)v59 << 16; - v97 = (const void *)((int)v59 << 16); - v61 = (signed __int64)((double)(32768 - v58 - v84) / v57); - pPalette_16 = (unsigned __int16 *)(v60 >> 16); - v62 = (int)v61 << 16; - teal = v60 >> 16; - v63 = (signed __int16)v61; - a4a = map_texture_16; - result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xCu, 0xCu, 0xCu); - screenCenter_X = 0; - for ( i = result; screenCenter_X < (signed int)v95; result = screenCenter_X ) - { - a5a = 0; - if ( screenCenterY > 0 ) - { - v96 = (v63 - 80) / 4; - v64 = teal; - do - { - v81 = (v64 - 80) / 4; - if ( !pOutdoor->_47F04C(v81, v96) ) - { - if ( pOutdoor->_47F097(v81, v96) ) - { - if ( !((a5a + screenCenter_X) % 2) ) - *a4a = i; - } - else - { - *a4a = 0; - } - } - ++a4a; - v97 = (char *)v97 + black; - v64 = (signed int)v97 >> 16; - ++a5a; - } - while ( a5a < screenCenterY ); - } - v62 += black; - v97 = (const void *)v60; - a4a += screenCenterY - a5a; - v63 = v62 >> 16; - ++screenCenter_X; - teal = (unsigned int)pPalette_16; - } - v65 = v95; - v66 = map_texture_16; - if ( (signed int)v95 > 0 ) - { - v67 = v77; - result = 2 * (surfPitch - screenCenterY); - do - { - if ( screenCenterY > 0 ) - { - v68 = screenCenterY; - do - { - v69 = *(short *)v66; - if ( !*(short *)v66 || v69 == (short)i ) - *v67 = v69; - ++v66; - ++v67; - --v68; - } - while ( v68 ); - } - v67 = (unsigned __int16 *)((char *)v67 + result); - --v65; - } - while ( v65 ); - } - } -} - @@ -14863,20 +13813,7 @@ } -//----- (00448A17) -------------------------------------------------------- -void Chest::ToggleFlag(unsigned int uChestID, unsigned __int16 uFlag, unsigned int bToggle) -{ - unsigned __int16 *pFlags; // eax@3 - - if ( (uChestID & 0x80000000u) == 0 && (signed int)uChestID <= 19 ) - { - pFlags = &pChests[uChestID].uFlags; - if ( bToggle ) - *pFlags |= uFlag; - else - *pFlags &= ~uFlag; - } -} + //----- (00448A40) -------------------------------------------------------- void Actor::ToggleFlag(signed int uActorID, unsigned int uFlag, int bToggle) diff -r f39d5902c85a -r 70c5a87a1307 mm7_4.cpp --- a/mm7_4.cpp Wed Mar 20 17:48:51 2013 +0600 +++ b/mm7_4.cpp Wed Mar 20 17:49:15 2013 +0600 @@ -2839,92 +2839,6 @@ -//----- (004908DE) -------------------------------------------------------- -signed int __cdecl PlayerCreation_Chose4Skills() -{ - Player *v0; // esi@1 - signed int v1; // edx@2 - unsigned short *v2; // eax@2 - signed int v3; // ecx@2 - - v0 = pParty->pPlayers;//[0].pActiveSkills; - while ( 1 ) - { - v1 = 0; - v2 = v0->pActiveSkills; - v3 = 37; - do - { - if ( *v2 ) - ++v1; - ++v2; - --v3; - } - while ( v3 ); - if ( v1 < 4 ) - break; - ++v0; - if ( v0 > &pParty->pPlayers[3] ) - return 1; - } - return 0; -} - - - - -//----- (00491CB5) -------------------------------------------------------- -void __cdecl LoadPlayerPortraintsAndVoices() -{ - //Texture **v0; // ebx@1 - //int v1; // eax@2 - //int v2; // edi@3 - char *v3; // esi@5 - char *v4; // [sp+10h] [bp-4h]@1 - - pIcons_LOD->pFacesLock = pIcons_LOD->uNumLoadedFiles; - - for (uint i = 0; i < 4; ++i) - for (uint j = 0; j < 56; ++j) - { - sprintf(pTmpBuf, "%s%02d", pPlayerPortraitsNames[pParty->pPlayers[i].uFace], j + 1); - pTextures_PlayerFaces[i][j] = pIcons_LOD->LoadTexturePtr(pTmpBuf, TEXTURE_16BIT_PALETTE); - } - - pTexture_PlayerFaceEradicated = pIcons_LOD->LoadTexturePtr("ERADCATE", TEXTURE_16BIT_PALETTE); - pTexture_PlayerFaceDead = pIcons_LOD->LoadTexturePtr("DEAD", TEXTURE_16BIT_PALETTE); - pTexture_PlayerFaceMask = pIcons_LOD->LoadTexturePtr("FACEMASK", TEXTURE_16BIT_PALETTE); - - if (SoundSetAction[24][0]) - for (uint i = 0; i < 4; ++i) - { - pSoundList->LoadSound(2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[i].uVoiceID) + 4998, 0); - pSoundList->LoadSound(2 * (SoundSetAction[24][0] + 50 * pParty->pPlayers[i].uVoiceID) + 4999, 0); - } -} - -//----- (00491DE7) -------------------------------------------------------- -int __fastcall ReloadPlayerPortraits(int a1, int a2) -{ - int result; // eax@1 - const char **v3; // ebp@1 - Texture **v4; // ebx@1 - int v5; // esi@2 - - result = 0; - v3 = &pPlayerPortraitsNames[a2]; - v4 = pTextures_PlayerFaces[a1]; - do - { - v5 = result + 1; - sprintf(pTmpBuf, "%s%02d", *v3, result + 1); - pIcons_LOD->ReloadTexture(*v4, pTmpBuf, 2); - result = v5; - ++v4; - } - while ( v5 < 56 ); - return result; -} //----- (00491E3A) -------------------------------------------------------- @@ -3028,270 +2942,7 @@ } // 4ED498: using guessed type char byte_4ED498; -//----- (00491F87) -------------------------------------------------------- -void __cdecl DrawHiredNPCs() -{ - //int v6; // eax@15 - char v7; // al@17 - unsigned int v8; // eax@18 - int v9; // esi@18 - int v10; // eax@18 - unsigned int v11; // eax@19 - unsigned int v12; // esi@19 - unsigned int v13; // eax@23 - IconFrame *v14; // eax@24 - unsigned int v15; // eax@26 - char pContainer[20]; // [sp+Ch] [bp-30h]@18 - unsigned int v17; // [sp+20h] [bp-1Ch]@19 - signed int uFrameID; // [sp+24h] [bp-18h]@19 - //int i; // [sp+28h] [bp-14h]@15 - unsigned int v20; // [sp+2Ch] [bp-10h]@20 - unsigned int v21; // [sp+30h] [bp-Ch]@19 - int v22; // [sp+34h] [bp-8h]@2 - unsigned __int8 v23; // [sp+3Bh] [bp-1h]@2 - - if ( bNoNPCHiring != 1 ) - { - v23 = 0; - v22 = 0; - /*for (uint i = 0; i < 2; ++i) - { - if (pParty->pHirelings[i].pName) - pTmpBuf[v22++] = i; - }*/ - if (pParty->pHirelings[0].pName) - pTmpBuf[v22++] = 0; - if (pParty->pHirelings[1].pName) - pTmpBuf[v22++] = 1; - - for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i) - { - if (pNPCStats->pNewNPCData[i].uFlags & 128) - { - if (!pParty->pHirelings[0].pName || strcmp(pNPCStats->pNewNPCData[i].pName, pParty->pHirelings[0].pName)) - { - if (!pParty->pHirelings[1].pName || strcmp(pNPCStats->pNewNPCData[i].pName, pParty->pHirelings[1].pName)) - pTmpBuf[v22++] = i + 2; - } - } - } - - //v6 = (unsigned __int8)pParty->field_709; - for ( int i = (unsigned __int8)pParty->field_709; i < v22 && v23 < 2; i++ ) - { - v7 = pTmpBuf[i]; - if ( (unsigned __int8)v7 >= 2 ) - { - sprintf(pContainer, "NPC%03d", pNPCStats->pNPCData[(unsigned __int8)v7 + 499].uPortraitID); - v15 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[v23], pHiredNPCsIconsOffsetsY[v23], (Texture *)(v15 != -1 ? &pIcons_LOD->pTextures[v15] : 0)); - } - else - { - sprintf(pContainer, "NPC%03d", pParty->pHirelings[(unsigned __int8)v7].uPortraitID); - v8 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - v9 = v23; - pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[v9], pHiredNPCsIconsOffsetsY[v9], (Texture *)(v8 != -1 ? &pIcons_LOD->pTextures[v8] : 0)); - v10 = (unsigned __int8)pTmpBuf[i]; - if ( pParty->pHirelings[v10].evt_A == 1 ) - { - uFrameID = pParty->pHirelings[v10].evt_B; - v11 = pHiredNPCsIconsOffsetsX[v9]; - v12 = pHiredNPCsIconsOffsetsY[v9]; - v17 = v11; - v21 = 0; - if ( (signed int)pIconsFrameTable->uNumIcons <= 0 ) - { -LABEL_23: - v13 = 0; - } - else - { - v20 = 0; - while ( _strcmpi("spell96", pIconsFrameTable->pIcons[v20 / 0x20].pAnimationName) ) - { - ++v21; - v20 += 32; - if ( (signed int)v21 >= (signed int)pIconsFrameTable->uNumIcons ) - goto LABEL_23; - } - v13 = v21; - } - v14 = pIconsFrameTable->GetFrame(v13, uFrameID); - pRenderer->DrawTextureTransparent(v17, v12, &pIcons_LOD->pTextures[v14->uTextureID]); - } - } - ++v23; - } - } -} -// 6BE3C5: using guessed type char bNoNPCHiring; - - - -//----- (004921C1) -------------------------------------------------------- -void GameUI_DrawPortraits(unsigned int _this) -{ - Texture *pFace; // eax@10 - unsigned int v7; // eax@17 - PlayerFrame *pFrame; // eax@21 - unsigned int v9; // eax@27 - bool v10; // eax@33 - bool v11; // edi@40 - bool v12; // edx@43 - bool v13; // ecx@46 - int v16; // eax@57 - int v19; // eax@62 - Texture *pPortrait; // [sp-4h] [bp-1Ch]@27 - unsigned int v22; // [sp+14h] [bp-4h]@1 - - v22 = _this; - if ( qword_A750D8 ) - { - qword_A750D8 -= (signed int)pMiscTimer->uTimeElapsed; - if ( qword_A750D8 <= 0 ) - { - if ( pPlayers[word_A750E2]->CanAct() ) - pPlayers[word_A750E2]->PlaySound((PlayerSpeech)word_A750E0, 0); - qword_A750D8 = 0i64; - } - } - - for (uint i = 0; i < 4; ++i) - { - auto pPlayer = pParty->pPlayers + i; - - if (pPlayer->Eradicated()) - { - pFace = pTexture_PlayerFaceEradicated; - pPortrait = pFace; - v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i]; - if ( pParty->pPartyBuffs[11].uExpireTime ) - pRenderer->_4A6E7E(v9, 0x183u, pPortrait); - else - pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, pPortrait); - auto _v1 = 0; - v10 = pPlayer->pPlayerBuffs[14].uExpireTime > 0; - if (pPlayer->pPlayerBuffs[1].uExpireTime > 0) - _v1 = 1; - v11 = pPlayer->pPlayerBuffs[8].uExpireTime > 0; - v12 = pPlayer->pPlayerBuffs[7].uExpireTime > 0; - v13 = pPlayer->pPlayerBuffs[13].uExpireTime > 0; - if ( v13 | v12 | v11 | _v1 | v10 ) - sub_441A4E(i); - continue; - } - if (pPlayer->Dead()) - { - pFace = pTexture_PlayerFaceDead; - pPortrait = pFace; - v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i]; - if ( pParty->pPartyBuffs[11].uExpireTime ) - pRenderer->_4A6E7E(v9, 0x183u, pPortrait); - else - pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, pPortrait); - auto _v1 = 0; - v10 = pPlayer->pPlayerBuffs[14].uExpireTime > 0; - if (pPlayer->pPlayerBuffs[1].uExpireTime > 0) - _v1 = 1; - v11 = pPlayer->pPlayerBuffs[8].uExpireTime > 0; - v12 = pPlayer->pPlayerBuffs[7].uExpireTime > 0; - v13 = pPlayer->pPlayerBuffs[13].uExpireTime > 0; - if ( v13 | v12 | v11 | _v1 | v10 ) - sub_441A4E(i); - continue; - } - v7 = 0; - for (uint j = 0; j < pPlayerFrameTable->uNumFrames; ++j) - if (pPlayerFrameTable->pFrames[j].expression == pPlayer->expression) - { - v7 = j; - break; - } - if ( v7 == 0 ) - v7 = 1; - if (pPlayer->expression == CHARACTER_EXPRESSION_21) - pFrame = pPlayerFrameTable->GetFrameBy_y(&pPlayer->_expression21_frameset, &pPlayer->_expression21_animtime, pMiscTimer->uTimeElapsed); - else - pFrame = pPlayerFrameTable->GetFrameBy_x(v7, pPlayer->uExpressionTimePassed); - if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || v22 ) - { - pPlayer->field_1AA2 = pFrame->uTextureID - 1; - pFace = (Texture *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture *)pTextures_PlayerFaces[i][pFrame->uTextureID]; - pPortrait = pFace; - v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i]; - if ( pParty->pPartyBuffs[11].uExpireTime ) - pRenderer->_4A6E7E(v9, 0x183u, pPortrait); - else - pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, pPortrait); - auto _v1 = 0; - v10 = pPlayer->pPlayerBuffs[14].uExpireTime > 0; - if (pPlayer->pPlayerBuffs[1].uExpireTime > 0) - _v1 = 1; - v11 = pPlayer->pPlayerBuffs[8].uExpireTime > 0; - v12 = pPlayer->pPlayerBuffs[7].uExpireTime > 0; - v13 = pPlayer->pPlayerBuffs[13].uExpireTime > 0; - if ( v13 | v12 | v11 | _v1 | v10 ) - sub_441A4E(i); - continue; - } - } - if ( pParty->bTurnBasedModeOn == 1 ) - { - if ( pTurnEngine->field_4 != 1 ) - { - if ( (pTurnEngine->pQueue[0].uPackedID & 7) == OBJECT_Player) - { - //v14 = 0; - if ( pTurnEngine->uActorQueueSize > 0 ) - { - //v15 = (char *)pTurnEngine->pQueue; - for (uint i = 0; i < pTurnEngine->uActorQueueSize; ++i) - { - auto pElem = pTurnEngine->pQueue + i; - - if ( (pElem->uPackedID & 7) != OBJECT_Player) - break; - v16 = dword_5079D0; - if ( pParty->uFlags & 0x10 ) - { - v16 = dword_5079CC; - } - else - { - if ( pParty->uFlags & 0x20 ) - v16 = dword_5079C8; - } - pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[pElem->uPackedID >> 3] - 4, - 0x181u, (Texture *)(v16 != -1 ? &pIcons_LOD->pTextures[v16] : 0)); - } - } - } - } - } - else - { - for (uint i = 0; i < 4; ++i) - { - auto pPlayer = pParty->pPlayers + i; - if (pPlayer->CanAct() && !pPlayer->uTimeToRecovery) - { - v19 = dword_5079D0; - if ( pParty->uFlags & 0x10 ) - { - v19 = dword_5079CC; - } - else - { - if ( pParty->uFlags & 0x20 ) - v19 = dword_5079C8; - } - pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] - 4, - 0x181u, (Texture *)(v19 != -1 ? &pIcons_LOD->pTextures[v19] : 0)); - } - } - } -} + //----- (0049387A) -------------------------------------------------------- @@ -5259,960 +4910,8 @@ return pTmpBuf2; } -//----- (00495B39) -------------------------------------------------------- -void __cdecl PlayerCreationUI_Draw() -{ - const char *uTitleText; // ST10_4@3 - int pTextCenter; // eax@3 - IconFrame *v3; // eax@3 - int v4; // ecx@7 - GUIButton *uPosActiveItem; // edi@12 - int v6; // esi@14 - int uNumLet; // eax@14 - char v8; // al@17 - int v9; // ecx@17 - char v10; // sf@17 - int v11; // ecx@19 - void *v12; // eax@20 - int v13; // ecx@21 - int v14; // ecx@22 - char *v15; // ST14_4@24 - size_t v16; // eax@28 - int v17; // eax@33 - //enum CHARACTER_RACE uNumRace; // eax@35 - int v19; // eax@36 - int v20; // eax@37 - int uNumMight; // eax@44 - unsigned int v24; // eax@44 - int v25; // eax@44 - unsigned int v26; // eax@44 - int v27; // eax@44 - unsigned int v28; // eax@44 - int v29; // eax@44 - unsigned int v30; // eax@44 - int v31; // eax@44 - unsigned int v32; // eax@44 - int v33; // eax@44 - unsigned int v34; // eax@44 - int v35; // eax@44 - unsigned int v36; // eax@44 - enum PLAYER_SKILL_TYPE v37; // eax@44 - enum PLAYER_SKILL_TYPE v39; // eax@44 - enum PLAYER_SKILL_TYPE v41; // eax@44 - const char *v42; // edx@44 - char *v43; // ST1C_4@44 - int v45; // eax@44 - enum PLAYER_SKILL_TYPE v46; // eax@46 - const char *v47; // edx@46 - char *v48; // ST1C_4@46 - int v50; // eax@46 - int v51; // eax@49 - char *v52; // edi@52 - char v53; // al@52 - PLAYER_CLASS_TYPE uClassType; // edi@53 - int v55; // ST0C_4@53 - int v57; // eax@53 - int v61; // ecx@55 - int v64; // ST08_4@57 - int v66; // ecx@57 - int v71; // eax@59 - int v75; // eax@61 - int v80; // eax@63 - int v85; // eax@65 - int v89; // eax@67 - int v94; // eax@69 - enum PLAYER_SKILL_TYPE pSkillId; // edi@72 - size_t pLenText; // eax@72 - signed int v104; // ecx@72 - int pColorText; // ecx@79 - unsigned int v107; // ST0C_4@81 - int pTextY; // ST08_4@81 - int v111; // ST0C_4@82 - signed int v113; // edi@82 - int v114; // ST0C_4@82 - const char *uRaceName; // [sp+0h] [bp-170h]@39 - char pText[200]; // [sp+10h] [bp-160h]@14 - GUIWindow pWindow; // [sp+D8h] [bp-98h]@83 - int v119; // [sp+12Ch] [bp-44h]@18 - size_t v120; // [sp+130h] [bp-40h]@25 - int uY; // [sp+134h] [bp-3Ch]@18 - int v122; // [sp+138h] [bp-38h]@18 - int v123; // [sp+13Ch] [bp-34h]@11 - void *v124; // [sp+140h] [bp-30h]@18 - int uColor1; // [sp+144h] [bp-2Ch]@1 - int v126; // [sp+148h] [bp-28h]@25 - int uColorGreen; // [sp+14Ch] [bp-24h]@1 - int v128; // [sp+150h] [bp-20h]@14 - int v129; // [sp+154h] [bp-1Ch]@18 - int uColorTeal; // [sp+158h] [bp-18h]@1 - int uColorWhite; // [sp+15Ch] [bp-14h]@1 - int uX; // [sp+160h] [bp-10h]@18 - unsigned int v133; // [sp+164h] [bp-Ch]@25 - int pOrder; // [sp+168h] [bp-8h]@14 - //char *Str; // [sp+16Ch] [bp-4h]@18 - //Player *pPlayer; - const char *pSkillName; - - uColor1 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xD1, 0xBB, 0x61); - uColorTeal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xF7, 0xF7); - uColorGreen = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFF, 0); - uColorWhite = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0xFF); - pRenderer->BeginScene(); - pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX); - uPlayerCreationUI_SkySliderPos = (GetTickCount() % 12800) / 20; - pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos, 2, pTexture_MAKESKY); - pRenderer->DrawTextureIndexed(uPlayerCreationUI_SkySliderPos - 640, 2, pTexture_MAKESKY); - //if (uPlayerCreationUI_SkySliderPos > 640) - //uPlayerCreationUI_SkySliderPos = 0; - pRenderer->DrawTextureTransparent(0, 0, pTexture_MAKETOP); - uTitleText = pGlobalTXT_LocalizationStrings[51]; - uPlayerCreationUI_SelectedCharacter = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) / 7; - pTextCenter = pFontCChar->AlignText_Center(640, pGlobalTXT_LocalizationStrings[51]); - pGUIWindow_CurrentMenu->DrawText(pFontCChar, pTextCenter + 1, 0, 0, uTitleText, 0, 0, 0); - pRenderer->DrawTextureTransparent(17, 35, pPlayerPortraits[pParty->pPlayers[0].uFace]); - pRenderer->DrawTextureTransparent(176, 35, pPlayerPortraits[pParty->pPlayers[1].uFace]); - pRenderer->DrawTextureTransparent(335, 35, pPlayerPortraits[pParty->pPlayers[2].uFace]); - pRenderer->DrawTextureTransparent(494, 35, pPlayerPortraits[pParty->pPlayers[3].uFace]); - v3 = pIconsFrameTable->GetFrame(uIconID_CharacterFrame, pEventTimer->uStartTime); - if ( uPlayerCreationUI_SelectedCharacter ) - { - switch ( uPlayerCreationUI_SelectedCharacter ) - { - case 1: - v4 = 171; - break; - case 2: - v4 = 329; - break; - case 3: - v4 = 488; - break; - default: - v4 = v123; - break; - } - } - else - { - v4 = 12; - } - - pRenderer->DrawTextureTransparent(v4, 29, &pIcons_LOD->pTextures[v3->uTextureID]); - uPosActiveItem = pGUIWindow_CurrentMenu->GetControl(pGUIWindow_CurrentMenu->pCurrentPosActiveItem); - uPlayerCreationUI_ArrowAnim = 19 - (GetTickCount() % 500) / 25; - pRenderer->DrawTextureTransparent(uPosActiveItem->uZ - 4, uPosActiveItem->uY, pTextures_arrowl[uPlayerCreationUI_ArrowAnim]); - pRenderer->DrawTextureTransparent(uPosActiveItem->uX - 12, uPosActiveItem->uY, pTextures_arrowr[uPlayerCreationUI_ArrowAnim]); - //if (uPlayerCreationUI_ArrowAnim < 0) - // uPlayerCreationUI_ArrowAnim = 18; - v6 = pFontCreate->uFontHeight - 2; - v128 = pFontCreate->uFontHeight - 2; - memset(pText, 0, 200); - strcpy(pText, pGlobalTXT_LocalizationStrings[205]);// "Skills" - uNumLet = strlen(pText) - 1; - pOrder = uNumLet; - if ( uNumLet >= 0 ) - { - while ( 1 ) - { - v8 = toupper((unsigned __int8)pText[uNumLet]); - v9 = pOrder; - v10 = pOrder-- - 1 < 0; - pText[v9] = v8; - if ( v10 ) - break; - uNumLet = pOrder; - } - } - pOrder = 18; - v124 = 0; - uX = 32; - uY = 3 * v6 + 169; - v122 = 5 * v6 + 169; - v123 = 3 * v6 + 311; - v129 = 493; - //pPlayer = pParty->pPlayers; - v119 = 6 * v6 + 169; - //do - - //for ( pPlayer = pParty->pPlayers; (signed int)pPlayer->pName < (signed int)&pParty->pPickedItem.uNumCharges; pPlayer++) - for (int i = 0; i < 4; ++i) - { - auto player = pParty->pPlayers + i; - - //Str = pPlayer->pName; - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pOrder + 73, 100, 0, pClassNames[player->classType], 0, 0, 0); - pRenderer->DrawTextureTransparent(pOrder + 77, 50, pTexture_IC_KNIGHT[player->classType / 4]); - v11 = pGUIWindow_CurrentMenu->field_40; - if ( v11 && (v12 = pGUIWindow_CurrentMenu->ptr_1C, v12 == v124) ) - { - v13 = v11 - 1; - if ( v13 ) - { - v14 = v13 - 1; - if ( v14 ) - { - if ( v14 == 1 ) - { - pGUIWindow_CurrentMenu->field_40 = 0; - pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 124, 0, player->pName, 130, 0); - SetCurrentMenuID(MENU_NAMEPANELESC); - } - } - else - { - pGUIWindow_CurrentMenu->field_40 = 0; - v120 = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); - v126 = 0; - v133 = 0; - if ( strlen((const char *)pKeyActionMap->pPressedKeysBuffer) )//edit name - { - do - { - if ( pKeyActionMap->pPressedKeysBuffer[v133] == ' ' ) - ++v126; - ++v133; - v16 = strlen((const char *)pKeyActionMap->pPressedKeysBuffer); - } - while ( v133 < v16 ); - } - if ( v120 && v126 != v120 ) - strcpy(player->pName, (const char *)pKeyActionMap->pPressedKeysBuffer); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 0x7C, 0, player->pName, 130, 0); - *(short *)&player->field_1988[27] = 1; // - } - } - else - { - v17 = pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, 159 * (int)v12 + 18, 0x7Cu, 0, (const char *)pKeyActionMap->pPressedKeysBuffer, 120, 1); - pGUIWindow_CurrentMenu->DrawFlashingInputCursor(159 * (unsigned int)pGUIWindow_CurrentMenu->ptr_1C + v17 + 20, 124, pFontCreate); - } - } - else - { - pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder, 0x7C, 0, player->pName, 130, 0); - } - switch (player->GetRace()) - { - case 0: uRaceName = pGlobalTXT_LocalizationStrings[99]; break; // "Human" - case 1: uRaceName = pGlobalTXT_LocalizationStrings[103]; break; // "Dwarf" - case 2: uRaceName = pGlobalTXT_LocalizationStrings[106]; break; // "Goblin" - case 3: uRaceName = pGlobalTXT_LocalizationStrings[101]; break; // "Elf" - }; - strcpy(pTmpBuf, uRaceName); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontCreate, pOrder + 72, v128 + 12, 0, pTmpBuf, 130, 0); - pTextCenter = pFontCreate->AlignText_Center(0x96, pText); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + uX - 24, 291, uColor1, pText, 0, 0, 0); - uNumMight = player->GetActualMight(); - sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[144], v129, uNumMight);// "Might" - LOWORD(v24) = player->GetStatColor(0); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 169, v24, pTmpBuf, 0, 0, 0); - v25 = player->GetActualIntelligence(); - sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[116], v129, v25);// "Intellect" - LOWORD(v26) = player->GetStatColor(1); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v128 + 169, v26, pTmpBuf, 0, 0, 0); - v27 = player->GetActualWillpower(); - sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[163], v129, v27);// "Personality" - LOWORD(v28) = player->GetStatColor(2); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 2 * v128 + 169, v28, pTmpBuf, 0, 0, 0); - v29 = player->GetActualEndurance(); - sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[75], v129, v29);// "Endurance" - LOWORD(v30) = player->GetStatColor(3); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, uY, v30, pTmpBuf, 0, 0, 0); - v31 = player->GetActualAccuracy(); - sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[1], v129, v31);// "Accuracy" - LOWORD(v32) = player->GetStatColor(4); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, 4 * v128 + 169, v32, pTmpBuf, 0, 0, 0); - v33 = player->GetActualSpeed(); - sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[211], v129, v33);// "Speed" - LOWORD(v34) = player->GetStatColor(5); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v122, v34, pTmpBuf, 0, 0, 0); - v35 = player->GetActualLuck(); - sprintf(pTmpBuf, "%s\r%03d%d", pGlobalTXT_LocalizationStrings[136], v129, v35);// "Luck" - LOWORD(v36) = player->GetStatColor(6); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX, v119, v36, pTmpBuf, 0, 0, 0); - v37 = player->GetSkillIdxByOrder(0); - pTextCenter = pFontCreate->AlignText_Center(0x96u, pSkillNames[v37]); - sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v37]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 311, uColorWhite, pTmpBuf, 0, 0, 0); - v39 = player->GetSkillIdxByOrder(1); - pTextCenter = pFontCreate->AlignText_Center(0x96u, pSkillNames[v39]); - sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v39]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, v128 + 311, uColorWhite, pTmpBuf, 0, 0, 0); - v41 = player->GetSkillIdxByOrder(2); - pTextCenter = pFontCreate->AlignText_Center(150u, pSkillNames[v41]); - sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v41]); - v45 = uColorGreen; - if ( (signed int)v41 >= 37 ) - v45 = uColorTeal; - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, 2 * v128 + 311, v45, pTmpBuf, 0, 0, 0); - v46 = player->GetSkillIdxByOrder(3); - pTextCenter = pFontCreate->AlignText_Center(150u, pSkillNames[v46]); - sprintf(pTmpBuf, "\t%03u%s", pTextCenter, pSkillNames[v46]); - v50 = uColorGreen; - if ( (signed int)v46 >= 37 ) - v50 = uColorTeal; - pGUIWindow_CurrentMenu->DrawText(pFontCreate, uX - 24, v123, v50, pTmpBuf, 0, 0, 0); - //pPlayer++; - v124 = (char *)v124 + 1; - pOrder += 159; - v129 -= 158; - uX += 158; - } - - //while ( (signed int)pPlayer->pName < (signed int)&pParty->pPickedItem.uNumCharges ); - strcpy(pText, pGlobalTXT_LocalizationStrings[41]);// "Class" - v51 = strlen(pText) - 1; - pOrder = v51; - if ( v51 >= 0 ) - { - while ( 1 ) - { - v52 = &pText[v51]; - v53 = toupper((unsigned __int8)pText[v51]); - v10 = pOrder-- - 1 < 0; - *v52 = v53; - if ( v10 ) - break; - v51 = pOrder; - } - } - uClassType = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].classType; - pTextCenter = pFontCreate->AlignText_Center(193u, pText); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 324, 395, uColor1, pText, 0, 0, 0); - v57 = uColorTeal; - if ( uClassType ) - v57 = uColorWhite; - pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[0]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 417, v57, pClassNames[0], 0, 0, 0); - v61 = uColorTeal; - if ( uClassType != PLAYER_CLASS_PALADIN ) - v61 = uColorWhite; - uColorGreen = v128 + 417; - pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[12]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, v128 + 417, v61, pClassNames[12], 0, 0, 0); - v66 = uColorTeal; - if ( uClassType != PLAYER_CLASS_DRUID ) - v66 = uColorWhite; - pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[20]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 323, 2 * v128 + 417, v66, pClassNames[20], 0, 0, 0); - v71 = uColorTeal; - if ( uClassType != PLAYER_CLASS_CLERIC ) - v71 = uColorWhite; - pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[24]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 417, v71, pClassNames[24], 0, 0, 0); - v75 = uColorTeal; - if ( uClassType != PLAYER_CLASS_DRUID) - v75 = uColorWhite; - pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[28]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, uColorGreen, v75, pClassNames[28], 0, 0, 0); - v80 = uColorTeal; - if ( uClassType != PLAYER_CLASS_SORCERER ) - v80 = uColorWhite; - pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[32]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 388, 2 * v128 + 417, v80, pClassNames[32], 0, 0, 0); - v85 = uColorTeal; - if ( uClassType != PLAYER_CLASS_ARCHER ) - v85 = uColorWhite; - pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[16]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 417, v85, pClassNames[16], 0, 0, 0); - v89 = uColorTeal; - if ( uClassType != PLAYER_CLASS_MONK ) - v89 = uColorWhite; - pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[8]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, uColorGreen, v89, pClassNames[8], 0, 0, 0); - v94 = uColorTeal; - if ( uClassType != PLAYER_CLASS_THEIF ) - v94 = uColorWhite; - pTextCenter = pFontCreate->AlignText_Center(65, pClassNames[4]); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 453, 2 * v128 + 417, v94, pClassNames[4], 0, 0, 0); - pTextCenter = pFontCreate->AlignText_Center(0xECu, pGlobalTXT_LocalizationStrings[20]); // "Available Skills" - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 37, 395, uColor1, pGlobalTXT_LocalizationStrings[20], 0, 0, 0); - //pOrder = 0; - //do - for (pOrder = 0; pOrder < 9; ++pOrder) - { - pSkillId = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pOrder + 4); - strcpy(pText, pSkillNames[pSkillId]); - pLenText = strlen(pText); - v104 = 0; - if ( (signed int)pLenText > 0 ) - { - if ( pText[v104] == 32 ) - { - pText[v104] = 0; - } - else - { - while ( pText[v104] != 32 ) - //for (v104 = 0; v104 < (signed int)pLenText || pText[v104] != 32; ++v104) - { - ++v104; - if ( v104 >= (signed int)pLenText ) - break; - } - } - } - uColorGreen = -5; - if ( (signed int)v124 > 2 ) - uColorGreen = 0; - pColorText = uColorTeal; - if ( !pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].pActiveSkills[pSkillId] ) - pColorText = uColorWhite; - pTextCenter = pFontCreate->AlignText_Center(100, pText); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, 100 * (pOrder / 3) + pTextCenter + uColorGreen + 17, v128 * (pOrder % 3) + 417, pColorText, pText, 0, 0, 0); - //++pOrder; - } - //while ( pOrder < 9 ); - pTextCenter = pFontCreate->AlignText_Center(0x5C, pGlobalTXT_LocalizationStrings[30]);// "Bonus" - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 533, 394, uColor1, pGlobalTXT_LocalizationStrings[30], 0, 0, 0); - v113 = PlayerCreation_ComputeAttributeBonus(); - sprintf(pTmpBuf, "%d", v113); - pTextCenter = pFontCreate->AlignText_Center(84, pTmpBuf); - pGUIWindow_CurrentMenu->DrawText(pFontCreate, pTextCenter + 530, 410, uColorWhite, pTmpBuf, 0, 0, 0); - if ( GameUI_StatusBar_TimedStringTimeLeft > GetTickCount() ) - { - pWindow.Hint = pGlobalTXT_LocalizationStrings[412];// "Create Party cannot be completed unless you have assigned all characters 2 extra skills and have spent all of your bonus points." - if ( v113 < 0 ) - pWindow.Hint = pGlobalTXT_LocalizationStrings[413];// "You can't spend more than 50 points." - pWindow.uFrameWidth = 300; - pWindow.uFrameHeight = 100; - pWindow.uFrameX = 170; - pWindow.uFrameY = 140; - pWindow.uFrameZ = 469; - pWindow.uFrameW = 239; - pWindow.DrawMessageBox(0); - } - pRenderer->EndScene(); -} - -//----- (0049695A) -------------------------------------------------------- -void __cdecl PlayerCreationUI_Initialize() -{ - unsigned int v0; // ebx@5 - unsigned int v1; // eax@6 - int v2; // ecx@6 - unsigned int v3; // eax@8 - signed int v4; // ecx@8 - signed int uControlParam; // [sp+10h] [bp-Ch]@7 - unsigned int uControlParama; // [sp+10h] [bp-Ch]@9 - unsigned int uControlParamb; // [sp+10h] [bp-Ch]@11 - unsigned int uControlParamc; // [sp+10h] [bp-Ch]@13 - signed int uControlParamd; // [sp+10h] [bp-Ch]@15 - signed int uX; // [sp+14h] [bp-8h]@5 - unsigned int uXa; // [sp+14h] [bp-8h]@9 - unsigned int uXb; // [sp+14h] [bp-8h]@11 - unsigned int uXc; // [sp+14h] [bp-8h]@13 - signed int uXd; // [sp+14h] [bp-8h]@16 - - if ( pMessageQueue_50CBD0->uNumMessages ) - pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; - pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f); - ++pIcons_LOD->uTexturePacksCount; - if ( !pIcons_LOD->uNumPrevLoadedFiles ) - pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; - pCurrentScreen = SCREEN_PARTY_CREATION; - uPlayerCreationUI_ArrowAnim = 0; - uPlayerCreationUI_SkySliderPos = 0; - uPlayerCreationUI_SelectedCharacter = 0; - v0 = LOBYTE(pFontCreate->uFontHeight) - 2; - pTexture_IC_KNIGHT[0] = pIcons_LOD->LoadTexturePtr("IC_KNIGHT", TEXTURE_16BIT_PALETTE); - pTexture_IC_KNIGHT[1] = pIcons_LOD->LoadTexturePtr("IC_THIEF", TEXTURE_16BIT_PALETTE); - pTexture_IC_KNIGHT[2] = pIcons_LOD->LoadTexturePtr("IC_MONK", TEXTURE_16BIT_PALETTE); - pTexture_IC_KNIGHT[3] = pIcons_LOD->LoadTexturePtr("IC_PALAD", TEXTURE_16BIT_PALETTE); - pTexture_IC_KNIGHT[4] = pIcons_LOD->LoadTexturePtr("IC_ARCH", TEXTURE_16BIT_PALETTE); - pTexture_IC_KNIGHT[5] = pIcons_LOD->LoadTexturePtr("IC_RANGER", TEXTURE_16BIT_PALETTE); - pTexture_IC_KNIGHT[6] = pIcons_LOD->LoadTexturePtr("IC_CLER", TEXTURE_16BIT_PALETTE); - pTexture_IC_KNIGHT[7] = pIcons_LOD->LoadTexturePtr("IC_DRUID", TEXTURE_16BIT_PALETTE); - pTexture_IC_KNIGHT[8] = pIcons_LOD->LoadTexturePtr("IC_SORC", TEXTURE_16BIT_PALETTE); - pTexture_MAKETOP = pIcons_LOD->LoadTexturePtr("MAKETOP", TEXTURE_16BIT_PALETTE); - pTexture_MAKESKY = pIcons_LOD->LoadTexturePtr("MAKESKY", TEXTURE_16BIT_PALETTE); - for(uX=0;uX < 22;++uX ) // load PlayerPortraits texture - { - sprintf(pTmpBuf, "%s01", pPlayerPortraitsNames[uX]); - v1 = pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE); - pPlayerPortraits[uX] = &pIcons_LOD->pTextures[v1]; - - } - pTexture_PlayerFaceMask = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("FACEMASK", TEXTURE_16BIT_PALETTE)]; - pTexture_buttminu = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("buttminu", TEXTURE_16BIT_PALETTE)]; - pTexture_buttplus = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("buttplus", TEXTURE_16BIT_PALETTE)]; - pTexture_pressrigh = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("presrigh", TEXTURE_16BIT_PALETTE)]; - pTexture_presleft = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("presleft", TEXTURE_16BIT_PALETTE)]; - uControlParam = 1; - do - { - sprintf(pTmpBuf, "arrowl%d", uControlParam); - pTextures_arrowl[uControlParam] = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)]; - sprintf(pTmpBuf, "arrowr%d", uControlParam); - v3 = pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE); - v4 = uControlParam++; - pTextures_arrowr[v4] = &pIcons_LOD->pTextures[v3]; - } - while ( uControlParam < 20 ); - pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); - uControlParama = 0; - uXa = 8; - do - { - pGUIWindow_CurrentMenu->CreateButton(uXa, 120u, 145u, 25u, 1, 0, 0x3Cu, uControlParama, 0, "", 0); - uXa += 158; - ++uControlParama; - } - while ( (signed int)uXa < 640 ); - pCreationUI_BtnPressLeft[0] = pGUIWindow_CurrentMenu->CreateButton(10, 32, 11, 13, 1, 0, 0xABu, 0, 0, "", pTexture_presleft, 0); - pCreationUI_BtnPressLeft[1] = pGUIWindow_CurrentMenu->CreateButton(169, 32, 11, 13, 1, 0, 0xABu, 1, 0, "", pTexture_presleft, 0); - pCreationUI_BtnPressLeft[2] = pGUIWindow_CurrentMenu->CreateButton(327, 32, 11, 13, 1, 0, 0xABu, 2, 0, "", pTexture_presleft, 0); - pCreationUI_BtnPressLeft[3] = pGUIWindow_CurrentMenu->CreateButton(486, 32, 11, 13, 1, 0, 0xABu, 3, 0, "", pTexture_presleft, 0); - pCreationUI_BtnPressRight[0] = pGUIWindow_CurrentMenu->CreateButton(74, 32, 11, 13, 1, 0, 0xACu, 0, 0, "", pTexture_pressrigh, 0); - pCreationUI_BtnPressRight[1] = pGUIWindow_CurrentMenu->CreateButton(233, 32, 11, 13, 1, 0, 0xACu, 1, 0, "", pTexture_pressrigh, 0); - pCreationUI_BtnPressRight[2] = pGUIWindow_CurrentMenu->CreateButton(391, 32, 11, 13, 1, 0, 0xACu, 2, 0, "", pTexture_pressrigh, 0); - pCreationUI_BtnPressRight[3] = pGUIWindow_CurrentMenu->CreateButton(549, 32, 11, 13, 1, 0, 0xACu, 3, 0, "", pTexture_pressrigh, 0); - pCreationUI_BtnPressLeft2[0] = pGUIWindow_CurrentMenu->CreateButton(10, 103, 11, 13, 1, 0, 0x90u, 0, 0, "", pTexture_presleft, 0); - pCreationUI_BtnPressLeft2[1] = pGUIWindow_CurrentMenu->CreateButton(169, 103, 11, 13, 1, 0, 0x90u, 1, 0, "", pTexture_presleft, 0); - pCreationUI_BtnPressLeft2[2] = pGUIWindow_CurrentMenu->CreateButton(327, 103, 11, 13, 1, 0, 0x90u, 2, 0, "", pTexture_presleft, 0); - pCreationUI_BtnPressLeft2[3] = pGUIWindow_CurrentMenu->CreateButton(486, 103, 11, 13, 1, 0, 0x90u, 3, 0, "", pTexture_presleft, 0); - pCreationUI_BtnPressRight2[0] = pGUIWindow_CurrentMenu->CreateButton(74, 103, 11, 13, 1, 0, 0x91u, 0, 0, "", pTexture_pressrigh, 0); - pCreationUI_BtnPressRight2[1] = pGUIWindow_CurrentMenu->CreateButton(233, 103, 11, 13, 1, 0, 0x91u, 1, 0, "", pTexture_pressrigh, 0); - pCreationUI_BtnPressRight2[2] = pGUIWindow_CurrentMenu->CreateButton(391, 103, 11, 13, 1, 0, 0x91u, 2, 0, "", pTexture_pressrigh, 0); - pCreationUI_BtnPressRight2[3] = pGUIWindow_CurrentMenu->CreateButton(549, 103, 11, 13, 1, 0, 0x91u, 3, 0, "", pTexture_pressrigh, 0); - uControlParamb = 0; - uXb = 8; - do - { - pGUIWindow_CurrentMenu->CreateButton(uXb, 308, 150, v0, 1, 0, 0x48u, uControlParamb, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(uXb, v0 + 308, 150, v0, 1, 0, 0x49u, uControlParamb, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(uXb, 2 * v0 + 308, 150u, v0, 1, 0, 0x4Au, uControlParamb, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(uXb, 3 * v0 + 308, 150u, v0, 1, 0, 0x4Bu, uControlParamb, 0, "", 0); - uXb += 158; - ++uControlParamb; - } - while ( (signed int)uXb < 640 ); - pGUIWindow_CurrentMenu->CreateButton(5u, 21u, 0x99u, 0x16Du, 1, 0, 0x76u, 0, 0x31u, "", 0); - pGUIWindow_CurrentMenu->CreateButton(163u, 21u, 0x99u, 0x16Du, 1, 0, 0x76u, 1u, 0x32u, "", 0); - pGUIWindow_CurrentMenu->CreateButton(321u, 21u, 0x99u, 0x16Du, 1, 0, 0x76u, 2u, 0x33u, "", 0); - pGUIWindow_CurrentMenu->CreateButton(479u, 21u, 0x99u, 0x16Du, 1, 0, 0x76u, 3u, 0x34u, "", 0); - uXc = 23; - uControlParamc = 2; - do - { - pGUIWindow_CurrentMenu->CreateButton(uXc, 169, 120, 20, 1, 0, 0, uControlParamc - 2, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(uXc, v0 + 169, 120, 20, 1, 0, 0, uControlParamc - 1, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(uXc, 2 * v0 + 169, 120, 20, 1, 0, 0, uControlParamc, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(uXc, 3 * v0 + 169, 120, 20, 1, 0, 0, uControlParamc + 1, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(uXc, 4 * v0 + 169, 120, 20, 1, 0, 0, uControlParamc + 2, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(uXc, 5 * v0 + 169, 120, 20, 1, 0, 0, uControlParamc + 3, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(uXc, 6 * v0 + 169, 120, 20, 1, 0, 0, uControlParamc + 4, 0, "", 0); - uControlParamc += 7; - uXc += 158; - } - while ( (signed int)uControlParamc < 30 ); - pGUIWindow_CurrentMenu->_41D08F(28, 0, 7, 40); - pGUIWindow_CurrentMenu->CreateButton(323, 417, 65, v0, 1, 0, 0x41, 0, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(323, v0 + 417, 65, v0, 1, 0, 0x41, 0xC, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(323, 2 * v0 + 417, 65, v0, 1, 0, 0x41, 0x14, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(388, 417, 65, v0, 1, 0, 0x41, 0x18, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(388, v0 + 417, 65, v0, 1, 0, 0x41, 0x1C, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(388, 2 * v0 + 417, 65, v0, 1, 0, 0x41, 0x20, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(453, 417, 65, v0, 1, 0, 0x41, 0x10, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(453, v0 + 417, 65, v0, 1, 0, 0x41, 8, 0, "", 0); - pGUIWindow_CurrentMenu->CreateButton(453, 2 * v0 + 417, 65, v0, 1, 0, 0x41, 4, 0, "", 0); - uControlParamd = 0; - do - { - uXd = -5; - if ( uControlParamd <= 3 ) - uXd = 0; - pGUIWindow_CurrentMenu->CreateButton(100 * (uControlParamd / 3) + uXd + 17, v0 * (uControlParamd % 3) + 417, 100, v0, 1, 0, 0x40, - uControlParamd, 0, "", 0); - ++uControlParamd; - } - while ( uControlParamd < 9 ); - pPlayerCreationUI_BtnOK = pGUIWindow_CurrentMenu->CreateButton(580, 431, 51, 39, 1, 0, 0x42, 0, 0xD, "", - (Texture *)(uTextureID_BUTTMAKE != -1 ? &pIcons_LOD->pTextures[uTextureID_BUTTMAKE] : 0), 0); - pPlayerCreationUI_BtnReset = pGUIWindow_CurrentMenu->CreateButton(527, 431, 51, 39, 1, 0, 0x43, 0, 0x43, "", - (Texture *)(uTextureID_BUTTMAKE2 != -1 ? &pIcons_LOD->pTextures[uTextureID_BUTTMAKE2] : 0), 0); - pPlayerCreationUI_BtnMinus = pGUIWindow_CurrentMenu->CreateButton(523, 393, 20, 35, 1, 0, 0x3F, 0, 0x2D, "", pTexture_buttminu, 0); - pPlayerCreationUI_BtnPlus = pGUIWindow_CurrentMenu->CreateButton(613, 393, 20, 35, 1, 0, 0x3E, 1, 0x2B, "", pTexture_buttplus, 0); - pFontCChar = LoadFont("cchar.fnt", "FONTPAL", NULL); -} -// 4E28F8: using guessed type int pCurrentScreen; - -//----- (0049750E) -------------------------------------------------------- -void __cdecl DeleteCCharFont() -{ - pAllocator->FreeChunk(pFontCChar); - pFontCChar = 0; -} -//----- (00497526) -------------------------------------------------------- -bool __cdecl PlayerCreationUI_Loop() -{ - //RGBTexture *pTexture; // ebx@1 - UINT v1; // esi@1 - unsigned int v2; // ecx@3 - LONG uMouseX; // edi@6 - LONG uMouseY; // eax@6 - GUIButton *pControlsHead; // edx@6 - //unsigned int pNumMessage; // ecx@7 - int pControlParam; // esi@12 - signed int v8; // edi@30 - int v9; // edx@31 - char *v10; // ebx@37 - Player *v11; // esi@38 - //signed int uSpellBookPageCount; // ecx@40 - int v13; // eax@40 - //signed int uSkillIdx; // eax@45 - int v15; // eax@70 - signed int v16; // ecx@70 - //unsigned int v18; // [sp-4h] [bp-84h]@48 - ItemGen item; // [sp+Ch] [bp-74h]@37 - char v20[32]; // [sp+30h] [bp-50h]@29 - //char v21; // [sp+31h] [bp-4Fh]@29 - //__int16 v22; // [sp+4Dh] [bp-33h]@29 - char v23; // [sp+4Fh] [bp-31h]@29 - MSG Msg; // [sp+50h] [bp-30h]@17 - POINT v25; // [sp+6Ch] [bp-14h]@6 - bool v26; // [sp+74h] [bp-Ch]@1 - //POINT v24; // [sp+78h] [bp-8h]@6 - //Player *pPlayer; - - //pTexture = &pTexture_PCX; - v1 = 0; - v26 = 0; - pTexture_PCX.Release(); - pTexture_PCX.Load("makeme.pcx", 0); - if (pAsyncMouse) - pAsyncMouse->Resume(); - v2 = 6; - pGUIWindow_CurrentMenu->field_40 = 0; -//LABEL_27: - SetCurrentMenuID((MENU_STATE)v2); - while ( GetCurrentMenuID() == MENU_CREATEPARTY ) - { - if ( pAsyncMouse != (void *)v1 ) - pAsyncMouse->_46B736_consume_click_lists(1); - uMouseX = pMouse->GetCursorPos(&v25)->x; - uMouseY = pMouse->GetCursorPos(&v25)->y; - pControlsHead = pGUIWindow_CurrentMenu->pControlsHead; - - //does nothing actually - /*if ( pControlsHead != (GUIButton *)v1 ) - { - pNumMessage = pMessageQueue_50CBD0->uNumMessages; - do - { - if ( uMouseX >= (signed int)pControlsHead->uX && uMouseX <= (signed int)pControlsHead->uZ - && uMouseY >= (signed int)pControlsHead->uY && uMouseY <= (signed int)pControlsHead->uW )//mouse movement - { - pControlParam = pControlsHead->uControlParam; - pMessageQueue_50CBD0->AddMessage((UIMessageType)pControlsHead->field_1C, pControlParam, 0); - v1 = 0; - } - pControlsHead = pControlsHead->pNext; - } - while ( pControlsHead != (GUIButton *)v1 ); - }*/ - - while ( PeekMessageA(&Msg, (HWND)v1, v1, v1, PM_REMOVE) ) - { - if ( Msg.message == WM_QUIT ) - Game_DeinitializeAndTerminate(0); - TranslateMessage(&Msg); - DispatchMessageA(&Msg); - } - if ( BYTE1(dword_6BE364_game_settings_1) & 1 ) - { - WaitMessage(); - } - else - { - PlayerCreationUI_Draw(); - GUI_MainMenuMessageProc(); - pRenderer->BeginScene(); - GUI_UpdateWindows(); - pRenderer->EndScene(); - pRenderer->Present(); - if ( uGameState == 1 ) - { - v26 = 1; - v2 = 0; - //goto LABEL_27; - SetCurrentMenuID((MENU_STATE)v2); - continue; - } - if ( uGameState == 6 ) - { - uGameState = v1; - v2 = 1; - //goto LABEL_27; - SetCurrentMenuID((MENU_STATE)v2); - continue; - } - } - } - pTexture_PCX.Release(); - pGUIWindow_CurrentMenu->Release(); - pIcons_LOD->_4114F2(); - - memset(v20, 0, 32); - do - { - v8 = 0; - do - { - v9 = rand() % 32; - if ( !v20[v9] ) - break; - ++v8; - } - while ( v8 < 10 ); - if ( v8 == 10 ) - { - v9 = 0; - if ( v20[0] ) - { - do - ++v9; - while ( v20[v9] ); - } - } - pParty->field_854[v1++] = v9; - v20[v9] = 1; - } - while ( (signed int)v1 < 32 ); - //v10 = (char *)&pParty->pPlayers[0].sResMagicBase; - - item.Reset(); - //for ( pPlayer = &pParty->pPlayers[0]; pPlayer < &pParty->pPlayers[4]; pPlayer++) - for (uint i = 0; i < 4; ++i) - { - auto player = &pParty->pPlayers[i]; - //v11 = pPlayer; - if (player->classType == PLAYER_CLASS_KNIGHT) - player->sResMagicBase = 10; - //*((short *)v10 + 400) = 0; - player->pPlayerBuffs[22].uExpireTime = 0; - for (uint j = 0; j < 9; j++) - { - if (player->pActiveSkills[PLAYER_SKILL_FIRE + j]) - { - player->lastOpenedSpellbookPage = j; - break; - } - } - pItemsTable->GenerateItem(2, 40, &item); - player->AddItem2(-1, &item); - //uSkillIdx = 0; - //v24.y = 0; - - player->sHealth = player->GetMaxHealth(); - player->sMana = player->GetMaxMana(); - for (uint j = 0; j < 37; ++j) - { - if (!player->pActiveSkills[j]) - continue; - - switch (j) - { - case PLAYER_SKILL_STAFF: player->AddItem(-1, 61); break; - case PLAYER_SKILL_SWORD: player->AddItem(-1, 1); break; - case PLAYER_SKILL_DAGGER: player->AddItem(-1, 15); break; - case PLAYER_SKILL_AXE: player->AddItem(-1, 23); break; - case PLAYER_SKILL_SPEAR: player->AddItem(-1, 31); break; - case PLAYER_SKILL_BOW: player->AddItem(-1, 47); break; - case PLAYER_SKILL_MACE: player->AddItem(-1, 50); break; - case PLAYER_SKILL_BLASTER: assert(false); break; - case PLAYER_SKILL_SHIELD: player->AddItem(-1, 84); break; - case PLAYER_SKILL_LEATHER: player->AddItem(-1, 66); break; - case PLAYER_SKILL_CHAIN: player->AddItem(-1, 71); break; - case PLAYER_SKILL_PLATE: player->AddItem(-1, 76); break; - case PLAYER_SKILL_FIRE: - player->AddItem(-1, 0x191); - player->spellbook.pFireSpellbook.bIsSpellAvailable[0] = true; - break; - case PLAYER_SKILL_AIR: - player->AddItem(-1, 0x19C); - player->spellbook.pAirSpellbook.bIsSpellAvailable[0] = true; - break; - case PLAYER_SKILL_WATER: - player->AddItem(-1, 0x1A7); - player->spellbook.pWaterSpellbook.bIsSpellAvailable[0] = true; - break; - case PLAYER_SKILL_EARTH: - player->AddItem(-1, 0x1B2); - player->spellbook.pEarthSpellbook.bIsSpellAvailable[0] = true; - break; - case PLAYER_SKILL_SPIRIT: - player->AddItem(-1, 0x1BD); - player->spellbook.pSpiritSpellbook.bIsSpellAvailable[0] = true; - break; - case PLAYER_SKILL_MIND: - player->AddItem(-1, 0x1C8); - player->spellbook.pMindSpellbook.bIsSpellAvailable[0] = true; - break; - case PLAYER_SKILL_BODY: - player->AddItem(-1, 0x1D3); - player->spellbook.pBodySpellbook.bIsSpellAvailable[0] = true; - break; - case PLAYER_SKILL_LIGHT: - case PLAYER_SKILL_DARK: - case PLAYER_SKILL_DIPLOMACY: - assert(false); - break; - case PLAYER_SKILL_ITEM_ID: - case PLAYER_SKILL_REPAIR: - case PLAYER_SKILL_MEDITATION: - case PLAYER_SKILL_PERCEPTION: - case PLAYER_SKILL_TRAP_DISARM: - case PLAYER_SKILL_LEARNING: - player->AddItem(-1, 0xDC); - player->AddItem(-1, 5 * (rand() % 3 + 40)); - break; - case PLAYER_SKILL_DODGE: player->AddItem(-1, 115); break; - case PLAYER_SKILL_UNARMED: player->AddItem(-1, 110); break; - default: - break; - } - - for (uint k = 0; k < 138; k++) - { - if (&player->pInventoryItems[k]) - player->pInventoryItems[k].SetIdentified(); - } - } - } - - pAudioPlayer->StopChannels(-1, -1); - if (pAsyncMouse) - pAsyncMouse->Suspend(); - return v26; -} - -//----- (004979D2) -------------------------------------------------------- -MENU_STATE __cdecl CreditsMenu__Loop() -{ - char *v0; // eax@5 - char *v1; // edi@5 - FILE *pFile; // eax@5 - unsigned int pSize; // esi@7 - GUIFont *pFont; // edx@9 - GUIFont *pFont2; // ecx@9 - __int16 pHeight; // ax@9 - void *v7; // eax@9 - unsigned int pNumPixels; // ST2C_4@9 - unsigned int teal; // eax@9 - unsigned int v10; // ST2C_4@19 - MSG Msg; // [sp+84h] [bp-B8h]@10 - int v17; // [sp+A0h] [bp-9Ch]@9 - int pX; // [sp+A4h] [bp-98h]@9 - unsigned int pY; // [sp+A8h] [bp-94h]@9 - int v20; // [sp+ACh] [bp-90h]@9 - int a4; // [sp+B0h] [bp-8Ch]@9 - int pColor2; // [sp+F8h] [bp-44h]@9 - int pColor1; // [sp+FCh] [bp-40h]@9 - int a5; // [sp+128h] [bp-14h]@1 - char *pString; // [sp+12Ch] [bp-10h]@9 - char *ptr; // [sp+130h] [bp-Ch]@5 - GUIFont *pFontQuick; // [sp+134h] [bp-8h]@1 - GUIFont *pFontCChar; // [sp+138h] [bp-4h]@1 - RGBTexture pTexture; // [sp+54h] [bp-E8h]@1 - RGBTexture pTexture2; // [sp+100h] [bp-3Ch]@1 - Texture pTexture3; // [sp+Ch] [bp-130h]@5 - - a5 = 0; - pFontQuick = LoadFont("quick.fnt", "FONTPAL", NULL); - pFontCChar = LoadFont("cchar.fnt", "FONTPAL", NULL); - if ( pMessageQueue_50CBD0->uNumMessages ) - pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; - ++pIcons_LOD->uTexturePacksCount; - if ( !pIcons_LOD->uNumPrevLoadedFiles ) - pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; - dword_A74C88 = 0; - pAudioPlayer->PlayMusicTrack(MUSIC_Credits); - pTexture.Load("mm6title.pcx", 0); - v0 = (char *)pEvents_LOD->LoadRaw("credits.txt", 0); - v1 = v0; - ptr = v0; - pFile = pEvents_LOD->FindContainer("credits.txt", 0); - if ( !pFile ) - Abortf(pGlobalTXT_LocalizationStrings[63]); // "Might and Magic VII is having trouble loading files. - // Please re-install to fix this problem. Note: Re-installing will not destroy your save games." - fread(&pTexture3, 1, 0x30, pFile); - pSize = pTexture3.uDecompressedSize; - if ( !pTexture3.uDecompressedSize ) - pSize = pTexture3.uTextureSize; - memset(&pTexture3, 0, 0x48); - pFont = pFontCChar; - pFont2 = pFontQuick; - v1[pSize] = 0; - v20 = 250; - a4 = 440; - pX = 389; - pY = 19; - pTexture2.uWidth = 250; - pHeight = pFont2->GetStringHeight2(pFont, v1, (int)&pX, 0, 1); - pTexture2.uHeight = pHeight + 2 * a4; - pTexture2.uNumPixels = (signed __int16)pTexture2.uWidth * (signed __int16)pTexture2.uHeight; - v7 = pAllocator->AllocNamedChunk(pTexture2.pPixels, 2 * pTexture2.uNumPixels, "scrollermap"); - pNumPixels = pTexture2.uNumPixels; - pTexture2.pPixels = (unsigned __int16 *)v7; - teal = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0xFFu); - fill_pixels_fast(teal, pTexture2.pPixels, pNumPixels); - pTexture2.field_20 = 0; - pTexture2.field_22 = 0; - pColor1 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0x70u, 0x8Fu, 0xFEu); - pColor2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xECu, 0xE6u, 0x9Cu); - pString = (char *)operator new(2 * pSize); - strncpy(pString, ptr, pSize); - pString[pSize]=0; - pFontQuick->_44D2FD_prolly_draw_credits_entry(pFontCChar, 0, a4, (signed __int16)pTexture2.uWidth, (signed __int16)pTexture2.uHeight, pColor1, - pColor2, pString, pTexture2.pPixels, (signed __int16)pTexture2.uWidth); - free(pString); - pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, (int)ptr); - pWindow_MainMenu->CreateButton(0, 0, 0, 0, 1, 0, 0x71u, 0, 0x1Bu, "", 0); - pCurrentScreen = SCREEN_CREATORS; - SetCurrentMenuID(MENU_CREDITSPROC); - do - { - while ( PeekMessageA(&Msg, 0, 0, 0, 1) ) - { - if ( Msg.message == 18 ) - Game_DeinitializeAndTerminate(0); - TranslateMessage(&Msg); - DispatchMessageA(&Msg); - } - if ( BYTE1(dword_6BE364_game_settings_1) & 1 ) - { - WaitMessage(); - } - else - { - if (pAsyncMouse) - pAsyncMouse->_46B736_consume_click_lists(1); - pRenderer->BeginScene(); - pRenderer->DrawTextureRGB(0, 0, &pTexture); - pRenderer->Clip(pX, pY, pX + v20, pY + a4); - pRenderer->_4A5D33(pX, pY, 0, a5, &pTexture2); - pRenderer->ResetClip(); - pRenderer->EndScene(); - ++a5; - if ( a5 >= (signed __int16)pTexture2.uHeight ) - SetCurrentMenuID(MENU_MAIN); - pRenderer->Present(); - pCurrentScreen = SCREEN_GAME;//Ritor1: temporarily, must be corrected GUI_MainMenuMessageProc() - GUI_MainMenuMessageProc(); - } - } - while ( GetCurrentMenuID() == MENU_CREDITSPROC ); - pAudioPlayer->_4AA258(1); - pAllocator->FreeChunk(ptr); - pAllocator->FreeChunk(pFontQuick); - pAllocator->FreeChunk(pFontCChar); - pWindow_MainMenu->Release(); - pIcons_LOD->_4114F2(); - pTexture.Release(); - pTexture2.Release(); - return MENU_MAIN; // return MENU_Main -} + + //----- (0049B04D) -------------------------------------------------------- int stru154::_49B04D(ODMFace *a2, BSPVertexBuffer *a3) diff -r f39d5902c85a -r 70c5a87a1307 mm7_5.cpp --- a/mm7_5.cpp Wed Mar 20 17:48:51 2013 +0600 +++ b/mm7_5.cpp Wed Mar 20 17:49:15 2013 +0600 @@ -59,7 +59,7 @@ -static char static_sub_417BB5_out_string[1200]; // static to a file, not sub actually + @@ -6222,340 +6222,6 @@ } } -//----- (0043BCA7) -------------------------------------------------------- -void CharacterUI_LoadPaperdollTextures() -{ - int v0; // edi@7 - enum CHARACTER_RACE pRace; // ebx@7 - signed int pSex; // eax@7 - int v3; // ebx@10 - Player *pPlayer; // edi@12 - unsigned __int8 v5; // cl@12 - int v6; // edi@16 - unsigned int v7; // eax@16 - Player *pPlayer2; // ebx@16 - char *v9; // ebx@16 - char v10; // al@16 - signed int v11; // edi@21 - Player *pPlayer3; // ebx@23 - //Player *pPlayer4; // edi@29 - //int v14; // ebp@29 - //stru331 *v15; // edi@65 - //signed int v16; // ebx@66 - //unsigned int v17; // eax@67 - //unsigned int *v18; // ecx@67 - //unsigned int *v19; // ebx@68 - //int v20; // edi@73 - int v21; // ebp@73 - unsigned int v22; // eax@76 - int v23; // ecx@76 - unsigned int v24; // eax@78 - int v25; // ecx@78 - int v26; // ebx@79 - unsigned int v27; // eax@80 - int v28; // ecx@80 - //int result; // eax@83 - int v30; // [sp+10h] [bp-28h]@5 - //signed int v31; // [sp+10h] [bp-28h]@68 - signed int v32; // [sp+10h] [bp-28h]@75 - signed int v33; // [sp+10h] [bp-28h]@77 - int v34; // [sp+10h] [bp-28h]@79 - //char *v35; // [sp+14h] [bp-24h]@65 - int v36; // [sp+14h] [bp-24h]@75 - int v37; // [sp+14h] [bp-24h]@77 - signed int v38; // [sp+14h] [bp-24h]@79 - //unsigned int *v39; // [sp+18h] [bp-20h]@66 - int *v40; // [sp+18h] [bp-20h]@73 - //unsigned int *v41; // [sp+1Ch] [bp-1Ch]@73 - int v42; // [sp+20h] [bp-18h]@6 - int v43; // [sp+20h] [bp-18h]@73 - char pContainer[128]; // [sp+24h] [bp-14h]@12 - - uTextureID_MAGNIF_B = pIcons_LOD->LoadTexture("MAGNIF-B", TEXTURE_16BIT_PALETTE); - //if ( !pParty->uAlignment || pParty->uAlignment == 1 || pParty->uAlignment == 2 ) - uTextureID_BACKDOLL = pIcons_LOD->LoadTexture("BACKDOLL", TEXTURE_16BIT_PALETTE); - uTextureID_507B04 = uTextureID_right_panel; - v30 = 0; - uTextureID_BACKHAND = pIcons_LOD->LoadTexture("BACKHAND", TEXTURE_16BIT_PALETTE); - uTextureID_5118C8 = uExitCancelTextureId; - do - { - v42 = v30 + 1; - if ( sub_43EE77_ProbablyIfUnderwaterSuitIsEquipped(v30 + 1) ) - { - v0 = v30; - pRace = pPlayers[v30 + 1]->GetRace(); - pSex = pPlayers[v30 + 1]->GetSexByVoice(); - if ( pRace && pRace != 1 && pRace != 2 )//race == 3 - v3 = (pSex != 0) + 3; - else - v3 = (pSex != 0) + 1; - wsprintfA(pContainer, "pc23v%dBod", v3); - papredoll_dbods[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);//Body texture - wsprintfA(pContainer, "pc23v%dlad", v3); - papredoll_dlads[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand - wsprintfA(pContainer, "pc23v%dlau", v3); - papredoll_dlaus[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Hand2 - wsprintfA(pContainer, "pc23v%drh", v3); - papredoll_drhs[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Right Hand - wsprintfA(pContainer, "pc23v%dlh", v3); - papredoll_dlhs[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE);// Left Fist - wsprintfA(pContainer, "pc23v%dlhu", v3); - papredoll_dlhus[v0] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); // Left Fist 2 - pPlayer = pPlayers[v0 + 1]; - v5 = pPlayer->uFace; - if ( v5 == 12 || v5 == 13 ) - papredoll_dbrds[(char)v5] = 0; - papredoll_flying_feet[pPlayer->uFace] = 0; - IsPlayerWearingWatersuit[v30 + 1] = 1; - } - else - { - v6 = v30; - papredoll_dbods[v30] = pIcons_LOD->LoadTexture(dbod_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE); - papredoll_dlads[v30] = pIcons_LOD->LoadTexture(dlad_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE); - papredoll_dlaus[v30] = pIcons_LOD->LoadTexture(dlau_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE); - papredoll_drhs[v30] = pIcons_LOD->LoadTexture(drh_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE); - papredoll_dlhs[v30] = pIcons_LOD->LoadTexture(dlh_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE); - v7 = pIcons_LOD->LoadTexture(dlhu_texnames_by_face[pPlayers[v30 + 1]->uFace], TEXTURE_16BIT_PALETTE); - pPlayer2 = pPlayers[v30 + 1]; - papredoll_dlhus[v30] = v7; - v9 = (char *)&pPlayer2->uFace; - v10 = *v9; - if ( *v9 == 12 || v10 == 13 ) - { - wsprintfA(pContainer, "pc%02dbrd", v10 + 1); - v9 = (char *)&pPlayers[v6 + 1]->uFace; - papredoll_dbrds[*v9] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - } - wsprintfA(pContainer, "item281pc%02d", *v9 + 1); - papredoll_flying_feet[pPlayers[v6 + 1]->uFace] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - IsPlayerWearingWatersuit[v30 + 1] = 0; - } - ++v30; - } - while ( v42 < 4 ); - uTextureID_ar_up_up = pIcons_LOD->LoadTexture("ar_up_up", TEXTURE_16BIT_PALETTE); - uTextureID_ar_up_dn = pIcons_LOD->LoadTexture("ar_up_dn", TEXTURE_16BIT_PALETTE); - uTextureID_ar_dn_up = pIcons_LOD->LoadTexture("ar_dn_up", TEXTURE_16BIT_PALETTE); - uTextureID_ar_dn_dn = pIcons_LOD->LoadTexture("ar_dn_dn", TEXTURE_16BIT_PALETTE); - papredoll_dbrds[9] = pIcons_LOD->LoadTexture("ib-cd1-d", TEXTURE_16BIT_PALETTE); - papredoll_dbrds[7] = pIcons_LOD->LoadTexture("ib-cd2-d", TEXTURE_16BIT_PALETTE); - papredoll_dbrds[5] = pIcons_LOD->LoadTexture("ib-cd3-d", TEXTURE_16BIT_PALETTE); - papredoll_dbrds[3] = pIcons_LOD->LoadTexture("ib-cd4-d", TEXTURE_16BIT_PALETTE); - papredoll_dbrds[1] = pIcons_LOD->LoadTexture("ib-cd5-d", TEXTURE_16BIT_PALETTE); - v11 = 0; - do - { - byte_5111C0[v11] = 0; - if ( pParty->pPickedItem.uItemID != v11 + 66 ) - { - pPlayer3 = pParty->pPlayers; - while ( !sub_43EE15_player_has_item(v11 + 66, pPlayer3, 0) ) - { - ++pPlayer3; - if ( (signed int)pPlayer3 >= (signed int)pParty->pHirelings ) - goto LABEL_28; - } - } - byte_5111C0[v11] = 1; -LABEL_28: - ++v11; - } - while ( v11 < 54 ); - - memset(byte_5111F6, 0, 16); - for (uint i = 0; i < 4; ++i) - { - auto player = pParty->pPlayers + i; - - if (sub_43EE15_player_has_item(ITEM_ARTICACT_GOVERNONS_ARMOR, player, 1)) byte_5111F6[0] = 1; - if (sub_43EE15_player_has_item(ITEM_ARTIFACT_YORUBA, player, 1)) byte_5111F6[1] = 1; - if (sub_43EE15_player_has_item(ITEM_RELIC_HARECS_LEATHER, player, 1)) byte_5111F6[2] = 1; - if (sub_43EE15_player_has_item(ITEM_ARTIFACT_LEAGUE_BOOTS, player, 1)) byte_5111F6[3] = 1; - if (sub_43EE15_player_has_item(ITEM_RELIC_TALEDONS_HELM, player, 1)) byte_5111F6[4] = 1; - if (sub_43EE15_player_has_item(ITEM_RELIC_SCHOLARS_CAP, player, 1)) byte_5111F6[5] = 1; - if (sub_43EE15_player_has_item(ITEM_RELIC_PHYNAXIAN_CROWN, player, 1)) byte_5111F6[6] = 1; - if (sub_43EE15_player_has_item(ITEM_ARTIFACT_MINDS_EYE, player, 1)) byte_5111F6[7] = 1; - if (sub_43EE15_player_has_item(ITEM_RARE_SHADOWS_MASK, player, 1)) byte_5111F6[8] = 1; - if (sub_43EE15_player_has_item(ITEM_RILIC_TITANS_BELT, player, 1)) byte_5111F6[9] = 1; - if (sub_43EE15_player_has_item(ITEM_ARTIFAT_HEROS_BELT, player, 1)) byte_5111F6[10] = 1; - if (sub_43EE15_player_has_item(ITEM_RELIC_TWILIGHT, player, 1)) byte_5111F6[11] = 1; - if (sub_43EE15_player_has_item(ITEM_ARTIFACT_CLOAK_OF_THE_SHEEP, player, 1)) byte_5111F6[12] = 1; - if (sub_43EE15_player_has_item(ITEM_RARE_SUN_CLOAK, player, 1)) byte_5111F6[13] = 1; - if (sub_43EE15_player_has_item(ITEM_RARE_MOON_CLOAK, player, 1)) byte_5111F6[14] = 1; - if (sub_43EE15_player_has_item(ITEM_RARE_VAMPIRES_CAPE, player, 1)) byte_5111F6[15] = 1; - if (sub_43EE15_player_has_item(ITEM_ELVEN_CHAINMAIL, player, 1)) byte_5111F6[16] = 1; - } - - //v14 = 1; - //v15 = &stru_511698.field_2C; - //v35 = (char *)&stru_511718.field_18; - for (uint i = 0; i < 2; ++i) - { - //v16 = 0; - //v39 = (unsigned int *)(v35 - 24); - for (uint j = 0; j < 5; ++j) - { - _43C91D_FormItemTextureFilename(pContainer, j + 100, i + 1, 0); - //v17 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - //++v16; - //v18 = v39; - //++v39; - //*v18 = v17; - stru_511718[i].texids[j] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - } - //while ( v16 < 5 ); - - //*(int *)v35 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 535, i + 1, 0); - stru_511718[i].texid2 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - - //v31 = 0; - //v19 = (unsigned int *)((char *)v15 - 44); - for (uint j = 0; j < 11; ++j) - { - _43C91D_FormItemTextureFilename(pContainer, j + 89, i + 1, 0); - //*v19 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - //++v19; - stru_511698[i].texids[j] = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - } - //while ( v31 < 11 ); - - _43C91D_FormItemTextureFilename(pContainer, 521, i + 1, 0); - stru_511698[i].texid1 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 522, i + 1, 0); - stru_511698[i].texid2 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 523, i + 1, 0); - stru_511698[i].texid3 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 532, i + 1, 0); - stru_511698[i].texid4 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 544, i + 1, 0); - stru_511698[i].texid5 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - if ( _43ED6F_check_party_races(true) ) - papredoll_dbrds[11] = pIcons_LOD->LoadTexture("item092v3", TEXTURE_16BIT_PALETTE); - //v35 += 28; - //++v14; - //++v15; - } - //while ( v14 - 1 < 2 ); - - v43 = 0; - //v20 = 1; - v40 = &dword_511638[0][5]; - v21 = (int)paperdoll_array_511290[0][13]; - //v41 = (unsigned int *)&stru_511718.texid1; - for (uint i = 0; i < 4; ++i) - { - if ( sub_43EDB9_get_some_race_sex_relation_2(i) ) - { - _43C91D_FormItemTextureFilename(pContainer, 524, i + 1, 0); - v32 = 66; - stru_511718[i].texid1 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - v36 = v21 - 152; - do - { - _43C91D_FormItemTextureFilename(pContainer, v32, i + 1, 0); - *(int *)(v36 - 4) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, v32, i + 1, 1); - *(int *)v36 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, v32, i + 1, 2); - v22 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - v23 = v36; - v36 += 12; - ++v32; - *(int *)(v23 + 4) = v22; - } - while ( v32 - 66 < 13 ); - _43C91D_FormItemTextureFilename(pContainer, 516, i + 1, 0); - *(int *)v21 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 516, i + 1, 1); - *(int *)(v21 + 4) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 516, i + 1, 2); - *(int *)(v21 + 8) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 505, i + 1, 0); - *(int *)(v21 + 12) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 505, i + 1, 1); - *(int *)(v21 + 16) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 505, i + 1, 2); - *(int *)(v21 + 20) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 504, i + 1, 0); - *(int *)(v21 + 24) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 504, i + 1, 1); - *(int *)(v21 + 28) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 504, i + 1, 2); - *(int *)(v21 + 32) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 533, i + 1, 0); - *(int *)(v21 + 36) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 533, i + 1, 1); - *(int *)(v21 + 40) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 533, i + 1, 2); - *(int *)(v21 + 44) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - v33 = 0; - v37 = (int)(v40 - 5); - do - { - _43C91D_FormItemTextureFilename(pContainer, v33 + 115, i + 1, 0); - v24 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - ++v33; - v25 = v37; - v37 += 4; - *(int *)v25 = v24; - } - while ( v33 < 5 ); - _43C91D_FormItemTextureFilename(pContainer, 512, i + 1, 0); - v26 = v43; - v38 = 105; - v34 = v43; - *v40 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - do - { - _43C91D_FormItemTextureFilename(pContainer, v38, i + 1, 0); - *(int *)((char *)paperdoll_array_511828 + v34) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, v38, i + 1, 1); - v27 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - v28 = v34; - v34 += 4; - ++v38; - *(int *)((char *)dword_511788 + v28) = v27; - } - while ( v38 - 105 < 5 ); - _43C91D_FormItemTextureFilename(pContainer, 525, i + 1, 0); - *(int *)((char *)&paperdoll_array_511828[0][5] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 530, i + 1, 0); - *(int *)((char *)&paperdoll_array_511828[0][6] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 547, i + 1, 0); - *(int *)((char *)&paperdoll_array_511828[0][7] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 548, i + 1, 0); - *(int *)((char *)&paperdoll_array_511828[0][8] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 550, i + 1, 0); - *(int *)((char *)&paperdoll_array_511828[0][9] + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 525, i + 1, 1); - *(int *)((char *)&dword_51179C + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 530, i + 1, 1); - *(int *)((char *)&dword_5117A0 + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 547, i + 1, 1); - *(int *)((char *)&dword_5117A4 + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 548, i + 1, 1); - *(int *)((char *)&dword_5117A8 + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - _43C91D_FormItemTextureFilename(pContainer, 550, i + 1, 1); - *(int *)((char *)&dword_5117AC + v43) = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - } - else - { - v26 = v43; - } - //v41 += 7; - v40 += 6; - v21 += 204; - //++v20; - //result = v20 - 1; - v43 = v26 + 40; - } - //while ( v20 - 1 < 4 ); - //return result; -} - //----- (0043C91D) -------------------------------------------------------- @@ -6761,2217 +6427,7 @@ return result; } -//----- (0043CC7C) -------------------------------------------------------- -void __fastcall CharacterUI_DrawPaperdoll(unsigned int uPlayerID) -{ - //Player **ppPlayer; // esi@1 - Player *pPlayer; // ebx@1 - //enum CHARACTER_RACE pRace; // edi@1 - signed int pSex; // eax@1 - //int v5; // edi@4 - unsigned int v6; // ecx@9 - int v7; // ecx@10 - unsigned int v8; // eax@14 - int v9; // eax@15 - int v10; // edx@15 - int v11; // ecx@15 - int v12; // eax@15 - unsigned int v13; // edi@15 - unsigned int v14; // ebx@18 - int v15; // ecx@18 - Texture *v16; // ebp@27 - double v17; // st7@29 - int v18; // edi@30 - char *v19; // eax@30 - Texture *v20; // edi@31 - unsigned int v21; // eax@37 - int v22; // edi@38 - int v23; // eax@38 - int v24; // ebx@38 - int v25; // eax@38 - LODFile_IconsBitmaps *v26; // ecx@42 - Texture *v27; // edi@51 - double v28; // st7@51 - char v29; // zf@54 - char *v30; // eax@54 - unsigned int v31; // eax@59 - int v32; // edx@60 - int v33; // eax@65 - int v34; // eax@74 - int v35; // ebx@74 - unsigned int v36; // ecx@74 - int v37; // eax@74 - LODFile_IconsBitmaps *v38; // ecx@78 - Texture *v39; // edi@85 - double v40; // st7@87 - int v41; // edi@88 - Texture *v42; // edi@89 - unsigned int v43; // eax@93 - int v44; // edx@94 - int v45; // eax@98 - int v46; // eax@106 - int v47; // ecx@106 - int v48; // ebx@106 - int v49; // eax@106 - LODFile_IconsBitmaps *v50; // ecx@110 - Texture *v51; // edi@117 - double v52; // st7@119 - int v53; // edi@120 - Texture *v54; // edi@121 - char *v55; // eax@122 - unsigned int v56; // eax@127 - int v57; // edi@128 - int v58; // ecx@128 - int v59; // ebx@129 - int v60; // ecx@132 - int v61; // eax@134 - int v62; // ecx@136 - Texture *v63; // edi@145 - double v64; // st7@147 - int v65; // edi@148 - char *v66; // eax@148 - Texture *v67; // edi@149 - //Player *v68; // ebx@155 - unsigned int v69; // edx@155 - int v70; // edx@156 - unsigned int v71; // eax@160 - int v72; // edi@161 - int v73; // edx@163 - int v74; // ecx@168 - unsigned int v75; // ebx@170 - int v76; // ecx@172 - Texture *v77; // edi@181 - double v78; // st7@183 - int v79; // edi@184 - char *v80; // eax@184 - Texture *v81; // edi@185 - unsigned int v82; // eax@192 - int v83; // eax@193 - int v84; // eax@197 - int v85; // eax@197 - int v86; // ecx@197 - int v87; // eax@197 - int v88; // eax@198 - int v89; // eax@199 - int v90; // edi@201 - int v91; // edi@213 - int v92; // ebx@213 - int v93; // edi@214 - int v94; // ebx@214 - int v95; // eax@214 - char *v96; // edi@226 - double v97; // st7@228 - int v98; // edi@229 - char *v99; // eax@229 - Render *v100; // ecx@229 - Texture *v101; // edi@230 - int v102; // edi@236 - int v103; // eax@237 - int v104; // ecx@237 - int v105; // edx@237 - int v106; // edx@238 - int v107; // edx@239 - int v108; // edx@240 - int v109; // edi@250 - char *v110; // edx@250 - unsigned int v111; // eax@259 - int v112; // eax@260 - int v113; // eax@260 - int v114; // eax@265 - int v115; // eax@274 - int v116; // ebx@274 - unsigned int v117; // edi@274 - double v118; // st7@286 - int v119; // edi@287 - char *v120; // eax@287 - Texture *v121; // edi@288 - unsigned int v122; // edi@295 - int v123; // ebx@297 - int v124; // edi@298 - int v125; // ecx@303 - int v126; // eax@312 - unsigned int v127; // ebx@314 - int v128; // ecx@316 - Texture *v129; // edi@325 - double v130; // st7@327 - int v131; // edi@328 - char *v132; // eax@328 - Texture *v133; // edi@329 - unsigned int v134; // eax@335 - int v135; // eax@336 - int v136; // edx@336 - int v137; // eax@336 - unsigned int v138; // ebx@339 - int v139; // ecx@339 - Texture *v140; // edi@348 - double v141; // st7@350 - int v142; // edi@351 - char *v143; // eax@351 - Texture *v144; // edi@352 - unsigned int v145; // eax@358 - int v146; // eax@359 - int v147; // ecx@359 - int v148; // eax@359 - int v149; // edx@359 - int v150; // ebx@362 - int v151; // ecx@363 - int v152; // ecx@364 - unsigned int v153; // eax@370 - unsigned int v154; // edi@370 - int v155; // eax@370 - LODFile_IconsBitmaps *v156; // ecx@374 - Texture *v157; // ebp@381 - double v158; // st7@383 - Texture *v159; // edi@385 - char *v160; // eax@386 - unsigned int v161; // eax@393 - int v162; // eax@394 - unsigned int v163; // [sp-Ch] [bp-58h]@230 - unsigned int v164; // [sp-Ch] [bp-58h]@233 - signed int v165; // [sp-Ch] [bp-58h]@235 - char *v166; // [sp-8h] [bp-54h]@16 - const char *v167; // [sp-8h] [bp-54h]@23 - const char *v168; // [sp-8h] [bp-54h]@43 - const char *v169; // [sp-8h] [bp-54h]@79 - const char *v170; // [sp-8h] [bp-54h]@111 - const char *v171; // [sp-8h] [bp-54h]@141 - const char *v172; // [sp-8h] [bp-54h]@177 - const char *v173; // [sp-8h] [bp-54h]@222 - int v174; // [sp-8h] [bp-54h]@228 - unsigned int v175; // [sp-8h] [bp-54h]@230 - unsigned int v176; // [sp-8h] [bp-54h]@233 - signed int v177; // [sp-8h] [bp-54h]@235 - const char *v178; // [sp-8h] [bp-54h]@242 - const char *v179; // [sp-8h] [bp-54h]@280 - const char *v180; // [sp-8h] [bp-54h]@321 - char *v181; // [sp-8h] [bp-54h]@337 - const char *v182; // [sp-8h] [bp-54h]@344 - const char *v183; // [sp-8h] [bp-54h]@375 - signed int v184; // [sp-4h] [bp-50h]@66 - signed int v185; // [sp-4h] [bp-50h]@99 - signed int v186; // [sp-4h] [bp-50h]@202 - int v187; // [sp-4h] [bp-50h]@228 - Texture *v188; // [sp-4h] [bp-50h]@230 - Texture *v189; // [sp-4h] [bp-50h]@233 - Texture *v190; // [sp-4h] [bp-50h]@235 - signed int v191; // [sp-4h] [bp-50h]@266 - signed int v192; // [sp-4h] [bp-50h]@304 - unsigned int a3; // [sp+10h] [bp-3Ch]@7 - int a3a; // [sp+10h] [bp-3Ch]@15 - int a3b; // [sp+10h] [bp-3Ch]@38 - unsigned int a3c; // [sp+10h] [bp-3Ch]@74 - unsigned int a3d; // [sp+10h] [bp-3Ch]@106 - int a3e; // [sp+10h] [bp-3Ch]@129 - int a3f; // [sp+10h] [bp-3Ch]@168 - unsigned int a3g; // [sp+10h] [bp-3Ch]@216 - unsigned int a3h; // [sp+10h] [bp-3Ch]@274 - int a3i; // [sp+10h] [bp-3Ch]@312 - int a3j; // [sp+10h] [bp-3Ch]@336 - int a3k; // [sp+10h] [bp-3Ch]@362 - signed int a2; // [sp+14h] [bp-38h]@7 - unsigned int a2a; // [sp+14h] [bp-38h]@15 - Texture *a2b; // [sp+14h] [bp-38h]@49 - int a2c; // [sp+14h] [bp-38h]@74 - int a2d; // [sp+14h] [bp-38h]@106 - int a2e; // [sp+14h] [bp-38h]@129 - int a2f; // [sp+14h] [bp-38h]@168 - int a2g; // [sp+14h] [bp-38h]@214 - int a2h; // [sp+14h] [bp-38h]@274 - Texture *a2i; // [sp+14h] [bp-38h]@284 - int a2j; // [sp+14h] [bp-38h]@312 - int a2k; // [sp+14h] [bp-38h]@336 - //Player *v217; // [sp+18h] [bp-34h]@1 - int v218; // [sp+1Ch] [bp-30h]@15 - int v219; // [sp+1Ch] [bp-30h]@60 - int v220; // [sp+1Ch] [bp-30h]@94 - int v221; // [sp+1Ch] [bp-30h]@128 - int v222; // [sp+1Ch] [bp-30h]@161 - int v223; // [sp+1Ch] [bp-30h]@213 - char v224; // [sp+1Ch] [bp-30h]@237 - int v225; // [sp+1Ch] [bp-30h]@260 - int v226; // [sp+1Ch] [bp-30h]@298 - int v227; // [sp+1Ch] [bp-30h]@336 - int v228; // [sp+1Ch] [bp-30h]@359 - int v229; // [sp+20h] [bp-2Ch]@15 - int v230; // [sp+20h] [bp-2Ch]@38 - int v231; // [sp+20h] [bp-2Ch]@60 - int v232; // [sp+20h] [bp-2Ch]@94 - int v233; // [sp+20h] [bp-2Ch]@128 - int v234; // [sp+20h] [bp-2Ch]@161 - int v235; // [sp+20h] [bp-2Ch]@197 - int v236; // [sp+20h] [bp-2Ch]@260 - int v237; // [sp+20h] [bp-2Ch]@298 - int v238; // [sp+20h] [bp-2Ch]@336 - int pBodyComplection; // [sp+24h] [bp-28h]@6 - int v240; // [sp+28h] [bp-24h]@7 - unsigned int v241; // [sp+2Ch] [bp-20h]@38 - int v242; // [sp+2Ch] [bp-20h]@197 - unsigned int v243; // [sp+2Ch] [bp-20h]@370 - int v244; // [sp+34h] [bp-18h]@6 - signed int v245; // [sp+34h] [bp-18h]@361 - unsigned int uPlayerID_; // [sp+38h] [bp-14h]@1 - int uPlayerID_a; // [sp+38h] [bp-14h]@9 - signed int IsDwarf; // [sp+40h] [bp-Ch]@4 - int v249; // [sp+40h] [bp-Ch]@358 - //signed int v250; // [sp+44h] [bp-8h]@1 - - pPlayer = pPlayers[uPlayerID]; - uPlayerID_ = uPlayerID; - pIcons_LOD->LoadTexture("sptext01", TEXTURE_16BIT_PALETTE); - pSex = pPlayer->GetSexByVoice(); - if ( pPlayer->GetRace() && pPlayer->GetRace() != 1 && pPlayer->GetRace() != 2 ) - { - IsDwarf = 1; - pBodyComplection = (pSex != 0) + 2; - } - else - { - IsDwarf = 0; - pBodyComplection = pSex != 0; - } - v244 = pPlayer->uFace; - pRenderer->ResetClip(); - pRenderer->DrawTextureIndexed(0x1D3u, 0, (Texture *)(uTextureID_BACKDOLL != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BACKDOLL] : 0));// - if ( !IsPlayerWearingWatersuit[uPlayerID_] ) - { - v21 = pPlayer->pEquipment.uBow; // - if ( !v21 ) - goto LABEL_59; - v230 = pPlayer->pEquipment.uBow; - v22 = (int)&pPlayer->pInventoryItems[v21-1]; - v23 = *(int *)v22; - v24 = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][2][0] - pItemsTable->pItems[v23].uEquipX; - a3b = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][2][1] - pItemsTable->pItems[v23].uEquipY; - v241 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v23].pIconName, TEXTURE_16BIT_PALETTE); - v25 = *(int *)(v22 + 20); - if ( !(*(int *)(v22 + 20) & 0xF0) ) - { - if ( v25 & 2 ) - { - v27 = (Texture *)(v241 != -1 ? (int)&pIcons_LOD->pTextures[v241] : 0); - pRenderer->DrawTransparentRedShade(v24, a3b, v27); - } - else - { - v29 = (v25 & 1) == 0; - v30 = (char *)&pIcons_LOD->pTextures[v241]; - if ( v29 ) - { - v27 = (Texture *)(v241 != -1 ? (int)v30 : 0); - pRenderer->DrawTransparentGreenShade(v24, a3b, (Texture *)(v241 != -1 ? (int)v30 : 0)); - } - else - { - v27 = (Texture *)(v241 != -1 ? (int)v30 : 0); - pRenderer->DrawTextureTransparent(v24, a3b, (Texture *)(v241 != -1 ? (int)v30 : 0)); - } - } -LABEL_57: - if ( !bRingsShownInCharScreen ) - pRenderer->_4A612A(v24, a3b, v27, v230); -LABEL_59: - v31 = pPlayer->pEquipment.uCloak;// - if ( !v31 ) - goto LABEL_93; - v231 = pPlayer->pEquipment.uCloak; - v32 = (int)&pPlayer->pInventoryItems[v31-1]; - v219 = v32; - if ( *(int *)v32 != 525 ) - { - switch ( *(int *)v32 ) - { - case 0x212: - v184 = 6; - break; - case 0x223: - v184 = 7; - break; - case 0x224: - v184 = 8; - break; - default: - if ( *(int *)v32 != 550 ) - { - v33 = *(int *)v32 - 105; -LABEL_72: - if ( v33 < 0 || v33 >= 10 ) - goto LABEL_93; -LABEL_74: - v34 = v33 + 10 * pBodyComplection; - v35 = paperdoll_array_511828[0][v34];//Texture_Cloak - a2c = pPaperdoll_BodyX + paperdoll_Cloak[0][v34][0]; - v36 = pPaperdoll_BodyY + paperdoll_Cloak[0][v34][1]; - v37 = *(int *)(v32 + 20); - a3c = v36; - if ( !(v37 & 0xF0) ) - { - v41 = v35 + 1; - if ( v37 & 2 ) - { - v42 = (Texture *)(v41 != 0 ? (int)&pIcons_LOD->pTextures[v35] : 0); - pRenderer->DrawTransparentRedShade(a2c, v36, v42); - } - else - { - v42 = (Texture *)(v41 != 0 ? (int)&pIcons_LOD->pTextures[v35] : 0); - pRenderer->DrawTextureTransparent(a2c, v36, v42); - } - if ( !bRingsShownInCharScreen ) - pRenderer->_4A612A(a2c, a3c, v42, v231); -LABEL_93: - v240 = 4 * uPlayerID_ - 4; - pRenderer->DrawTextureTransparent(pPaperdoll_BodyX, pPaperdoll_BodyY, - (Texture *)(*(unsigned int *)((char *)papredoll_dbods + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dbods + v240)] : 0)); - v43 = pPlayer->pEquipment.uBody;// - if ( !v43 ) - goto LABEL_127; - v232 = pPlayer->pEquipment.uBody; - v44 = (int)&pPlayer->pInventoryItems[v43-1]; - v220 = v44; - if ( *(int *)v44 != 504 ) - { - if ( *(int *)v44 == 505 ) - { - v185 = 14; - } - else - { - if ( *(int *)v44 == 516 ) - { - v185 = 13; - } - else - { - if ( *(int *)v44 != 533 ) - { - v45 = *(int *)v44 - 66; -LABEL_104: - if ( v45 < 0 || v45 >= 17 ) - goto LABEL_127; -LABEL_106: - v46 = 17 * pBodyComplection + v45; - a2d = pPaperdoll_BodyX + paperdoll_Armor[0][v46][0]; - v47 = pPaperdoll_BodyY + paperdoll_Armor[0][v46][1]; - v48 = paperdoll_array_511290[0][v46][0];//Texture_Armor - v49 = *(int *)(v44 + 20); - a3d = v47; - if ( !(v49 & 0xF0) ) - { - v53 = v48 + 1; - if ( v49 & 2 ) - { - v54 = (Texture *)(v53 != 0 ? (int)&pIcons_LOD->pTextures[v48] : 0); - pRenderer->DrawTransparentRedShade(a2d, v47, v54); - } - else - { - v29 = (v49 & 1) == 0; - v55 = (char *)&pIcons_LOD->pTextures[v48]; - if ( v29 ) - { - v54 = (Texture *)(v53 != 0 ? (int)v55 : 0); - pRenderer->DrawTransparentGreenShade(a2d, v47, v54); - } - else - { - v54 = (Texture *)(v53 != 0 ? (int)v55 : 0); - pRenderer->DrawTextureTransparent(a2d, v47, v54); - } - } - if ( !bRingsShownInCharScreen ) - pRenderer->_4A612A(a2d, a3d, v54, v232); -LABEL_127: - v56 = pPlayer->pEquipment.field_20; - if ( !v56 ) - goto LABEL_155; - v233 = pPlayer->pEquipment.field_20; - v57 = (int)&pPlayer->pInventoryItems[v56-1]; - v221 = v57; - v58 = *(int *)v57; - if ( *(int *)v57 == 529 ) - { - a3e = pPaperdoll_BodyY + paperdoll_Boot[pBodyComplection][5][1]; - a2e = pPaperdoll_BodyX + paperdoll_Boot[pBodyComplection][5][0]; - v59 = papredoll_flying_feet[v244]; - } - else - { - if ( v58 == 512 ) - { - a3e = pPaperdoll_BodyY + paperdoll_Boot[pBodyComplection][6][1]; - a2e = pPaperdoll_BodyX + paperdoll_Boot[pBodyComplection][6][0]; - v59 = dword_511638[pBodyComplection][5]; - } - else - { - v60 = v58 - 115; - if ( v60 < 0 || v60 >= 5 ) - { - a2e = 0; - a3e = 0; - v59 = dword_511638[pBodyComplection][0]; - } - else - { - v61 = v60 + 7 * pBodyComplection; - a3e = pPaperdoll_BodyY + paperdoll_Boot[0][v61][1]; - a2e = pPaperdoll_BodyX + paperdoll_Boot[0][v61][0]; - v59 = dword_511638[0][v60 + 6 * pBodyComplection]; - } - } - } - v62 = *(int *)(v57 + 20); - if ( !(*(int *)(v57 + 20) & 0xF0) ) - { - v65 = v59 + 1; - v66 = (char *)&pIcons_LOD->pTextures[v59]; - if ( v62 & 2 ) - { - v67 = (Texture *)(v65 != 0 ? (int)v66 : 0); - pRenderer->DrawTransparentRedShade(a2e, a3e, v67); - } - else - { - if ( v62 & 1 ) - { - v67 = (Texture *)(v65 != 0 ? (int)v66 : 0); - pRenderer->DrawTextureTransparent(a2e, a3e, v67); - } - else - { - v67 = (Texture *)(v65 != 0 ? (int)v66 : 0); - pRenderer->DrawTransparentGreenShade(a2e, a3e, v67); - } - } - if ( !bRingsShownInCharScreen ) - pRenderer->_4A612A(a2e, a3e, v67, v233); -LABEL_155: - v69 = pPlayer->pEquipment.uMainHand; - uPlayerID_a = 2 * pBodyComplection; - if ( !v69 || (v70 = *(int *)&pPlayer->pInventoryItems[v69-1], pItemsTable->pItems[v70].uEquipType != 1) - && (pItemsTable->pItems[v70].uSkillType != 4 || pPlayer->pEquipment.uOffHand) ) - pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0], - pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1], - (Texture *)(*(unsigned int *)((char *)papredoll_dlads + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlads + v240)] : 0)); - v71 = pPlayer->pEquipment.uBelt; - if ( v71 ) - { - v234 = pPlayer->pEquipment.uBelt; - v72 = (int)&pPlayer->pInventoryItems[v71-1]; - v222 = v72; - if ( *(int *)v72 == 524 ) - { - v73 = 5; - } - else - { - if ( *(int *)v72 == 535 ) - { - v73 = 6; - goto LABEL_168; - } - v73 = *(int *)v72 - 100; - } - if ( v73 >= 0 && v73 < 7 ) - { -LABEL_168: - v74 = 7 * pBodyComplection + v73; - a2f = pPaperdoll_BodyX + paperdoll_Belt[0][v74][0]; - a3f = pPaperdoll_BodyY + paperdoll_Belt[0][v74][1]; - if ( IsDwarf != 1 || v73 == 5 ) - v75 = stru_511718[pBodyComplection].texids[v73]; - else - v75 = stru_511718[pBodyComplection - 2].texids[v73]; - v76 = *(int *)&pPlayer->field_1F5[36 * v71 + 15]; - if ( !(*(int *)&pPlayer->field_1F5[36 * v71 + 15] & 0xF0) ) - { - v79 = v75 + 1; - v80 = (char *)&pIcons_LOD->pTextures[v75]; - if ( v76 & 2 ) - { - v81 = (Texture *)(v79 != 0 ? (int)v80 : 0); - pRenderer->DrawTransparentRedShade(a2f, a3f, v81); - } - else - { - if ( v76 & 1 ) - { - v81 = (Texture *)(v79 != 0 ? (int)v80 : 0); - pRenderer->DrawTextureTransparent(a2f, a3f, v81); - } - else - { - v81 = (Texture *)(v79 != 0 ? (int)v80 : 0); - pRenderer->DrawTransparentGreenShade(a2f, a3f, v81); - } - } - if ( !bRingsShownInCharScreen ) - pRenderer->_4A612A(a2f, a3f, v81, v234); - goto LABEL_192; - } - if ( (*(int *)&pPlayer->field_1F5[36 * v71 + 15] & 0xF0) != 16 ) - { - if ( (*(int *)&pPlayer->field_1F5[36 * v71 + 15] & 0xF0) == 32 ) - { - v172 = "sp28a"; - v77 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v172, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v222 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v78 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2f, a3f, (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), v77, (signed __int64)v78, 0, 255); - goto LABEL_192; - } - if ( (*(int *)&pPlayer->field_1F5[36 * v71 + 15] & 0xF0) == 64 ) - { - v172 = "sp30a"; - v77 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v172, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v222 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v78 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2f, a3f, (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), v77, (signed __int64)v78, 0, 255); - goto LABEL_192; - } - if ( (*(int *)&pPlayer->field_1F5[36 * v71 + 15] & 0xF0) == 128 ) - { - v172 = "sp91a"; - v77 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v172, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v222 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v78 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2f, a3f, (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), v77, (signed __int64)v78, 0, 255); - goto LABEL_192; - } - } - v172 = "sptext01"; - v77 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v172, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v222 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v78 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2f, a3f, (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), v77, (signed __int64)v78, 0, 255); - goto LABEL_192; - } - } -LABEL_192: - v82 = pPlayer->pEquipment.uMainHand; - if ( v82 ) - { - v83 = *(int *)&pPlayer->pInventoryItems[v82-1]; - if ( pItemsTable->pItems[v83].uEquipType == 1 - || pItemsTable->pItems[v83].uSkillType == 4 && !pPlayer->pEquipment.uOffHand ) - pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[0][uPlayerID_a], - pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[0][uPlayerID_a + 1], - (Texture *)(*(unsigned int *)((char *)papredoll_dlaus + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlaus + v240)] : 0)); - } - v84 = pPlayer->pEquipment.uBody; - v235 = v84; - v85 = (int)((char *)pPlayer + 36 * v84); - v242 = v85; - v86 = *(int *)(v85 + 496); - v87 = *(int *)(v85 + 496) - 504; - if ( v87 ) - { - v88 = v87 - 1; - if ( v88 ) - { - v89 = v88 - 11; - if ( v89 ) - { - if ( v89 != 17 ) - { - v90 = v86 - 66; -LABEL_207: - if ( v90 < 0 || v90 > 17 ) - { -LABEL_259: - v111 = pPlayer->pEquipment.uCloak; - if ( !v111 ) - goto LABEL_293; - v236 = pPlayer->pEquipment.uCloak; - v112 = (int)&pPlayer->pInventoryItems[v111-1]; - v225 = v112; - v113 = *(int *)v112; - if ( v113 != 525 ) - { - switch ( v113 ) - { - case 530: - v191 = 6; - break; - case 547: - v191 = 7; - break; - case 548: - v191 = 8; - break; - default: - if ( v113 != 550 ) - { - v114 = v113 - 105; -LABEL_272: - if ( v114 < 0 || v114 >= 10 ) - goto LABEL_293; -LABEL_274: - v115 = v114 + 10 * pBodyComplection; - v116 = dword_511788[v115]; - v115 *= 8; - v117 = pPaperdoll_BodyX + *(int *)((char *)&dword_4E56B0 + v115); - a2h = pPaperdoll_BodyX + *(int *)((char *)&dword_4E56B0 + v115); - a3h = pPaperdoll_BodyY + *(int *)((char *)&dword_4E56B4 + v115); - if ( v116 == pIcons_LOD->FindTextureByName("pending") ) - { -LABEL_292: -LABEL_293: - if ( v244 == 12 || v244 == 13 ) - { - v122 = papredoll_dbrds[v244]; - if ( v122 != pIcons_LOD->FindTextureByName("Pending") ) - pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_Beards[2 * v244 - 24], - pPaperdoll_BodyY + pPaperdoll_Beards[2 * v244 - 23], - (Texture *)(v122 != -1 ? (int)&pIcons_LOD->pTextures[v122] : 0)); - } - v123 = pPlayer->pEquipment.uHelm; - if ( !v123 ) - goto LABEL_335; - v237 = v123; - v124 = (int)&pPlayer->pInventoryItems[v123-1]; - v226 = v124; - if ( *(int *)v124 != 521 ) - { - switch ( *(int *)v124 ) - { - case 0x20A: - v192 = 12; - break; - case 0x20B: - v192 = 13; - break; - case 0x214: - v192 = 14; - break; - default: - if ( *(int *)v124 != 544 ) - { - v125 = *(int *)v124 - 89; - if ( v125 < 0 || v125 >= 16 ) - goto LABEL_335; - goto LABEL_312; - } - v192 = 15; - break; - } - v125 = v192; -LABEL_312: - v126 = 2 * (v125 + 16 * pBodyComplection); - a2j = pPaperdoll_BodyX + dword_4E58D0[v126]; - a3i = pPaperdoll_BodyY + dword_4E58D4[v126]; - if ( IsDwarf != 1 || *(int *)v124 != 92 ) - v127 = stru_511698[0].texids[v125 + 16 * pSex]; - else - v127 = papredoll_dbrds[11]; - v128 = *(int *)(v124 + 20); - if ( *(int *)(v124 + 20) & 0xF0 ) - { - if ( (*(int *)(v124 + 20) & 0xF0) != 16 ) - { - if ( (*(int *)(v124 + 20) & 0xF0) == 32 ) - { - v180 = "sp28a"; - v129 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v180, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v226 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v130 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2j, a3i, (Texture *)(v127 != -1 ? (int)&pIcons_LOD->pTextures[v127] : 0), - v129, (signed __int64)v130, 0, 255); - goto LABEL_335; - } - if ( (*(int *)(v124 + 20) & 0xF0) == 64 ) - { - v180 = "sp30a"; - v129 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v180, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v226 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v130 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2j, a3i, (Texture *)(v127 != -1 ? (int)&pIcons_LOD->pTextures[v127] : 0), - v129, (signed __int64)v130, 0, 255); - goto LABEL_335; - } - if ( (*(int *)(v124 + 20) & 0xF0) == 128 ) - { - v180 = "sp91a"; - v129 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v180, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v226 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v130 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2j, a3i, (Texture *)(v127 != -1 ? (int)&pIcons_LOD->pTextures[v127] : 0), - v129, (signed __int64)v130, 0, 255); - goto LABEL_335; - } - } - v180 = "sptext01"; - v129 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v180, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v226 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v130 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2j, a3i, (Texture *)(v127 != -1 ? (int)&pIcons_LOD->pTextures[v127] : 0), - v129, (signed __int64)v130, 0, 255); - goto LABEL_335; - } - v131 = v127 + 1; - v132 = (char *)&pIcons_LOD->pTextures[v127]; - if ( v128 & 2 ) - { - v133 = (Texture *)(v131 != 0 ? (int)v132 : 0); - pRenderer->DrawTransparentRedShade(a2j, a3i, v133); - } - else - { - if ( v128 & 1 ) - { - v133 = (Texture *)(v131 != 0 ? (int)v132 : 0); - pRenderer->DrawTextureTransparent(a2j, a3i, v133); - } - else - { - v133 = (Texture *)(v131 != 0 ? (int)v132 : 0); - pRenderer->DrawTransparentGreenShade(a2j, a3i, v133); - } - } - if ( !bRingsShownInCharScreen ) - pRenderer->_4A612A(a2j, a3i, v133, v237); -LABEL_335: - v134 = pPlayer->pEquipment.uMainHand; - if ( !v134 ) - goto LABEL_358; - v238 = pPlayer->pEquipment.uMainHand; - v135 = (int)&pPlayer->pInventoryItems[v134-1]; - v227 = v135; - v136 = *(int *)v135; - v137 = *(int *)v135; - a2k = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[v137].uEquipX; - a3j = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[v137].uEquipY; - if ( v136 == 64 ) - v181 = "item64v1"; - else - v181 = pItemsTable->pItems[v137].pIconName; - v138 = pIcons_LOD->LoadTexture(v181, TEXTURE_16BIT_PALETTE); - v139 = *(int *)(v227 + 20); - if ( !(*(int *)(v227 + 20) & 0xF0) ) - { - v142 = v138 + 1; - v143 = (char *)&pIcons_LOD->pTextures[v138]; - if ( v139 & 2 ) - { - v144 = (Texture *)(v142 != 0 ? (int)v143 : 0); - pRenderer->DrawTransparentRedShade(a2k, a3j, v144); - } - else - { - if ( v139 & 1 ) - { - v144 = (Texture *)(v142 != 0 ? (int)v143 : 0); - pRenderer->DrawTextureTransparent(a2k, a3j, v144); - } - else - { - v144 = (Texture *)(v142 != 0 ? (int)v143 : 0); - pRenderer->DrawTransparentGreenShade(a2k, a3j, v144); - } - } - if ( !bRingsShownInCharScreen ) - pRenderer->_4A612A(a2k, a3j, v144, v238); -LABEL_358: - v145 = pPlayer->pEquipment.uOffHand; - v249 = pPlayer->pEquipment.uOffHand; - if ( !v145 ) - goto LABEL_393; - v146 = (int)&pPlayer->pInventoryItems[v145-1]; - v228 = v146; - v147 = *(int *)v146; - v148 = *(int *)v146; - v149 = pItemsTable->pItems[v148].uSkillType; - if ( v149 != 2 && v149 != 1 ) - { - v245 = 0; - v150 = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][0][0] - pItemsTable->pItems[v148].uEquipX; - a3k = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][0][1] - pItemsTable->pItems[v148].uEquipY; - goto LABEL_370; - } - v151 = v147 - 400; - v245 = 1; - if ( v151 ) - { - v152 = v151 - 3; - if ( v152 ) - { - if ( v152 != 12 ) - { - v150 = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][0][0] - pItemsTable->pItems[v148].uEquipX; - a3k = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][0][1] - pItemsTable->pItems[v148].uEquipY; - goto LABEL_370; - } - v150 = 595; - a3k = 33; -LABEL_370: - v153 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v148].pIconName, TEXTURE_16BIT_PALETTE); - v154 = v153; - v243 = v153; - v155 = *(int *)(v228 + 20); - if ( !(*(int *)(v228 + 20) & 0xF0) ) - { - if ( v155 & 2 ) - { - v159 = (Texture *)(v243 != -1 ? (int)&pIcons_LOD->pTextures[v243] : 0); - pRenderer->DrawTransparentRedShade(v150, a3k, v159); - } - else - { - v29 = (v155 & 1) == 0; - v160 = (char *)&pIcons_LOD->pTextures[v243]; - if ( v29 ) - { - v159 = (Texture *)(v243 != -1 ? (int)v160 : 0); - pRenderer->DrawTransparentGreenShade(v150, a3k, (Texture *)(v243 != -1 ? (int)v160 : 0)); - } - else - { - v159 = (Texture *)(v243 != -1 ? (int)v160 : 0); - pRenderer->DrawTextureTransparent(v150, a3k, (Texture *)(v243 != -1 ? (int)v160 : 0)); - } - } - if ( !bRingsShownInCharScreen ) - pRenderer->_4A612A(v150, a3k, v159, v249); - if ( v245 ) - pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a], - pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1], - (Texture *)(*(unsigned int *)((char *)papredoll_dlhs - + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0)); - goto LABEL_393; - } - if ( (*(int *)(v228 + 20) & 0xF0) != 16 ) - { - if ( (*(int *)(v228 + 20) & 0xF0) == 32 ) - { - v183 = "sp28a"; - } - else - { - if ( (*(int *)(v228 + 20) & 0xF0) != 64 ) - { - v156 = pIcons_LOD; - if ( (*(int *)(v228 + 20) & 0xF0) == 128 ) - { - v183 = "sp91a"; - v157 = &pIcons_LOD->pTextures[v156->LoadTexture(v183, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v228 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v158 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(v150, a3k, (Texture *)(v154 != -1 ? (int)&pIcons_LOD->pTextures[v154] : 0), - v157, (signed __int64)v158, 0, 255); - if ( v245 ) - pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a], - pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1], - (Texture *)(*(unsigned int *)((char *)papredoll_dlhs - + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0)); - goto LABEL_393; - } - v183 = "sptext01"; - v157 = &pIcons_LOD->pTextures[v156->LoadTexture(v183, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v228 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v158 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(v150, a3k, (Texture *)(v154 != -1 ? (int)&pIcons_LOD->pTextures[v154] : 0), - v157, (signed __int64)v158, 0, 255); - if ( v245 ) - pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a], - pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1], - (Texture *)(*(unsigned int *)((char *)papredoll_dlhs - + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0)); - goto LABEL_393; - } - v183 = "sp30a"; - } - v156 = pIcons_LOD; - v157 = &pIcons_LOD->pTextures[v156->LoadTexture(v183, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v228 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v158 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(v150, a3k, (Texture *)(v154 != -1 ? (int)&pIcons_LOD->pTextures[v154] : 0), - v157, (signed __int64)v158, 0, 255); - if ( v245 ) - pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a], - pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1], - (Texture *)(*(unsigned int *)((char *)papredoll_dlhs - + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0)); - goto LABEL_393; - } - v156 = pIcons_LOD; - v183 = "sptext01"; - v157 = &pIcons_LOD->pTextures[v156->LoadTexture(v183, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v228 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v158 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(v150, a3k, (Texture *)(v154 != -1 ? (int)&pIcons_LOD->pTextures[v154] : 0), - v157, (signed __int64)v158, 0, 255); - if ( v245 ) - pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdollLeftEmptyHand[uPlayerID_a], - pPaperdoll_BodyY + pPaperdollLeftEmptyHand[uPlayerID_a + 1], - (Texture *)(*(unsigned int *)((char *)papredoll_dlhs - + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0)); - goto LABEL_393; - } - a3k = 28; - } - else - { - a3k = 86; - } - v150 = 596; - goto LABEL_370; - } - if ( (*(int *)(v227 + 20) & 0xF0) != 16 ) - { - if ( (*(int *)(v227 + 20) & 0xF0) == 32 ) - { - v182 = "sp28a"; - v140 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v182, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v227 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v141 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2k, a3j, (Texture *)(v138 != -1 ? (int)&pIcons_LOD->pTextures[v138] : 0), - v140, (signed __int64)v141, 0, 255); - goto LABEL_358; - } - if ( (*(int *)(v227 + 20) & 0xF0) == 64 ) - { - v182 = "sp30a"; - v140 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v182, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v227 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v141 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2k, a3j, (Texture *)(v138 != -1 ? (int)&pIcons_LOD->pTextures[v138] : 0), - v140, (signed __int64)v141, 0, 255); - goto LABEL_358; - } - if ( (*(int *)(v227 + 20) & 0xF0) == 128 ) - { - v182 = "sp91a"; - v140 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v182, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v227 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v141 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2k, a3j, (Texture *)(v138 != -1 ? (int)&pIcons_LOD->pTextures[v138] : 0), - v140, (signed __int64)v141, 0, 255); - goto LABEL_358; - } - } - v182 = "sptext01"; - v140 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v182, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v227 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v141 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2k, a3j, (Texture *)(v138 != -1 ? (int)&pIcons_LOD->pTextures[v138] : 0), - v140, (signed __int64)v141, 0, 255); - goto LABEL_358; - } - v125 = 11; - if ( v125 < 0 || v125 >= 16 ) - goto LABEL_335; - goto LABEL_312; - } - if ( !(*(int *)(v225 + 20) & 0xF0) ) - { - v119 = v116 + 1; - v120 = (char *)&pIcons_LOD->pTextures[v116]; - if ( *(int *)(v225 + 20) & 2 ) - { - v121 = (Texture *)(v119 != 0 ? (int)v120 : 0); - pRenderer->DrawTransparentRedShade(a2h, a3h, v121); - } - else - { - v121 = (Texture *)(v119 != 0 ? (int)v120 : 0); - pRenderer->DrawTextureTransparent(a2h, a3h, v121); - } - if ( !bRingsShownInCharScreen ) - pRenderer->_4A612A(a2h, a3h, v121, v236); - goto LABEL_292; - } - if ( (*(int *)(v225 + 20) & 0xF0) != 16 ) - { - if ( (*(int *)(v225 + 20) & 0xF0) == 32 ) - { - v179 = "sp28a"; - a2i = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v179, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v225 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v118 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(v117, a3h, (Texture *)(v116 != -1 ? (int)&pIcons_LOD->pTextures[v116] : 0), - a2i, (signed __int64)v118, 0, 255); - goto LABEL_292; - } - if ( (*(int *)(v225 + 20) & 0xF0) == 64 ) - { - v179 = "sp30a"; - a2i = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v179, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v225 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v118 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(v117, a3h, (Texture *)(v116 != -1 ? (int)&pIcons_LOD->pTextures[v116] : 0), - a2i, (signed __int64)v118, 0, 255); - goto LABEL_292; - } - if ( (*(int *)(v225 + 20) & 0xF0) == 128 ) - { - v179 = "sp91a"; - a2i = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v179, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v225 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v118 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(v117, a3h, (Texture *)(v116 != -1 ? (int)&pIcons_LOD->pTextures[v116] : 0), - a2i, (signed __int64)v118, 0, 255); - goto LABEL_292; - } - } - v179 = "sptext01"; - a2i = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v179, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v225 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v118 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(v117, a3h, (Texture *)(v116 != -1 ? (int)&pIcons_LOD->pTextures[v116] : 0), - a2i, (signed __int64)v118, 0, 255); - goto LABEL_292; - } - v191 = 9; - break; - } - v114 = v191; - goto LABEL_274; - } - v114 = 5; - goto LABEL_272; - } -LABEL_209: - if ( pPlayer->pEquipment.uMainHand - && (pPlayer->GetEquippedItemEquipType(1u) == 1 - || pPlayer->GetEquippedItemSkillType(EQUIP_TWO_HANDED) == 4 - && !pPlayer->pEquipment.uOffHand) ) - { - v91 = 17 * pBodyComplection + v90; - v92 = v91; - v223 = paperdoll_array_511290[0][v91][2]; - if ( v223 == pIcons_LOD->FindTextureByName("pending") ) - { - v93 = 2 * v91; - v94 = paperdoll_array_511290[0][v92][1]; - a2g = pPaperdoll_BodyX + paperdoll_shoulder[0][0][v93]; - v95 = paperdoll_shoulder[0][0][v93 + 1]; - } - else - { - v94 = v223; - a2g = pPaperdoll_BodyX + dword_4E5270[2 * v91]; - v95 = dword_4E5270[2 * v91 + 1]; - } - a3g = pPaperdoll_BodyY + v95; - if ( v94 == pIcons_LOD->FindTextureByName("pending") ) - goto LABEL_259; - if ( *(int *)(v242 + 516) & 0xF0 ) - { - if ( (*(int *)(v242 + 516) & 0xF0) != 16 ) - { - if ( (*(int *)(v242 + 516) & 0xF0) == 32 ) - { - v173 = "sp28a"; - v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v173, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v242 + 516) &= 0xFu; - ptr_50C9A4 = 0; - } - v187 = 255; - v174 = 0; - v97 = (double)GetTickCount(); - pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), - (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); - goto LABEL_259; - } - if ( (*(int *)(v242 + 516) & 0xF0) == 64 ) - { - v173 = "sp30a"; - v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v173, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v242 + 516) &= 0xFu; - ptr_50C9A4 = 0; - } - v187 = 255; - v174 = 0; - v97 = (double)GetTickCount(); - pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), - (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); - goto LABEL_259; - } - if ( (*(int *)(v242 + 516) & 0xF0) == 128 ) - { - v173 = "sp91a"; - v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v173, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v242 + 516) &= 0xFu; - ptr_50C9A4 = 0; - } - v187 = 255; - v174 = 0; - v97 = (double)GetTickCount(); - pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), - (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); - goto LABEL_259; - } - } - v173 = "sptext01"; - v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v173, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v242 + 516) &= 0xFu; - ptr_50C9A4 = 0; - } - v187 = 255; - v174 = 0; - v97 = (double)GetTickCount(); - pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), - (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); - goto LABEL_259; - } - v98 = v94 + 1; - v99 = (char *)&pIcons_LOD->pTextures[v94]; - v100 = pRenderer; - if ( *(int *)(v242 + 516) & 2 ) - { - v101 = (Texture *)(v98 != 0 ? (int)v99 : 0); - v188 = v101; - v175 = a3g; - v163 = a2g; - v100->DrawTransparentRedShade(v163, v175, v188); - if ( !bRingsShownInCharScreen ) - pRenderer->_4A612A(a2g, a3g, v101, v235); - goto LABEL_259; - } - if ( *(char *)(v242 + 516) & 1 ) - { - v101 = (Texture *)(v98 != 0 ? (int)v99 : 0); - v189 = v101; - v176 = a3g; - v164 = a2g; - pRenderer->DrawTextureTransparent(v164, v176, v189); - if ( !bRingsShownInCharScreen ) - pRenderer->_4A612A(a2g, a3g, v101, v235); - goto LABEL_259; - } - v101 = (Texture *)(v98 != 0 ? (int)v99 : 0); - v190 = v101; - v177 = a3g; - v165 = a2g; - pRenderer->DrawTransparentGreenShade(v165, v177, v190); - if ( !bRingsShownInCharScreen ) - pRenderer->_4A612A(a2g, a3g, v101, v235); - goto LABEL_259; - } - v102 = 17 * pBodyComplection + v90; - v94 = paperdoll_array_511290[0][v102][1]; - if ( v94 == pIcons_LOD->FindTextureByName("pending") ) - goto LABEL_259; - v103 = pPaperdoll_BodyX + paperdoll_shoulder[0][v102][0]; - v104 = pPaperdoll_BodyY + paperdoll_shoulder[0][v102][1]; - v224 = *(int *)(v242 + 516); - v105 = *(int *)(v242 + 516) & 0xF0; - a2g = pPaperdoll_BodyX + paperdoll_shoulder[0][v102][0]; - a3g = pPaperdoll_BodyY + paperdoll_shoulder[0][v102][1]; - if ( !v105 ) - { - v109 = v94 + 1; - v110 = (char *)&pIcons_LOD->pTextures[v94]; - if ( v224 & 2 ) - { - v101 = (Texture *)(v109 != 0 ? (int)v110 : 0); - v188 = v101; - v175 = v104; - v163 = v103; - v100 = pRenderer; - v100->DrawTransparentRedShade(v163, v175, v188); - if ( !bRingsShownInCharScreen ) - pRenderer->_4A612A(a2g, a3g, v101, v235); - goto LABEL_259; - } - if ( v224 & 1 ) - { - v101 = (Texture *)(v109 != 0 ? (int)v110 : 0); - v189 = v101; - v176 = v104; - v164 = v103; - v100 = pRenderer; - pRenderer->DrawTextureTransparent(v164, v176, v189); - if ( !bRingsShownInCharScreen ) - pRenderer->_4A612A(a2g, a3g, v101, v235); - goto LABEL_259; - } - v101 = (Texture *)(v109 != 0 ? (int)v110 : 0); - v190 = v101; - v177 = v104; - v165 = v103; - v100 = pRenderer; - pRenderer->DrawTransparentGreenShade(v165, v177, v190); - if ( !bRingsShownInCharScreen ) - pRenderer->_4A612A(a2g, a3g, v101, v235); - goto LABEL_259; - } - v106 = v105 - 16; - if ( v106 ) - { - v107 = v106 - 16; - if ( !v107 ) - { - v178 = "sp28a"; - v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v178, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v242 + 516) &= 0xFu; - ptr_50C9A4 = 0; - } - v187 = 255; - v174 = 0; - v97 = (double)GetTickCount(); - pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), - (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); - goto LABEL_259; - } - v108 = v107 - 32; - if ( !v108 ) - { - v178 = "sp30a"; - v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v178, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v242 + 516) &= 0xFu; - ptr_50C9A4 = 0; - } - v187 = 255; - v174 = 0; - v97 = (double)GetTickCount(); - pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), - (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); - goto LABEL_259; - } - if ( v108 == 64 ) - { - v178 = "sp91a"; - v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v178, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v242 + 516) &= 0xFu; - ptr_50C9A4 = 0; - } - v187 = 255; - v174 = 0; - v97 = (double)GetTickCount(); - pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), - (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); - goto LABEL_259; - } - } - v178 = "sptext01"; - v96 = (char *)&pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v178, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v242 + 516) &= 0xFu; - ptr_50C9A4 = 0; - } - v187 = 255; - v174 = 0; - v97 = (double)GetTickCount(); - pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), - (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); - goto LABEL_259; - } - v186 = 16; - } - else - { - v186 = 13; - } - } - else - { - v186 = 14; - } - v90 = v186; - goto LABEL_209; - } - v90 = 15; - goto LABEL_207; - } - if ( (*(int *)(v57 + 20) & 0xF0) != 16 ) - { - if ( (*(int *)(v57 + 20) & 0xF0) == 32 ) - { - v171 = "sp28a"; - v63 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v171, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v221 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v64 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2e, a3e, (Texture *)(v59 != -1 ? (int)&pIcons_LOD->pTextures[v59] : 0), v63, - (signed __int64)v64, 0, 255); - goto LABEL_155; - } - if ( (*(int *)(v57 + 20) & 0xF0) == 64 ) - { - v171 = "sp30a"; - v63 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v171, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v221 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v64 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2e, a3e, (Texture *)(v59 != -1 ? (int)&pIcons_LOD->pTextures[v59] : 0), v63, - (signed __int64)v64, 0, 255); - goto LABEL_155; - } - if ( (*(int *)(v57 + 20) & 0xF0) == 128 ) - { - v171 = "sp91a"; - v63 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v171, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v221 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v64 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2e, a3e, (Texture *)(v59 != -1 ? (int)&pIcons_LOD->pTextures[v59] : 0), v63, - (signed __int64)v64, 0, 255); - goto LABEL_155; - } - } - v171 = "sptext01"; - v63 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v171, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v221 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v64 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2e, a3e, (Texture *)(v59 != -1 ? (int)&pIcons_LOD->pTextures[v59] : 0), v63, - (signed __int64)v64, 0, 255); - goto LABEL_155; - } - if ( (*(int *)(v44 + 20) & 0xF0) != 16 ) - { - if ( (*(int *)(v44 + 20) & 0xF0) == 32 ) - { - v170 = "sp28a"; - } - else - { - if ( (*(int *)(v44 + 20) & 0xF0) != 64 ) - { - v50 = pIcons_LOD; - if ( (*(int *)(v44 + 20) & 0xF0) == 128 ) - { - v170 = "sp91a"; - v51 = &pIcons_LOD->pTextures[v50->LoadTexture(v170, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v220 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v52 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2d, a3d, (Texture *)(v48 != -1 ? (int)&pIcons_LOD->pTextures[v48] : 0), - v51, (signed __int64)v52, 0, 255); - goto LABEL_127; - } - v170 = "sptext01"; - v51 = &pIcons_LOD->pTextures[v50->LoadTexture(v170, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v220 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v52 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2d, a3d, (Texture *)(v48 != -1 ? (int)&pIcons_LOD->pTextures[v48] : 0), - v51, (signed __int64)v52, 0, 255); - goto LABEL_127; - } - v170 = "sp30a"; - } - v50 = pIcons_LOD; - v51 = &pIcons_LOD->pTextures[v50->LoadTexture(v170, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v220 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v52 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2d, a3d, (Texture *)(v48 != -1 ? (int)&pIcons_LOD->pTextures[v48] : 0), - v51, (signed __int64)v52, 0, 255); - goto LABEL_127; - } - v50 = pIcons_LOD; - v170 = "sptext01"; - v51 = &pIcons_LOD->pTextures[v50->LoadTexture(v170, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v220 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v52 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2d, a3d, (Texture *)(v48 != -1 ? (int)&pIcons_LOD->pTextures[v48] : 0), - v51, (signed __int64)v52, 0, 255); - goto LABEL_127; - } - v185 = 16; - } - } - v45 = v185; - goto LABEL_106; - } - v45 = 15; - goto LABEL_104; - } - if ( (*(int *)(v32 + 20) & 0xF0) != 16 ) - { - if ( (*(int *)(v32 + 20) & 0xF0) == 32 ) - { - v169 = "sp28a"; - } - else - { - if ( (*(int *)(v32 + 20) & 0xF0) != 64 ) - { - v38 = pIcons_LOD; - if ( (*(int *)(v32 + 20) & 0xF0) == 128 ) - { - v169 = "sp91a"; - v39 = &pIcons_LOD->pTextures[v38->LoadTexture(v169, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v219 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v40 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2c, a3c, (Texture *)(v35 != -1 ? (int)&pIcons_LOD->pTextures[v35] : 0), v39, - (signed __int64)v40, 0, 255); - goto LABEL_93; - } - v169 = "sptext01"; - v39 = &pIcons_LOD->pTextures[v38->LoadTexture(v169, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v219 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v40 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2c, a3c, (Texture *)(v35 != -1 ? (int)&pIcons_LOD->pTextures[v35] : 0), v39, - (signed __int64)v40, 0, 255); - goto LABEL_93; - } - v169 = "sp30a"; - } - v38 = pIcons_LOD; - v39 = &pIcons_LOD->pTextures[v38->LoadTexture(v169, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v219 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v40 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2c, a3c, (Texture *)(v35 != -1 ? (int)&pIcons_LOD->pTextures[v35] : 0), v39, - (signed __int64)v40, 0, 255); - goto LABEL_93; - } - v38 = pIcons_LOD; - v169 = "sptext01"; - v39 = &pIcons_LOD->pTextures[v38->LoadTexture(v169, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v219 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v40 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2c, a3c, (Texture *)(v35 != -1 ? (int)&pIcons_LOD->pTextures[v35] : 0), v39, - (signed __int64)v40, 0, 255); - goto LABEL_93; - } - v184 = 9; - break; - } - v33 = v184; - goto LABEL_74; - } - v33 = 5; - goto LABEL_72; - } - if ( (*(int *)(v22 + 20) & 0xF0) != 16 ) - { - if ( (*(int *)(v22 + 20) & 0xF0) == 32 ) - { - v168 = "sp28a"; - } - else - { - if ( (*(int *)(v22 + 20) & 0xF0) != 64 ) - { - v26 = pIcons_LOD; - if ( (*(int *)(v22 + 20) & 0xF0) == 128 ) - { - v168 = "sp91a"; - a2b = &pIcons_LOD->pTextures[v26->LoadTexture(v168, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v22 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v27 = (Texture *)(v241 != -1 ? (int)&pIcons_LOD->pTextures[v241] : 0); - v28 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(v24, a3b, v27, a2b, (signed __int64)v28, 0, 255); - goto LABEL_57; - } - v168 = "sptext01"; - a2b = &pIcons_LOD->pTextures[v26->LoadTexture(v168, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v22 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v27 = (Texture *)(v241 != -1 ? (int)&pIcons_LOD->pTextures[v241] : 0); - v28 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(v24, a3b, v27, a2b, (signed __int64)v28, 0, 255); - goto LABEL_57; - } - v168 = "sp30a"; - } - v26 = pIcons_LOD; - a2b = &pIcons_LOD->pTextures[v26->LoadTexture(v168, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v22 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v27 = (Texture *)(v241 != -1 ? (int)&pIcons_LOD->pTextures[v241] : 0); - v28 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(v24, a3b, v27, a2b, (signed __int64)v28, 0, 255); - goto LABEL_57; - } - v26 = pIcons_LOD; - v168 = "sptext01"; - a2b = &pIcons_LOD->pTextures[v26->LoadTexture(v168, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v22 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v27 = (Texture *)(v241 != -1 ? (int)&pIcons_LOD->pTextures[v241] : 0); - v28 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(v24, a3b, v27, a2b, (signed __int64)v28, 0, 255); - goto LABEL_57;; - } - a3 = pPaperdoll_BodyY; - a2 = pPaperdoll_BodyX; - v240 = 4 * uPlayerID_ - 4; - pRenderer->DrawTextureTransparent(pPaperdoll_BodyX, pPaperdoll_BodyY, - (Texture *)(*(unsigned int *)((char *)papredoll_dbods + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dbods + v240)] : 0)); - if ( !bRingsShownInCharScreen ) - pRenderer->_4A612A(a2, a3, - (Texture *)(*(unsigned int *)((char *)papredoll_dbods + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dbods + v240)] : 0), - pPlayer->pEquipment.uBody); - uPlayerID_a = 2 * pBodyComplection; - v6 = pPlayer->pEquipment.uMainHand; - if ( !v6 - || (v7 = *(int *)&pPlayer->pInventoryItems[v6-1], pItemsTable->pItems[v7].uEquipType != 1) - && (pItemsTable->pItems[v7].uSkillType != 4 || pPlayer->pEquipment.uOffHand) ) - pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_LeftHand[pBodyComplection][0], pPaperdoll_BodyY + pPaperdoll_LeftHand[pBodyComplection][1], - (Texture *)(*(unsigned int *)((char *)papredoll_dlads + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlads + v240)] : 0)); - v8 = pPlayer->pEquipment.uMainHand; - if ( v8 ) - { - v229 = pPlayer->pEquipment.uMainHand; - v9 = (int)&pPlayer->pInventoryItems[v8-1]; - // v10 = pBodyComplection << 7; - v218 = v9; - v11 = *(int *)v9; - v12 = *(int *)v9; - v13 = pPaperdoll_BodyX + paperdoll_Weapon[pBodyComplection][1][0] - pItemsTable->pItems[v12].uEquipX; - a2a = v13; - a3a = pPaperdoll_BodyY + paperdoll_Weapon[pBodyComplection][1][1] - pItemsTable->pItems[v12].uEquipY; - if ( v11 == 64 ) - v166 = "item64v1"; - else - v166 = pItemsTable->pItems[v12].pIconName; - v14 = pIcons_LOD->LoadTexture(v166, TEXTURE_16BIT_PALETTE); - v15 = *(int *)(v218 + 20); - if ( *(int *)(v218 + 20) & 0xF0 ) - { - if ( (*(int *)(v218 + 20) & 0xF0) != 16 ) - { - if ( (*(int *)(v218 + 20) & 0xF0) == 32 ) - { - v167 = "sp28a"; - //v16 = (Texture *)(72 * pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE) + 7145548); - v16 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v218 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v17 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(v13, a3a, (Texture *)(v14 != -1 ? (int)&pIcons_LOD->pTextures[v14] : 0), v16, (signed __int64)v17, 0, 255); - goto LABEL_393;; - } - if ( (*(int *)(v218 + 20) & 0xF0) == 64 ) - { - v167 = "sp30a"; - //v16 = (Texture *)(72 * pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE) + 7145548); - v16 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v218 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v17 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(v13, a3a, (Texture *)(v14 != -1 ? (int)&pIcons_LOD->pTextures[v14] : 0), v16, (signed __int64)v17, 0, 255); - goto LABEL_393; - } - if ( (*(int *)(v218 + 20) & 0xF0) == 128 ) - { - v167 = "sp91a"; - //v16 = (Texture *)(72 * pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE) + 7145548); - v16 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v218 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v17 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(v13, a3a, (Texture *)(v14 != -1 ? (int)&pIcons_LOD->pTextures[v14] : 0), v16, (signed __int64)v17, 0, 255); - goto LABEL_393; - } - } - v167 = "sptext01"; - //v16 = (Texture *)(72 * pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE) + 7145548); - v16 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v167, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v218 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v17 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(v13, a3a, (Texture *)(v14 != -1 ? (int)&pIcons_LOD->pTextures[v14] : 0), v16, (signed __int64)v17, 0, 255); - goto LABEL_393; - } - v18 = v14 + 1; - v19 = (char *)&pIcons_LOD->pTextures[v14]; - if ( v15 & 2 ) - { - v20 = (Texture *)(v18 != 0 ? (int)v19 : 0); - pRenderer->DrawTransparentRedShade(a2a, a3a, v20); - } - else - { - if ( v15 & 1 ) - { - v20 = (Texture *)(v18 != 0 ? (int)v19 : 0); - pRenderer->DrawTextureTransparent(a2a, a3a, v20); - } - else - { - v20 = (Texture *)(v18 != 0 ? (int)v19 : 0); - pRenderer->DrawTransparentGreenShade(a2a, a3a, v20); - } - } - if ( !bRingsShownInCharScreen ) - pRenderer->_4A612A(a2a, a3a, v20, v229); - } -LABEL_393: - pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_RightHand[uPlayerID_a], - pPaperdoll_BodyY + pPaperdoll_RightHand[uPlayerID_a + 1], - (Texture *)(*(unsigned int *)((char *)papredoll_drhs + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_drhs + v240)] : 0)); - v161 = pPlayer->pEquipment.uMainHand; - if ( v161 ) - { - v162 = *(int *)&pPlayer->pInventoryItems[v161-1]; - if ( pItemsTable->pItems[v162].uEquipType == 1 || pItemsTable->pItems[v162].uSkillType == 4 && !pPlayer->pEquipment.uOffHand ) - pRenderer->DrawTextureTransparent(pPaperdoll_BodyX + pPaperdoll_SecondLeftHand[0][uPlayerID_a], - pPaperdoll_BodyY + pPaperdoll_SecondLeftHand[0][uPlayerID_a + 1], - (Texture *)(*(unsigned int *)((char *)papredoll_dlhus + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhus + v240)] : 0)); - } - if ( !bRingsShownInCharScreen ) - pRenderer->DrawTextureTransparent(0x25Bu, 0x12Bu, - (Texture *)(uTextureID_MAGNIF_B != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_MAGNIF_B] : 0)); - pRenderer->DrawTextureTransparent(0x1D4u, 0, - (Texture *)(uTextureID_507B04 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507B04] : 0)); -} - - -//----- (0043E825) -------------------------------------------------------- -void __fastcall CharacterUI_DrawPaperdollWithRingOverlay(unsigned int uPlayerID) -{ - unsigned int v1; // ebx@1 - Player *pPlayer; // edi@1 - int v3; // ecx@1 - int *v4; // edi@3 - unsigned int v5; // ebx@3 - int v6; // eax@3 - LODFile_IconsBitmaps *v7; // ecx@7 - double v8; // st7@16 - int v9; // edi@17 - Texture *v10; // edi@18 - unsigned __int8 v11; // zf@19 - Texture *v12; // eax@19 - char v13; // sf@24 - unsigned __int8 v14; // of@24 - unsigned int v15; // eax@25 - unsigned int v16; // ebx@26 - int v17; // eax@26 - LODFile_IconsBitmaps *v18; // ecx@30 - double v19; // st7@39 - int v20; // edi@40 - int v21; // eax@41 - signed int v22; // ebx@41 - Texture *v23; // edi@41 - int v24; // eax@42 - char *v25; // eax@42 - unsigned int v26; // eax@46 - int v27; // edi@47 - unsigned int v28; // ebx@47 - int v29; // eax@47 - LODFile_IconsBitmaps *v30; // ecx@51 - Texture *v31; // esi@58 - double v32; // st7@60 - int v33; // esi@61 - int v34; // esi@62 - Texture *v35; // eax@63 - const char *v36; // [sp-8h] [bp-38h]@8 - const char *v37; // [sp-8h] [bp-38h]@31 - const char *v38; // [sp-8h] [bp-38h]@52 - int v39; // [sp+10h] [bp-20h]@3 - Texture *v40; // [sp+10h] [bp-20h]@14 - int v41; // [sp+10h] [bp-20h]@26 - Texture *v42; // [sp+10h] [bp-20h]@37 - int v43; // [sp+10h] [bp-20h]@47 - unsigned int a3; // [sp+14h] [bp-1Ch]@3 - unsigned int a2; // [sp+18h] [bp-18h]@3 - unsigned int *v46; // [sp+1Ch] [bp-14h]@1 - Player *v47; // [sp+20h] [bp-10h]@1 - int v48; // [sp+24h] [bp-Ch]@1 - int v49; // [sp+24h] [bp-Ch]@26 - - v1 = uPlayerID; - pPlayer = pPlayers[uPlayerID]; - v47 = pPlayers[uPlayerID]; - pIcons_LOD->LoadTexture("sptext01", TEXTURE_16BIT_PALETTE); - CharacterUI_DrawPaperdoll(v1); - pRenderer->DrawTextureTransparent(0x1D9u, 0, (Texture *)(uTextureID_BACKHAND != -1 ? &pIcons_LOD->pTextures[uTextureID_BACKHAND] : 0)); - pRenderer->DrawTextureTransparent(0x1D4u, 0, (Texture *)(uTextureID_507B04 != -1 ? &pIcons_LOD->pTextures[uTextureID_507B04] : 0)); - pRenderer->DrawTextureIndexed(pCharacterScreen_DetalizBtn->uX, pCharacterScreen_DetalizBtn->uY, - (Texture *)(uTextureID_5118C8 != -1 ? &pIcons_LOD->pTextures[uTextureID_5118C8] : 0)); - v3 = 0; - v46 = &pPlayer->pEquipment.field_28; - v48 = 0; - do - { - if ( !*v46 ) - goto LABEL_24; - v39 = *v46; - v4 = (int *)&pPlayer->pInventoryItems[*v46-1].uItemID; - a3 = pPaperdollRingsY[v3]; - a2 = pPaperdollRingsX[v3]; - v5 = pIcons_LOD->LoadTexture(pItemsTable->pItems[*v4].pIconName, TEXTURE_16BIT_PALETTE); - v6 = *(int *)(v4 + 20); - if ( *(int *)(v4 + 20) & 0xF0 ) - { - if ( (*(int *)(v4 + 20) & 0xF0) != 16 ) - { - if ( (*(int *)(v4 + 20) & 0xF0) == 32 ) - { - v36 = "sp28a"; - } - else - { - if ( (*(int *)(v4 + 20) & 0xF0) != 64 ) - { - v7 = pIcons_LOD; - if ( (*(int *)(v4 + 20) & 0xF0) == 128 ) - { - v36 = "sp91a"; -LABEL_14: - v40 = &pIcons_LOD->pTextures[v7->LoadTexture(v36, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v4 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v8 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(a2, a3, (Texture *)(v5 != -1 ? (int)&pIcons_LOD->pTextures[v5] : 0), - v40, (signed __int64)v8, 0, 255); - goto LABEL_23; - } -LABEL_13: - v36 = "sptext01"; - goto LABEL_14; - } - v36 = "sp30a"; - } - v7 = pIcons_LOD; - goto LABEL_14; - } - v7 = pIcons_LOD; - goto LABEL_13; - } - v9 = v5 + 1; - if ( v6 & 2 ) - { - v10 = (Texture *)(v9 != 0 ? (int)&pIcons_LOD->pTextures[v5] : 0); - pRenderer->DrawTransparentRedShade(a2, a3, v10); - } - else - { - v11 = (v6 & 1) == 0; - v12 = &pIcons_LOD->pTextures[v5]; - if ( v11 ) - { - v10 = (Texture *)(v9 != 0 ? (int)v12 : 0); - pRenderer->DrawTransparentGreenShade(a2, a3, v10); - } - else - { - v10 = (Texture *)(v9 != 0 ? (int)v12 : 0); - pRenderer->DrawTextureTransparent(a2, a3, v10); - } - } - pRenderer->_4A601E(a2, a3, v10, v39); -LABEL_23: - pPlayer = v47; -LABEL_24: - v46 += 4; - v3 = v48 + 4; - v14 = __OFSUB__(v48 + 4, 20); - v11 = v48 == 16; - v13 = v48 - 16 < 0; - v48 += 4; - } - while ( (unsigned __int8)(v13 ^ v14) | v11 ); - v15 = pPlayer->pEquipment.field_24; - if ( !v15 ) - goto LABEL_46; - v41 = pPlayer->pEquipment.field_24; - v49 = (int)&pPlayer->pInventoryItems[v15-1]; - v16 = pIcons_LOD->LoadTexture(pItemsTable->pItems[*(int *)v49].pIconName, TEXTURE_16BIT_PALETTE); - v17 = *(int *)(v49 + 20); - if ( !(*(int *)(v49 + 20) & 0xF0) ) - { - v20 = v16 + 1; - if ( v17 & 2 ) - { - v21 = 9 * v16; - v22 = 493; - v23 = (Texture *)(v20 != 0 ? (int)&pIcons_LOD->pTextures[8 * v21 / 0x48u] : 0); - pRenderer->DrawTransparentRedShade(0x1EDu, 0x5Bu, v23); - } - else - { - v11 = (v17 & 1) == 0; - v24 = 9 * v16; - v22 = 493; - v25 = (char *)&pIcons_LOD->pTextures[8 * v24 / 0x48u]; - if ( v11 ) - { - v23 = (Texture *)(v20 != 0 ? (int)v25 : 0); - pRenderer->DrawTransparentGreenShade(493, 91, v23); - } - else - { - v23 = (Texture *)(v20 != 0 ? (int)v25 : 0); - pRenderer->DrawTextureTransparent(0x1EDu, 0x5Bu, v23); - } - } - pRenderer->_4A601E(v22, 91, v23, v41); - pPlayer = v47; - goto LABEL_46; - } - if ( (*(int *)(v49 + 20) & 0xF0) == 16 ) - { - v18 = pIcons_LOD; - goto LABEL_36; - } - if ( (*(int *)(v49 + 20) & 0xF0) == 32 ) - { - v37 = "sp28a"; - goto LABEL_34; - } - if ( (*(int *)(v49 + 20) & 0xF0) == 64 ) - { - v37 = "sp30a"; -LABEL_34: - v18 = pIcons_LOD; - goto LABEL_37; - } - v18 = pIcons_LOD; - if ( (*(int *)(v49 + 20) & 0xF0) == 128 ) - { - v37 = "sp91a"; - goto LABEL_37; - } -LABEL_36: - v37 = "sptext01"; -LABEL_37: - v42 = &pIcons_LOD->pTextures[v18->LoadTexture(v37, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v49 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v19 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6( - 0x1EDu, - 0x5Bu, - (Texture *)(v16 != -1 ? (int)&pIcons_LOD->pTextures[v16] : 0), - v42, - (signed __int64)v19, - 0, - 255); -LABEL_46: - v26 = pPlayer->pEquipment.field_1C; - if ( !v26 ) - return; - v43 = pPlayer->pEquipment.field_1C; - v27 = (int)&pPlayer->pInventoryItems[v26-1]; - v28 = pIcons_LOD->LoadTexture(pItemsTable->pItems[*(int *)v27].pIconName, TEXTURE_16BIT_PALETTE); - v29 = *(int *)(v27 + 20); - if ( !(*(int *)(v27 + 20) & 0xF0) ) - { - v33 = v28 + 1; - if ( v29 & 2 ) - { - v34 = v33 != 0 ? (int)&pIcons_LOD->pTextures[v28] : 0; - pRenderer->DrawTransparentRedShade(0x24Au, 0x58u, (Texture *)v34); - } - else - { - v11 = (v29 & 1) == 0; - v35 = &pIcons_LOD->pTextures[v28]; - if ( v11 ) - { - v34 = v33 != 0 ? (int)v35 : 0; - pRenderer->DrawTransparentGreenShade(586, 88, (Texture *)v34); - } - else - { - v34 = v33 != 0 ? (int)v35 : 0; - pRenderer->DrawTextureTransparent(0x24Au, 0x58u, (Texture *)v34); - } - } - pRenderer->_4A601E(586, 88, (Texture *)v34, v43); - return; - } - if ( (*(int *)(v27 + 20) & 0xF0) == 16 ) - { - v30 = pIcons_LOD; - goto LABEL_57; - } - if ( (*(int *)(v27 + 20) & 0xF0) == 32 ) - { - v38 = "sp28a"; - goto LABEL_55; - } - if ( (*(int *)(v27 + 20) & 0xF0) == 64 ) - { - v38 = "sp30a"; -LABEL_55: - v30 = pIcons_LOD; - goto LABEL_58; - } - v30 = pIcons_LOD; - if ( (*(int *)(v27 + 20) & 0xF0) == 128 ) - { - v38 = "sp91a"; - goto LABEL_58; - } -LABEL_57: - v38 = "sptext01"; -LABEL_58: - v31 = &pIcons_LOD->pTextures[v30->LoadTexture(v38, TEXTURE_16BIT_PALETTE)]; - dword_50C9A8 -= pEventTimer->uTimeElapsed; - if ( dword_50C9A8 <= 0 ) - { - dword_50C9A8 = 0; - *(char *)(v27 + 20) &= 0xFu; - ptr_50C9A4 = 0; - } - v32 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6(0x24Au, 0x58u, (Texture *)(v28 != -1 ? (int)&pIcons_LOD->pTextures[v28] : 0), - v31, (signed __int64)v32, 0, 255); -} + //----- (0043ED6F) -------------------------------------------------------- bool _43ED6F_check_party_races(bool a1) @@ -12817,89 +10273,6 @@ aMoonPhaseNames[4] = pGlobalTXT_LocalizationStrings[92]; } -//----- (00410B28) -------------------------------------------------------- -void __thiscall DrawSpellDescriptionPopup(int spell_index) -{ - Player *v1; // edi@1 - SpellInfo *v2; // esi@1 - unsigned int v3; // eax@2 - int v4; // eax@4 - LONG v5; // ecx@4 - int v6; // eax@10 - char *v7; // ST44_4@12 - unsigned __int16 v8; // ax@12 - GUIWindow a1; // [sp+Ch] [bp-68h]@4 - int v10; // [sp+60h] [bp-14h]@1 - POINT a2; // [sp+64h] [bp-10h]@1 - int v12; // [sp+6Ch] [bp-8h]@4 - int v13; // [sp+70h] [bp-4h]@4 - - v1 = pPlayers[uActiveCharacter]; - v10 = spell_index; - v2 = &pSpellStats->pInfos[spell_index + 11 * v1->lastOpenedSpellbookPage + 1]; - if ( pMouse->GetCursorPos(&a2)->y <= 250 ) - v3 = pMouse->GetCursorPos(&a2)->y + 30; - else - v3 = 30; - a1.uFrameY = v3; - a1.uFrameWidth = 328; - a1.uFrameHeight = 68; - a1.uFrameX = 90; - a1.uFrameZ = 417; - a1.uFrameW = v3 + 67; - a1.Hint = 0; - a2.y = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL]); - v13 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_MASTER]); - v12 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT]); - v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[LOCSTR_GRAND]); - v5 = a2.y; - if ( v13 > a2.y ) - v5 = v13; - if ( v12 > v5 ) - v5 = v12; - if ( v4 > v5 ) - v5 = v4; - sprintf( pTmpBuf2, - "%s\n\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s\t000\n%s\t%03d:\t%03d%s", - v2->pDescription, - pGlobalTXT_LocalizationStrings[LOCSTR_NORMAL], - v5 + 3, v5 + 10, - v2->pBasicSkillDesc, - pGlobalTXT_LocalizationStrings[LOCSTR_EXPERT], - v5 + 3, v5 + 10, - v2->pExpertSkillDesc, - pGlobalTXT_LocalizationStrings[LOCSTR_MASTER], - v5 + 3, v5 + 10, - v2->pMasterSkillDesc, - pGlobalTXT_LocalizationStrings[LOCSTR_GRAND], - v5 + 3, v5 + 10, - v2->pGrandmasterSkillDesc); - v6 = pFontSmallnum->CalcTextHeight(pTmpBuf2, &a1, 0, 0); - a1.uFrameHeight += v6; - if ( (signed int)a1.uFrameHeight < 150 ) - a1.uFrameHeight = 150; - a1.uFrameWidth = 460; - a1.DrawMessageBox(0); - a1.uFrameWidth -= 12; - a1.uFrameHeight -= 12; - v7 = v2->pName; - a1.uFrameZ = a1.uFrameX + a1.uFrameWidth - 1; - a1.uFrameW = a1.uFrameHeight + a1.uFrameY - 1; - v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - a1.DrawTitleText(pFontArrus, 0x78u, 0xCu, v8, v7, 3u); - a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2, 0, 0, 0); - a1.uFrameWidth = 108; - a1.uFrameZ = a1.uFrameX + 107; - a1.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v1->lastOpenedSpellbookPage + 12], 3u); - sprintf( pTmpBuf, "%s\n%d", pGlobalTXT_LocalizationStrings[LOCSTR_SP_COST], - pSpellDatas[spell_index + 11 * v1->lastOpenedSpellbookPage + 1].mana_per_skill[v1->pActiveSkills[v1->lastOpenedSpellbookPage + PLAYER_SKILL_FIRE]]); - // *(&[0].field_12 //temp_fix field_14 - // + ((unsigned int)LOBYTE(v1->pActiveSkills[v1->lastOpenedSpellbookPage + 12]) >> 6) - // + 10 * (int)((char *)v10 + 11 * v1->lastOpenedSpellbookPage))); - a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf, 3u); - dword_507B00_spell_info_to_draw_in_popup = 0; -} -// 507B00: using guessed type int dword_507B00_spell_info_to_draw_in_popup; //----- (00410D99) -------------------------------------------------------- signed int __fastcall sub_410D99_get_map_index(int a1) @@ -13221,1007 +10594,6 @@ } // 4E1D3A: using guessed type __int16 word_4E1D3A[]; -//----- (00411300) -------------------------------------------------------- -void LoadSpellbook(unsigned int spell_school) -{ - //unsigned int v1; // esi@1 - Player *pPlayer; // ecx@1 - char v3; // al@1 - //int v4; // edi@5 - //Texture *result; // eax@6 - //unsigned char *v6; // edi@7 - //unsigned int v7; // eax@7 - //unsigned __int8 v8; // sf@8 - //unsigned __int8 v9; // of@8 - char pContainer[20]; // [sp+Ch] [bp-1Ch]@7 - //Texture *v11; // [sp+20h] [bp-8h]@5 - //int v12; // [sp+24h] [bp-4h]@5 - - byte_506550 = 0; - //v1 = uID; - pPlayer = pPlayers[uActiveCharacter]; - v3 = pPlayer->uQuickSpell; - if ( v3 && (unsigned __int8)v3 / 11 == spell_school ) - quick_spell_at_page = (unsigned __int8)v3 - 11 * spell_school; - else - quick_spell_at_page = 0; - - for (uint i = 1; i < 12; ++i) - { - if (pPlayer->spellbook.pChapters[spell_school].bIsSpellAvailable[i - 1]) - { - sprintf(pContainer, "SB%sS%02d", spellbook_texture_filename_suffices[spell_school], pSpellbookSpellIndices[spell_school][i]); - dword_506408[i] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); - - sprintf(pContainer, "SB%sC%02d", spellbook_texture_filename_suffices[spell_school], pSpellbookSpellIndices[spell_school][i]); - dword_5063D8[i] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); - } - } -} - -//----- (0041140B) -------------------------------------------------------- -GUIWindow *__cdecl sub_41140B() -{ - signed int v0; // esi@1 - GUIButton *v1; // eax@3 - GUIButton *v2; // esi@4 - GUIWindow *result; // eax@5 - - v0 = 0; - do - { - dword_5063D8[11+v0]->Release(); - dword_506408[11+v0]->Release(); - --v0; - } - while ( v0 >= -11 ); - pIcons_LOD->_40F9C5(); - v1 = pGUIWindow_CurrentMenu->pControlsHead; - if ( v1 ) - { - do - { - v2 = v1->pNext; - pAllocator->FreeChunk(v1); - v1 = v2; - } - while ( v2 ); - } - pGUIWindow_CurrentMenu->pControlsHead = 0; - pGUIWindow_CurrentMenu->pControlsTail = 0; - result = pGUIWindow_CurrentMenu; - pGUIWindow_CurrentMenu->uNumControls = 0; - return result; -} - -//----- (00411473) -------------------------------------------------------- -void __cdecl sub_411473() -{ - pTexture_pagemask->Release(); - pTexture_506448->Release(); - pTexture_50643C->Release(); - for (uint i = 0; i < 8; ++i) - { - pSpellBookPagesTextr[i]->Release(); - pTextures_tabs[i][0]->Release(); - pTextures_tabs[i][1]->Release(); - } - pAudioPlayer->PlaySound((SoundID)231, 0, 0, -1, 0, 0, 0, 0); - pIcons_LOD->_4114F2(); -} - - -//----- (00411597) -------------------------------------------------------- -void __cdecl OnCloseSpellook() -{ - pAllocator->FreeChunk(pSpellFont); - pSpellFont = 0; - pAllocator->FreeChunk(pBookFont); - pBookFont = 0; - pAllocator->FreeChunk(pBook2Font); - pBook2Font = 0; - pAllocator->FreeChunk(pAutonoteFont); - pAutonoteFont = 0; - pTexture_mapbordr->Release(); - pAudioPlayer->PlaySound((SoundID)231, 0, 0, -1, 0, 0, 0, 0); - pIcons_LOD->_4114F2(); - dword_506364 = 0; -} -// 506364: using guessed type int dword_506364; - - - - - - - -//----- (00412AF9) -------------------------------------------------------- -void sub_412AF9() - { - int v0; // ecx@1 - - v0 = 0; - if ( uActiveCharacter ) - v0 = pParty->pPlayers[uActiveCharacter-1].lastOpenedSpellbookPage;//*((char *)&pParty->pPartyBuffs[5].uExpireTime + 6972 * uActiveCharacter + 2); - pRenderer->DrawTextureIndexed(8u, 8u, pSpellBookPagesTextr[v0]); - pRenderer->DrawTextureIndexed(0x1DCu, 0x1C2u, pTexture_50643C); - pRenderer->DrawTextureIndexed(0x231u, 0x1C2u, pTexture_506448); -} - -//----- (00412B58) -------------------------------------------------------- -void __cdecl DrawSpellBookContent() -{ - Player *v0; // ebx@1 - int v1; // ebp@1 - unsigned int v2; // eax@1 - Texture *v3; // edi@1 - int v4; // esi@1 - Texture *v5; // eax@3 - Texture *v6; // edx@5 - int v7; // eax@8 - int v8; // eax@11 - POINT *v9; // esi@13 - int v10; // eax@13 - Texture *v11; // edx@14 - int v12; // eax@15 - signed int v13; // ecx@18 - unsigned int v14; // esi@18 - unsigned int v15; // edi@18 - Texture *pPageTexture; // eax@21 - unsigned int v17; // [sp-Ch] [bp-2Ch]@8 - unsigned int v18; // [sp-Ch] [bp-2Ch]@15 - unsigned int v19; // [sp-8h] [bp-28h]@8 - unsigned int v20; // [sp-8h] [bp-28h]@15 - Texture *v21; // [sp-4h] [bp-24h]@15 - signed int v22; // [sp-4h] [bp-24h]@22 - Texture *v23; // [sp+10h] [bp-10h]@5 - POINT a2; // [sp+18h] [bp-8h]@13 - POINT v24; - int v25; - - sub_412AF9(); - v0 = pPlayers[uActiveCharacter]; - v1 = 11 * v0->lastOpenedSpellbookPage; - v2 = pIcons_LOD->FindTextureByName("Pending"); - v3 = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0); - pRenderer->ClearZBuffer(0, 479); - v4 = 1; - if ( __OFSUB__(v1, v1 + 11) ^ 1 ) - { - do - { - if ( *(&v0->_guilds_member_bits[v1 + 63] + v4) ) - { - v5 = (Texture *)dword_506408[v4]; - if ( v5 != v3 ) - { - if ( quick_spell_at_page == v4 ) - { - v6 = dword_5063D8[v4]; - v23 = dword_5063D8[v4]; - } - else - { - v23 = dword_506408[v4]; - v6 = v5; - } - if ( v6->pLevelOfDetail0 ) - { - v7 = v0->lastOpenedSpellbookPage; - // v7 = (12 * v0->lastOpenedSpellbookPage + pSpellbookSpellIndices[v0->lastOpenedSpellbookPage][v4]); - v19 = pViewport->uViewportTL_Y + pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Ypos; - v17 = pViewport->uViewportTL_X + pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Xpos; - if ( BYTE1(v6->pBits) & 2 ) - pRenderer->DrawTextureTransparent(v17, v19, v6); - else - pRenderer->DrawTextureIndexed(v17, v19, v6); - pRenderer->_4A612A(pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Xpos, - pIconPos[v7][pSpellbookSpellIndices[v7][v4]].Ypos, v23, v4); - } - } - } - ++v4; - } - while ( v4 + v1 - 1 < v1 + 11 ); - } - v9 = pMouse->GetCursorPos(&a2); - v10 = pRenderer->pActiveZBuffer[v9->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v24)->y]] & 0xFFFF; - if ( v10 ) - { - v11 = dword_5063D8[v10]; - if ( v11->pLevelOfDetail0 ) - { - v21 = dword_5063D8[v10]; - v12 = v0->lastOpenedSpellbookPage; - // v12 = (12 * v0->lastOpenedSpellbookPage + pSpellbookSpellIndices[v0->lastOpenedSpellbookPage][v10]); - v20 = pViewport->uViewportTL_Y + pIconPos[v12][pSpellbookSpellIndices[v12][v10]].Ypos; - v18 = pViewport->uViewportTL_X + pIconPos[v12][pSpellbookSpellIndices[v12][v10]].Xpos; - if ( BYTE1(v11->pBits) & 2 ) - pRenderer->DrawTextureTransparent(v18, v20, v21); - else - pRenderer->DrawTextureIndexed(v18, v20, v21); - } - } - v13 = 0; - a2.x = (LONG)&v0->pActiveSkills[12]; - v14 = (unsigned int)&v0->pActiveSkills[12]; - v15 = (unsigned int)&v0->pActiveSkills[12]; - v25 = 0; - do - { - if ( *(short *)a2.x ) - { - if ( v0->lastOpenedSpellbookPage == v13 ) - { - pPageTexture = pTextures_tabs[v13][1]; - switch ( v13 ) - { - case 0: - v14 = 406; - v22 = 9; - goto LABEL_27; - case 1: - v14 = 406; - goto LABEL_38; - case 2: - v14 = 406; - v22 = 84; - goto LABEL_27; - case 3: - v14 = 406; - goto LABEL_26; - case 4: - v14 = 407; - goto LABEL_29; - case 5: - v15 = 196; - goto LABEL_34; - case 6: - v15 = 234; - goto LABEL_34; - case 7: - v15 = 272; - goto LABEL_34; - case 8: - v15 = 309; -LABEL_34: - v14 = 405; - break; - default: - break; - } - } - else - { - pPageTexture = pTextures_tabs[v13][0]; - switch ( v13 ) - { - case 0: - v14 = 415; - v22 = 10; - goto LABEL_27; - case 1: - v14 = 415; -LABEL_38: - v22 = 46; - goto LABEL_27; - case 2: - v14 = 415; - v22 = 83; - goto LABEL_27; - case 3: - v14 = 415; -LABEL_26: - v22 = 121; -LABEL_27: - v15 = v22; - break; - case 4: - v14 = 415; -LABEL_29: - v15 = 158; - break; - case 5: - v15 = 196; - goto LABEL_46; - case 6: - v15 = 234; - goto LABEL_46; - case 7: - v15 = 271; - goto LABEL_46; - case 8: - v15 = 307; -LABEL_46: - v14 = 416; - break; - default: - break; - } - } - pRenderer->DrawTextureTransparent(v14, v15, pPageTexture); - v13 = v25; - } - a2.x += 2; - ++v13; - v25 = v13; - } - while ( v13 < 9 ); -} -// 506408: using guessed type int dword_506408[]; -// 50654C: using guessed type int dword_50654C; - -//----- (00412E85) -------------------------------------------------------- -char __cdecl DrawBook_History() -{ - unsigned int v0; // eax@3 - unsigned int v1; // eax@7 - int v2; // eax@10 - const char *v3; // eax@10 - signed int v4; // ecx@12 - int v5; // ecx@14 - int v6; // eax@21 - int v7; // esi@21 - char *v8; // eax@21 - int v9; // eax@22 - unsigned int v11; // [sp-8h] [bp-64h]@3 - unsigned int v12; // [sp-8h] [bp-64h]@7 - Texture *v13; // [sp-4h] [bp-60h]@3 - Texture *v14; // [sp-4h] [bp-60h]@7 - GUIWindow a1; // [sp+8h] [bp-54h]@10 - - pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_11); - if ( dword_506548 || !dword_506528 ) - { - v13 = pTex_tab_an_6a__zoom_off; - v11 = pViewport->uViewportTL_Y + 2; - v0 = pViewport->uViewportTL_X + 407; - } - else - { - v13 = pTex_tab_an_6b__zoom_on; - v11 = pViewport->uViewportTL_Y + 1; - v0 = pViewport->uViewportTL_X + 398; - } - pRenderer->DrawTextureTransparent(v0, v11, v13); - if ( dword_506544 || dword_506528 + awards_count >= awards_count2 ) - { - v14 = pTex_tab_an_7a__zoot_off; - v12 = pViewport->uViewportTL_Y + 38; - v1 = pViewport->uViewportTL_X + 407; - } - else - { - v14 = pTex_tab_an_7b__zoot_on; - v12 = pViewport->uViewportTL_Y + 38; - v1 = pViewport->uViewportTL_X + 398; - } - pRenderer->DrawTextureTransparent(v1, v12, v14); - if ( !byte_5C6D50[dword_506528] ) - { - v2 = achievedAwardsIndex[dword_506528]; - a1.uFrameWidth = 460; - a1.uFrameX = 8; - a1.uFrameY = 8; - a1.uFrameHeight = 344; - v3 = (const char *)pStorylineText->StoreLine[v2].pPageTitle;//field_4[]; - a1.uFrameZ = 467; - a1.uFrameW = 351; - if ( v3 ) - a1.DrawTitleText(pBook2Font, 0, 0x16u, 0, v3, 3u); - } - a1.uFrameX = 48; - a1.uFrameY = 70; - a1.uFrameWidth = 360; - a1.uFrameHeight = 264; - v4 = LOBYTE(pAutonoteFont->uFontHeight) - 3; - a1.uFrameZ = 407; - a1.uFrameHeight = v4 * 264 / v4; - a1.uFrameW = a1.uFrameHeight + 69; - if ( dword_506544 && dword_506528 + awards_count < awards_count2 ) - { - pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); - v5 = dword_50651C++; - dword_506528 += awards_count; - byte_506130[v5] = awards_count; - } - if ( dword_506548 && dword_50651C ) - { - pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); - --dword_50651C; - dword_506528 -= (unsigned __int8)byte_506130[dword_50651C]; - } - if ( !awards_count || dword_506528 < 1 ) - { - dword_506528 = 0; - dword_50651C = 0; - } - dword_506544 = 0; - v6 = achievedAwardsIndex[dword_506528]; - dword_506548 = 0; - awards_count = 0; - //v7 = *pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6); - v7 = (int)pStorylineText->StoreLine[v6].pText;//*(&pStorylineText->field_0 + 3 * v6); - v8 = BuilDialogueString( - pStorylineText->StoreLine[v6].pText, - uActiveCharacter - 1, - 0, - 0, - 0, - (__int64 *)&pParty->field_3C._s_times[ v6 + 21]); - if ( v7 ) - { - v9 = pAutonoteFont->_44C6C2(v8, &a1, 1u, (unsigned __int8)byte_5C6D50[dword_506528]); - LOBYTE(v8) = a1.DrawText(pAutonoteFont, 1, 0, 0, (const char *)v9, 0, a1.uFrameY + a1.uFrameHeight, 0); - ++awards_count; - } - return (char)v8; -} - - -//----- (00413126) -------------------------------------------------------- -void __cdecl DrawBook_Quests() -{ - unsigned int v0; // eax@3 - unsigned int v1; // eax@7 - int v2; // ecx@11 - int v3; // ebx@16 - int v4; // eax@19 - const char *v5; // edi@19 - int v6; // eax@19 - unsigned int v7; // edi@19 - unsigned int v8; // [sp-8h] [bp-68h]@3 - unsigned int v9; // [sp-8h] [bp-68h]@7 - Texture *v10; // [sp-4h] [bp-64h]@3 - Texture *v11; // [sp-4h] [bp-64h]@7 - GUIWindow a1; // [sp+Ch] [bp-54h]@9 - - pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_CurrentBook); - if ( dword_506548 || !dword_506528 ) - { - v10 = pTex_tab_an_6a__zoom_off; - v8 = pViewport->uViewportTL_Y + 2; - v0 = pViewport->uViewportTL_X + 407; - } - else - { - v10 = pTex_tab_an_6b__zoom_on; - v8 = pViewport->uViewportTL_Y + 1; - v0 = pViewport->uViewportTL_X + 398; - } - pRenderer->DrawTextureTransparent(v0, v8, v10); - if ( dword_506544 || dword_506528 + awards_count >= awards_count2 ) - { - v11 = pTex_tab_an_7a__zoot_off; - v9 = pViewport->uViewportTL_Y + 38; - v1 = pViewport->uViewportTL_X + 407; - } - else - { - v11 = pTex_tab_an_7b__zoot_on; - v9 = pViewport->uViewportTL_Y + 38; - v1 = pViewport->uViewportTL_X + 398; - } - pRenderer->DrawTextureTransparent(v1, v9, v11); - a1.uFrameWidth = 460; - a1.uFrameHeight = 344; - a1.uFrameX = 8; - a1.uFrameY = 8; - a1.uFrameZ = 467; - a1.uFrameW = 351; - a1.DrawTitleText(pBook2Font, 0, 0x16u, 0, pGlobalTXT_LocalizationStrings[174], 3u); - a1.uFrameX = 48; - a1.uFrameY = 70; - a1.uFrameWidth = 360; - a1.uFrameHeight = 264; - a1.uFrameZ = 407; - a1.uFrameW = 333; - if ( dword_506544 && dword_506528 + awards_count < awards_count2 ) - { - pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); - v2 = dword_50651C++; - dword_506528 += awards_count; - byte_506130[v2] = awards_count; - } - if ( dword_506548 && dword_50651C ) - { - pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); - --dword_50651C; - dword_506528 -= (unsigned __int8)byte_506130[dword_50651C]; - } - if ( !awards_count || (v3 = dword_506528, dword_506528 < 1) ) - { - v3 = 0; - dword_50651C = 0; - dword_506528 = 0; - } - dword_506544 = 0; - dword_506548 = 0; - awards_count = 0; - while ( v3 < awards_count2 ) - { - v4 = achievedAwardsIndex[v3]; - ++awards_count; - v5 = pQuestTable[v4-1];//(&dword_722F10)[4 * v4]; - a1.DrawText(pAutonoteFont, 1, 0, 0, pQuestTable[v4-1], 0, 0, 0);//(&dword_722F10)[4 * v4], 0, 0, 0); - v6 = pAutonoteFont->CalcTextHeight(v5, &a1, 1, 0); - v7 = a1.uFrameY + v6; - if ( (signed int)(a1.uFrameY + v6) > (signed int)a1.uFrameHeight ) - break; - pRenderer->DrawTextureTransparent(100, v7 + 12, pSpellBookPagesTextr_10); - ++v3; - a1.uFrameY = v7 + 24; - } -} - - -//----- (0041338E) -------------------------------------------------------- -void __cdecl DrawBook_Autonotes() -{ - unsigned int v0; // eax@3 - unsigned int v1; // eax@7 - signed int v2; // ebp@11 - unsigned int v3; // eax@18 - unsigned int v4; // eax@24 - unsigned int v5; // eax@30 - unsigned int v6; // eax@36 - unsigned int v7; // eax@42 - signed int v8; // ebp@47 - int v9; // eax@52 - int v10; // eax@56 - int v11; // edx@57 - int v12; // ebp@64 - int v13; // eax@65 - const char *v14; // edi@65 - int v15; // eax@65 - unsigned int v16; // edi@65 - unsigned int v17; // [sp-8h] [bp-70h]@3 - unsigned int v18; // [sp-8h] [bp-70h]@7 - unsigned int v19; // [sp-8h] [bp-70h]@18 - unsigned int v20; // [sp-8h] [bp-70h]@24 - unsigned int v21; // [sp-8h] [bp-70h]@30 - unsigned int v22; // [sp-8h] [bp-70h]@36 - unsigned int v23; // [sp-8h] [bp-70h]@42 - Texture *v24; // [sp-4h] [bp-6Ch]@3 - Texture *v25; // [sp-4h] [bp-6Ch]@7 - Texture *v26; // [sp-4h] [bp-6Ch]@18 - Texture *v27; // [sp-4h] [bp-6Ch]@24 - Texture *v28; // [sp-4h] [bp-6Ch]@30 - Texture *v29; // [sp-4h] [bp-6Ch]@36 - Texture *v30; // [sp-4h] [bp-6Ch]@42 - signed __int16 v31; // [sp+10h] [bp-58h]@1 - char *v32; // [sp+10h] [bp-58h]@49 - GUIWindow a1; // [sp+14h] [bp-54h]@46 - - v31 = 0; - pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pTexture_AutonotesBook); - if ( dword_506548 || !dword_506528 ) - { - v24 = pTex_tab_an_6a__zoom_off; - v17 = pViewport->uViewportTL_Y + 2; - v0 = pViewport->uViewportTL_X + 407; - } - else - { - v24 = pTex_tab_an_6b__zoom_on; - v17 = pViewport->uViewportTL_Y + 1; - v0 = pViewport->uViewportTL_X + 398; - } - pRenderer->DrawTextureTransparent(v0, v17, v24); - if ( dword_506544 || dword_506528 + awards_count >= awards_count2 ) - { - v25 = pTex_tab_an_7a__zoot_off; - v18 = pViewport->uViewportTL_Y + 38; - v1 = pViewport->uViewportTL_X + 407; - } - else - { - v25 = pTex_tab_an_7b__zoot_on; - v18 = pViewport->uViewportTL_Y + 38; - v1 = pViewport->uViewportTL_X + 398; - } - pRenderer->DrawTextureTransparent(v1, v18, v25); - if ( !dword_506540 ) - { - if ( dword_506568 ) - { - pRenderer->DrawTextureTransparent( - pViewport->uViewportTL_X + 408, - pViewport->uViewportTL_Y + 113, - pTexture_506390); - v2 = 1; - goto LABEL_16; - } - goto LABEL_14; - } - if ( !dword_506568 ) - { -LABEL_14: - v2 = 1; - goto LABEL_15; - } - v2 = 1; - v31 = 1; - pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); -LABEL_15: - dword_506568 = 0; - pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTexture_506394); -LABEL_16: - if ( dword_50653C ) - { - if ( dword_506568 != v2 ) - { - v31 = v2; - pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); - } - } - else - { - if ( dword_506568 != v2 ) - { - v26 = pTexture_506388; - v19 = pViewport->uViewportTL_Y + 150; - v3 = pViewport->uViewportTL_X + 408; - goto LABEL_22; - } - } - v26 = pTexture_50638C; - dword_506568 = v2; - v19 = pViewport->uViewportTL_Y + 150; - v3 = pViewport->uViewportTL_X + 399; -LABEL_22: - pRenderer->DrawTextureTransparent(v3, v19, v26); - if ( dword_506538 ) - { - if ( dword_506568 != 2 ) - { - v31 = v2; - pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); - } - } - else - { - if ( dword_506568 != 2 ) - { - v27 = pTexture_506380; - v20 = pViewport->uViewportTL_Y + 188; - v4 = pViewport->uViewportTL_X + 408; - goto LABEL_28; - } - } - v27 = pTexture_506384; - dword_506568 = 2; - v20 = pViewport->uViewportTL_Y + 188; - v4 = pViewport->uViewportTL_X + 397; -LABEL_28: - pRenderer->DrawTextureTransparent(v4, v20, v27); - if ( dword_506534 ) - { - if ( dword_506568 != 3 ) - { - v31 = v2; - pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); - } - } - else - { - if ( dword_506568 != 3 ) - { - v28 = pTexture_506378; - v21 = pViewport->uViewportTL_Y + 226; - v5 = pViewport->uViewportTL_X + 408; - goto LABEL_34; - } - } - v28 = pTexture_50637C; - dword_506568 = 3; - v21 = pViewport->uViewportTL_Y + 226; - v5 = pViewport->uViewportTL_X + 397; -LABEL_34: - pRenderer->DrawTextureTransparent(v5, v21, v28); - if ( dword_506530 ) - { - if ( dword_506568 != 4 ) - { - v31 = v2; - pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); - } - } - else - { - if ( dword_506568 != 4 ) - { - v29 = pTexture_506370; - v22 = pViewport->uViewportTL_Y + 263; - v6 = pViewport->uViewportTL_X + 408; - goto LABEL_40; - } - } - v29 = pTexture_506374; - dword_506568 = 4; - v22 = pViewport->uViewportTL_Y + 264; - v6 = pViewport->uViewportTL_X + 397; -LABEL_40: - pRenderer->DrawTextureTransparent(v6, v22, v29); - if ( dword_50652C ) - { - if ( dword_506568 != 5 ) - { - v31 = v2; - pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); - } - } - else - { - if ( dword_506568 != 5 ) - { - v30 = pTexture_506368; - v23 = pViewport->uViewportTL_Y + 302; - v7 = pViewport->uViewportTL_X + 408; - goto LABEL_46; - } - } - v30 = pTexture_50636C; - dword_506568 = 5; - v23 = pViewport->uViewportTL_Y + 302; - v7 = pViewport->uViewportTL_X + 397; -LABEL_46: - pRenderer->DrawTextureTransparent(v7, v23, v30); - a1.uFrameWidth = 460; - a1.uFrameHeight = 344; - a1.uFrameX = 8; - a1.uFrameY = 8; - a1.uFrameZ = 467; - a1.uFrameW = 467; - a1.DrawTitleText(pBook2Font, 0, 0x16u, 0, pGlobalTXT_LocalizationStrings[154], 3u); - a1.uFrameX = 48; - a1.uFrameY = 70; - a1.uFrameWidth = 360; - a1.uFrameHeight = 264; - a1.uFrameZ = 407; - a1.uFrameW = 333; - if ( v31 ) - { - awards_count2 = 0; - dword_506528 = 0; - dword_50651C = 0; - awards_count = 0; - v8 = 0; - do - { - //if ( dword_72371C[2 * v8] == dword_506568 ) - if ( pAutonoteTxt[v8-1].eType == dword_506568 ) - { - //v32 = (&dword_723718_autonote_related)[8 * (signed __int16)v8]; - v32 = (char *)pAutonoteTxt[v8-1].pText; - if ( (short)v8 ) - { - if ( (unsigned __int16)_449B57_test_bit(pParty->_autonote_bits, v8) && v32 ) - { - v9 = awards_count++; - achievedAwardsIndex[v9] = (signed __int16)v8; - } - } - } - ++v8; - } - while ( v8 < 196 ); - awards_count2 = awards_count; - } - else - { - if ( dword_506544 ) - { - v10 = awards_count + dword_506528; - if ( awards_count + dword_506528 < awards_count2 ) - { - v11 = dword_50651C++; - byte_506130[v11] = awards_count; - dword_506528 = v10; - pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); - } - } - if ( dword_506548 && dword_50651C ) - { - --dword_50651C; - dword_506528 -= (unsigned __int8)byte_506130[dword_50651C]; - pAudioPlayer->PlaySound((SoundID)230, 0, 0, -1, 0, 0, 0, 0); - } - if ( !awards_count || dword_506528 < 1 ) - { - dword_506528 = 0; - dword_50651C = 0; - } - } - v12 = dword_506528; - dword_50652C = 0; - dword_506544 = 0; - dword_506548 = 0; - awards_count = 0; - dword_506530 = 0; - dword_506534 = 0; - dword_506538 = 0; - dword_50653C = 0; - dword_506540 = 0; - while ( v12 < awards_count2 ) - { - v13 = achievedAwardsIndex[v12]; - ++awards_count; - //v14 = (&dword_723718_autonote_related)[8 * v13]; - v14 = pAutonoteTxt[v13-1].pText; - //a1.DrawText(pAutonoteFont, 1, 0, 0, (&dword_723718_autonote_related)[8 * v13], 0, 0, 0); - a1.DrawText(pAutonoteFont, 1, 0, 0, pAutonoteTxt[v13-1].pText, 0, 0, 0); - v15 = pAutonoteFont->CalcTextHeight(v14, &a1, 1, 0); - v16 = a1.uFrameY + v15; - if ( (signed int)(a1.uFrameY + v15) > (signed int)a1.uFrameHeight ) - break; - pRenderer->DrawTextureTransparent(0x64u, v16 + 12, pSpellBookPagesTextr_10); - ++v12; - a1.uFrameY = v16 + 24; - } -} - - -//----- (00413980) -------------------------------------------------------- -void DrawBook_Maps() - { - - int v6; // eax@31 - unsigned int map_id; // eax@35 - Texture *buttnTxtr; // [sp-4h] [bp-DCh]@3 - char party_coord[120]; // [sp+Ch] [bp-CCh]@37 - GUIWindow map_window; // [sp+84h] [bp-54h]@35 - unsigned int textrX, textrY; - - pRenderer->DrawTextureIndexed(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, pSpellBookPagesTextr_12); - if ( dword_506548 || viewparams->field_2C / 128 >= 12 ) - { - buttnTxtr = pTex_tab_an_6a__zoom_off; - textrY = pViewport->uViewportTL_Y + 2; - textrX = pViewport->uViewportTL_X + 408; - } - else - { - buttnTxtr = pTex_tab_an_6b__zoom_on; - textrY = pViewport->uViewportTL_Y + 1; - textrX = pViewport->uViewportTL_X + 398; - } - pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr); - if ( dword_506544 || viewparams->field_2C / 128 <= 3 ) - { - buttnTxtr = pTex_tab_an_7a__zoot_off; - textrY = pViewport->uViewportTL_Y + 38; - textrX = pViewport->uViewportTL_X + 408; - } - else - { - buttnTxtr = pTex_tab_an_7b__zoot_on; - textrY = pViewport->uViewportTL_Y + 38; - textrX = pViewport->uViewportTL_X + 398; - } - pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr); - if ( dword_506540 ) - { - buttnTxtr = pTexture_506390; - textrY = pViewport->uViewportTL_Y + 113; - textrX = pViewport->uViewportTL_X + 408; - } - else - { - buttnTxtr = pTexture_506394; - textrY = pViewport->uViewportTL_Y + 113; - textrX = pViewport->uViewportTL_X + 398; - } - pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr); - if ( dword_50653C ) - { - buttnTxtr = pTexture_506388; - textrY = pViewport->uViewportTL_X + 150; - textrX = pViewport->uViewportTL_Y + 408; - } - else - { - buttnTxtr = pTexture_50638C; - textrY = pViewport->uViewportTL_X + 150; - textrX = pViewport->uViewportTL_Y + 399; - } - pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr); - if ( dword_506538 ) - { - buttnTxtr = pTexture_506380; - textrY = pViewport->uViewportTL_Y + 188; - textrX = pViewport->uViewportTL_X + 408; - } - else - { - buttnTxtr = pTexture_506384; - textrY = pViewport->uViewportTL_Y + 188; - textrX = pViewport->uViewportTL_X + 397; - } - pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr); - if ( dword_506534 ) - { - buttnTxtr = pTexture_506378; - textrY = pViewport->uViewportTL_Y + 226; - textrX = pViewport->uViewportTL_X + 408; - } - else - { - buttnTxtr = pTexture_50637C; - textrY = pViewport->uViewportTL_Y + 226; - textrX = pViewport->uViewportTL_X + 397; - } - pRenderer->DrawTextureTransparent(textrX, textrY, buttnTxtr); - if ( dword_506544 ) - viewparams->CenterOnParty2(); - if ( dword_506548 ) - viewparams->CenterOnParty(); - if ( dword_506540 ) - viewparams->_443219(); - if ( dword_50653C ) - viewparams->_443231(); - if ( dword_506538 ) - viewparams->_44323D(); - if ( dword_506534 ) - viewparams->_443225(); - - if ( dword_506548 | dword_506544 | dword_506540 | dword_50653C | dword_506538 | dword_506534 ) - pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0); - dword_506548 = 0; - dword_506544 = 0; - dword_506534 = 0; - dword_506538 = 0; - dword_50653C = 0; - dword_506540 = 0; - DrawBook_Map_sub(97, 49, 361, 313, 0); - pRenderer->DrawTextureTransparent(75, 22, pTexture_mapbordr); - map_window.uFrameWidth = 460; - map_window.uFrameHeight = 344; - map_window.uFrameX = 8; - map_window.uFrameY = 8; - map_window.uFrameZ = 467; - map_window.uFrameW = 467; - map_id = pMapStats->GetMapInfo(pCurrentMapName); - if ( map_id ) - map_window.DrawTitleText(pBook2Font, -14, 12, 0, pMapStats->pInfos[map_id].pName, 3); - map_window.uFrameX = 0; - sprintf(party_coord, pGlobalTXT_LocalizationStrings[659], pParty->vPosition.x, pParty->vPosition.y); //"x: %d y: %d" - map_window.DrawTitleText(pFontComic, 0, 320, 0, party_coord, 0); -} - - -//----- (00413CC6) -------------------------------------------------------- -void __thiscall SellectDrawBook(unsigned int uBook) -{ - enum WindowType pWindowType; // esi@1 - - pWindowType = (enum WindowType)uBook; - pRenderer->DrawTextureIndexed(471u, 445u, (Texture *)(uExitCancelTextureId != -1 ? (int)&pIcons_LOD->pTextures[uExitCancelTextureId] : 0)); - switch ( pWindowType ) - { - case WINDOW_Lloyd: // 177 - DrawLloydBeaconsScreen(); - break; - case WINDOW_TownPortal: //195 - DrawTownPortalScreen(); - break; - case WINDOW_QuestBook: //200 - DrawBook_Quests(); - break; - case WINDOW_AutonotesBook: //201 - DrawBook_Autonotes(); - break; - case WINDOW_MapsBook://202 - DrawBook_Maps(); - break; - case WINDOW_CalendarBook://203 - DrawBook_Calendar(); - break; - case WINDOW_HistoryBook://224 - DrawBook_History(); - break; - } -} //----- (00413D3C) -------------------------------------------------------- char *__cdecl GetDayPart() @@ -14442,496 +10814,8 @@ } // 4E28F8: using guessed type int pCurrentScreen; -//----- (004142D3) -------------------------------------------------------- -char __cdecl GameMenuUI_DrawKeyBindings() -{ - unsigned int v0; // ebp@1 - int v1; // ecx@2 - unsigned int v2; // eax@6 - GUIWindow *v3; // edx@6 - signed int v4; // ecx@7 - signed int v5; // eax@8 - const char *v6; // ST0C_4@16 - unsigned int v7; // eax@16 - const char *v8; // ST0C_4@16 - unsigned int v9; // eax@16 - const char *v10; // ST0C_4@16 - unsigned int v11; // eax@16 - const char *v12; // ST0C_4@16 - unsigned int v13; // eax@16 - const char *v14; // ST0C_4@16 - unsigned int v15; // eax@16 - const char *v16; // ST0C_4@16 - unsigned int v17; // eax@16 - const char *v18; // ST0C_4@16 - unsigned int v19; // eax@16 - const char *v20; // ST0C_4@16 - unsigned int v21; // eax@16 - signed int v22; // ebp@16 - const char *v23; // ST0C_4@16 - unsigned int v24; // eax@16 - const char *v25; // ST0C_4@16 - unsigned int v26; // eax@16 - const char *v27; // ST0C_4@16 - unsigned int v28; // eax@16 - const char *v29; // ST0C_4@16 - unsigned int v30; // eax@16 - const char *v31; // ST0C_4@16 - unsigned int v32; // eax@16 - const char *v33; // ST0C_4@17 - unsigned int v34; // eax@17 - const char *v35; // ST0C_4@17 - unsigned int v36; // eax@17 - const char *v37; // ST0C_4@17 - unsigned int v38; // eax@17 - const char *v39; // ST0C_4@17 - unsigned int v40; // eax@17 - const char *v41; // ST0C_4@17 - unsigned int v42; // eax@17 - const char *v43; // ST0C_4@17 - unsigned int v44; // eax@17 - const char *v45; // ST0C_4@17 - unsigned int v46; // eax@17 - const char *v47; // ST0C_4@17 - unsigned int v48; // eax@17 - const char *v49; // ST0C_4@17 - unsigned int v50; // eax@17 - const char *v51; // ST0C_4@17 - unsigned int v52; // eax@17 - const char *v53; // ST0C_4@17 - unsigned int v54; // eax@17 - const char *v55; // ST0C_4@17 - unsigned int v56; // eax@17 - const char *v57; // ST0C_4@17 - unsigned int v58; // eax@17 - unsigned int v59; // eax@18 - int v61; // [sp-14h] [bp-28h]@16 - const char *v62; // [sp-10h] [bp-24h]@16 - int v63; // [sp-Ch] [bp-20h]@16 - int v64; // [sp-8h] [bp-1Ch]@16 - unsigned int v65; // [sp-4h] [bp-18h]@16 - unsigned int a5; // [sp+10h] [bp-4h]@1 - - v0 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); - a5 = v0; - if ( byte_4E28FC ) - { - v1 = dword_507C0C + 15; - dword_507C0C = v1; - if ( v1 == 255 ) - byte_4E28FC = 0; - } - else - { - v1 = dword_507C0C - 15; - dword_507C0C = v1; - if ( v1 == 15 ) - byte_4E28FC = 1; - } - v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v1, 0, 0); - v3 = pGUIWindow_CurrentMenu; - dword_507C08 = v2; - if ( pGUIWindow_CurrentMenu->field_40 == 2 ) - { - pPrevVirtualCidesMapping[dword_506E68] = pKeyActionMap->pPressedKeysBuffer[0]; - memset(&KeyButtonFlagChangesArray, 0, sizeof(KeyButtonFlagChangesArray)); - v4 = 0; - do - { - v5 = 0; - do - { - if ( v4 != v5 && pPrevVirtualCidesMapping[v4] == pPrevVirtualCidesMapping[v5] ) - { - KeyButtonFlagChangesArray[v4] = 1; - KeyButtonFlagChangesArray[v5] = 1; - } - ++v5; - } - while ( v5 < 28 ); - ++v4; - } - while ( v4 < 28 ); - dword_506E68 = -1; - v3->field_40 = 0; - } - pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_Optkb[0] != -1 ? &pIcons_LOD->pTextures[uTextureID_Optkb[0]] : 0)); - if ( KeyboardPageNum == 1 ) - { - pRenderer->DrawTextureIndexed(0x13, 0x12E, (Texture *)(uTextureID_Optkb[3] != -1 ? &pIcons_LOD->pTextures[uTextureID_Optkb[3]] : 0)); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, v0, ascii_4E2D5C, 0, 0, 0); - v6 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[0]); - v7 = sub_414D24(0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, v7, v6, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 163, v0, ascii_4E2D50, 0, 0, 0); - v8 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[1]); - v9 = sub_414D24(1); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 163, v9, v8, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 184, v0, ascii_4E2D48, 0, 0, 0); - v10 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[2]); - v11 = sub_414D24(2); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 184, v11, v10, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 205, v0, ascii_4E2D40, 0, 0, 0); - v12 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[3]); - v13 = sub_414D24(3); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 205, v13, v12, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 226, v0, ascii_4E2D38, 0, 0, 0); - v14 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[4]); - v15 = sub_414D24(4); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 226, v15, v14, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 247, v0, ascii_4E2D30, 0, 0, 0); - v16 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[5]); - v17 = sub_414D24(5); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 247, v17, v16, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 268, v0, ascii_4E2D28, 0, 0, 0); - v18 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[6]); - v19 = sub_414D24(6); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 268, v19, v18, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 142, v0, ascii_4E2D1C, 0, 0, 0); - v20 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[7]); - v21 = sub_414D24(7); - v22 = 350; - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 142, v21, v20, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 163, a5, ascii_4E2D14, 0, 0, 0); - v23 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[8]); - v24 = sub_414D24(8); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 163, v24, v23, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 184, a5, ascii_4E2D0C, 0, 0, 0); - v25 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[9]); - v26 = sub_414D24(9); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 184, v26, v25, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 205, a5, ascii_4E2D04, 0, 0, 0); - v27 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[10]); - v28 = sub_414D24(10); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 205, v28, v27, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 226, a5, ascii_4E2CFC, 0, 0, 0); - v29 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[11]); - v30 = sub_414D24(11); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 226, v30, v29, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 247, a5, ascii_4E2CF0, 0, 0, 0); - v31 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[12]); - v32 = sub_414D24(12); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 247, v32, v31, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 268, a5, ascii_4E2CE8, 0, 0, 0); - v65 = 0; - v64 = 0; - v63 = 0; - v62 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[13]); - v61 = 13; - } - else - { - pRenderer->DrawTextureIndexed(0x7F, 0x12E, (Texture *)(uTextureID_Optkb[4] != -1 ? &pIcons_LOD->pTextures[uTextureID_Optkb[4]] : 0)); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 142, v0, ascii_4E2CDC, 0, 0, 0); - v33 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[14]); - v34 = sub_414D24(14); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 142, v34, v33, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 163, v0, ascii_4E2CD4, 0, 0, 0); - v35 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[15]); - v36 = sub_414D24(15); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 163, v36, v35, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 184, v0, ascii_4E2CC8, 0, 0, 0); - v37 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[16]); - v38 = sub_414D24(16); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 184, v38, v37, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 205, v0, ascii_4E2CBC, 0, 0, 0); - v39 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[17]); - v40 = sub_414D24(17); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 205, v40, v39, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 226, v0, ascii_4E2CB0, 0, 0, 0); - v41 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[18]); - v42 = sub_414D24(18); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 226, v42, v41, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 247, v0, ascii_4E2CA4, 0, 0, 0); - v43 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[19]); - v44 = sub_414D24(19); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 247, v44, v43, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 23, 268, v0, ascii_4E2C9C, 0, 0, 0); - v45 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[20]); - v46 = sub_414D24(20); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 127, 268, v46, v45, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 142, v0, ascii_4E2C90, 0, 0, 0); - v47 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[21]); - v48 = sub_414D24(21); - v22 = 350; - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 142, v48, v47, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 163, a5, ascii_4E2C84, 0, 0, 0); - v49 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[22]); - v50 = sub_414D24(22); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 163, v50, v49, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 184, a5, ascii_4E2C7C, 0, 0, 0); - v51 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[23]); - v52 = sub_414D24(23); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 184, v52, v51, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 205, a5, ascii_4E2C70, 0, 0, 0); - v53 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[24]); - v54 = sub_414D24(24); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 205, v54, v53, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 226, a5, ascii_4E2C68, 0, 0, 0); - v55 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[25]); - v56 = sub_414D24(25); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 226, v56, v55, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 247, a5, ascii_4E2C5C, 0, 0, 0); - v57 = pKeyActionMap->GetVKeyDisplayName(pPrevVirtualCidesMapping[26]); - v58 = sub_414D24(26); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 350, 247, v58, v57, 0, 0, 0); - pGUIWindow_CurrentMenu->DrawText(pFontLucida, 247, 268, a5, ascii_4E2C54, 0, 0, 0); - v65 = 0; - v64 = 0; - v63 = 0; - v62 = pKeyActionMap->GetVKeyDisplayName(pWindowList_at_506F50_minus1_indexing[0]); - v61 = 27; - } - v59 = sub_414D24(v61); - return pGUIWindow_CurrentMenu->DrawText(pFontLucida, v22, 268, v59, v62, v63, v64, v65); -} - - -//----- (00414D24) -------------------------------------------------------- -unsigned int __thiscall sub_414D24(int _this) -{ - int v1; // esi@1 - unsigned int v2; // edi@1 - unsigned int v3; // ebx@1 - unsigned int result; // eax@1 - - v1 = _this; - v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); - v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFu, 0, 0); - result = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); - if ( dword_506E68 == v1 ) - { - if ( GetTickCount() % 0x3E8 <= 0x1F4 ) - result = v3; - else - result = v2; - } - else - { - if ( KeyButtonFlagChangesArray[v1] ) - result = dword_507C08; - } - return result; -} -// 506E68: using guessed type int dword_506E68; -// 506E6C: using guessed type __int16 word_506E6C[18]; -// 507C08: using guessed type int dword_507C08; - -//----- (00414D9A) -------------------------------------------------------- -void __cdecl GameMenuUI_DrawVideoOptions() -{ - const char *v0; // ST0C_4@3 - unsigned __int16 v1; // ax@3 - int v2; // eax@10 - GUIWindow v3; // [sp+8h] [bp-54h]@3 - - pRenderer->DrawTextureIndexed( - 8u, - 8u, - (Texture *)(uTextureID_507C10 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C10] : 0)); - if ( !pRenderer->bWindowMode && GammaController::IsGammaSupported() ) - { - pRenderer->DrawTextureIndexed( - 17 * uGammaPos + 42, - 162u, - (Texture *)(pTextureIDs_GammaPositions[uGammaPos] != -1 ? &pIcons_LOD->pTextures[pTextureIDs_GammaPositions[uGammaPos]] : 0)); - pRenderer->DrawTextureRGB(0x112u, 0xA9u, &stru_506E40); - v3.uFrameX = 22; - v0 = pGlobalTXT_LocalizationStrings[226]; - v3.uFrameY = 190; - v3.uFrameWidth = 211; - v3.uFrameHeight = 79; - v3.uFrameZ = 232; - v3.uFrameW = 268; - v1 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - v3.DrawTitleText(pFontSmallnum, 0, 0, v1, v0, 3u); - } - if ( !pRenderer->pRenderD3D ) - { - pRenderer->DrawTextureIndexed( - 0x14u, - 0x119u, - (Texture *)(uTextureID_507C50 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C50] : 0)); - pRenderer->DrawTextureIndexed( - 0x14u, - 0x12Fu, - (Texture *)(uTextureID_507C54 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C54] : 0)); - v2 = uTextureID_507C58; - goto LABEL_12; - } - if ( pGame->uFlags2 & GAME_FLAGS_2_DRAW_BLOODSPLATS ) - pRenderer->DrawTextureIndexed( - 0x14u, - 0x119u, - (Texture *)(uTextureID_507C14 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C14] : 0)); - if ( pRenderer->bUseColoredLights ) - pRenderer->DrawTextureIndexed( - 0x14u, - 0x12Fu, - (Texture *)(uTextureID_507C18 != -1 ? &pIcons_LOD->pTextures[uTextureID_507C18] : 0)); - if ( pRenderer->bTinting ) - { - v2 = uTextureID_507C1C; -LABEL_12: - pRenderer->DrawTextureIndexed(0x14u, 0x145u, (Texture *)(v2 != -1 ? &pIcons_LOD->pTextures[v2] : 0)); - } -} - - - -//----- (00414F82) -------------------------------------------------------- -void __cdecl DrawGameOptions() -{ - signed int v0; // eax@1 - - pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_Options != -1 ? &pIcons_LOD->pTextures[uTextureID_Options] : 0)); - pRenderer->DrawTextureIndexed(8, 132, (Texture *)(uTextureID_ControlBG[0] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[0]] : 0)); - v0 = 0; - if ( uTurnSpeed == 128 ) - { - v0 = 2; - } - else - { - if ( uTurnSpeed == 64 ) - v0 = 1; - } - pRenderer->DrawTextureIndexed(BtnTurnCoord[v0], 270, (Texture *)(uTextureID_ControlBG[v0 + 1] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[v0 + 1]] : 0)); - if ( bWalkSound ) - pRenderer->DrawTextureIndexed(20, 303, (Texture *)(uTextureID_ControlBG[21] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[21]] : 0)); - if ( bShowDamage ) - pRenderer->DrawTextureIndexed(128, 303, (Texture *)(uTextureID_ControlBG[22] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[22]] : 0)); - if ( bFlipOnExit ) - pRenderer->DrawTextureIndexed(128, 325, (Texture *)(uTextureID_ControlBG[9] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[9]] : 0)); - if ( bAlwaysRun ) - pRenderer->DrawTextureIndexed(20, 325, (Texture *)(uTextureID_ControlBG[20] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[20]] : 0)); - pRenderer->DrawTextureIndexed(17 * (char)uSoundVolumeMultiplier + 265, 162, - (Texture *)(uTextureID_ControlBG[(char)uSoundVolumeMultiplier + 10] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[(char)uSoundVolumeMultiplier + 10]] : 0)); - pRenderer->DrawTextureIndexed(17 * (char)uMusicVolimeMultiplier + 265, 216, - (Texture *)(uTextureID_ControlBG[(char)uMusicVolimeMultiplier + 10] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[(char)uMusicVolimeMultiplier + 10]] : 0)); - pRenderer->DrawTextureIndexed(17 * (char)uVoicesVolumeMultiplier + 265, 270, - (Texture *)(uTextureID_ControlBG[(char)uVoicesVolumeMultiplier + 10] != -1 ? &pIcons_LOD->pTextures[uTextureID_ControlBG[(char)uVoicesVolumeMultiplier + 10]] : 0)); -} - - -//----- (004151D9) -------------------------------------------------------- -void __fastcall DrawPopupWindow(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight) -{ - unsigned int v4; // ebx@1 - Texture *v5; // edi@1 - signed int uTileWidth; // ecx@1 - int v7; // eax@5 - int v8; // ecx@10 - unsigned int v9; // ebx@14 - int v10; // [sp+10h] [bp-28h]@5 - signed int uTileHeight; // [sp+18h] [bp-20h]@1 - int v12; // [sp+1Ch] [bp-1Ch]@7 - int v13; // [sp+20h] [bp-18h]@1 - int a5; // [sp+24h] [bp-14h]@5 - unsigned int a5a; // [sp+24h] [bp-14h]@11 - unsigned int a4; // [sp+28h] [bp-10h]@1 - int uNumXTiles; // [sp+2Ch] [bp-Ch]@3 - unsigned int uNumXTilesa; // [sp+2Ch] [bp-Ch]@6 - unsigned int uNumXTilesb; // [sp+2Ch] [bp-Ch]@11 - unsigned int a2a; // [sp+30h] [bp-8h]@1 - unsigned int v21; // [sp+34h] [bp-4h]@5 - unsigned int v22; // [sp+34h] [bp-4h]@11 - - v4 = uY; - a2a = uX; - a4 = uX + uWidth; - pRenderer->Clip(uX, v4, uX + uWidth, v4 + uHeight); - v5 = (Texture *)(uTextureID_Parchment != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Parchment] : 0); - uTileWidth = (uTextureID_Parchment != -1 ? pIcons_LOD->pTextures[uTextureID_Parchment].uTextureWidth : 24); - v13 = (uTextureID_Parchment != -1 ? pIcons_LOD->pTextures[uTextureID_Parchment].uTextureWidth : 24); - uTileHeight = (uTextureID_Parchment != -1 ? pIcons_LOD->pTextures[uTextureID_Parchment].uTextureHeight : 26); - if ( (uTextureID_Parchment != -1 ? pIcons_LOD->pTextures[uTextureID_Parchment].uTextureWidth : 24) - && (uTextureID_Parchment != -1 ? pIcons_LOD->pTextures[uTextureID_Parchment].uTextureHeight : 26) ) - { - uNumXTiles = (signed int)uWidth / uTileWidth; - if ( (signed int)uWidth % uTileWidth ) - ++uNumXTiles; - a5 = 0; - v21 = v4; - v7 = uNumXTiles + 1; - v10 = uNumXTiles + 1; - do - { - uNumXTilesa = a2a - v13; - if ( v7 > 0 ) - { - v12 = v7; - do - { - uNumXTilesa += v13; - pRenderer->DrawTextureIndexed(uNumXTilesa, v21, v5); - --v12; - } - while ( v12 ); - v7 = v10; - } - v21 += uTileHeight; - v8 = a5++; - } - while ( v8 < (signed int)uHeight / uTileHeight ); - a5a = v4 + uHeight - 32; - pRenderer->DrawTextureTransparent( - a2a, - v4, - (Texture *)(uTextureID_5076AC != -1 ? &pIcons_LOD->pTextures[uTextureID_5076AC] : 0)); - pRenderer->DrawTextureTransparent( - a2a, - a5a, - (Texture *)(uTextureID_5076B4 != -1 ? &pIcons_LOD->pTextures[uTextureID_5076B4] : 0)); - pRenderer->DrawTextureTransparent( - a4 - 32, - v4, - (Texture *)(uTextureID_5076A8 != -1 ? &pIcons_LOD->pTextures[uTextureID_5076A8] : 0)); - pRenderer->DrawTextureTransparent( - a4 - 32, - a5a, - (Texture *)(uTextureID_5076B0 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_5076B0] : 0)); - uNumXTilesb = a2a + 32; - v22 = v4 + uHeight - 10; - if ( (signed int)uWidth > 64 ) - { - pRenderer->Clip(a2a + 32, v4, a4 - 32, v4 + uHeight); - pRenderer->DrawTextureTransparent( - uNumXTilesb, - v4, - (Texture *)(uTextureID_507698 != -1 ? &pIcons_LOD->pTextures[uTextureID_507698] : 0)); - pRenderer->DrawTextureTransparent( - uNumXTilesb, - v22, - (Texture *)(uTextureID_5076A4 != -1 ? &pIcons_LOD->pTextures[uTextureID_5076A4] : 0)); - if ( (signed int)uWidth > 512 ) - { - pRenderer->DrawTextureTransparent( - a2a + 544, - v4, - (Texture *)(uTextureID_507698 != -1 ? &pIcons_LOD->pTextures[uTextureID_507698] : 0)); - pRenderer->DrawTextureTransparent( - a2a + 544, - v22, - (Texture *)(uTextureID_5076A4 != -1 ? &pIcons_LOD->pTextures[uTextureID_5076A4] : 0)); - } - } - v9 = v4 + 32; - if ( (signed int)uHeight > 64 ) - { - pRenderer->Clip(a2a, v9, a4, a5a); - pRenderer->DrawTextureTransparent( - a2a, - v9, - (Texture *)(uTextureID_5076A0 != -1 ? &pIcons_LOD->pTextures[uTextureID_5076A0] : 0)); - pRenderer->DrawTextureTransparent( - a4 - 10, - v9, - (Texture *)(uTextureID_50769C != -1 ? &pIcons_LOD->pTextures[uTextureID_50769C] : 0)); - } - pRenderer->ResetClip(); - } -} + + //----- (00415485) -------------------------------------------------------- @@ -15836,380 +11720,7 @@ } -//----- (00416D62) -------------------------------------------------------- -void sub_416D62_ShowPopupWindow_MonsterRecord_ItemInfo_etcsub_416D62(Vec2_int_ *_this) -{ - signed int pPlayerNum; // eax@12 - char *v2; // eax@32 - void *v3; // ecx@52 - unsigned int v4; // eax@59 - int v5; // esi@62 - signed int v6; // esi@64 - signed int v7; // esi@69 - ItemGen *v8; // ecx@70 - unsigned int v9; // eax@72 - unsigned int v10; // eax@76 - char v11; // zf@83 - GUIButton *pButton; // esi@84 - unsigned int v13; // ecx@85 - char *pStr; // edi@85 - signed int pControlID; // eax@92 - int v16; // eax@95 - int v17; // eax@96 - enum PLAYER_SKILL_TYPE v18; // eax@98 - char *pStr2; // eax@99 - unsigned int v20; // eax@108 - unsigned int pSkillId; // eax@109 - const char *pSkillInfo; // eax@111 - //char *v23; // ebx@112 - char *pHint; // edx@113 - unsigned int pColor; // eax@113 - GUIWindow pWindow; // [sp+4h] [bp-74h]@32 - double v27; // [sp+58h] [bp-20h]@33 - struct tagPOINT Point; // [sp+60h] [bp-18h]@6 - char *v29; // [sp+68h] [bp-10h]@33 - float v30; // [sp+6Ch] [bp-Ch]@33 - unsigned int pX; // [sp+70h] [bp-8h]@3 - unsigned int pY; // [sp+74h] [bp-4h]@3 - - if ( pCurrentScreen == SCREEN_VIDEO ) - return; - if ( _this ) - { - pX = _this->x; - pY = _this->y; - } - else - { - pMouse->GetClickPos(&pX, &pY); - } - if ( pRenderer->bWindowMode ) - { - GetCursorPos(&Point); - ScreenToClient(hWnd, &Point); - if ( Point.x < 1 || Point.y < 1 || Point.x > 638 || Point.y > 478 ) - { - back_to_game(); - return; - } - } - - if ( pParty->pPickedItem.uItemID )// - { - //v1 = 0; - //do - for ( pPlayerNum = 0; pPlayerNum < 4; ++pPlayerNum) - { - if ( (signed int)pX > RightClickPortraitXmin[pPlayerNum] && (signed int)pX < RightClickPortraitXmax[pPlayerNum] - && (signed int)pY > 375 && (signed int)pY < 466 ) - { - pPlayers[uActiveCharacter]->UseItem_DrinkPotion_etc(pPlayerNum + 1, 1); - return; - } - //++v1; - } - //while ( v1 < 4 ); - } - - pEventTimer->Pause(); - - switch(pCurrentScreen) - { - case SCREEN_CASTING: - { - identify_item(); - break; - } - - case SCREEN_CHEST: - { - if ( !pPlayers[uActiveCharacter]->CanAct() ) - { - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[427],//%s %s - pPlayers[uActiveCharacter]->pName, pGlobalTXT_LocalizationStrings[541]);// - pWindow.Hint = pTmpBuf; - pWindow.uFrameWidth = 384; - pWindow.uFrameHeight = 180; - pWindow.uFrameY = 40; - if ( (signed int)pX <= 320 ) - v10 = pX + 30; - else - v10 = pX - 414; - pWindow.uFrameX = v10; - pWindow.DrawMessageBox(0); - } - else - { - v9 = pX + pSRZBufferLineOffsets[pY]; - if ( pRenderer->pActiveZBuffer[v9] & 0xFFFF ) - { - - // __debugbreak(); // invalid indexing will result in invalid object ptr - // v8 = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)pChestWindow->ptr_1C + 18* *((short *)&pChests[0].igChestItems[139].uExpireTime - // + (pRenderer->pActiveZBuffer[v9] & 0xFFFF) + 2662 * (unsigned int)pChestWindow->ptr_1C + 3)); - v10=pChests[pChestWindow->par1C].pInventoryIndices[(pRenderer->pActiveZBuffer[v9] & 0xFFFF)-1]; - v8 =&pChests[pChestWindow->par1C].igChestItems[v10-1]; - GameUI_DrawItemInfo(v8); - } - } - break; - } - case SCREEN_GAME: - { - if (GetCurrentMenuID() > 0) - break; - - if ( (signed int)pY > (signed int)pViewport->uViewportBR_Y ) - { - pWindow.ptr_1C = (void *)((signed int)pX / 118); - if ( (signed int)pX / 118 < 4 ) - { - pWindow.Hint = 0; - pWindow.uFrameWidth = 400; - pWindow.uFrameHeight = 200; - pWindow.uFrameX = 38; - pWindow.uFrameY = 60; - pAudioPlayer->StopChannels(-1, -1); - pWindow.DrawQuickCharRecord(); - } - } - else if ( (signed int)pX > (signed int)pViewport->uViewportBR_X ) - { - if ( (signed int)pY >= 130 ) - { - if ( (signed int)pX >= 476 && (signed int)pX <= 636 && (signed int)pY >= 240 && (signed int)pY <= 300 ) - { - pWindow.Hint = 0; - pWindow.uFrameWidth = 400; - pWindow.uFrameHeight = 200; - pWindow.uFrameX = 38; - pWindow.uFrameY = 60; - pAudioPlayer->StopChannels(-1, -1); - pWindow._41D73D_draw_buff_tooltip(); - } - else if ( (signed int)pX < 485 || (signed int)pX > 548 || (signed int)pY < 156 || (signed int)pY > 229 ) - { - if (!( (signed int)pX < 566 || (signed int)pX > 629 || (signed int)pY < 156 || (signed int)pY > 229 )) - { - pAudioPlayer->StopChannels(-1, -1); - v3 = (void *)1; - } - } - else - { - pAudioPlayer->StopChannels(-1, -1); - v3 = 0; - sub_416B01(v3); - } - } - else - { - pWindow.Hint = _4443D5_GetMinimapRightClickText(); - pWindow.uFrameWidth = 256; - pWindow.uFrameX = 130; - pWindow.uFrameY = 140; - pWindow.uFrameHeight = 64; - pAudioPlayer->StopChannels(-1, -1); - pWindow.DrawMessageBox(0); - } - } - else - { - pWindow.Hint = 0; - pWindow.uFrameWidth = 320; - pWindow.uFrameHeight = 320; - v4 = pX - 350; - if ( (signed int)pX <= 320 ) - v4 = pX + 30; - pWindow.uFrameX = v4; - pWindow.uFrameY = 40; - if ( pRenderer->pRenderD3D ) - LOWORD(v5) = pGame->pVisInstance->get_picked_object_zbuf_val(); - else - v5 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; - v6 = (unsigned __int16)v5; - if ( (v6 & 7) != OBJECT_Item) - { - if ( (v6 & 7) == OBJECT_Actor) - { - if ( pRenderer->uNumSceneBegins ) - { - pWindow.DrawMessageBox(1); - MonsterPopup_Draw(v6 >> 3, &pWindow); - } - else - { - pRenderer->BeginScene(); - pWindow.DrawMessageBox(1); - MonsterPopup_Draw(v6 >> 3, &pWindow); - pRenderer->EndScene(); - } - } - } - else - { - v7 = v6 >> 3; - if ( ! (pObjectList->pObjects[pSpriteObjects[v7].uObjectDescID].uFlags & 0x10 ) ) - { - v8 = &pSpriteObjects[v7].stru_24; - GameUI_DrawItemInfo(v8); - } - } - } - break; - } - case SCREEN_BOOKS: - { - if ( !dword_506364 - || (signed int)pX < (signed int)pViewport->uViewportTL_X - || (signed int)pX > (signed int)pViewport->uViewportBR_X - || (signed int)pY < (signed int)pViewport->uViewportTL_Y - || (signed int)pY > (signed int)pViewport->uViewportBR_Y - || (v2 = (char *)sub_444564(), (pWindow.Hint = v2) == 0) ) - break; - v30 = (double)(pFontArrus->GetLineWidth(v2) + 32); - v27 = v30 + 6.7553994e15; - v29 = (char *)LODWORD(v27); - pWindow.uFrameWidth = LODWORD(v27); - pWindow.uFrameX = pX + 5; - pWindow.uFrameY = pY + 5; - pWindow.uFrameHeight = 64; - pAudioPlayer->StopChannels(-1, -1); - pWindow.DrawMessageBox(0); - break; - } - case SCREEN_CHARACTERS: - case SCREEN_E: - case SCREEN_F: - { - if ( (signed int)pX > 467 && pCurrentScreen != SCREEN_E ) - { - identify_item(); - } - else if ( (signed int)pY >= 345 ) - break; - else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 100 )//2DEvent - CharacerScreenStats - { - CharacterUI_StatsTab_ShowHint(); - } - else if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 101 )//2DEvent - CharacerScreenSkills - { - CharacterUI_SkillsTab_ShowHint(); - } - else - { - v11 = pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103;//2DEvent - CharacerScreenInventory - if ( v11 ) - identify_item(); - } - break; - } - case SCREEN_SPELL_BOOK: - { - if ( dword_507B00_spell_info_to_draw_in_popup ) - DrawSpellDescriptionPopup(dword_507B00_spell_info_to_draw_in_popup - 1); - break; - } - case SCREEN_HOUSE: - { - if ( (signed int)pY < 345 && (signed int)pX < 469 ) - sub_4B1A2D();//identify item in inventory - break; - } - - case SCREEN_PARTY_CREATION: - { - pWindow.Hint = 0; - pStr = 0; - for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext) - { - if ( pButton->uButtonType == 1 && pButton->uButtonType != 3 && (signed int)pX > (signed int)pButton->uX && (signed int)pX < (signed int)pButton->uZ - && (signed int)pY > (signed int)pButton->uY && (signed int)pY < (signed int)pButton->uW ) - { - pControlID = pButton->uControlID; - switch ( pControlID ) - { - case 0: //stats info - pWindow.Hint = pAttributeDescriptions[(signed int)pButton->uControlParam % 7]; - pStr = aAttributeNames[(signed int)pButton->uControlParam % 7]; - break; - case 62: //Plus button info - pStr = pGlobalTXT_LocalizationStrings[670];// - pWindow.Hint = pGlobalTXT_LocalizationStrings[671];//" , " - break; - case 63: //Minus button info - pStr = pGlobalTXT_LocalizationStrings[668];// - pWindow.Hint = pGlobalTXT_LocalizationStrings[669];//" , " - break; - case 64: //Available skill button info - v18 = pParty->pPlayers[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(pButton->uControlParam + 4); - pStr = pSkillNames[v18]; - pWindow.Hint = pSkillDesc[v18]; - break; - case 65: //Available Class Info - pWindow.Hint = pClassDescriptions[pButton->uControlParam]; - pStr = pClassNames[pButton->uControlParam]; - break; - case 66: //OK Info - pWindow.Hint = pGlobalTXT_LocalizationStrings[664];// . - pStr = pGlobalTXT_LocalizationStrings[665];// - break; - case 67: //Clear info - pWindow.Hint = pGlobalTXT_LocalizationStrings[666];// . - pStr = pGlobalTXT_LocalizationStrings[667];// - break; - case 118: // Character info - pStr = pParty->pPlayers[pButton->uControlParam].pName; - pWindow.Hint = pClassDescriptions[pParty->pPlayers[pButton->uControlParam].classType]; - break; - } - if ( pControlID > 68 && pControlID <= 75 ) //Sellected skills info - { - pSkillId = pParty->pPlayers[pButton->uControlParam].GetSkillIdxByOrder(pControlID - 72); - pY = 0; - if ( (signed int)pSkillId < 37 ) - { - pSkillInfo = CharacterUI_GetSkillDescText(pButton->uControlParam, (enum PLAYER_SKILL_TYPE)pSkillId); - strcpy(pTmpBuf2, pSkillInfo); - pWindow.Hint = pTmpBuf2; - pStr = pSkillNames[pSkillId]; - } - } - } - } - if ( pWindow.Hint ) - { - pHint = pWindow.Hint; - pWindow.Hint = 0; - pWindow.uFrameWidth = 384; - pWindow.uFrameHeight = 256; - pWindow.uFrameX = 128; - pWindow.uFrameY = 40; - pWindow.uFrameHeight = pFontSmallnum->CalcTextHeight(pHint, &pWindow, 24, 0) + 2 * LOBYTE(pFontLucida->uFontHeight) + 24; - pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; - pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; - pWindow.DrawMessageBox(0); - pWindow.uFrameX += 12; - pWindow.uFrameWidth -= 24; - pWindow.uFrameY += 12; - pWindow.uFrameHeight -= 12; - pWindow.uFrameZ = pWindow.uFrameX + pWindow.uFrameWidth - 1; - pWindow.uFrameW = pWindow.uFrameY + pWindow.uFrameHeight - 1; - pColor = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0x9B); - sprintf(pTmpBuf, format_4E2D80, pColor, pStr);//"\f%05d%s\f00000\n" - pWindow.DrawTitleText(pFontCreate, 0, 0, 0, pTmpBuf, 3); - pWindow.DrawText(pFontSmallnum, 1, pFontLucida->uFontHeight, 0, pHint, 0, 0, 0); - } - break; - } - default: - { - break; - } - } - dword_507BF0_is_there_popup_onscreen = 1; - viewparams->bRedrawGameUI = 1; -} + //----- (004175C0) -------------------------------------------------------- void UI_OnMouseLeftClick(int *pXY) @@ -16543,834 +12054,6 @@ return white; } -//----- (00417BB5) -------------------------------------------------------- -const char *__fastcall CharacterUI_GetSkillDescText(unsigned int uPlayerID, enum PLAYER_SKILL_TYPE uPlayerSkillType) -{ - //enum PLAYER_SKILL_TYPE v2; // esi@1 - //unsigned int v3; // ebx@1 - int v4; // edi@1 - int v5; // eax@1 - Player *pPlayer; // ebx@7 - char v7; // al@7 - char v8; // cl@7 - unsigned int v9; // eax@8 - unsigned int v10; // eax@8 - unsigned int v11; // eax@8 - enum PLAYER_SKILL_TYPE v12; // edi@8 - unsigned int v13; // eax@8 - unsigned int v14; // eax@8 - enum PLAYER_SKILL_TYPE v15; // esi@8 - int v16; // edi@8 - char v17; // al@8 - int v18; // ST5C_4@8 - int v19; // ST4C_4@8 - int v20; // ST3C_4@8 - int v21; // ST2C_4@8 - int v22; // ST1C_4@8 - char *v23; // esi@8 - unsigned int v24; // eax@9 - unsigned int v25; // eax@9 - unsigned int v26; // eax@9 - unsigned int v27; // ecx@9 - enum PLAYER_SKILL_TYPE v28; // ebx@9 - unsigned int v29; // eax@9 - char a2[1200]; // [sp+Ch] [bp-538h]@7 - char Source[120]; // [sp+4BCh] [bp-88h]@7 - unsigned __int16 *v33; // [sp+534h] [bp-10h]@1 - int v34; // [sp+538h] [bp-Ch]@1 - unsigned __int16 *v35; // [sp+53Ch] [bp-8h]@1 - //enum PLAYER_SKILL_TYPE v36; // [sp+540h] [bp-4h]@1 - - //v2 = uPlayerSkillType; - //v3 = uPlayerID; - //v36 = uPlayerSkillType; - v4 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[431]);// Normal - v34 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[433]);// Expert - v33 = (unsigned __int16 *)pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[432]);// Master - v5 = pFontSmallnum->GetLineWidth(pGlobalTXT_LocalizationStrings[96]);// Grand - v35 = (unsigned __int16 *)v4; - if ( v34 > v4 ) - v35 = (unsigned __int16 *)v34; - if ( (signed int)v33 > (signed int)v35 ) - v35 = v33; - if ( v5 > (signed int)v35 ) - v35 = (unsigned __int16 *)v5; - pPlayer = &pParty->pPlayers[uPlayerID]; - //v33 = &pPlayer->pActiveSkills[uPlayerSkillType]; - v7 = pPlayer->GetActualSkillLevel(uPlayerSkillType); - v8 = pPlayer->pActiveSkills[uPlayerSkillType]; - a2[0] = 0; - Source[0] = 0; - if ( (v8 & 0x3F) == (v7 & 0x3F) ) - { - strcpy(a2, "%s\n\n"); - v24 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 1); - sprintf(Source, "\f%05d", v24); - strcat(a2, Source); - strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); - v25 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 2); - sprintf(Source, "\f%05d", v25); - strcat(a2, Source); - strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); - v26 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 3); - sprintf(Source, "\f%05d", v26); - strcat(a2, Source); - strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); - v27 = pPlayer->classType; - v28 = uPlayerSkillType; - v29 = GetSkillColor(v27, uPlayerSkillType, 4); - sprintf(Source, "\f%05d", v29); - strcat(a2, Source); - strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); - - v23 = static_sub_417BB5_out_string; - sprintf(static_sub_417BB5_out_string, a2, pSkillDesc[v28], pGlobalTXT_LocalizationStrings[431], // Normal - (char *)v35 + 3, v35 + 5, pNormalSkillDesc[v28], pGlobalTXT_LocalizationStrings[433], // Expert - (char *)v35 + 3, v35 + 5, pExpertSkillDesc[v28], pGlobalTXT_LocalizationStrings[432], // Master - (char *)v35 + 3, v35 + 5, pMasterSkillDesc[v28], pGlobalTXT_LocalizationStrings[96], // Grand - (char *)v35 + 3, v35 + 5, pGrandSkillDesc[v28]); - } - else - { - strcpy(a2, "%s\n\n"); - v9 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 1); - sprintf(Source, "\f%05d", v9); - strcat(a2, Source); - strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); - v10 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 2); - sprintf(Source, "\f%05d", v10); - strcat(a2, Source); - strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); - v11 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 3); - sprintf(Source, "\f%05d", v11); - strcat(a2, Source); - strcat(a2, "%s\t%03d:\t%03d%s\t000\n"); - v12 = uPlayerSkillType; - v13 = GetSkillColor(pPlayer->classType, uPlayerSkillType, 4); - sprintf(Source, "\f%05d", v13); - strcat(a2, Source); - strcat(a2, "%s\t%03d:\t%03d%s\t000\n\n"); - v14 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); - sprintf(Source, "\f%05d", v14); - strcat(a2, Source); - strcat(a2, "%s: +%d"); - v15 = v12; - v16 = (int)(v35 + 5); - v15 = (PLAYER_SKILL_TYPE)((int)v15 * 4); - v34 = (int)((char *)v35 + 3); - v17 = pPlayer->GetActualSkillLevel(uPlayerSkillType); - v18 = *(int *)((char *)pGrandSkillDesc + v15); - v19 = *(int *)((char *)pMasterSkillDesc + v15); - v20 = *(int *)((char *)pExpertSkillDesc + v15); - v21 = *(int *)((char *)pNormalSkillDesc + v15); - v22 = *(int *)((char *)pSkillDesc + v15); - v23 = static_sub_417BB5_out_string; - sprintf( - static_sub_417BB5_out_string, - a2, - v22, - pGlobalTXT_LocalizationStrings[431], - v34, - v16, - v21, - pGlobalTXT_LocalizationStrings[433], - v34, - v16, - v20, - pGlobalTXT_LocalizationStrings[432], - v34, - v16, - v19, - pGlobalTXT_LocalizationStrings[96], - v34, - v16, - v18, - pGlobalTXT_LocalizationStrings[623], - (v17 & 0x3F) - (*(char *)v33 & 0x3F)); - } - return v23; -} - -//----- (00417FE5) -------------------------------------------------------- -char __cdecl CharacterUI_SkillsTab_ShowHint() -{ - unsigned int v0; // ecx@1 - unsigned int v1; // eax@1 - GUIButton *i; // esi@6 - const char *v3; // eax@12 - unsigned int pX; // [sp+4h] [bp-8h]@1 - unsigned int pY; // [sp+8h] [bp-4h]@1 - - pMouse->GetClickPos(&pX, &pY); - v0 = pX; - v1 = pY; - if ( (signed int)pX < 24 || (signed int)pX > 455 || (signed int)pY < 18 || (signed int)pY > 36 ) - { - for ( i = pGUIWindow_CurrentMenu->pControlsHead; i; i = i->pNext ) - { - if ( i->uControlID == 121 - && (signed int)v0 >= (signed int)i->uX - && (signed int)v0 <= (signed int)i->uZ - && (signed int)v1 >= (signed int)i->uY - && (signed int)v1 <= (signed int)i->uW ) - { - v3 = CharacterUI_GetSkillDescText(uActiveCharacter - 1, (enum PLAYER_SKILL_TYPE)i->uControlParam); - sub_4179BC_draw_tooltip(pSkillNames[i->uControlParam], v3); - v1 = pY; - v0 = pX; - } - } - } - else - { - LOBYTE(v1) = sub_4179BC_draw_tooltip(pGlobalTXT_LocalizationStrings[207], pSkillPointsAttributeDescription); - } - return v1; -} - -//----- (00418083) -------------------------------------------------------- -char __cdecl CharacterUI_StatsTab_ShowHint() -{ - LONG _x; // esi@1 - Player *_y; // eax@1 - int v2; // edi@1 - __int16 *v3; // ecx@1 - LONG v4; // edx@2 - signed int v5; // edx@4 - char *v6; // ecx@9 - char *v7; // ebx@9 - unsigned int v8; // ebx@15 - unsigned __int64 v9; // kr00_8@15 - char *v10; // ST2C_4@15 - signed int v11; // eax@15 - char *v12; // ecx@17 - char *v13; // eax@20 - Player *v14; // esi@28 - int v15; // ebx@28 - int v16; // eax@33 - POINT a2; // [sp+Ch] [bp-24h]@1 - __int64 v19; // [sp+14h] [bp-1Ch]@15 - char *v20; // [sp+1Ch] [bp-14h]@13 - Player *v21; // [sp+20h] [bp-10h]@13 - unsigned int v22; // [sp+24h] [bp-Ch]@15 - int *v23; // [sp+28h] [bp-8h]@13 - const char *v24; // [sp+2Ch] [bp-4h]@10 - - _x = pMouse->GetCursorPos(&a2)->x; - _y = (Player *)pMouse->GetCursorPos(&a2)->y; - v2 = 0; - v3 = &array_4E2940[0].field_2; - while ( 1 ) - { - v4 = *(v3 - 1); - if ( _x >= v4 ) - { - if ( _x <= v4 + v3[1] ) - { - v5 = *v3; - if ( (signed int)_y >= v5 ) - { - if ( (signed int)_y <= v5 + v3[2] ) - break; - } - } - } - v3 += 4; - ++v2; - if ( (signed int)v3 >= (signed int)&off_4E2A12 ) - return (char)_y; - } - switch ( v2 ) - { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - LOBYTE(_y) = 4 * v2; - v6 = aAttributeNames[v2]; - v7 = pAttributeDescriptions[v2]; - goto LABEL_46; - case 7: - LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[108]); - v7 = pHealthPointsAttributeDescription; - v24 = pGlobalTXT_LocalizationStrings[108]; - goto LABEL_47; - case 8: - LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[212]); - v7 = pSpellPointsAttributeDescription; - v24 = pGlobalTXT_LocalizationStrings[212]; - goto LABEL_47; - case 9: - LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[12]); - v7 = pArmourClassAttributeDescription; - v24 = pGlobalTXT_LocalizationStrings[12]; - goto LABEL_47; - case 10: - v24 = pGlobalTXT_LocalizationStrings[47]; - strcpy(pTmpBuf2, pPlayerConditionAttributeDescription); - v7 = pTmpBuf2; - v20 = pTmpBuf2; - strcat(pTmpBuf2, "\n"); - - extern unsigned int pConditionImportancyTable[18]; - v23 = (int *)pConditionImportancyTable; - _y = pPlayers[uActiveCharacter]; - v21 = pPlayers[uActiveCharacter]; - do - { - if ( _y->pConditions[*v23] ) - { - strcat(pTmpBuf2, " \n"); - v8 = *v23; - v9 = pParty->uTimePlayed - v21->pConditions[*v23]; - a2.x = LODWORD(pParty->uTimePlayed) - LODWORD(v21->pConditions[*v23]); - a2.y = HIDWORD(v9); - v19 = (signed __int64)((double)*(signed __int64 *)&a2 * 0.234375) / 60 / 60; - v22 = (unsigned int)v19 / 0x18; - v10 = aCharacterConditionNames[v8]; - v19 %= 24i64; - v11 = GetConditionDrawColor(v8); - sprintf(pTmpBuf, &byte_4E2DE8, v11, v10); - strcat(pTmpBuf2, pTmpBuf); - if ( v19 && v19 <= 1 ) - v12 = pGlobalTXT_LocalizationStrings[109]; - else - v12 = pGlobalTXT_LocalizationStrings[110]; - if ( !v22 || (v13 = pGlobalTXT_LocalizationStrings[56], v22 > 1) ) - v13 = pGlobalTXT_LocalizationStrings[57]; - sprintf(pTmpBuf, "%lu %s, %lu %s", v22, v13, v19, v12); - strcat(pTmpBuf2, pTmpBuf); - v7 = v20; - _y = v21; - } - ++v23; - } - while ( (signed int)v23 < (signed int)&unk_4EDF40 ); - goto LABEL_47; - case 11: - LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[172]); - v7 = pFastSpellAttributeDescription; - v24 = pGlobalTXT_LocalizationStrings[172]; - goto LABEL_47; - case 12: - LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[5]); - v7 = pPlayerAgeAttributeDescription; - v24 = pGlobalTXT_LocalizationStrings[5]; - goto LABEL_47; - case 13: - LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[131]); - v7 = pPlayerLevelAttributeDescription; - v24 = pGlobalTXT_LocalizationStrings[131]; - goto LABEL_47; - case 14: - v14 = pPlayers[uActiveCharacter]; - v24 = pGlobalTXT_LocalizationStrings[83]; - v15 = v14->uLevel; - do - { - if ( (signed __int64)v14->uExperience < (unsigned int)sub_4B46F8(v15) ) - break; - ++v15; - } - while ( v15 <= 10000 ); - pTmpBuf[0] = 0; - pTmpBuf2[0] = 0; - if ( v15 > v14->uLevel ) - sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[147], v15); - v16 = sub_4B46F8(v15) - LODWORD(v14->uExperience); - sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[538], v16, v15 + 1); - strcat(pTmpBuf, "\n"); - strcat(pTmpBuf, pTmpBuf2); - LOBYTE(_y) = sprintf(pTmpBuf2, "%s\n \n%s", pPlayerExperienceAttributeDescription, pTmpBuf); - v7 = pTmpBuf2; - goto LABEL_47; - case 15: - LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[587]); - v7 = pAttackBonusAttributeDescription; - v24 = pGlobalTXT_LocalizationStrings[587]; - goto LABEL_47; - case 16: - LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[588]); - v7 = pAttackDamageAttributeDescription; - v24 = pGlobalTXT_LocalizationStrings[588]; - goto LABEL_47; - case 17: - LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[589]); - v7 = pMissleBonusAttributeDescription; - v24 = pGlobalTXT_LocalizationStrings[589]; - goto LABEL_47; - case 18: - LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[590]); - v7 = pMissleDamageAttributeDescription; - v24 = pGlobalTXT_LocalizationStrings[590]; - goto LABEL_47; - case 19: - LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[87]); - v7 = pFireResistanceAttributeDescription; - v24 = pGlobalTXT_LocalizationStrings[87]; - goto LABEL_47; - case 20: - LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[6]); - v7 = pAirResistanceAttributeDescription; - v24 = pGlobalTXT_LocalizationStrings[6]; - goto LABEL_47; - case 21: - LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[240]); - v7 = pWaterResistanceAttributeDescription; - v24 = pGlobalTXT_LocalizationStrings[240]; - goto LABEL_47; - case 22: - LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[70]); - v7 = pEarthResistanceAttributeDescription; - v24 = pGlobalTXT_LocalizationStrings[70]; - goto LABEL_47; - case 23: - LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[142]); - v7 = pMindResistanceAttributeDescription; - v24 = pGlobalTXT_LocalizationStrings[142]; - goto LABEL_47; - case 24: - LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[29]); - v7 = pBodyResistanceAttributeDescription; - v24 = pGlobalTXT_LocalizationStrings[29]; - goto LABEL_47; - case 25: - LOBYTE(_y) = LOBYTE(pGlobalTXT_LocalizationStrings[207]); - v7 = pSkillPointsAttributeDescription; - v24 = pGlobalTXT_LocalizationStrings[207]; - goto LABEL_47; - case 26: - _y = (Player *)(4 * pPlayers[uActiveCharacter]->classType); - v6 = *(char **)((char *)_y->pConditions + (int)pClassNames); - v7 = *(char **)((char *)_y->pConditions + (int)pClassDescriptions); -LABEL_46: - v24 = v6; -LABEL_47: - if ( v24 && v7 ) - LOBYTE(_y) = sub_4179BC_draw_tooltip(v24, v7); - break; - default: - return (char)_y; - } - return (char)_y; -} - -//----- (00418511) -------------------------------------------------------- -char __fastcall CharacterUI_StatsTab_Draw(unsigned int uPlayerID) -{ - Player *pPlayer; // edi@1 - unsigned int v2; // eax@1 - unsigned int v3; // eax@1 - unsigned int v4; // eax@2 - int v5; // ST20_4@4 - int v6; // ST1C_4@4 - int v7; // ebp@4 - int v8; // eax@4 - unsigned int v9; // eax@4 - int v10; // ST34_4@4 - int v11; // ST20_4@4 - int v12; // ST1C_4@4 - int v13; // ebp@4 - int v14; // eax@4 - unsigned int v15; // eax@4 - int v16; // ST34_4@4 - int v17; // ST20_4@4 - int v18; // ST1C_4@4 - int v19; // ebp@4 - int v20; // eax@4 - unsigned int v21; // eax@4 - int v22; // ST34_4@4 - int v23; // ST20_4@4 - int v24; // ST1C_4@4 - int v25; // ebp@4 - int v26; // eax@4 - unsigned int v27; // eax@4 - int v28; // ST34_4@4 - int v29; // ST20_4@4 - int v30; // ST1C_4@4 - int v31; // ebp@4 - int v32; // eax@4 - unsigned int v33; // eax@4 - int v34; // ST34_4@4 - int v35; // ST20_4@4 - int v36; // ST1C_4@4 - int v37; // ebp@4 - int v38; // eax@4 - unsigned int v39; // eax@4 - int v40; // ST34_4@4 - int v41; // ST20_4@4 - int v42; // ST1C_4@4 - int v43; // ebp@4 - int v44; // eax@4 - unsigned int v45; // eax@4 - int v46; // ebp@4 - signed int v47; // ST20_4@6 - int v48; // ST1C_4@6 - signed int v49; // eax@6 - unsigned int v50; // eax@6 - int v51; // ST20_4@8 - int v52; // ST1C_4@8 - int v53; // eax@8 - unsigned int v54; // eax@8 - int v55; // ST34_4@8 - int v56; // ST20_4@8 - int v57; // ST1C_4@8 - int v58; // ebp@8 - int v59; // eax@8 - unsigned int v60; // eax@8 - unsigned int v61; // ebp@8 - unsigned int v62; // eax@8 - char *v63; // ST20_4@8 - signed int v64; // eax@8 - unsigned int v65; // ebp@8 - unsigned __int8 v66; // al@8 - char *v67; // eax@9 - unsigned int v68; // ST20_4@11 - unsigned int v69; // ST1C_4@11 - signed int v70; // ebp@11 - signed int v71; // eax@11 - unsigned int v72; // eax@11 - int v73; // ST20_4@13 - int v74; // ST1C_4@13 - int v75; // ebp@13 - int v76; // eax@13 - unsigned int v77; // eax@13 - char *v78; // ecx@14 - int v79; // ST20_4@16 - char *v80; // ST40_4@16 - unsigned int v81; // eax@16 - int v82; // ST34_4@16 - int v83; // eax@16 - int v84; // ST34_4@16 - char *v85; // eax@16 - int v86; // ST34_4@16 - int v87; // eax@16 - int v88; // ST34_4@16 - char *v89; // eax@16 - int v90; // eax@16 - int v91; // ST20_4@19 - unsigned int v92; // eax@19 - int v93; // eax@19 - int v94; // ST20_4@22 - unsigned int v95; // eax@22 - int v96; // eax@22 - int v97; // ST20_4@25 - unsigned int v98; // eax@25 - int v99; // eax@25 - int v100; // ST20_4@27 - unsigned int v101; // eax@27 - int v102; // eax@27 - int v103; // ST20_4@30 - unsigned int v104; // eax@30 - char *v105; // ST20_4@32 - unsigned int v106; // eax@32 - int v107; // eax@33 - int v108; // ST20_4@36 - unsigned int v109; // eax@36 - char *v110; // ST20_4@38 - unsigned int v111; // eax@38 - int uY; // [sp+10h] [bp-10h]@6 - int uYa; // [sp+10h] [bp-10h]@11 - int uYb; // [sp+10h] [bp-10h]@13 - int uYc; // [sp+10h] [bp-10h]@16 - int uYd; // [sp+10h] [bp-10h]@19 - int uYe; // [sp+10h] [bp-10h]@22 - int uYf; // [sp+10h] [bp-10h]@25 - int uYg; // [sp+10h] [bp-10h]@27 - int uYh; // [sp+10h] [bp-10h]@33 - const char *a2; // [sp+14h] [bp-Ch]@4 - const char *a2a; // [sp+14h] [bp-Ch]@6 - const char *a2b; // [sp+14h] [bp-Ch]@11 - const char *a2c; // [sp+14h] [bp-Ch]@16 - const char *a2d; // [sp+14h] [bp-Ch]@19 - const char *a2e; // [sp+14h] [bp-Ch]@22 - const char *a2f; // [sp+14h] [bp-Ch]@25 - const char *a2g; // [sp+14h] [bp-Ch]@27 - const char *a2h; // [sp+14h] [bp-Ch]@33 - int v131; // [sp+18h] [bp-8h]@16 - int v132; // [sp+18h] [bp-8h]@19 - int v133; // [sp+18h] [bp-8h]@22 - int v134; // [sp+18h] [bp-8h]@25 - int v135; // [sp+18h] [bp-8h]@27 - int v136; // [sp+18h] [bp-8h]@33 - int v137; // [sp+1Ch] [bp-4h]@27 - int v138; // [sp+1Ch] [bp-4h]@33 - - pPlayer = &pParty->pPlayers[uPlayerID-1]; - v2 = pIcons_LOD->LoadTexture("fr_stats", TEXTURE_16BIT_PALETTE); - pRenderer->DrawTextureIndexed(8, 8, (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0)); - v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); - sprintf(pTmpBuf, "\f%05d", v3); - sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], pPlayer->pName, pClassNames[pPlayer->classType]);//^Pi[%s] %s - strcat(pTmpBuf, pTmpBuf2); - if ( pPlayer->uSkillPoints ) - v4 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); - else - v4 = 0xFFFFu; - sprintf(pTmpBuf2, "\f00000\r180%s: \f%05d%d\f00000\n\n\n", pGlobalTXT_LocalizationStrings[207], v4, pPlayer->uSkillPoints);//Skill points - strcat(pTmpBuf, pTmpBuf2); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, 18, 0, pTmpBuf, 0, 0, 0); - v5 = pPlayer->GetBaseStrength(); - v6 = pPlayer->GetActualMight(); - v7 = pPlayer->GetBaseStrength(); - v8 = pPlayer->GetActualMight(); - v9 = UI_GetHealthManaStringColor(v8, v7); - sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[144], v9, v6, v5);//Might - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, 53, 0, pTmpBuf, 0, 0, 0); - v10 = LOBYTE(pFontArrus->uFontHeight) + 51; - v11 = pPlayer->GetBaseIntelligence(); - v12 = pPlayer->GetActualIntelligence(); - v13 = pPlayer->GetBaseIntelligence(); - v14 = pPlayer->GetActualIntelligence(); - v15 = UI_GetHealthManaStringColor(v14, v13); - sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[116], v15, v12, v11);//Intellect - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v10, 0, pTmpBuf, 0, 0, 0); - v16 = LOBYTE(pFontArrus->uFontHeight) + v10 - 2; - v17 = pPlayer->GetBaseWillpower(); - v18 = pPlayer->GetActualWillpower(); - v19 = pPlayer->GetBaseWillpower(); - v20 = pPlayer->GetActualWillpower(); - v21 = UI_GetHealthManaStringColor(v20, v19); - sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[163], v21, v18, v17);// - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v16, 0, pTmpBuf, 0, 0, 0); - v22 = LOBYTE(pFontArrus->uFontHeight) + v16 - 2; - v23 = pPlayer->GetBaseEndurance(); - v24 = pPlayer->GetActualEndurance(); - v25 = pPlayer->GetBaseEndurance(); - v26 = pPlayer->GetActualEndurance(); - v27 = UI_GetHealthManaStringColor(v26, v25); - sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[75], v27, v24, v23);// - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v22, 0, pTmpBuf, 0, 0, 0); - v28 = LOBYTE(pFontArrus->uFontHeight) + v22 - 2; - v29 = pPlayer->GetBaseAccuracy(); - v30 = pPlayer->GetActualAccuracy(); - v31 = pPlayer->GetBaseAccuracy(); - v32 = pPlayer->GetActualAccuracy(); - v33 = UI_GetHealthManaStringColor(v32, v31); - sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[1], v33, v30, v29); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v28, 0, pTmpBuf, 0, 0, 0); - v34 = LOBYTE(pFontArrus->uFontHeight) + v28 - 2; - v35 = pPlayer->GetBaseSpeed(); - v36 = pPlayer->GetActualSpeed(); - v37 = pPlayer->GetBaseSpeed(); - v38 = pPlayer->GetActualSpeed(); - v39 = UI_GetHealthManaStringColor(v38, v37); - sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n", pGlobalTXT_LocalizationStrings[211], v39, v36, v35); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v34, 0, pTmpBuf, 0, 0, 0); - v40 = LOBYTE(pFontArrus->uFontHeight) + v34 - 2; - v41 = pPlayer->GetBaseLuck(); - v42 = pPlayer->GetActualLuck(); - v43 = pPlayer->GetBaseLuck(); - v44 = pPlayer->GetActualLuck(); - v45 = UI_GetHealthManaStringColor(v44, v43); - sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[136], v45, v42, v41); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v40, 0, pTmpBuf, 0, 0, 0); - a2 = "%s\f%05u\r424%d\f00000 /\t185%d\n"; - v46 = v40 + 2 * LOBYTE(pFontArrus->uFontHeight) + 5; - if ( pPlayer->GetMaxHealth() >= 1000 ) - a2 = "%s\f%05u\r388%d\f00000 / %d\n"; - v47 = pPlayer->GetMaxHealth(); - v48 = pPlayer->sHealth; - v49 = pPlayer->GetMaxHealth(); - v50 = UI_GetHealthManaStringColor(pPlayer->sHealth, v49); - sprintf(pTmpBuf, a2, pGlobalTXT_LocalizationStrings[108], v50, v48, v47); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v46, 0, pTmpBuf, 0, 0, 0); - a2a = "%s\f%05u\r424%d\f00000 /\t185%d\n"; - uY = LOBYTE(pFontArrus->uFontHeight) + v46 - 2; - if ( pPlayer->GetMaxMana() >= 1000 ) - a2a = "%s\f%05u\r388%d\f00000 / %d\n"; - v51 = pPlayer->GetMaxMana(); - v52 = pPlayer->sMana; - v53 = pPlayer->GetMaxMana(); - v54 = UI_GetHealthManaStringColor(pPlayer->sMana, v53); - sprintf(pTmpBuf, a2a, pGlobalTXT_LocalizationStrings[212], v54, v52, v51); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, uY, 0, pTmpBuf, 0, 0, 0); - v55 = LOBYTE(pFontArrus->uFontHeight) + uY - 2; - v56 = pPlayer->GetBaseAC(); - v57 = pPlayer->GetActualAC(); - v58 = pPlayer->GetBaseAC(); - v59 = pPlayer->GetActualAC(); - v60 = UI_GetHealthManaStringColor(v59, v58); - sprintf(pTmpBuf, "%s\f%05u\r424%d\f00000 /\t185%d\n\n", pGlobalTXT_LocalizationStrings[12], v60, v57, v56); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 26, v55, 0, pTmpBuf, 0, 0, 0); - v61 = v55 + 2 * LOBYTE(pFontArrus->uFontHeight) - 2; - v62 = pPlayer->GetMajorConditionIdx(); - v63 = aCharacterConditionNames[v62]; - v64 = GetConditionDrawColor(v62); - sprintf(pTmpBuf, "%s: \f%05d%s\n", pGlobalTXT_LocalizationStrings[47], v64, v63); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x1Au, v61, 0, pTmpBuf, 226, 0); - v65 = LOBYTE(pFontArrus->uFontHeight) + v61 - 1; - v66 = pPlayer->uQuickSpell; - if ( v66 ) - v67 = pSpellStats->pInfos[v66].pShortName; - else - v67 = pGlobalTXT_LocalizationStrings[153]; - sprintf(pTmpBuf, "%s: %s", pGlobalTXT_LocalizationStrings[172], v67); - pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x1Au, v65, 0, pTmpBuf, 226, 0); - v68 = pPlayer->GetBaseAge(); - v69 = pPlayer->GetActualAge(); - v70 = pPlayer->GetBaseAge(); - v71 = pPlayer->GetActualAge(); - v72 = UI_GetHealthManaStringColor(v71, v70); - sprintf(pTmpBuf, "%s\f%05u\t100%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[5], v72, v69, v68); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, 50, 0, pTmpBuf, 0, 0, 0); - a2b = "%s\f%05u\t100%d\f00000 / %d\n"; - uYa = LOBYTE(pFontArrus->uFontHeight) + 48; - if ( pPlayer->GetBaseLevel() > 99 ) - a2b = format_4E2E68; - v73 = pPlayer->GetBaseLevel(); - v74 = pPlayer->GetActualLevel(); - v75 = pPlayer->GetBaseLevel(); - v76 = pPlayer->GetActualLevel(); - v77 = UI_GetHealthManaStringColor(v76, v75); - sprintf(pTmpBuf, a2b, pGlobalTXT_LocalizationStrings[131], v77, v74, v73); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYa, 0, pTmpBuf, 0, 0, 0); - uYb = uYa + LOBYTE(pFontArrus->uFontHeight) - 2; - if ( (signed __int64)pPlayer->uExperience <= 9999999 ) - v78 = pGlobalTXT_LocalizationStrings[83]; - else - v78 = pGlobalTXT_LocalizationStrings[17]; - v79 = LODWORD(pPlayer->uExperience); - v80 = v78; - v81 = pPlayer->GetExperienceDisplayColor(); - sprintf(pTmpBuf, "%s\r180\f%05d%lu\f00000\n\n", v80, v81, v79); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYb, 0, pTmpBuf, 0, 0, 0); - v82 = uYb + 2 * LOBYTE(pFontArrus->uFontHeight); - v83 = pPlayer->GetActualAttack(0); - sprintf(pTmpBuf, "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[18], v83); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v82, 0, pTmpBuf, 0, 0, 0); - v84 = v82 + LOBYTE(pFontArrus->uFontHeight) - 2; - v85 = pPlayer->GetMeleeDamageString(); - sprintf(pTmpBuf, "%s\t100 %s\n", pGlobalTXT_LocalizationStrings[53], v85); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v84, 0, pTmpBuf, 0, 0, 0); - v86 = v84 + LOBYTE(pFontArrus->uFontHeight) - 2; - v87 = pPlayer->GetRangedAttack(); - sprintf(pTmpBuf, "%s\t100%+d\n", pGlobalTXT_LocalizationStrings[203], v87); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v86, 0, pTmpBuf, 0, 0, 0); - v88 = v86 + LOBYTE(pFontArrus->uFontHeight) - 2; - v89 = pPlayer->GetRangedDamageString(); - sprintf(pTmpBuf, "%s\t100 %s\n\n", pGlobalTXT_LocalizationStrings[53], v89); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, v88, 0, pTmpBuf, 0, 0, 0); - a2c = format_4E2E10; - uYc = v88 + 2 * LOBYTE(pFontArrus->uFontHeight) - 4; - v131 = pPlayer->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE); - v90 = pPlayer->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_FIRE); - if ( v131 > 99 || v90 > 99 ) - a2c = format_4E2E68; - v91 = v90; - v92 = UI_GetHealthManaStringColor(v131, v90); - sprintf(pTmpBuf, a2c, pGlobalTXT_LocalizationStrings[87], v92, v131, v91); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYc, 0, pTmpBuf, 0, 0, 0); - a2d = format_4E2E10; - uYd = uYc + LOBYTE(pFontArrus->uFontHeight) - 2; - v132 = pPlayer->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_AIR); - v93 = pPlayer->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_AIR); - if ( v132 > 99 || v93 > 99 ) - a2d = format_4E2E68; - v94 = v93; - v95 = UI_GetHealthManaStringColor(v132, v93); - sprintf(pTmpBuf, a2d, pGlobalTXT_LocalizationStrings[6], v95, v132, v94); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYd, 0, pTmpBuf, 0, 0, 0); - a2e = format_4E2E10; - uYe = uYd + LOBYTE(pFontArrus->uFontHeight) - 2; - v133 = pPlayer->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_WATER); - v96 = pPlayer->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_WATER); - if ( v133 > 99 || v96 > 99 ) - a2e = format_4E2E68; - v97 = v96; - v98 = UI_GetHealthManaStringColor(v133, v96); - sprintf(pTmpBuf, a2e, pGlobalTXT_LocalizationStrings[240], v98, v133, v97); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYe, 0, pTmpBuf, 0, 0, 0); - a2f = format_4E2E10; - uYf = uYe + LOBYTE(pFontArrus->uFontHeight) - 2; - v134 = pPlayer->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH); - v99 = pPlayer->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_EARTH); - if ( v134 > 99 ) - a2f = format_4E2E68; - v100 = v99; - v101 = UI_GetHealthManaStringColor(v134, v99); - sprintf(pTmpBuf, a2f, pGlobalTXT_LocalizationStrings[70], v101, v134, v100); - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYf, 0, pTmpBuf, 0, 0, 0); - a2g = format_4E2E10; - uYg = uYf + LOBYTE(pFontArrus->uFontHeight) - 2; - v135 = pPlayer->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_MIND); - v102 = pPlayer->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_MIND); - v137 = v102; - if ( v135 > 99 || v102 > 99 ) - a2g = format_4E2E68; - v103 = v102; - v104 = UI_GetHealthManaStringColor(v135, v102); - sprintf(pTmpBuf, a2g, pGlobalTXT_LocalizationStrings[142], v104, v135, v103); - if ( pPlayer->classType == PLAYER_CLASS_LICH && v137 == 200 ) - { - v105 = pGlobalTXT_LocalizationStrings[625]; - v106 = UI_GetHealthManaStringColor(v135, 200); - sprintf(pTmpBuf, format_4E2E00, pGlobalTXT_LocalizationStrings[142], v106, v105); - } - pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYg, 0, pTmpBuf, 0, 0, 0); - a2h = format_4E2E10; - uYh = uYg + LOBYTE(pFontArrus->uFontHeight) - 2; - v136 = pPlayer->GetActualResistance(CHARACTER_ATTRIBUTE_RESIST_BODY); - v107 = pPlayer->GetBaseResistance(CHARACTER_ATTRIBUTE_RESIST_BODY); - v138 = v107; - if ( v136 > 99 || v107 > 99 ) - a2h = format_4E2E68; - v108 = v107; - v109 = UI_GetHealthManaStringColor(v136, v107); - sprintf(pTmpBuf, a2h, pGlobalTXT_LocalizationStrings[29], v109, v136, v108); - if ( pPlayer->classType == PLAYER_CLASS_LICH && v138 == 200 ) - { - v110 = pGlobalTXT_LocalizationStrings[625]; - v111 = UI_GetHealthManaStringColor(v136, 200); - sprintf(pTmpBuf, format_4E2E00, pGlobalTXT_LocalizationStrings[29], v111, v110); - } - return pGUIWindow_CurrentMenu->DrawText(pFontArrus, 266, uYh, 0, pTmpBuf, 0, 0, 0); -} - -//----- (00419100) -------------------------------------------------------- -void FillAwardsData() - { - Player *pPlayer; // esi@1 - - pPlayer = pPlayers[uActiveCharacter]; - memset(&achievedAwardsIndex, 0, 4000); - memset(pTmpBuf2, 0, 0x7D0u); - dword_506544 = 0; - dword_506548 = 0; - awards_count = 0; - dword_50651C = 0; - dword_506528 = 0; - for(int i=0; i<105; ++i) - { - if ( _449B57_test_bit((unsigned char*)&pPlayer->_guilds_member_bits, i) && pAwards[i].pText ) - achievedAwardsIndex[awards_count++] = i; - } - awards_count2 = awards_count; - awards_count = 0; - //sort awards index - if ( awards_count2>0 ) - { - for(int i=0; ipControlsHead; pButton; pButton = pButton->pNext ) - { - if ( pButton->uControlID == 120 ) - { - dword_50698C = pButton->uX; - dword_506988 = pButton->uY; - dword_506984 = pButton->uZ; - dword_506980 = pButton->uW; - pButton->uW = 0; - pButton->uZ = 0; - pButton->uY = 0; - pButton->uX = 0; - v0 = uActiveCharacter; - } - } - v12 = 0; - a5 = pGUIWindow_CurrentMenu->uNumControls; - v18 = &pParty->pPlayers[v0-1]; - v2 = pFontLucida; - v14 = pWeaponSkills; - v3 = 2 * LOBYTE(pFontLucida->uFontHeight) + 13; - do - { - if ( v18->pActiveSkills[*v14] & 0x3F )//crash - { - v4 = LOBYTE(v2->uFontHeight); - v3 = v3 + v4 - 3; - ++a2; - ++v12; - pGUIWindow_CurrentMenu->CreateButton(0x18u, v3, 0xCCu, v4 - 3, 3, *v14 | 0x8000, 0x79u, *v14, 0, "", 0, 0); - v2 = pFontLucida; - } - ++v14; - } - while ( v14 <= &pWeaponSkills[8] ); - if ( !v12 ) - v3 = v3 + LOBYTE(v2->uFontHeight) - 3; - v15 = pMagicSkills; - v5 = v3 + 2 * LOBYTE(v2->uFontHeight) - 6; - do - { - if ( v18->pActiveSkills[*v15] & 0x3F && a2 < 15 ) - { - v6 = LOBYTE(v2->uFontHeight); - v5 = v5 + v6 - 3; - ++a2; - pGUIWindow_CurrentMenu->CreateButton(0x18u, v5, 0xCCu, v6 - 3, 3, *v15 | 0x8000, 0x79u, *v15, 0, "", 0, 0); - v2 = pFontLucida; - } - ++v15; - } - while ( v15 <= &pMagicSkills[8] ); - v13 = 0; - v16 = pArmorSkills; - v7 = 2 * LOBYTE(v2->uFontHeight) + 13; - do - { - if ( v18->pActiveSkills[*v16] & 0x3F ) - { - v8 = LOBYTE(v2->uFontHeight); - v7 = v7 + v8 - 3; - ++a2; - ++v13; - pGUIWindow_CurrentMenu->CreateButton(0xF6u, v7, 0xCCu, v8 - 3, 3, *v16 | 0x8000, 0x79u, *v16, 0, "", 0, 0); - v2 = pFontLucida; - } - ++v16; - } - while ( v16 <= &pArmorSkills[4] ); - if ( !v13 ) - v7 = v7 + LOBYTE(v2->uFontHeight) - 3; - v17 = pMiscSkills; - v9 = v7 + 2 * LOBYTE(v2->uFontHeight) - 6; - do - { - if ( v18->pActiveSkills[*v17] & 0x3F ) - { - v10 = LOBYTE(v2->uFontHeight); - v9 = v9 + v10 - 3; - ++a2; - pGUIWindow_CurrentMenu->CreateButton(0xF6u, v9, 0xCCu, v10 - 3, 3, *v17 | 0x8000, 0x79u, *v17, 0, "", 0, 0); - v2 = pFontLucida; - } - ++v17; - } - while ( v17 <= &pMiscSkills[11] ); - if ( a2 ) - pGUIWindow_CurrentMenu->_41D08F(a2, 1, 0, a5); -} \ No newline at end of file