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
This commit is contained in:
terminx 2012-10-14 22:22:03 +00:00
parent 54ec3c7640
commit ca46dc76ec

View file

@ -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");