From f4603871993eb7f1b010ecd4e587f001abf77a4c Mon Sep 17 00:00:00 2001 From: Eidolon Date: Tue, 14 Apr 2026 16:58:35 -0500 Subject: [PATCH] Create window early for immediate feedback --- src/console.c | 14 -------------- src/console.h | 6 +----- src/d_main.cpp | 12 +++--------- src/sdl/i_video.cpp | 5 +++++ 4 files changed, 9 insertions(+), 28 deletions(-) diff --git a/src/console.c b/src/console.c index 1e7585fbc..363989503 100644 --- a/src/console.c +++ b/src/console.c @@ -1914,10 +1914,6 @@ void CON_Drawer(void) static const char *CON_LoadingStrings[LOADED_ALLDONE+1] = { - "Init zone memory...", //LOADED_ZINIT - "Init game timing...", //LOADED_ISTARTUPTIMER - "Loading main assets...", //LOADED_IWAD - "Init graphics subsystem...", //LOADED_ISTARTUPGRAPHICS "Cache fonts...", //LOADED_HUINIT "Loading add-ons...", //LOADED_PWAD "Load settings...", //LOADED_CONFIG @@ -1937,21 +1933,11 @@ static const char *CON_LoadingStrings[LOADED_ALLDONE+1] = // void CON_SetLoadingProgress(con_loadprogress_t newStep) { - const con_loadprogress_t expectedStep = con_startup_loadprogress + 1; - - if (newStep != expectedStep) - { - I_Error("Something is wrong with the loading bar! (got %d, expected %d)\n", newStep, expectedStep); - return; - } - con_startup_loadprogress = newStep; if (con_startup_loadprogress <= LOADED_ALLDONE) CONS_Printf("LOADING UPDATE - %s\n", CON_LoadingStrings[con_startup_loadprogress]); - if (con_startup_loadprogress < LOADED_ISTARTUPGRAPHICS) // rendering not possible? - return; CON_DrawLoadBar(); // here we display the console text I_OsPolling(); I_UpdateNoBlit(); diff --git a/src/console.h b/src/console.h index 4200d4d2a..8cbeba248 100644 --- a/src/console.h +++ b/src/console.h @@ -39,11 +39,7 @@ extern boolean con_startup; // when modifying the below, you must also adjust d_main and console.c typedef enum { - LOADED_ZINIT = 1, - LOADED_ISTARTUPTIMER, - LOADED_IWAD, - LOADED_ISTARTUPGRAPHICS, - LOADED_HUINIT, + LOADED_HUINIT = 1, LOADED_PWAD, LOADED_CONFIG, LOADED_INITTEXTUREDATA, diff --git a/src/d_main.cpp b/src/d_main.cpp index a98155301..6a09fb39f 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -106,7 +106,7 @@ extern "C" consvar_t cv_lua_profile, cv_menuframeskip; /* Manually defined asset hashes */ - + #define ASSET_HASH_BIOS_PK3 "36201c4690256d133dff7d3879436dff" #define ASSET_HASH_SCRIPTS_PK3 "56be3c47192870c3265f19cf024e860e" #define ASSET_HASH_GFX_PK3 "76c824a221bd4745e002a8b7d0520621" @@ -1717,12 +1717,13 @@ void D_SRB2Main(void) CONS_Printf("Z_Init(): Init zone memory allocation daemon. \n"); Z_Init(); - CON_SetLoadingProgress(LOADED_ZINIT); M_NewGameDataStruct(); // Do this up here so that WADs loaded through the command line can use ExecCfg COM_Init(); + CONS_Printf("I_StartupGraphics()...\n"); + I_StartupGraphics(); COM_AddDebugCommand("assert", Command_assert); #ifdef DEVELOP @@ -1762,7 +1763,6 @@ void D_SRB2Main(void) CONS_Printf("I_InitializeTime()...\n"); I_InitializeTime(); - CON_SetLoadingProgress(LOADED_ISTARTUPTIMER); // Make backups of some SOCcable tables. P_BackupTables(); @@ -1788,8 +1788,6 @@ void D_SRB2Main(void) basenummapheaders = nummapheaders; basenumkartcupheaders = numkartcupheaders; - CON_SetLoadingProgress(LOADED_IWAD); - M_PasswordInit(); W_InitShaderLookup(va(spandf, srb2path, "data", "shaders.pk3")); @@ -1797,8 +1795,6 @@ void D_SRB2Main(void) //---------------------------------------------------- READY SCREEN // we need to check for dedicated before initialization of some subsystems - CONS_Printf("I_StartupGraphics()...\n"); - I_StartupGraphics(); I_StartDisplayUpdate(); I_StartupInput(); @@ -1817,8 +1813,6 @@ void D_SRB2Main(void) // Do this in background; lots of number crunching R_InitTranslucencyTables(); - CON_SetLoadingProgress(LOADED_ISTARTUPGRAPHICS); - CONS_Printf("HU_Init()...\n"); HU_Init(); diff --git a/src/sdl/i_video.cpp b/src/sdl/i_video.cpp index 69fcb5336..fa09ef4e4 100644 --- a/src/sdl/i_video.cpp +++ b/src/sdl/i_video.cpp @@ -1614,6 +1614,11 @@ void I_StartupGraphics(void) SDL_RaiseWindow(window); graphics_started = true; + +#ifdef __APPLE__ + // Must pump events once after creating window before window will actually appear. + SDL_PumpEvents(); +#endif } void VID_StartupOpenGL(void)