diff --git a/src/rendering/character_preview.cpp b/src/rendering/character_preview.cpp index 9dc0efcf..2314e6e9 100644 --- a/src/rendering/character_preview.cpp +++ b/src/rendering/character_preview.cpp @@ -547,20 +547,6 @@ bool CharacterPreview::applyEquipment(const std::vector& eq return false; } - // Diagnostic: log equipment vector and DBC state - LOG_INFO("applyEquipment: ", equipment.size(), " items, ItemDisplayInfo.dbc records=", - displayInfoDbc->getRecordCount(), " fields=", displayInfoDbc->getFieldCount(), - " bodySkin=", bodySkinPath_.empty() ? "(empty)" : bodySkinPath_); - for (size_t ei = 0; ei < equipment.size(); ++ei) { - const auto& it = equipment[ei]; - if (it.displayModel == 0) continue; - int32_t dbcRec = displayInfoDbc->findRecordById(it.displayModel); - LOG_INFO(" slot[", ei, "]: displayModel=", it.displayModel, - " invType=", (int)it.inventoryType, - " dbcRec=", dbcRec, - (dbcRec >= 0 ? " (found)" : " (NOT FOUND in ItemDisplayInfo.dbc)")); - } - auto hasInvType = [&](std::initializer_list types) -> bool { for (const auto& it : equipment) { if (it.displayModel == 0) continue; @@ -586,10 +572,6 @@ bool CharacterPreview::applyEquipment(const std::vector& eq int32_t recIdx = displayInfoDbc->findRecordById(displayInfoId); if (recIdx < 0) return 0; uint32_t val = displayInfoDbc->getUInt32(static_cast(recIdx), 7 + groupField); - if (val > 0) { - LOG_INFO(" getGeosetGroup: displayInfoId=", displayInfoId, - " groupField=", groupField, " field=", (7 + groupField), " val=", val); - } return val; }; @@ -661,6 +643,20 @@ bool CharacterPreview::applyEquipment(const std::vector& eq "LegUpperTexture", "LegLowerTexture", "FootTexture", }; + // Texture component region fields — use DBC layout when available, fall back to binary offsets. + const auto* idiL = pipeline::getActiveDBCLayout() + ? pipeline::getActiveDBCLayout()->getLayout("ItemDisplayInfo") : nullptr; + const uint32_t texRegionFields[8] = { + 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> regionLayers; regionLayers.reserve(32); @@ -670,13 +666,9 @@ bool CharacterPreview::applyEquipment(const std::vector& eq if (recIdx < 0) continue; for (int region = 0; region < 8; region++) { - uint32_t fieldIdx = 14 + region; // texture_1..texture_8 - std::string texName = displayInfoDbc->getString(static_cast(recIdx), fieldIdx); + std::string texName = displayInfoDbc->getString(static_cast(recIdx), texRegionFields[region]); if (texName.empty()) continue; - LOG_INFO(" texture region ", region, " (field ", fieldIdx, "): texName=", texName, - " for displayModel=", it.displayModel); - std::string base = "Item\\TextureComponents\\" + std::string(componentDirs[region]) + "\\" + texName; @@ -692,7 +684,6 @@ bool CharacterPreview::applyEquipment(const std::vector& eq } else if (assetManager_->fileExists(basePath)) { fullPath = basePath; } else { - LOG_INFO(" texture path not found: ", base, " (_M/_F/_U/.blp)"); continue; } regionLayers.emplace_back(region, fullPath);