mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Load creature display DBC lookups at startup instead of first spawn
Moves buildCreatureDisplayLookups() from lazy init on first creature spawn to eagerly run after asset manager init, eliminating a 133s hang.
This commit is contained in:
parent
a09bea5e1e
commit
a0c24e70f9
1 changed files with 4 additions and 4 deletions
|
|
@ -171,6 +171,8 @@ bool Application::initialize() {
|
|||
LOG_INFO("Attempting to load WoW assets from: ", dataPath);
|
||||
if (assetManager->initialize(dataPath)) {
|
||||
LOG_INFO("Asset manager initialized successfully");
|
||||
// Eagerly load creature display DBC lookups so first spawn doesn't stall
|
||||
buildCreatureDisplayLookups();
|
||||
} else {
|
||||
LOG_WARNING("Failed to initialize asset manager - asset loading will be unavailable");
|
||||
LOG_WARNING("Set WOW_DATA_PATH environment variable to your WoW Data directory");
|
||||
|
|
@ -1842,10 +1844,8 @@ std::string Application::getModelPathForDisplayId(uint32_t displayId) const {
|
|||
void Application::spawnOnlineCreature(uint64_t guid, uint32_t displayId, float x, float y, float z, float orientation) {
|
||||
if (!renderer || !renderer->getCharacterRenderer() || !assetManager) return;
|
||||
|
||||
// Build lookups on first creature spawn
|
||||
if (!creatureLookupsBuilt_) {
|
||||
buildCreatureDisplayLookups();
|
||||
}
|
||||
// Skip if lookups not yet built (asset manager not ready)
|
||||
if (!creatureLookupsBuilt_) return;
|
||||
|
||||
// Skip if already spawned
|
||||
if (creatureInstances_.count(guid)) return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue