From 8ee906ca022709cc0f73b8760817e8c0ef12a7b9 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Tue, 9 Apr 2019 17:32:43 +0200 Subject: [PATCH] Clean up init_create_window --- Source/init.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Source/init.cpp b/Source/init.cpp index dfe4d3da0..810dcdcd6 100644 --- a/Source/init.cpp +++ b/Source/init.cpp @@ -144,10 +144,9 @@ void init_disable_screensaver(BOOLEAN disable) void init_create_window(int nCmdShow) { - int nHeight; // eax - HWND hWnd; // esi - WNDCLASSEXA wcex; // [esp+8h] [ebp-34h] - int nWidth; // [esp+38h] [ebp-4h] + int nWidth, nHeight; + HWND hWnd; + WNDCLASSEXA wcex; init_kill_mom_parent(); pfile_init_save_directory(); @@ -164,14 +163,14 @@ void init_create_window(int nCmdShow) wcex.hIconSm = (HICON)LoadImage(ghInst, MAKEINTRESOURCE(IDI_ICON1), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR); if (!RegisterClassEx(&wcex)) app_fatal("Unable to register window class"); - if (GetSystemMetrics(SM_CXSCREEN) >= 640) - nWidth = GetSystemMetrics(SM_CXSCREEN); - else + if (GetSystemMetrics(SM_CXSCREEN) < 640) nWidth = 640; - if (GetSystemMetrics(SM_CYSCREEN) >= 480) - nHeight = GetSystemMetrics(SM_CYSCREEN); else + nWidth = GetSystemMetrics(SM_CXSCREEN); + if (GetSystemMetrics(SM_CYSCREEN) < 480) nHeight = 480; + else + nHeight = GetSystemMetrics(SM_CYSCREEN); hWnd = CreateWindowEx(0, "DIABLO", "DIABLO", WS_POPUP, 0, 0, nWidth, nHeight, NULL, NULL, ghInst, NULL); if (!hWnd) app_fatal("Unable to create main window");