From 5ebbf3273127463cc9d47428d5030e3b243fd7e8 Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 23 Mar 2026 20:39:16 +0100 Subject: [PATCH] use constructor for W_Startup never liked having this inside i_system --- src/dedicated/i_system.c | 1 - src/sdl/i_system.cpp | 2 -- src/w_wad.c | 5 ++--- src/w_wad.h | 1 - 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/dedicated/i_system.c b/src/dedicated/i_system.c index 87a93fd48..9359b69d2 100644 --- a/src/dedicated/i_system.c +++ b/src/dedicated/i_system.c @@ -1402,7 +1402,6 @@ static void I_Fork(void) INT32 I_StartupSystem(void) { - W_Startup(); I_StartupConsole(); #ifdef NEWSIGNALHANDLER // This is useful when debugging. It lets GDB attach to diff --git a/src/sdl/i_system.cpp b/src/sdl/i_system.cpp index c2a473cad..4375bf978 100644 --- a/src/sdl/i_system.cpp +++ b/src/sdl/i_system.cpp @@ -1934,8 +1934,6 @@ INT32 I_StartupSystem(void) SDL_VERSION(&SDLcompiled) SDL_GetVersion(&SDLlinked); - W_Startup(); - I_StartupConsole(); #ifdef NEWSIGNALHANDLER // This is useful when debugging. It lets GDB attach to diff --git a/src/w_wad.c b/src/w_wad.c index 2ac8ae68d..8c7494898 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -158,8 +158,7 @@ void W_Shutdown(void) } // the lumpnum cache needs to be initialized before use -// call this as early as possible! -void W_Startup(void) +CONSTRUCTOR static void W_Startup(void) { lumpnum_map_init(&lumpnumcache); lumpnum_map_reserve(&lumpnumcache, LUMPNUMCACHESIZE); @@ -367,7 +366,7 @@ static inline INT32 W_MakeFileMD5(const char *filename, void *resblock) { precise_t t = I_GetPreciseTime(); - CONS_Debug(DBG_SETUP, "Making MD5 for %s\n",filename); + CONS_Debug(DBG_SETUP, "Making MD5 for %s\n", filename); if (md5_stream(fhandle, resblock) == 1) { diff --git a/src/w_wad.h b/src/w_wad.h index ea4a98dd6..474f72c23 100644 --- a/src/w_wad.h +++ b/src/w_wad.h @@ -154,7 +154,6 @@ extern wadfile_t *wadfiles[MAX_WADFILES]; // ========================================================================= -void W_Startup(void); void W_Shutdown(void); // Opens a WAD file. Returns the FILE * handle for the file, or NULL if not found or could not be opened