Fix instance portals: WDT byte order, box trigger sizing, suppress ping-pong, WMO cache cleanup

- Fix WDT chunk magic constants to big-endian ASCII (matching ADTLoader)
- Add minimum effective size for box area triggers (90 units, like sphere 45-unit radius)
- Add areaTriggerSuppressFirst_ flag to prevent portal ping-pong on map transfer
- Add WMORenderer::clearAll() to clear models/textures on map change (prevents GPU crash)
- Increase WMO texture cache default to 8GB
- Fix setMapName called after loadTestTerrain so WMO renderer exists
- Save/restore player position around CMSG_AREATRIGGER to prevent bad DB persistence
This commit is contained in:
Kelsi 2026-02-27 04:59:12 -08:00
parent d0e8b44866
commit 16d88f19fc
6 changed files with 120 additions and 41 deletions

View file

@ -136,6 +136,11 @@ public:
*/
void clearInstances();
/**
* Clear all instances, loaded models, and texture cache (for map transitions)
*/
void clearAll();
/**
* Render all WMO instances (Vulkan)
* @param cmd Command buffer to record into
@ -630,7 +635,7 @@ private:
std::unordered_map<std::string, TextureCacheEntry> textureCache;
size_t textureCacheBytes_ = 0;
uint64_t textureCacheCounter_ = 0;
size_t textureCacheBudgetBytes_ = 2048ull * 1024 * 1024; // Default, overridden at init
size_t textureCacheBudgetBytes_ = 8192ull * 1024 * 1024; // 8 GB default, overridden at init
std::unordered_set<std::string> failedTextureCache_;
std::unordered_set<std::string> loggedTextureLoadFails_;
uint32_t textureBudgetRejectWarnings_ = 0;