mirror of
https://github.com/Zelda64Recomp/Zelda64Recomp
synced 2026-06-22 17:13:07 -04:00
Fix define on flatpak, add cwd behavior.
This commit is contained in:
+8
-1
@@ -601,7 +601,14 @@ int main(int argc, char** argv) {
|
||||
// Force wasapi on Windows, as there seems to be some issue with sample queueing with directsound currently.
|
||||
SDL_setenv("SDL_AUDIODRIVER", "wasapi", true);
|
||||
#endif
|
||||
//printf("Current dir: %ls\n", std::filesystem::current_path().c_str());
|
||||
|
||||
#if defined(__linux__) && defined(RECOMP_FLATPAK)
|
||||
// When using Flatpak, applications tend to launch from the home directory by default.
|
||||
// Mods might use the current working directory to store the data, so we switch it to a directory
|
||||
// with persistent data storage and write permissions under Flatpak to ensure it works.
|
||||
std::error_code ec;
|
||||
std::filesystem::current_path("/var/data", ec);
|
||||
#endif
|
||||
|
||||
// Initialize SDL audio and set the output frequency.
|
||||
SDL_InitSubSystem(SDL_INIT_AUDIO);
|
||||
|
||||
Reference in New Issue
Block a user