# HG changeset patch # User Grumpy7 # Date 1383017393 25200 # Node ID 2233efdc8d004c39509e6bec745e4365d94d08a8 # Parent 780dd567f1da367fce35e29d5eac2efae0714bbb fixing wrong shape of element being enchanted in inventory diff -r 780dd567f1da -r 2233efdc8d00 UI/UICharacter.cpp --- a/UI/UICharacter.cpp Mon Oct 28 00:57:37 2013 -0700 +++ b/UI/UICharacter.cpp Mon Oct 28 20:29:53 2013 -0700 @@ -1575,12 +1575,13 @@ v17 = uCellX + ((v15 - pTexture->uTextureWidth) >> 1) + pSRZBufferLineOffsets[uCellY + (( (int)((pTexture->uTextureHeight - 14) & 0xFFFFFFE0) - pTexture->uTextureHeight + 32) >> 1)]; //added typecast. without it the value in the brackets got cat to unsigned which messed stuff up if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes & 0xF0) { + Texture *loadedTextureptr = nullptr; switch (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes & 0xF0) { - case ITEM_AURA_EFFECT_RED: pTexture = pIcons_LOD->LoadTexturePtr("sptext01", TEXTURE_16BIT_PALETTE); break; - case ITEM_AURA_EFFECT_BLUE: pTexture = pIcons_LOD->LoadTexturePtr("sp28a", TEXTURE_16BIT_PALETTE); break; - case ITEM_AURA_EFFECT_GREEN: pTexture = pIcons_LOD->LoadTexturePtr("sp30a", TEXTURE_16BIT_PALETTE); break; - case ITEM_AURA_EFFECT_PURPLE: pTexture = pIcons_LOD->LoadTexturePtr("sp91a", TEXTURE_16BIT_PALETTE); break; + case ITEM_AURA_EFFECT_RED: loadedTextureptr = pIcons_LOD->LoadTexturePtr("sptext01", TEXTURE_16BIT_PALETTE); break; + case ITEM_AURA_EFFECT_BLUE: loadedTextureptr = pIcons_LOD->LoadTexturePtr("sp28a", TEXTURE_16BIT_PALETTE); break; + case ITEM_AURA_EFFECT_GREEN: loadedTextureptr = pIcons_LOD->LoadTexturePtr("sp30a", TEXTURE_16BIT_PALETTE); break; + case ITEM_AURA_EFFECT_PURPLE: loadedTextureptr = pIcons_LOD->LoadTexturePtr("sp91a", TEXTURE_16BIT_PALETTE); break; } _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; if (_50C9A8_item_enchantment_timer <= 0) @@ -1589,7 +1590,8 @@ LOBYTE(player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes) &= 0xF; ptr_50C9A4_ItemToEnchant = 0; } - pRenderer->DrawAura(uCellX, uCellY, pTexture, pTexture, GetTickCount() * 0.1, 0, 255); + + pRenderer->DrawAura(uCellX, uCellY, pTexture, loadedTextureptr, GetTickCount() * 0.1, 0, 255); ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, player->pInventoryMatrix[i]); } else