Fix equipment textures: correct DBC field indices and stop texture cycling

Binary ItemDisplayInfo.dbc has 23 fields with texture components at
14-21, not 15-22. The previous "fix" shifted all fields by +1 which
read wrong columns and broke both player and NPC equipment rendering.

Also fix local player texture cycling: rebuildOnlineInventory() was
called on every item query response (including for other players),
unconditionally setting onlineEquipDirty_ which triggered redundant
texture recompositing. Now tracks previous equipment displayInfoIds
and only sets dirty when they actually change.

Unified all 3 equipment texture code paths (local player, other
players, NPCs) to use the DBC layout system with correct field 14
base index.
This commit is contained in:
Kelsi 2026-02-14 16:33:24 -08:00
parent e0e927cac1
commit 8282583b9a
8 changed files with 57 additions and 35 deletions

View file

@ -3130,16 +3130,16 @@ void Application::spawnOnlineCreature(uint64_t guid, uint32_t displayId, float x
const auto* idiL = pipeline::getActiveDBCLayout()
? pipeline::getActiveDBCLayout()->getLayout("ItemDisplayInfo") : nullptr;
// Texture component region fields (8 regions: ArmUpper..Foot)
// Fields 15-22 in WotLK ItemDisplayInfo.dbc (field 14 = HelmetGeosetVis[1])
// Binary DBC (23 fields) has textures at 14+
const uint32_t texRegionFields[8] = {
idiL ? (*idiL)["TextureArmUpper"] : 15u,
idiL ? (*idiL)["TextureArmLower"] : 16u,
idiL ? (*idiL)["TextureHand"] : 17u,
idiL ? (*idiL)["TextureTorsoUpper"]: 18u,
idiL ? (*idiL)["TextureTorsoLower"]: 19u,
idiL ? (*idiL)["TextureLegUpper"] : 20u,
idiL ? (*idiL)["TextureLegLower"] : 21u,
idiL ? (*idiL)["TextureFoot"] : 22u,
idiL ? (*idiL)["TextureArmUpper"] : 14u,
idiL ? (*idiL)["TextureArmLower"] : 15u,
idiL ? (*idiL)["TextureHand"] : 16u,
idiL ? (*idiL)["TextureTorsoUpper"]: 17u,
idiL ? (*idiL)["TextureTorsoLower"]: 18u,
idiL ? (*idiL)["TextureLegUpper"] : 19u,
idiL ? (*idiL)["TextureLegLower"] : 20u,
idiL ? (*idiL)["TextureFoot"] : 21u,
};
const bool npcIsFemale = (extra.sexId == 1);
@ -3970,16 +3970,16 @@ void Application::setOnlinePlayerEquipment(uint64_t guid,
};
// Texture component region fields from DBC layout
// Fields 15-22 in WotLK ItemDisplayInfo.dbc (field 14 = HelmetGeosetVis[1])
// Binary DBC (23 fields) has textures at 14+
const uint32_t texRegionFields[8] = {
idiL ? (*idiL)["TextureArmUpper"] : 15u,
idiL ? (*idiL)["TextureArmLower"] : 16u,
idiL ? (*idiL)["TextureHand"] : 17u,
idiL ? (*idiL)["TextureTorsoUpper"]: 18u,
idiL ? (*idiL)["TextureTorsoLower"]: 19u,
idiL ? (*idiL)["TextureLegUpper"] : 20u,
idiL ? (*idiL)["TextureLegLower"] : 21u,
idiL ? (*idiL)["TextureFoot"] : 22u,
idiL ? (*idiL)["TextureArmUpper"] : 14u,
idiL ? (*idiL)["TextureArmLower"] : 15u,
idiL ? (*idiL)["TextureHand"] : 16u,
idiL ? (*idiL)["TextureTorsoUpper"]: 17u,
idiL ? (*idiL)["TextureTorsoLower"]: 18u,
idiL ? (*idiL)["TextureLegUpper"] : 19u,
idiL ? (*idiL)["TextureLegLower"] : 20u,
idiL ? (*idiL)["TextureFoot"] : 21u,
};
std::vector<std::pair<int, std::string>> regionLayers;