comparison UI/UICharacter.cpp @ 1978:2233efdc8d00

fixing wrong shape of element being enchanted in inventory
author Grumpy7
date Mon, 28 Oct 2013 20:29:53 -0700
parents a86c60679949
children c1c74df0a33e
comparison
equal deleted inserted replaced
1977:780dd567f1da 1978:2233efdc8d00
1573 if (pTexture->uTextureHeight < 14 ) 1573 if (pTexture->uTextureHeight < 14 )
1574 pTexture->uTextureHeight = 14; 1574 pTexture->uTextureHeight = 14;
1575 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 1575 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
1576 if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes & 0xF0) 1576 if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes & 0xF0)
1577 { 1577 {
1578 Texture *loadedTextureptr = nullptr;
1578 switch (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes & 0xF0) 1579 switch (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes & 0xF0)
1579 { 1580 {
1580 case ITEM_AURA_EFFECT_RED: pTexture = pIcons_LOD->LoadTexturePtr("sptext01", TEXTURE_16BIT_PALETTE); break; 1581 case ITEM_AURA_EFFECT_RED: loadedTextureptr = pIcons_LOD->LoadTexturePtr("sptext01", TEXTURE_16BIT_PALETTE); break;
1581 case ITEM_AURA_EFFECT_BLUE: pTexture = pIcons_LOD->LoadTexturePtr("sp28a", TEXTURE_16BIT_PALETTE); break; 1582 case ITEM_AURA_EFFECT_BLUE: loadedTextureptr = pIcons_LOD->LoadTexturePtr("sp28a", TEXTURE_16BIT_PALETTE); break;
1582 case ITEM_AURA_EFFECT_GREEN: pTexture = pIcons_LOD->LoadTexturePtr("sp30a", TEXTURE_16BIT_PALETTE); break; 1583 case ITEM_AURA_EFFECT_GREEN: loadedTextureptr = pIcons_LOD->LoadTexturePtr("sp30a", TEXTURE_16BIT_PALETTE); break;
1583 case ITEM_AURA_EFFECT_PURPLE: pTexture = pIcons_LOD->LoadTexturePtr("sp91a", TEXTURE_16BIT_PALETTE); break; 1584 case ITEM_AURA_EFFECT_PURPLE: loadedTextureptr = pIcons_LOD->LoadTexturePtr("sp91a", TEXTURE_16BIT_PALETTE); break;
1584 } 1585 }
1585 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed; 1586 _50C9A8_item_enchantment_timer -= pEventTimer->uTimeElapsed;
1586 if (_50C9A8_item_enchantment_timer <= 0) 1587 if (_50C9A8_item_enchantment_timer <= 0)
1587 { 1588 {
1588 _50C9A8_item_enchantment_timer = 0; 1589 _50C9A8_item_enchantment_timer = 0;
1589 LOBYTE(player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes) &= 0xF; 1590 LOBYTE(player->pInventoryItemList[player->pInventoryMatrix[i] - 1].uAttributes) &= 0xF;
1590 ptr_50C9A4_ItemToEnchant = 0; 1591 ptr_50C9A4_ItemToEnchant = 0;
1591 } 1592 }
1592 pRenderer->DrawAura(uCellX, uCellY, pTexture, pTexture, GetTickCount() * 0.1, 0, 255); 1593
1594 pRenderer->DrawAura(uCellX, uCellY, pTexture, loadedTextureptr, GetTickCount() * 0.1, 0, 255);
1593 ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, player->pInventoryMatrix[i]); 1595 ZBuffer_Fill(&pRenderer->pActiveZBuffer[v17], item_texture_id, player->pInventoryMatrix[i]);
1594 } 1596 }
1595 else 1597 else
1596 { 1598 {
1597 if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].IsIdentified() || pCurrentScreen != SCREEN_HOUSE) 1599 if (player->pInventoryItemList[player->pInventoryMatrix[i] - 1].IsIdentified() || pCurrentScreen != SCREEN_HOUSE)