mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Add pre-computed WMO floor cache and improve save logging
- Add initial floor cache for faster collision on first run - Log absolute path when saving cache for debugging
This commit is contained in:
parent
a96ea0758c
commit
125cf588bb
3 changed files with 13 additions and 2 deletions
BIN
cache/wmo_floor_cache.bin
vendored
Normal file
BIN
cache/wmo_floor_cache.bin
vendored
Normal file
Binary file not shown.
|
|
@ -317,7 +317,11 @@ void Application::shutdown() {
|
|||
|
||||
// Save floor cache before renderer is destroyed
|
||||
if (renderer && renderer->getWMORenderer()) {
|
||||
renderer->getWMORenderer()->saveFloorCache("cache/wmo_floor_cache.bin");
|
||||
size_t cacheSize = renderer->getWMORenderer()->getFloorCacheSize();
|
||||
if (cacheSize > 0) {
|
||||
LOG_INFO("Saving WMO floor cache (", cacheSize, " entries)...");
|
||||
renderer->getWMORenderer()->saveFloorCache("cache/wmo_floor_cache.bin");
|
||||
}
|
||||
}
|
||||
|
||||
// Stop renderer first: terrain streaming workers may still be reading via
|
||||
|
|
|
|||
|
|
@ -517,8 +517,15 @@ void WMORenderer::resetQueryStats() {
|
|||
bool WMORenderer::saveFloorCache(const std::string& filepath) const {
|
||||
// Create directory if needed
|
||||
std::filesystem::path path(filepath);
|
||||
std::filesystem::path absPath = std::filesystem::absolute(path);
|
||||
core::Logger::getInstance().info("Saving floor cache to: ", absPath.string());
|
||||
|
||||
if (path.has_parent_path()) {
|
||||
std::filesystem::create_directories(path.parent_path());
|
||||
std::error_code ec;
|
||||
std::filesystem::create_directories(path.parent_path(), ec);
|
||||
if (ec) {
|
||||
core::Logger::getInstance().error("Failed to create cache directory: ", ec.message());
|
||||
}
|
||||
}
|
||||
|
||||
std::ofstream file(filepath, std::ios::binary);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue