mirror of
https://github.com/Zelda64Recomp/Zelda64Recomp
synced 2026-06-15 22:49:54 -04:00
Flatpak support. (#569)
* Add flatpak support. * Add gamepad to supported controls list in flatpak metainfo --------- Co-authored-by: Wiseguy <68165316+Mr-Wiseguy@users.noreply.github.com>
This commit is contained in:
+11
-4
@@ -45,13 +45,20 @@ namespace zelda64 {
|
||||
|
||||
// MARK: - Public API
|
||||
|
||||
std::filesystem::path get_asset_path(const char* asset) {
|
||||
std::filesystem::path base_path = "";
|
||||
std::filesystem::path get_program_path() {
|
||||
#if defined(__APPLE__)
|
||||
base_path = get_bundle_resource_directory();
|
||||
return get_bundle_resource_directory();
|
||||
#elif defined(__linux__)
|
||||
std::error_code ec;
|
||||
if (std::filesystem::exists("/.flatpak-info", ec)) {
|
||||
return "/app/bin";
|
||||
}
|
||||
#endif
|
||||
return "";
|
||||
}
|
||||
|
||||
return base_path / "assets" / asset;
|
||||
std::filesystem::path get_asset_path(const char* asset) {
|
||||
return get_program_path() / "assets" / asset;
|
||||
}
|
||||
|
||||
void open_file_dialog(std::function<void(bool success, const std::filesystem::path& path)> callback) {
|
||||
|
||||
Reference in New Issue
Block a user