summaryrefslogtreecommitdiff
path: root/src/video/cocoa/event.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/video/cocoa/event.mm')
-rw-r--r--src/video/cocoa/event.mm18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/video/cocoa/event.mm b/src/video/cocoa/event.mm
index cb3c753ac..642149858 100644
--- a/src/video/cocoa/event.mm
+++ b/src/video/cocoa/event.mm
@@ -617,7 +617,7 @@ static bool QZ_PollEvent()
}
-void QZ_GameLoop()
+void VideoDriver_Cocoa::GameLoop()
{
uint32 cur_ticks = GetTick();
uint32 last_cur_ticks = cur_ticks;
@@ -633,7 +633,7 @@ void QZ_GameLoop()
_cocoa_subdriver->Draw(true);
CSleep(1);
- for (int i = 0; i < 2; i++) GameLoop();
+ for (int i = 0; i < 2; i++) ::GameLoop();
UpdateWindows();
QZ_CheckPaletteAnim();
@@ -652,7 +652,17 @@ void QZ_GameLoop()
while (QZ_PollEvent()) {}
- if (_exit_game) break;
+ /* If we do that right after window creation, a grey bar will be left at the top. */
+ if (this->fullscreen_on_mainloop) {
+ this->fullscreen_on_mainloop = false;
+ _cocoa_subdriver->ToggleFullscreen(true);
+ }
+
+ if (_exit_game) {
+ /* Restore saved resolution if in fullscreen mode. */
+ if (_cocoa_subdriver->IsFullscreen()) _cur_resolution = this->orig_res;
+ break;
+ }
#if defined(_DEBUG)
if (_current_mods & NSShiftKeyMask)
@@ -678,7 +688,7 @@ void QZ_GameLoop()
if (old_ctrl_pressed != _ctrl_pressed) HandleCtrlChanged();
- GameLoop();
+ ::GameLoop();
UpdateWindows();
QZ_CheckPaletteAnim();