From ca46dc76ecf4f213bdec5483fbde27349cb81fc0 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 14 Oct 2012 22:22:03 +0000 Subject: [PATCH] Move the Windows screen size based aspect ratio determination code down farther into the initialization and change the printed message to only appear when the calculation fails git-svn-id: https://svn.eduke32.com/eduke32@3085 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/winlayer.c | 31 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/polymer/eduke32/build/src/winlayer.c b/polymer/eduke32/build/src/winlayer.c index d4c30e613..ba97aa109 100644 --- a/polymer/eduke32/build/src/winlayer.c +++ b/polymer/eduke32/build/src/winlayer.c @@ -522,21 +522,6 @@ int32_t WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, in startwin_open(); baselayer_init(); - // determine physical screen size - { - const int32_t oscreenx = GetSystemMetrics(SM_CXSCREEN); - const int32_t oscreeny = GetSystemMetrics(SM_CYSCREEN); - int32_t screenx=oscreenx, screeny=oscreeny, good=0; - - divcommon(&screenx, &screeny); - - if (screenx >= 1 && screenx <= 99 && screeny >= 1 && screeny <= 99) - r_screenxy = screenx*100 + screeny, good=1; - - initprintf("Automatic fullscreen size determination: %d %d -> %d %d%s.\n", - oscreenx, oscreeny, screenx, screeny, good?"":" (failed)"); - } - r = app_main(_buildargc, _buildargv); fclose(stdout); @@ -705,6 +690,22 @@ int32_t initsystem(void) } #endif + // determine physical screen size + { + const int32_t oscreenx = GetSystemMetrics(SM_CXSCREEN); + const int32_t oscreeny = GetSystemMetrics(SM_CYSCREEN); + int32_t screenx=oscreenx, screeny=oscreeny, good=0; + + divcommon(&screenx, &screeny); + + if (screenx >= 1 && screenx <= 99 && screeny >= 1 && screeny <= 99) + r_screenxy = screenx*100 + screeny, good=1; + + if (!good) + initprintf("Automatic fullscreen size determination failed! %d %d -> %d %d.\n", + oscreenx, oscreeny, screenx, screeny); + } + // try and start DirectDraw if (InitDirectDraw()) initprintf("DirectDraw initialization failed. Fullscreen modes will be unavailable.\n");