From 5a232f8fa670a7dd511998100b8b8b704425f778 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 4 Jan 2024 22:23:05 +0100 Subject: [PATCH] eliminated the small white part of the initial window content after the IWAD picker. --- source/common/platform/win32/i_input.cpp | 2 +- source/common/platform/win32/i_mainwindow.cpp | 2 +- source/common/startscreen/startscreen.cpp | 2 +- .../startscreen/startscreen_generic.cpp | 24 +++++++++---------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/source/common/platform/win32/i_input.cpp b/source/common/platform/win32/i_input.cpp index 05988060f..4ce8766aa 100644 --- a/source/common/platform/win32/i_input.cpp +++ b/source/common/platform/win32/i_input.cpp @@ -491,7 +491,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) break; case WM_ERASEBKGND: - return true; + return DefWindowProc(hWnd, message, wParam, lParam); case WM_DEVICECHANGE: if (wParam == DBT_DEVNODES_CHANGED || diff --git a/source/common/platform/win32/i_mainwindow.cpp b/source/common/platform/win32/i_mainwindow.cpp index fe0ad730a..95dda5031 100644 --- a/source/common/platform/win32/i_mainwindow.cpp +++ b/source/common/platform/win32/i_mainwindow.cpp @@ -36,7 +36,7 @@ void MainWindow::Create(const FString& caption, int x, int y, int width, int hei WndClass.hInstance = hInstance; WndClass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1)); WndClass.hCursor = LoadCursor(NULL, IDC_ARROW); - WndClass.hbrBackground = NULL; + WndClass.hbrBackground = CreateSolidBrush(RGB(0,0,0)); WndClass.lpszMenuName = NULL; WndClass.lpszClassName = WinClassName; diff --git a/source/common/startscreen/startscreen.cpp b/source/common/startscreen/startscreen.cpp index 50974fd0e..ff1160666 100644 --- a/source/common/startscreen/startscreen.cpp +++ b/source/common/startscreen/startscreen.cpp @@ -367,7 +367,7 @@ FStartScreen* GetGameStartScreen(int max_progress) Printf("Error creating start screen: %s\n", err.what()); // fall through to the generic startup screen } - //return CreateGenericStartScreen(max_progress); + return CreateGenericStartScreen(max_progress); } return nullptr; } diff --git a/source/common/startscreen/startscreen_generic.cpp b/source/common/startscreen/startscreen_generic.cpp index 3484e2200..b76cbd3e2 100644 --- a/source/common/startscreen/startscreen_generic.cpp +++ b/source/common/startscreen/startscreen_generic.cpp @@ -72,10 +72,10 @@ FGenericStartScreen::FGenericStartScreen(int max_progress) : FStartScreen(max_progress) { // at this point we do not have a working texture manager yet, so we have to do the lookup via the file system - int startup_lump = fileSystem.CheckNumForName("GZDOOM", FileSys::ns_graphics); + int startup_lump = fileSystem.CheckNumForName("BOOTLOGO", FileSys::ns_graphics); - StartupBitmap.Create(640, 480); - ClearBlock(StartupBitmap, { 0, 0, 0, 255 }, 0, 0, 640, 480); + StartupBitmap.Create(640 * 2, 480 * 2); + ClearBlock(StartupBitmap, { 0, 0, 0, 255 }, 0, 0, 640 * 2, 480 * 2); // This also needs to work if the lump turns out to be unusable. if (startup_lump != -1) { @@ -83,14 +83,13 @@ FGenericStartScreen::FGenericStartScreen(int max_progress) if (iBackground) { Background = iBackground->GetCachedBitmap(nullptr, FImageSource::normal); - if (Background.GetWidth() < 640 || Background.GetHeight() < 480) - StartupBitmap.Blit(320 - Background.GetWidth()/2, 220 - Background.GetHeight() /2, Background); + if (Background.GetWidth() < 640 * 2 || Background.GetHeight() < 480 * 2) + StartupBitmap.Blit(320 * 2 - Background.GetWidth()/2, 220 * 2 - Background.GetHeight() / 2, Background); else - StartupBitmap.Blit(0, 0, Background, 640, 480); + StartupBitmap.Blit(0, 0, Background, 640 * 2, 480 * 2); } } - CreateHeader(); } //========================================================================== @@ -107,14 +106,15 @@ bool FGenericStartScreen::DoProgress(int advance) if (CurPos < MaxPos) { - RgbQuad bcolor = { 128, 0, 0, 255 }; // todo: make configurable - int numnotches = 512; - notch_pos = ((CurPos + 1) * 512) / MaxPos; + RgbQuad bcolor = { 2, 25, 87, 255 }; // todo: make configurable + int numnotches = 200 * 2; + notch_pos = ((CurPos + 1) * numnotches) / MaxPos; if (notch_pos != NotchPos) { // Time to draw another notch. - ClearBlock(StartupBitmap, bcolor, ST_PROGRESS_X, ST_PROGRESS_Y, notch_pos, 16); + ClearBlock(StartupBitmap, bcolor, (320 - 100) * 2, 480 * 2 - 30, notch_pos, 4 * 2); NotchPos = notch_pos; - StartupTexture->CleanHardwareData(true); + if (StartupTexture) + StartupTexture->CleanHardwareData(true); } } return FStartScreen::DoProgress(advance);