mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-04 08:23:50 +00:00
refactor: extract fallback textures, add why-comments, name WMO constant
- character_renderer: extract duplicated fallback texture creation (white/transparent/flat-normal) into createFallbackTextures() — was copy-pasted between initialize() and clear() - wmo_renderer: replace magic 8192 with kMaxRetryTracked constant, add why-comment explaining the fallback-retry set cap (Dalaran has 2000+ unique WMO groups) - quest_handler: add why-comment on reqCount=0 fallback — escort/event quests can report kill credit without objective counts in query response
This commit is contained in:
parent
f313eec24e
commit
4acebff65c
4 changed files with 40 additions and 44 deletions
|
|
@ -363,12 +363,16 @@ bool WMORenderer::loadModel(const pipeline::WMOModel& model, uint32_t id) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
// Track which WMO models have been force-reloaded after resolving only to
|
||||
// fallback textures. Cap the set to avoid unbounded memory growth in worlds
|
||||
// with many unique WMO groups (e.g. Dalaran has 2000+).
|
||||
static constexpr size_t kMaxRetryTracked = 8192;
|
||||
static std::unordered_set<uint32_t> retryReloadedModels;
|
||||
static bool retryReloadedModelsCapped = false;
|
||||
if (retryReloadedModels.size() > 8192) {
|
||||
if (retryReloadedModels.size() > kMaxRetryTracked) {
|
||||
retryReloadedModels.clear();
|
||||
if (!retryReloadedModelsCapped) {
|
||||
core::Logger::getInstance().warning("WMO fallback-retry set exceeded 8192 entries; reset");
|
||||
core::Logger::getInstance().warning("WMO fallback-retry set exceeded ", kMaxRetryTracked, " entries; reset");
|
||||
retryReloadedModelsCapped = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue