mirror of
https://github.com/RetroPortingToolKit/psxrecomp
synced 2026-10-27 10:38:46 -04:00
Merge pull request #685 from boburning/fix/portable-generated-texture-defaults
Keep runtime-generated texture-pack defaults portable across installs
This commit is contained in:
@@ -1583,15 +1583,19 @@ bool mod_runtime_initialize(const std::filesystem::path& root,
|
||||
});
|
||||
if (resource == package->resources.end()) continue;
|
||||
std::error_code ec;
|
||||
const auto pack = std::filesystem::absolute(
|
||||
root / "texture-packs" / texture_game_id, ec);
|
||||
std::string directory_error;
|
||||
if (!s.manager.set_generated_feature_resource_default(package->id,
|
||||
plugin.feature_id, "pack", std::filesystem::path("texture-packs") / texture_game_id,
|
||||
&directory_error)) {
|
||||
std::fprintf(stderr, "psxrecomp: texture pack folder: %s\n", directory_error.c_str());
|
||||
continue;
|
||||
}
|
||||
const auto pack = s.manager.feature_resource_path(package->id, plugin.feature_id, "pack");
|
||||
if (!ec) std::filesystem::create_directories(pack / "replacements", ec);
|
||||
if (!ec) std::filesystem::create_directories(pack / "dumps", ec);
|
||||
std::string directory_error;
|
||||
if (ec || !s.manager.set_feature_resource_path(package->id,
|
||||
plugin.feature_id, "pack", pack, &directory_error)) {
|
||||
if (ec) {
|
||||
std::fprintf(stderr, "psxrecomp: texture pack folder: %s\n",
|
||||
ec ? ec.message().c_str() : directory_error.c_str());
|
||||
ec.message().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user