mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2024-12-12 20:18:00 +01:00
call Gamestate_Pause and Gamestate_Resume on window focus change in debug mode (autoreload)
This commit is contained in:
parent
3b2a675d23
commit
91a3bd1efa
1 changed files with 10 additions and 0 deletions
|
@ -527,6 +527,13 @@ SYMBOL_INTERNAL char* GetLibraryPath(struct Game* game, char* filename) {
|
|||
}
|
||||
|
||||
SYMBOL_INTERNAL void PauseExecution(struct Game* game) {
|
||||
struct Gamestate* tmp = game->_priv.gamestates;
|
||||
while (tmp) {
|
||||
if (!tmp->paused && tmp->loaded && tmp->api->Gamestate_Pause) {
|
||||
tmp->api->Gamestate_Pause(game, tmp->data);
|
||||
}
|
||||
tmp = tmp->next;
|
||||
}
|
||||
game->_priv.paused = true;
|
||||
PrintConsole(game, "DEBUG: game execution paused.");
|
||||
}
|
||||
|
@ -543,6 +550,9 @@ SYMBOL_INTERNAL void ResumeExecution(struct Game* game) {
|
|||
if (tmp->api->Gamestate_Reload) {
|
||||
tmp->api->Gamestate_Reload(game, tmp->data);
|
||||
}
|
||||
if (!tmp->paused && tmp->api->Gamestate_Resume) {
|
||||
tmp->api->Gamestate_Resume(game, tmp->data);
|
||||
}
|
||||
}
|
||||
tmp = tmp->next;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue