Add pause on unfocus feature

This commit is contained in:
Pheenoh
2026-04-19 10:02:55 -06:00
parent aa8af54687
commit 3eeae1278e
9 changed files with 40 additions and 0 deletions
+2
View File
@@ -12,6 +12,8 @@ namespace dusk::audio {
void SetMasterVolume(f32 value);
void SetPaused(bool paused);
u32 GetResetCount(int channelIdx);
f32 VolumeFromU16(u16 value);
+1
View File
@@ -8,6 +8,7 @@ namespace game_clock {
void ensure_initialized();
void reset_accumulator();
void reset_frame_timer();
constexpr float sim_pace() { return 1.0f / 30.0f; }
constexpr float period_for_original_frames(float frame_count) { return frame_count * sim_pace(); }
+1
View File
@@ -5,6 +5,7 @@ namespace dusk {
extern bool IsRunning;
extern bool IsShuttingDown;
extern bool IsGameLaunched;
extern bool IsFocusPaused;
}
#endif // DUSK_MAIN_H
+1
View File
@@ -68,6 +68,7 @@ struct UserSettings {
ConfigVar<bool> enableMirrorMode;
ConfigVar<bool> invertCameraXAxis;
ConfigVar<bool> disableMainHUD;
ConfigVar<bool> pauseOnFocusLost;
// Graphics
ConfigVar<BloomMode> bloomMode;