MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / GetSubdivCachePath

Function GetSubdivCachePath

engine/Poseidon/World/Terrain/LandSave.cpp:959–973  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

957// Subdivision cache file format: magic + version + params + raw heightmap data
958static const uint32_t SUBDIV_CACHE_MAGIC = 0x53444356; // "SDCV"
959static const uint32_t SUBDIV_CACHE_VERSION = 1;
960
961static std::string GetSubdivCachePath(const char* wrpName, int targetSubdivLog)
962{
963 // Build cache path from WRP name
964 std::string base(wrpName ? wrpName : "unknown");
965 // Replace path separators and dots
966 for (auto& c : base)
967 {
968 if (c == '\\' || c == '/' || c == ':')
969 c = '_';
970 }
971 char buf[512];
972 const auto& cacheDir = GamePaths::Instance().CacheDir();
973 snprintf(buf, sizeof(buf), "%s/cwr_subdiv_%s_L%d.cache", cacheDir.c_str(), base.c_str(), targetSubdivLog);
974 return std::string(buf);
975}
976

Callers 2

LoadSubdivCacheMethod · 0.85
SaveSubdivCacheMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected