Improve runtime stutter handling and ground clutter performance

- reduce per-tile ground clutter generation pressure and enforce tighter caps to avoid spikes

- remove expensive detail dedupe scans from the hot render path

- add progressive/lazy clutter updates around player movement to smooth frame pacing

- lower noisy runtime INFO logging to DEBUG/throttled paths

- keep terrain/game screen updates responsive while preserving existing behavior
This commit is contained in:
Kelsi 2026-02-21 01:26:16 -08:00
parent c04e97e375
commit 1003b25ff4
11 changed files with 714 additions and 116 deletions

View file

@ -222,7 +222,9 @@ std::shared_ptr<DBCFile> AssetManager::loadDBC(const std::string& name) {
(name == "CreatureDisplayInfo.dbc" ||
name == "CreatureDisplayInfoExtra.dbc" ||
name == "ItemDisplayInfo.dbc" ||
name == "CreatureModelData.dbc");
name == "CreatureModelData.dbc" ||
name == "GroundEffectTexture.dbc" ||
name == "GroundEffectDoodad.dbc");
// Try expansion-specific CSV first (e.g. Data/expansions/wotlk/db/Spell.csv)
bool loadedFromCSV = false;

View file

@ -368,12 +368,15 @@ std::string readString(const std::vector<uint8_t>& data, uint32_t offset, uint32
return "";
}
// Strip trailing null bytes (M2 nameLength includes \0)
while (length > 0 && data[offset + length - 1] == 0) {
length--;
// M2 string blocks are C-strings. Some extracted files have a valid
// string terminated early with embedded NUL and garbage bytes after it.
// Respect first NUL within the declared length.
uint32_t actualLen = 0;
while (actualLen < length && data[offset + actualLen] != 0) {
actualLen++;
}
return std::string(reinterpret_cast<const char*>(&data[offset]), length);
return std::string(reinterpret_cast<const char*>(&data[offset]), actualLen);
}
enum class TrackType { VEC3, QUAT_COMPRESSED, FLOAT };