This commit is contained in:
2026-04-05 00:49:29 +02:00
parent f8b60cb641
commit 91f88ded09
6 changed files with 43 additions and 2 deletions

View File

@@ -34,6 +34,10 @@ class Director {
// Indica si ESC està bloquejada (el joc no l'ha de veure)
auto isEscBlocked() const -> bool { return esc_blocked_ || esc_swallow_until_release_; }
// Pausa: bloqueja el consum de frames del game thread + pausa la música
void togglePause();
auto isPaused() const -> bool { return paused_; }
private:
Director() = default;
~Director() = default;
@@ -56,6 +60,7 @@ class Director {
std::atomic<bool> game_thread_done_{false};
std::atomic<bool> key_pressed_{false};
std::atomic<bool> esc_blocked_{false};
std::atomic<bool> paused_{false};
// Quan el menú tanca amb ESC, empassem-nos l'ESC fins que l'usuari la deixe anar,
// per no fer eixir el joc al proper poll de JI_KeyPressed.
std::atomic<bool> esc_swallow_until_release_{false};