| 957 | // Subdivision cache file format: magic + version + params + raw heightmap data |
| 958 | static const uint32_t SUBDIV_CACHE_MAGIC = 0x53444356; // "SDCV" |
| 959 | static const uint32_t SUBDIV_CACHE_VERSION = 1; |
| 960 | |
| 961 | static 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 |
no outgoing calls
no test coverage detected