AGS: Added more logging for multitasking mode, switching in/out

From upstream d3925672f5b96fab3308b606eb6f38dc279636d7
This commit is contained in:
Thierry Crozat 2022-06-21 23:15:38 +01:00
parent 76aebcd336
commit 5089b28645
3 changed files with 18 additions and 4 deletions

View File

@ -715,9 +715,15 @@ void render_to_screen() {
succeeded = true;
/*}
catch (Ali3DFullscreenLostException)
{
platform->Delay(500);
catch (Ali3DFullscreenLostException e) {
Debug::Printf("Renderer exception: %s", e._message);
platform->Delay(500);
}
catch (Ali3DException e) {
Debug::Printf("Renderer exception: %s", e._message);
}
catch (...) {
Debug::Printf("Unknown renderer exception");
}*/
}
}

View File

@ -1191,6 +1191,7 @@ int __GetLocationType(int xxx, int yyy, int allowHotspot0) {
// Called whenever game looses input focus
void display_switch_out() {
Debug::Printf("Switching out from the game");
_G(switched_away) = true;
ags_clear_input_state();
// Always unlock mouse when switching out from the game
@ -1199,6 +1200,7 @@ void display_switch_out() {
// Called when game looses input focus and must pause until focus is returned
void display_switch_out_suspend() {
Debug::Printf("Suspending the game on switch out");
_G(switching_away_from_game)++;
_G(game_update_suspend)++;
display_switch_out();
@ -1225,6 +1227,7 @@ void display_switch_out_suspend() {
// Called whenever game gets input focus
void display_switch_in() {
Debug::Printf("Switching back into the game");
ags_clear_input_state();
// If auto lock option is set, lock mouse to the game window
if (_GP(usetup).mouse_auto_lock && _GP(scsystem).windowed)
@ -1234,6 +1237,7 @@ void display_switch_in() {
// Called when game gets input focus and must resume after pause
void display_switch_in_resume() {
Debug::Printf("Resuming the game on switch in");
display_switch_in();
// Resume all the sounds

View File

@ -639,14 +639,18 @@ void SetMultitasking(int mode) {
quit("!SetMultitasking: invalid mode parameter");
if (_GP(usetup).override_multitasking >= 0) {
Debug::Printf("SetMultitasking: overridden by user config: %d -> %d", mode, _GP(usetup).override_multitasking);
mode = _GP(usetup).override_multitasking;
}
// Don't allow background running if full screen
if ((mode == 1) && (!_GP(scsystem).windowed))
if ((mode == 1) && (!_GP(scsystem).windowed)) {
Debug::Printf("SetMultitasking: overridden by fullscreen: %d -> %d", mode, 0);
mode = 0;
}
// Install engine callbacks for switching in and out the window
Debug::Printf("SetMultitasking: mode %d", mode);
if (mode == 0) {
sys_set_background_mode(false);
sys_evt_set_focus_callbacks(display_switch_in_resume, display_switch_out_suspend);