mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-22 10:17:22 +00:00
AGS: Engine: abort in case failed both to switch and restore gfx mode
This may be a temporary solution, but it's necessary, because otherwise engine will fail later, with a seemingly unrelated error, which will be harder to diagnose. From upstream 902568c4eba9dba4eb762882890c6e8a308683aa
This commit is contained in:
parent
f0887a3b9f
commit
711ca20dd1
@ -1244,16 +1244,15 @@ bool engine_try_switch_windowed_gfxmode() {
|
||||
// If failed, try switching back to previous gfx mode
|
||||
res = graphics_mode_set_dm(old_dm) &&
|
||||
graphics_mode_set_render_frame(old_frame);
|
||||
if (!res)
|
||||
quitprintf("Failed to restore graphics mode.");
|
||||
}
|
||||
|
||||
if (res) {
|
||||
// If succeeded (with any case), update engine objects that rely on
|
||||
// active display mode.
|
||||
if (!_G(gfxDriver)->GetDisplayMode().IsRealFullscreen())
|
||||
init_desktop = get_desktop_size();
|
||||
engine_post_gfxmode_setup(init_desktop);
|
||||
}
|
||||
|
||||
// If succeeded (with any case), update engine objects that rely on
|
||||
// active display mode.
|
||||
if (!_G(gfxDriver)->GetDisplayMode().IsRealFullscreen())
|
||||
init_desktop = get_desktop_size();
|
||||
engine_post_gfxmode_setup(init_desktop);
|
||||
// Make sure that we don't receive window events queued during init
|
||||
sys_flush_events();
|
||||
return res;
|
||||
|
Loading…
x
Reference in New Issue
Block a user