From 077aa6b0aec45772997649f16cbc72ae2f1c075b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 19 May 2022 08:32:50 +0200 Subject: [PATCH] - cleaned out some duplicates in Posix platform code --- src/common/engine/i_net.cpp | 2 +- src/common/engine/st_start.h | 2 -- src/common/platform/posix/cocoa/st_start.mm | 25 --------------------- src/common/platform/posix/sdl/st_start.cpp | 20 ----------------- src/common/platform/win32/st_start.cpp | 4 ---- src/d_main.cpp | 2 ++ src/menu/doommenu.cpp | 2 +- 7 files changed, 4 insertions(+), 53 deletions(-) diff --git a/src/common/engine/i_net.cpp b/src/common/engine/i_net.cpp index 028314022..df25c90ab 100644 --- a/src/common/engine/i_net.cpp +++ b/src/common/engine/i_net.cpp @@ -1039,7 +1039,7 @@ void I_NetMessage(const char* text, ...) FString str; va_list argptr; - va_start(argptr, format); + va_start(argptr, text); str.VFormat(format, argptr); va_end(argptr); fprintf(stderr, "\r%-40s\n", str.GetChars()); diff --git a/src/common/engine/st_start.h b/src/common/engine/st_start.h index cf9791525..60e62ae99 100644 --- a/src/common/engine/st_start.h +++ b/src/common/engine/st_start.h @@ -83,8 +83,6 @@ protected: extern FStartupScreen *StartWindow; -extern void ST_Endoom(); - //=========================================================================== // // DeleteStartupScreen diff --git a/src/common/platform/posix/cocoa/st_start.mm b/src/common/platform/posix/cocoa/st_start.mm index 00361fe05..5900c7577 100644 --- a/src/common/platform/posix/cocoa/st_start.mm +++ b/src/common/platform/posix/cocoa/st_start.mm @@ -42,22 +42,6 @@ #include "engineerrors.h" -FStartupScreen *StartScreen; - - -CUSTOM_CVAR(Int, showendoom, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) -{ - if (self < 0) - { - self = 0; - } - else if (self > 2) - { - self = 2; - } -} - - // --------------------------------------------------------------------------- @@ -152,12 +136,3 @@ FStartupScreen *FStartupScreen::CreateInstance(const int maxProgress) { return new FBasicStartupScreen(maxProgress, true); } - - -// --------------------------------------------------------------------------- - - -void ST_Endoom() -{ - throw CExitEvent(0); -} diff --git a/src/common/platform/posix/sdl/st_start.cpp b/src/common/platform/posix/sdl/st_start.cpp index a86213d9b..3d37246ad 100644 --- a/src/common/platform/posix/sdl/st_start.cpp +++ b/src/common/platform/posix/sdl/st_start.cpp @@ -70,22 +70,6 @@ class FTTYStartupScreen : public FStartupScreen extern void RedrawProgressBar(int CurPos, int MaxPos); extern void CleanProgressBar(); -// PUBLIC FUNCTION PROTOTYPES ---------------------------------------------- - -// PRIVATE FUNCTION PROTOTYPES --------------------------------------------- - -// EXTERNAL DATA DECLARATIONS ---------------------------------------------- - -// PUBLIC DATA DEFINITIONS ------------------------------------------------- - -FStartupScreen *StartWindow; - -CUSTOM_CVAR(Int, showendoom, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) -{ - if (self < 0) self = 0; - else if (self > 2) self=2; -} - // PRIVATE DATA DEFINITIONS ------------------------------------------------ static const char SpinnyProgressChars[4] = { '|', '/', '-', '\\' }; @@ -309,7 +293,3 @@ bool FTTYStartupScreen::NetLoop(bool (*timer_callback)(void *), void *userdata) } } -void ST_Endoom() -{ - throw CExitEvent(0); -} diff --git a/src/common/platform/win32/st_start.cpp b/src/common/platform/win32/st_start.cpp index b2788fcf7..ceabf7d0f 100644 --- a/src/common/platform/win32/st_start.cpp +++ b/src/common/platform/win32/st_start.cpp @@ -63,10 +63,6 @@ void ST_Util_SizeWindowForBitmap (int scale); extern HINSTANCE g_hInst; -// PUBLIC DATA DEFINITIONS ------------------------------------------------- - -FStartupScreen *StartWindow; - // PRIVATE DATA DEFINITIONS ------------------------------------------------ // CODE -------------------------------------------------------------------- diff --git a/src/d_main.cpp b/src/d_main.cpp index 2784f4c29..36447ef89 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -330,6 +330,8 @@ FString lastIWAD; int restart = 0; bool AppActive = true; bool playedtitlemusic; + +FStartupScreen* StartWindow; FStartScreen* StartScreen; cycle_t FrameCycles; diff --git a/src/menu/doommenu.cpp b/src/menu/doommenu.cpp index 901012380..50f296e36 100644 --- a/src/menu/doommenu.cpp +++ b/src/menu/doommenu.cpp @@ -56,7 +56,7 @@ #include "g_level.h" #include "d_event.h" #include "p_tick.h" -#include "st_start.h" +#include "startscreen.h" #include "d_main.h" #include "i_system.h" #include "doommenu.h"