Add flatpak support.

This commit is contained in:
Dario
2025-04-26 23:21:27 -03:00
parent d766cf328f
commit 61643779a2
9 changed files with 184 additions and 7 deletions
+11 -4
View File
@@ -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) {