mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-25 08:30:13 +00:00
Preload terrain textures on background thread and fix ramp Z-snapping
Load BLP texture data during prepareTile() and upload to GL cache in finalizeTile(), eliminating file I/O stalls on the main thread. Reduce ready tiles per frame to 1. Fix camera sweep to snap Z to ramp surfaces. Change hearthstone action bar slot from spell to item.
This commit is contained in:
parent
0ce38cfb99
commit
d910073d7a
6 changed files with 66 additions and 13 deletions
|
|
@ -4,6 +4,7 @@
|
|||
#include "pipeline/terrain_mesh.hpp"
|
||||
#include "pipeline/m2_loader.hpp"
|
||||
#include "pipeline/wmo_loader.hpp"
|
||||
#include "pipeline/blp_loader.hpp"
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
|
@ -103,6 +104,10 @@ struct PendingTile {
|
|||
glm::mat4 modelMatrix; // Pre-computed world transform
|
||||
};
|
||||
std::vector<WMODoodadReady> wmoDoodads;
|
||||
|
||||
// Pre-loaded terrain texture BLP data (loaded on background thread to avoid
|
||||
// blocking file I/O on the main thread during finalizeTile)
|
||||
std::unordered_map<std::string, pipeline::BLPImage> preloadedTextures;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include "pipeline/terrain_mesh.hpp"
|
||||
#include "pipeline/blp_loader.hpp"
|
||||
#include "rendering/shader.hpp"
|
||||
#include "rendering/texture.hpp"
|
||||
#include "rendering/camera.hpp"
|
||||
|
|
@ -87,6 +88,12 @@ public:
|
|||
*/
|
||||
void removeTile(int tileX, int tileY);
|
||||
|
||||
/**
|
||||
* Upload pre-loaded BLP textures to the GL texture cache.
|
||||
* Called before loadTerrain() so texture loading avoids file I/O.
|
||||
*/
|
||||
void uploadPreloadedTextures(const std::unordered_map<std::string, pipeline::BLPImage>& textures);
|
||||
|
||||
/**
|
||||
* Render loaded terrain
|
||||
* @param camera Camera for view/projection matrices
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue