Add loading screen with random WOWEE splash images

- Add loading screen system with stb_image for JPEG loading
- Two loading screen images (orc and dwarf) randomly selected
- Display loading screen while terrain data loads
- Cache WMO inverse matrices to reduce per-frame computation
- Stub WMO liquid rendering (needs coordinate system fix)
- Update spawn point to Stormwind Trade District
This commit is contained in:
Kelsi 2026-02-03 13:33:31 -08:00
parent 665a73e75f
commit 01bf3b4c08
14 changed files with 8395 additions and 165 deletions

View file

@ -469,15 +469,37 @@ void TerrainManager::finalizeTile(std::unique_ptr<PendingTile> pending) {
}
int loadedWMOs = 0;
int loadedLiquids = 0;
for (auto& wmoReady : pending->wmoModels) {
if (wmoRenderer->loadModel(wmoReady.model, wmoReady.modelId)) {
uint32_t wmoInstId = wmoRenderer->createInstance(wmoReady.modelId, wmoReady.position, wmoReady.rotation);
if (wmoInstId) {
wmoInstanceIds.push_back(wmoInstId);
loadedWMOs++;
// Load WMO liquids (canals, pools, etc.)
if (waterRenderer) {
// Compute the same model matrix as WMORenderer uses
glm::mat4 modelMatrix = glm::mat4(1.0f);
modelMatrix = glm::translate(modelMatrix, wmoReady.position);
modelMatrix = glm::rotate(modelMatrix, wmoReady.rotation.z, glm::vec3(0.0f, 0.0f, 1.0f));
modelMatrix = glm::rotate(modelMatrix, wmoReady.rotation.y, glm::vec3(0.0f, 1.0f, 0.0f));
modelMatrix = glm::rotate(modelMatrix, wmoReady.rotation.x, glm::vec3(1.0f, 0.0f, 0.0f));
// Load liquids from each WMO group
for (const auto& group : wmoReady.model.groups) {
if (group.liquid.hasLiquid()) {
waterRenderer->loadFromWMO(group.liquid, modelMatrix, wmoInstId);
loadedLiquids++;
}
}
}
}
}
}
if (loadedLiquids > 0) {
LOG_INFO(" Loaded WMO liquids for tile [", x, ",", y, "]: ", loadedLiquids);
}
// Upload WMO doodad M2 models
if (m2Renderer) {
@ -608,9 +630,13 @@ void TerrainManager::unloadTile(int x, int y) {
LOG_DEBUG(" Removed ", tile->m2InstanceIds.size(), " M2 instances");
}
// Remove WMO instances
// Remove WMO instances and their liquids
if (wmoRenderer) {
for (uint32_t id : tile->wmoInstanceIds) {
// Remove WMO liquids associated with this instance
if (waterRenderer) {
waterRenderer->removeWMO(id);
}
wmoRenderer->removeInstance(id);
}
LOG_DEBUG(" Removed ", tile->wmoInstanceIds.size(), " WMO instances");