Mercurial > mm7
comparison Chest.cpp @ 1709:8251e59fd7c1
ITEM_ENCHANTED to ITEM_HARDENED, created helper functions to get params from itemtable for ItemGens
author | Grumpy7 |
---|---|
date | Tue, 24 Sep 2013 07:29:55 +0200 |
parents | 4da5644df18f |
children | 35c1e4ff6ba7 |
comparison
equal
deleted
inserted
replaced
1708:f8414042db1f | 1709:8251e59fd7c1 |
---|---|
263 chest_item_index = pChests[uChestID].pInventoryIndices[item_counter]; | 263 chest_item_index = pChests[uChestID].pInventoryIndices[item_counter]; |
264 if ( chest_item_index > 0 ) | 264 if ( chest_item_index > 0 ) |
265 { | 265 { |
266 item_texture_id = pIcons_LOD->LoadTexture( | 266 item_texture_id = pIcons_LOD->LoadTexture( |
267 //pItemsTable->pItems[*(int *)((char *)&pOtherOverlayList->pOverlays[49].field_4 + 36 * v6 + v3 * 5324)].pIconName, | 267 //pItemsTable->pItems[*(int *)((char *)&pOtherOverlayList->pOverlays[49].field_4 + 36 * v6 + v3 * 5324)].pIconName, |
268 pItemsTable->pItems[pChests[uChestID].igChestItems[chest_item_index - 1].uItemID].pIconName, TEXTURE_16BIT_PALETTE); | 268 pChests[uChestID].igChestItems[chest_item_index - 1].GetIconName(), TEXTURE_16BIT_PALETTE); |
269 item_texture = pIcons_LOD->GetTexture(item_texture_id); | 269 item_texture = pIcons_LOD->GetTexture(item_texture_id); |
270 itemPixelWidth = item_texture->uTextureWidth; | 270 itemPixelWidth = item_texture->uTextureWidth; |
271 itemPixelHeght = item_texture->uTextureHeight; | 271 itemPixelHeght = item_texture->uTextureHeight; |
272 if ( itemPixelWidth < 14 ) | 272 if ( itemPixelWidth < 14 ) |
273 itemPixelWidth = 14; | 273 itemPixelWidth = 14; |
428 { | 428 { |
429 if ( uActiveCharacter ) | 429 if ( uActiveCharacter ) |
430 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NoRoom, 0); | 430 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NoRoom, 0); |
431 return 0; | 431 return 0; |
432 } | 432 } |
433 v7 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v4->uItemID].pIconName, TEXTURE_16BIT_PALETTE); | 433 v7 = pIcons_LOD->LoadTexture(v4->GetIconName(), TEXTURE_16BIT_PALETTE); |
434 HIWORD(v8) = 0; | 434 HIWORD(v8) = 0; |
435 v9 = pIcons_LOD->GetTexture(v7); | 435 v9 = pIcons_LOD->GetTexture(v7); |
436 v10 = v9->uTextureWidth; | 436 v10 = v9->uTextureWidth; |
437 if ( v10 < 14 ) | 437 if ( v10 < 14 ) |
438 v10 = 14; | 438 v10 = 14; |
749 v2 = (void *)(5324 * (int)v2); | 749 v2 = (void *)(5324 * (int)v2); |
750 //v3 = (ItemGen *)((char *)v2 + 36 * a1 + (int)((char *)pChests + 4)); | 750 //v3 = (ItemGen *)((char *)v2 + 36 * a1 + (int)((char *)pChests + 4)); |
751 v3 = &pChests[v20].igChestItems[a1]; | 751 v3 = &pChests[v20].igChestItems[a1]; |
752 //v17 = pChestWidthsByType[*(short *)((char *)v2 + (int)pChests)]; | 752 //v17 = pChestWidthsByType[*(short *)((char *)v2 + (int)pChests)]; |
753 v17 = pChestWidthsByType[pChests[v20].uChestBitmapID]; | 753 v17 = pChestWidthsByType[pChests[v20].uChestBitmapID]; |
754 v4 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v3->uItemID].pIconName, TEXTURE_16BIT_PALETTE); | 754 v4 = pIcons_LOD->LoadTexture(v3->GetIconName(), TEXTURE_16BIT_PALETTE); |
755 v5 = pIcons_LOD->GetTexture(v4); | 755 v5 = pIcons_LOD->GetTexture(v4); |
756 v6 = v5->uTextureWidth; | 756 v6 = v5->uTextureWidth; |
757 if ( v6 < 14 ) | 757 if ( v6 < 14 ) |
758 v6 = 14; | 758 v6 = 14; |
759 v7 = v6 - 14; | 759 v7 = v6 - 14; |
831 if ( v2 ) | 831 if ( v2 ) |
832 v3 = v2 - 1; | 832 v3 = v2 - 1; |
833 else | 833 else |
834 v3 = -1; | 834 v3 = -1; |
835 v4 = pChests[chest_id].pInventoryIndices[v3] - 1; | 835 v4 = pChests[chest_id].pInventoryIndices[v3] - 1; |
836 if ( pItemsTable->pItems[pChests[chest_id].igChestItems[v4].uItemID].uEquipType == EQUIP_GOLD ) | 836 if ( pChests[chest_id].igChestItems[v4].GetItemEquipType() == EQUIP_GOLD ) |
837 { | 837 { |
838 party_finds_gold(pChests[chest_id].igChestItems[v4].uSpecEnchantmentType, 0); | 838 party_finds_gold(pChests[chest_id].igChestItems[v4].uSpecEnchantmentType, 0); |
839 viewparams->bRedrawGameUI = 1; | 839 viewparams->bRedrawGameUI = 1; |
840 } | 840 } |
841 else | 841 else |