File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -260,6 +260,15 @@ namespace {
260260 }
261261 }
262262
263+ void sanitize_paths (gf::TiledMap& map, const std::filesystem::path& raw_directory)
264+ {
265+ for (auto & texture : map.textures ) {
266+ const std::filesystem::path relative_path = std::filesystem::proximate (texture.string (), raw_directory);
267+ texture = relative_path;
268+ }
269+ }
270+
271+
263272 void compile_json_characters (const std::filesystem::path& filename, akgr::DataLexicon<akgr::CharacterData>& data) {
264273 gf::Log::info (" \t Reading '{}'..." , filename.string ());
265274 std::ifstream ifs (filename);
@@ -348,6 +357,8 @@ int main() {
348357 copy_textures (data.map , raw_directory, out_directory);
349358 copy_textures (data.items , raw_directory, out_directory);
350359
360+ sanitize_paths (data.map , raw_directory);
361+
351362 auto duration = clock.elapsed_time ();
352363 gf::Log::info (" Data successfully compiled in {} ms" , duration.as_milliseconds ());
353364
You can’t perform that action at this time.
0 commit comments