summaryrefslogtreecommitdiff
path: root/src/yuzu_cmd/yuzu.cpp
diff options
context:
space:
mode:
authorGravatar flodavid2023-11-03 15:41:16 +0100
committerGravatar flodavid2023-11-25 19:30:37 +0100
commit40644d43f700cb0075db0eea288078bda7cf4527 (patch)
tree876d26a64a803d2b1509e71a13fe822f1e851c00 /src/yuzu_cmd/yuzu.cpp
parentyuzu: integrate gamemode support on linux (diff)
downloadyuzu-40644d43f700cb0075db0eea288078bda7cf4527.tar.gz
yuzu-40644d43f700cb0075db0eea288078bda7cf4527.tar.xz
yuzu-40644d43f700cb0075db0eea288078bda7cf4527.zip
yuzu: create linux group in general settings
- Create files dedicated to starting and stopping gamemode functions - Use them in yuzu and yuzu_cmd modules
Diffstat (limited to 'src/yuzu_cmd/yuzu.cpp')
-rw-r--r--src/yuzu_cmd/yuzu.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp
index 1c3a1809b..a81635fa4 100644
--- a/src/yuzu_cmd/yuzu.cpp
+++ b/src/yuzu_cmd/yuzu.cpp
@@ -63,8 +63,8 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
63} 63}
64#endif 64#endif
65 65
66#ifdef __linux__ 66#ifdef __unix__
67#include <gamemode_client.h> 67#include "common/linux/gamemode.h"
68#endif 68#endif
69 69
70static void PrintHelp(const char* argv0) { 70static void PrintHelp(const char* argv0) {
@@ -429,14 +429,8 @@ int main(int argc, char** argv) {
429 exit(0); 429 exit(0);
430 }); 430 });
431 431
432#ifdef __linux__ 432#ifdef __unix__
433 if (Settings::values.disable_gamemode) { 433 Common::Linux::StartGamemode();
434 if (gamemode_request_start() < 0) {
435 LOG_WARNING(Frontend, "Failed to start gamemode: {}", gamemode_error_string());
436 } else {
437 LOG_INFO(Frontend, "Started gamemode");
438 }
439 }
440#endif 434#endif
441 435
442 void(system.Run()); 436 void(system.Run());
@@ -450,14 +444,8 @@ int main(int argc, char** argv) {
450 void(system.Pause()); 444 void(system.Pause());
451 system.ShutdownMainProcess(); 445 system.ShutdownMainProcess();
452 446
453#ifdef __linux__ 447#ifdef __unix__
454 if (Settings::values.disable_gamemode) { 448 Common::Linux::StopGamemode();
455 if (gamemode_request_end() < 0) {
456 LOG_WARNING(Frontend, "Failed to stop gamemode: {}", gamemode_error_string());
457 } else {
458 LOG_INFO(Frontend, "Stopped gamemode");
459 }
460 }
461#endif 449#endif
462 450
463 detached_tasks.WaitForAllTasks(); 451 detached_tasks.WaitForAllTasks();