Move display sleep functions to emu callbacks

This commit is contained in:
Megamouse 2025-02-24 21:41:14 +01:00
parent 87db82cacd
commit 8d801dadc4
8 changed files with 38 additions and 48 deletions

View file

@ -51,8 +51,6 @@
#include "Utilities/JIT.h"
#include "display_sleep_control.h"
#include "Emu/IPC_socket.h"
#if defined(HAVE_VULKAN)
@ -2506,7 +2504,7 @@ void Emulator::Run(bool start_playtime)
if (g_cfg.misc.prevent_display_sleep)
{
disable_display_sleep();
Emu.GetCallbacks().enable_display_sleep(false);
}
}
@ -2791,7 +2789,7 @@ bool Emulator::Pause(bool freeze_emulation, bool show_resume_message)
}
// Always Enable display sleep, not only if it was prevented.
enable_display_sleep();
Emu.GetCallbacks().enable_display_sleep(true);
return true;
}
@ -2888,7 +2886,7 @@ void Emulator::Resume()
if (g_cfg.misc.prevent_display_sleep)
{
disable_display_sleep();
Emu.GetCallbacks().enable_display_sleep(false);
}
}
@ -3798,7 +3796,7 @@ void Emulator::Kill(bool allow_autoexit, bool savestate, savestate_stage* save_s
GetCallbacks().on_stop();
// Always Enable display sleep, not only if it was prevented.
enable_display_sleep();
Emu.GetCallbacks().enable_display_sleep(true);
if (allow_autoexit)
{