mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 00:00:13 +00:00
Allow texture load retries instead of permanently caching failures
Remove negative cache for transient load failures in M2, terrain, and character renderers. Failed textures return white and will be retried on next model/tile load when assets may have finished streaming.
This commit is contained in:
parent
3e6de8485b
commit
93f873b521
4 changed files with 11 additions and 25 deletions
|
|
@ -526,17 +526,12 @@ VkTexture* CharacterRenderer::loadTexture(const std::string& path) {
|
|||
return whiteTexture_.get();
|
||||
}
|
||||
|
||||
// Check negative cache to avoid repeated file I/O for textures that don't exist
|
||||
if (failedTextureCache_.count(key)) {
|
||||
return whiteTexture_.get();
|
||||
}
|
||||
|
||||
auto blpImage = assetManager->loadTexture(key);
|
||||
if (!blpImage.isValid()) {
|
||||
static constexpr size_t kMaxFailedTextureCache = 200000;
|
||||
core::Logger::getInstance().warning("Failed to load texture: ", path);
|
||||
if (failedTextureCache_.size() < kMaxFailedTextureCache) {
|
||||
failedTextureCache_.insert(key);
|
||||
// Return white fallback but don't cache the failure — allow retry
|
||||
// on next character load in case the asset becomes available.
|
||||
if (loggedTextureLoadFails_.insert(key).second) {
|
||||
core::Logger::getInstance().warning("Failed to load texture: ", path);
|
||||
}
|
||||
return whiteTexture_.get();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue