// TextureSet .txt(首行 `TextureSet`)—— 地表图层表。 // 对标 PRTerrainLib/TextureSet.cpp CTextureSet::Load。SHINSOO §5.4。 // // 关键:运行时 index 0 是原客户端内部的空图层(AddEmptyTexture),文件里的 // `Texture001` 对应运行时索引 1。`layers` 按文件顺序(即运行时索引 1..N)。 #pragma once #include #include namespace fmt { struct TextureLayer { std::string texture; // 相对路径(原样,含 d:\ymir work\ 前缀) float u_scale = 1, v_scale = 1; float u_offset = 0, v_offset = 0; bool splat_enabled = false; unsigned short height_begin = 0; unsigned short height_end = 0; }; struct TextureSet { int declared_count = 0; // TextureCount std::vector layers; // 实际解析到的图层(运行时索引 = 下标 + 1) int runtime_count() const { return (int)layers.size() + 1; } // +1 空图层 }; bool parse_texture_set(const std::string& text, TextureSet& out, std::string* err); bool parse_texture_set_file(const std::string& path, TextureSet& out, std::string* err); } // namespace fmt