Mercurial > mm7
comparison GUI/UI/Chest.cpp @ 2575:a76d408c5132 tip
DrawTranslucent -> DrawTextureGrayShade
Removed old texture drawing stuff
author | a.parshin |
---|---|
date | Wed, 09 Mar 2016 01:39:52 +0200 |
parents | dd36326a9994 |
children |
comparison
equal
deleted
inserted
replaced
2574:dd36326a9994 | 2575:a76d408c5132 |
---|---|
55 // ----------------------------------------------------- | 55 // ----------------------------------------------------- |
56 // 0042092D void Chest::DrawChestUI(signed int uChestID) | 56 // 0042092D void Chest::DrawChestUI(signed int uChestID) |
57 auto uChestID = (unsigned int)ptr_1C; | 57 auto uChestID = (unsigned int)ptr_1C; |
58 | 58 |
59 int chestBitmapId; // eax@1 | 59 int chestBitmapId; // eax@1 |
60 unsigned int v5; // eax@1 | 60 //Image *v5; // eax@1 |
61 int chest_item_index; // ecx@3 | 61 int chest_item_index; // ecx@3 |
62 unsigned int item_texture_id; // eax@4 | 62 //unsigned int item_texture_id; // eax@4 |
63 Texture_MM7 *item_texture; // esi@4 | 63 //Texture_MM7 *item_texture; // esi@4 |
64 signed int itemPixelWidth; // ecx@4 | 64 signed int itemPixelWidth; // ecx@4 |
65 signed int itemPixelHeght; // edx@4 | 65 signed int itemPixelHeght; // edx@4 |
66 // signed int v11; // eax@4 | 66 // signed int v11; // eax@4 |
67 int v12; // eax@6 | 67 int v12; // eax@6 |
68 int v13; // eax@6 | 68 int v13; // eax@6 |
82 chest_offs_x = pChestPixelOffsetX[chestBitmapId]; | 82 chest_offs_x = pChestPixelOffsetX[chestBitmapId]; |
83 chest_offs_y = pChestPixelOffsetY[chestBitmapId]; | 83 chest_offs_y = pChestPixelOffsetY[chestBitmapId]; |
84 chestWidthCells = pChestWidthsByType[chestBitmapId]; | 84 chestWidthCells = pChestWidthsByType[chestBitmapId]; |
85 chestHeghtCells = pChestHeightsByType[chestBitmapId]; | 85 chestHeghtCells = pChestHeightsByType[chestBitmapId]; |
86 sprintfex(pTmpBuf.data(), "chest%02d", pChestList->pChests[chestBitmapId].uTextureID); | 86 sprintfex(pTmpBuf.data(), "chest%02d", pChestList->pChests[chestBitmapId].uTextureID); |
87 v5 = pIcons_LOD->LoadTexture(pTmpBuf.data(), TEXTURE_16BIT_PALETTE); | 87 |
88 pRenderer->DrawTextureTransparentColorKey(8u, 8u, pIcons_LOD->GetTexture(v5)); | 88 //v5 = pIcons_LOD->LoadTexture(pTmpBuf.data(), TEXTURE_16BIT_PALETTE); |
89 auto chest_background = assets->GetImage_16BitColorKey(pTmpBuf.data(), 0x7FF); | |
90 pRenderer->DrawTextureAlphaNew(8/640.0f, 8/480.0f, chest_background); | |
89 | 91 |
90 for (item_counter = 0; item_counter < chestWidthCells * chestHeghtCells; ++item_counter) | 92 for (item_counter = 0; item_counter < chestWidthCells * chestHeghtCells; ++item_counter) |
91 { | 93 { |
92 chest_item_index = pChests[uChestID].pInventoryIndices[item_counter]; | 94 chest_item_index = pChests[uChestID].pInventoryIndices[item_counter]; |
93 if (chest_item_index > 0) | 95 if (chest_item_index > 0) |
94 { | 96 { |
95 item_texture_id = pIcons_LOD->LoadTexture( | 97 //item_texture_id = pIcons_LOD->LoadTexture( |
96 //pItemsTable->pItems[*(int *)((char *)&pOtherOverlayList->pOverlays[49].field_4 + 36 * v6 + v3 * 5324)].pIconName, | 98 // //pItemsTable->pItems[*(int *)((char *)&pOtherOverlayList->pOverlays[49].field_4 + 36 * v6 + v3 * 5324)].pIconName, |
97 pChests[uChestID].igChestItems[chest_item_index - 1].GetIconName(), TEXTURE_16BIT_PALETTE); | 99 // pChests[uChestID].igChestItems[chest_item_index - 1].GetIconName(), TEXTURE_16BIT_PALETTE); |
98 item_texture = pIcons_LOD->GetTexture(item_texture_id); | 100 //item_texture = pIcons_LOD->GetTexture(item_texture_id); |
99 itemPixelWidth = item_texture->uTextureWidth; | 101 //itemPixelWidth = item_texture->uTextureWidth; |
100 itemPixelHeght = item_texture->uTextureHeight; | 102 //itemPixelHeght = item_texture->uTextureHeight; |
103 auto item_texture = assets->GetImage_16BitColorKey(pChests[uChestID].igChestItems[chest_item_index - 1].GetIconName(), 0x7FF); | |
104 itemPixelWidth = item_texture->GetWidth(); | |
105 itemPixelHeght = item_texture->GetHeight(); | |
106 | |
101 if (itemPixelWidth < 14) | 107 if (itemPixelWidth < 14) |
102 itemPixelWidth = 14; | 108 itemPixelWidth = 14; |
103 v12 = itemPixelWidth - 14; | 109 v12 = itemPixelWidth - 14; |
104 v12 = v12 & 0xFFFFFFE0; | 110 v12 = v12 & 0xFFFFFFE0; |
105 v13 = v12 + 32; | 111 v13 = v12 + 32; |
106 if (itemPixelHeght < 14) | 112 if (itemPixelHeght < 14) |
107 itemPixelHeght = 14; | 113 itemPixelHeght = 14; |
108 itemPixelPosX = chest_offs_x + 32 * (item_counter % chestWidthCells) + ((signed int)(v13 - itemPixelWidth) / 2); | 114 itemPixelPosX = chest_offs_x + 32 * (item_counter % chestWidthCells) + ((signed int)(v13 - itemPixelWidth) / 2); |
109 itemPixelPosY = chest_offs_y + 32 * (item_counter / chestHeghtCells) + | 115 itemPixelPosY = chest_offs_y + 32 * (item_counter / chestHeghtCells) + |
110 ((signed int)(((itemPixelHeght - 14) & 0xFFFFFFE0) + 32 - item_texture->uTextureHeight) / 2); | 116 ((signed int)(((itemPixelHeght - 14) & 0xFFFFFFE0) + 32 - item_texture->GetHeight()) / 2); |
111 pRenderer->DrawTextureIndexedAlpha(itemPixelPosX, itemPixelPosY, item_texture); | 117 pRenderer->DrawTextureAlphaNew(itemPixelPosX/640.0f, itemPixelPosY/480.0f, item_texture); |
112 ZBuffer_DoFill2(&v16[itemPixelPosX + pSRZBufferLineOffsets[itemPixelPosY]], item_texture, item_counter + 1); | 118 //ZBuffer_DoFill2(&v16[itemPixelPosX + pSRZBufferLineOffsets[itemPixelPosY]], item_texture, item_counter + 1); |
113 } | 119 } |
114 } | 120 } |
115 pRenderer->DrawTextureAlphaNew(pBtn_ExitCancel->uX/640.0f, pBtn_ExitCancel->uY/480.0f, ui_exit_cancel_button_background); | 121 pRenderer->DrawTextureAlphaNew(pBtn_ExitCancel->uX/640.0f, pBtn_ExitCancel->uY/480.0f, ui_exit_cancel_button_background); |
116 } | 122 } |
117 } | 123 } |