From 16045726f227ed183f36c69ca9e507c1a652e4e5 Mon Sep 17 00:00:00 2001 From: pagefault <> Date: Thu, 7 Jun 2001 20:36:36 +0000 Subject: [PATCH] Fixed another resolution switching bug --- zsnes/src/win/winlink.cpp | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/zsnes/src/win/winlink.cpp b/zsnes/src/win/winlink.cpp index 631abe05..173f0c40 100644 --- a/zsnes/src/win/winlink.cpp +++ b/zsnes/src/win/winlink.cpp @@ -1530,7 +1530,6 @@ void initwinvideo(void) } else { - FirstVid=0; atexit(ExitFunction); AltTimer = AlternateTimer; @@ -1561,8 +1560,6 @@ void initwinvideo(void) hMainWindow = CreateWindow( "ZSNESWIN", WinName, WS_VISIBLE|WS_POPUP,X,Y, //WS_OVERLAPPED "ZSNESWIN" WindowWidth,WindowHeight,NULL,NULL,hInst,NULL); - - if (FullScreen == 0) InitDirectDraw(); CheckPriority(); CheckAlwaysOnTop(); @@ -1579,23 +1576,38 @@ void initwinvideo(void) TestJoy(); } + if (FirstVid == 1) + { + FirstVid = 0; + InitDirectDraw(); + return; + } + + if (Moving == 1) return; + if (FullScreen == 0 && PrevFull == 1) { PrevFull = 0; ReleaseDirectDraw(); InitDirectDraw(); } - - if (FullScreen == 1 && PrevFull != 1) { PrevFull = 1; InitDirectDraw(); } - if (Moving == 1) return; + if (FullScreen == 1 && PrevFull != 1) + { + PrevFull = 1; + InitDirectDraw(); + } if (FullScreen == 0 || newmode == 1) { if (newmode) clearwin(); } - if (FullScreen == 1 && newmode == 1) { ReleaseDirectDraw(); InitDirectDraw(); } + if (FullScreen == 1 && newmode == 1) + { + ReleaseDirectDraw(); + InitDirectDraw(); + } }