From e4aac749dc55a18ee883d38457351837712ba98f Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Fri, 8 Aug 2025 13:54:59 +0200 Subject: [PATCH] Nuke st_start.h from orbit --- src/CMakeLists.txt | 9 +- src/common/console/c_console.cpp | 2 - src/common/engine/i_interface.cpp | 2 - src/common/engine/i_net.cpp | 28 +- src/common/engine/st_start.h | 117 ------ src/common/filesystem/source/critsec.cpp | 2 + .../filesystem/source/files_decompress.cpp | 2 + src/common/platform/posix/cocoa/st_start.mm | 174 --------- src/common/platform/posix/sdl/i_system.cpp | 1 - src/common/platform/posix/sdl/st_start.cpp | 338 ------------------ src/common/platform/win32/base_sysfb.cpp | 2 + src/common/platform/win32/hardware.cpp | 2 + src/common/platform/win32/i_crash.cpp | 2 + src/common/platform/win32/i_dijoy.cpp | 2 + src/common/platform/win32/i_input.cpp | 2 + src/common/platform/win32/i_keyboard.cpp | 2 + src/common/platform/win32/i_main.cpp | 3 +- src/common/platform/win32/i_mainwindow.cpp | 1 - src/common/platform/win32/i_mainwindow.h | 2 + src/common/platform/win32/i_mouse.cpp | 2 + src/common/platform/win32/i_rawps2.cpp | 2 + src/common/platform/win32/i_system.cpp | 2 + src/common/platform/win32/i_xinput.cpp | 2 + src/common/platform/win32/st_start.cpp | 224 ------------ src/common/utility/i_module.cpp | 2 + src/common/utility/zstring.cpp | 4 + src/common/widgets/widgetresourcedata.cpp | 2 + src/d_main.cpp | 16 +- src/d_net.cpp | 2 +- src/rendering/r_utility.cpp | 1 - src/win32/i_steam.cpp | 2 + 31 files changed, 58 insertions(+), 896 deletions(-) delete mode 100644 src/common/engine/st_start.h delete mode 100644 src/common/platform/posix/cocoa/st_start.mm delete mode 100644 src/common/platform/posix/sdl/st_start.cpp delete mode 100644 src/common/platform/win32/st_start.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ffc0ebcb7..f3e5d0116 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -53,7 +53,7 @@ add_definitions( -DTHIS_IS_GZDOOM ) if( WIN32 ) - add_definitions( -D_WIN32 ) + add_definitions( -D_WIN32 -DNOMINMAX -DWIN32_LEAN_AND_MEAN ) set( PROJECT_LIBRARIES psapi @@ -389,7 +389,6 @@ set( PLAT_WIN32_SOURCES common/platform/win32/i_mainwindow.cpp common/platform/win32/i_system.cpp common/platform/win32/i_specialpaths.cpp - common/platform/win32/st_start.cpp common/platform/win32/base_sysfb.cpp common/platform/win32/win32basevideo.cpp common/platform/win32/i_crash.cpp @@ -414,8 +413,7 @@ set( PLAT_SDL_SOURCES common/platform/posix/sdl/i_input.cpp common/platform/posix/sdl/i_joystick.cpp common/platform/posix/sdl/i_main.cpp - common/platform/posix/sdl/i_system.cpp - common/platform/posix/sdl/st_start.cpp ) + common/platform/posix/sdl/i_system.cpp ) set( PLAT_UNIX_SOURCES common/platform/posix/unix/i_specialpaths.cpp common/platform/posix/unix/gtk_dialogs.cpp ) @@ -429,8 +427,7 @@ set( PLAT_COCOA_SOURCES common/platform/posix/cocoa/i_main.mm common/platform/posix/cocoa/i_system.mm common/platform/posix/cocoa/i_video.mm - common/platform/posix/cocoa/st_console.mm - common/platform/posix/cocoa/st_start.mm ) + common/platform/posix/cocoa/st_console.mm ) if( WIN32 ) set( SYSTEM_SOURCES_DIR common/platform/win32 ) diff --git a/src/common/console/c_console.cpp b/src/common/console/c_console.cpp index 38bfe9d6e..9ac7bdaa7 100644 --- a/src/common/console/c_console.cpp +++ b/src/common/console/c_console.cpp @@ -67,7 +67,6 @@ #include "vm.h" #include "common/widgets/errorwindow.h" #include "common/scripting/dap/GameEventEmit.h" -#include "st_start.h" #include #define LEFTMARGIN 8 @@ -442,7 +441,6 @@ void I_CloseMainWindow(); void ShowFatalError(const char* text) { - DeleteStartupScreen(); S_StopMusic(true); I_CloseMainWindow(); diff --git a/src/common/engine/i_interface.cpp b/src/common/engine/i_interface.cpp index a700a746a..eb9c18361 100644 --- a/src/common/engine/i_interface.cpp +++ b/src/common/engine/i_interface.cpp @@ -1,5 +1,4 @@ #include "i_interface.h" -#include "st_start.h" #include "gamestate.h" #include "startupinfo.h" #include "c_cvars.h" @@ -17,7 +16,6 @@ static_assert(sizeof(void*) == 8, "that lead to a bad user experience."); // Some global engine variables taken out of the backend code. -FStartupScreen* StartWindow; SystemCallbacks sysCallbacks; FString endoomName; bool batchrun; diff --git a/src/common/engine/i_net.cpp b/src/common/engine/i_net.cpp index 46607b5dd..cc38f22c1 100644 --- a/src/common/engine/i_net.cpp +++ b/src/common/engine/i_net.cpp @@ -51,7 +51,9 @@ /* [Petteri] Use Winsock for Win32: */ #ifdef __WIN32__ +#ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN +#endif # include # include #else @@ -70,7 +72,7 @@ #include "i_system.h" #include "m_argv.h" #include "m_crc32.h" -#include "st_start.h" +#include "common/widgets/netstartwindow.h" #include "engineerrors.h" #include "cmdlib.h" #include "printf.h" @@ -386,27 +388,27 @@ static void I_NetLog(const char* text, ...) // Gracefully closes the net window so that any error messaging can be properly displayed. static void I_NetError(const char* error) { - StartWindow->NetClose(); + NetStartWindow::NetClose(); I_FatalError("%s", error); } static void I_NetInit(const char* msg, bool host) { - StartWindow->NetInit(msg, host); + NetStartWindow::NetInit(msg, host); } // todo: later these must be dispatched by the main menu, not the start screen. // Updates the general status of the lobby. static void I_NetMessage(const char* msg) { - StartWindow->NetMessage(msg); + NetStartWindow::NetMessage(msg); } // Listen for incoming connections while the lobby is active. The main thread needs to be locked up // here to prevent the engine from continuing to start the game until everyone is ready. static bool I_NetLoop(bool (*loopCallback)(void*), void* data) { - return StartWindow->NetLoop(loopCallback, data); + return NetStartWindow::NetLoop(loopCallback, data); } // A new client has just entered the game, so add them to the player list. @@ -419,28 +421,28 @@ static void I_NetClientConnected(int client, unsigned int charLimit = 0u) if (client == consoleplayer) flags |= CFL_CONSOLEPLAYER; - StartWindow->NetConnect(client, name, flags, Connected[client].Status); + NetStartWindow::NetConnect(client, name, flags, Connected[client].Status); } // A client changed ready state. static void I_NetClientUpdated(int client) { - StartWindow->NetUpdate(client, Connected[client].Status); + NetStartWindow::NetUpdate(client, Connected[client].Status); } static void I_NetClientDisconnected(int client) { - StartWindow->NetDisconnect(client); + NetStartWindow::NetDisconnect(client); } static void I_NetUpdatePlayers(int current, int limit) { - StartWindow->NetProgress(current, limit); + NetStartWindow::NetProgress(current, limit); } static bool I_ShouldStartNetGame() { - return StartWindow->ShouldStartNet(); + return NetStartWindow::ShouldStartNet(); } static void I_GetKickClients(TArray& clients) @@ -448,7 +450,7 @@ static void I_GetKickClients(TArray& clients) clients.Clear(); int c = -1; - while ((c = StartWindow->GetNetKickClient()) != -1) + while ((c = NetStartWindow::GetNetKickClient()) != -1) clients.Push(c); } @@ -457,13 +459,13 @@ static void I_GetBanClients(TArray& clients) clients.Clear(); int c = -1; - while ((c = StartWindow->GetNetBanClient()) != -1) + while ((c = NetStartWindow::GetNetBanClient()) != -1) clients.Push(c); } void I_NetDone() { - StartWindow->NetDone(); + NetStartWindow::NetDone(); } void I_ClearClient(size_t client) diff --git a/src/common/engine/st_start.h b/src/common/engine/st_start.h deleted file mode 100644 index 11d07849d..000000000 --- a/src/common/engine/st_start.h +++ /dev/null @@ -1,117 +0,0 @@ -#pragma once -/* -** st_start.h -** Interface for the startup screen. -** -**--------------------------------------------------------------------------- -** Copyright 2006-2007 Randy Heit -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. -** 3. The name of the author may not be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -**--------------------------------------------------------------------------- -** -** The startup screen interface is based on a mix of Heretic and Hexen. -** Actual implementation is system-specific. -*/ -#include - -class FStartupScreen -{ -public: - static FStartupScreen *CreateInstance(int max_progress); - - FStartupScreen(int max_progress) - { - MaxPos = max_progress; - CurPos = 0; - NotchPos = 0; - } - - virtual ~FStartupScreen() = default; - - virtual void Progress(int advance = 1) {} - virtual void AppendStatusLine(const char* status) {} - virtual void LoadingStatus(const char* message, int colors) {} - - virtual void NetInit(const char* message, bool host) {} - virtual void NetMessage(const char* message) {} - virtual void NetConnect(int client, const char* name, unsigned flags, int status) {} - virtual void NetUpdate(int client, int status) {} - virtual void NetDisconnect(int client) {} - virtual void NetProgress(int cur, int limit) {} - virtual void NetDone() {} - virtual void NetClose() {} - virtual bool ShouldStartNet() { return false; } - virtual int GetNetKickClient() { return -1; } - virtual int GetNetBanClient() { return -1; } - virtual bool NetLoop(bool (*loopCallback)(void *), void *data) { return false; } - -protected: - int MaxPos, CurPos, NotchPos; -}; - -class FBasicStartupScreen : public FStartupScreen -{ -public: - FBasicStartupScreen(int max_progress); - ~FBasicStartupScreen(); - - void Progress(int advance = 1) override; - - void NetInit(const char* message, bool host) override; - void NetMessage(const char* message) override; - void NetConnect(int client, const char* name, unsigned flags, int status) override; - void NetUpdate(int client, int status) override; - void NetDisconnect(int client) override; - void NetProgress(int cur, int limit) override; - void NetDone() override; - void NetClose() override; - bool ShouldStartNet() override; - int GetNetKickClient() override; - int GetNetBanClient() override; - bool NetLoop(bool (*loopCallback)(void*), void* data) override; -}; - - - -extern FStartupScreen *StartWindow; - -//=========================================================================== -// -// DeleteStartupScreen -// -// Makes sure the startup screen has been deleted before quitting. -// -//=========================================================================== - -inline void DeleteStartupScreen() -{ - if (StartWindow != nullptr) - { - delete StartWindow; - StartWindow = nullptr; - } -} - - diff --git a/src/common/filesystem/source/critsec.cpp b/src/common/filesystem/source/critsec.cpp index b8b8c5522..1e49f44b0 100644 --- a/src/common/filesystem/source/critsec.cpp +++ b/src/common/filesystem/source/critsec.cpp @@ -34,7 +34,9 @@ #ifdef _WIN32 #ifndef _WINNT_ +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include #endif diff --git a/src/common/filesystem/source/files_decompress.cpp b/src/common/filesystem/source/files_decompress.cpp index 3f7dfb865..3e13a1e03 100644 --- a/src/common/filesystem/source/files_decompress.cpp +++ b/src/common/filesystem/source/files_decompress.cpp @@ -34,7 +34,9 @@ */ // Caution: LzmaDec also pulls in windows.h! +#ifndef NOMINMAX #define NOMINMAX +#endif #include "LzmaDec.h" #include "Xz.h" // CRC table needs to be generated prior to reading XZ compressed files. diff --git a/src/common/platform/posix/cocoa/st_start.mm b/src/common/platform/posix/cocoa/st_start.mm deleted file mode 100644 index fe1d0df68..000000000 --- a/src/common/platform/posix/cocoa/st_start.mm +++ /dev/null @@ -1,174 +0,0 @@ -/* - ** st_start.mm - ** - **--------------------------------------------------------------------------- - ** Copyright 2015 Alexey Lysiuk - ** All rights reserved. - ** - ** Redistribution and use in source and binary forms, with or without - ** modification, are permitted provided that the following conditions - ** are met: - ** - ** 1. Redistributions of source code must retain the above copyright - ** notice, this list of conditions and the following disclaimer. - ** 2. Redistributions in binary form must reproduce the above copyright - ** notice, this list of conditions and the following disclaimer in the - ** documentation and/or other materials provided with the distribution. - ** 3. The name of the author may not be used to endorse or promote products - ** derived from this software without specific prior written permission. - ** - ** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - ** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - ** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - ** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - ** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - ** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - **--------------------------------------------------------------------------- - ** - */ - -#include - -#import - -#include "c_cvars.h" -#include "st_console.h" -#include "st_start.h" -#include "printf.h" -#include "engineerrors.h" - - -// --------------------------------------------------------------------------- - - -FBasicStartupScreen::FBasicStartupScreen(int maxProgress) -: FStartupScreen(maxProgress) -{ - FConsoleWindow& consoleWindow = FConsoleWindow::GetInstance(); - consoleWindow.SetProgressBar(true); - -#if 0 - // Testing code, please do not remove - consoleWindow.AddText("----------------------------------------------------------------\n"); - consoleWindow.AddText("1234567890 !@#$%^&*() ,<.>/?;:'\" [{]}\\| `~-_=+ " - "This is very very very long message needed to trigger word wrapping...\n\n"); - consoleWindow.AddText("Multiline...\n\tmessage...\n\t\twith...\n\t\t\ttabs.\n\n"); - - consoleWindow.AddText(TEXTCOLOR_BRICK "TEXTCOLOR_BRICK\n" TEXTCOLOR_TAN "TEXTCOLOR_TAN\n"); - consoleWindow.AddText(TEXTCOLOR_GRAY "TEXTCOLOR_GRAY & TEXTCOLOR_GREY\n"); - consoleWindow.AddText(TEXTCOLOR_GREEN "TEXTCOLOR_GREEN\n" TEXTCOLOR_BROWN "TEXTCOLOR_BROWN\n"); - consoleWindow.AddText(TEXTCOLOR_GOLD "TEXTCOLOR_GOLD\n" TEXTCOLOR_RED "TEXTCOLOR_RED\n"); - consoleWindow.AddText(TEXTCOLOR_BLUE "TEXTCOLOR_BLUE\n" TEXTCOLOR_ORANGE "TEXTCOLOR_ORANGE\n"); - consoleWindow.AddText(TEXTCOLOR_WHITE "TEXTCOLOR_WHITE\n" TEXTCOLOR_YELLOW "TEXTCOLOR_YELLOW\n"); - consoleWindow.AddText(TEXTCOLOR_UNTRANSLATED "TEXTCOLOR_UNTRANSLATED\n"); - consoleWindow.AddText(TEXTCOLOR_BLACK "TEXTCOLOR_BLACK\n" TEXTCOLOR_LIGHTBLUE "TEXTCOLOR_LIGHTBLUE\n"); - consoleWindow.AddText(TEXTCOLOR_CREAM "TEXTCOLOR_CREAM\n" TEXTCOLOR_OLIVE "TEXTCOLOR_OLIVE\n"); - consoleWindow.AddText(TEXTCOLOR_DARKGREEN "TEXTCOLOR_DARKGREEN\n" TEXTCOLOR_DARKRED "TEXTCOLOR_DARKRED\n"); - consoleWindow.AddText(TEXTCOLOR_DARKBROWN "TEXTCOLOR_DARKBROWN\n" TEXTCOLOR_PURPLE "TEXTCOLOR_PURPLE\n"); - consoleWindow.AddText(TEXTCOLOR_DARKGRAY "TEXTCOLOR_DARKGRAY\n" TEXTCOLOR_CYAN "TEXTCOLOR_CYAN\n"); - consoleWindow.AddText(TEXTCOLOR_ICE "TEXTCOLOR_ICE\n" TEXTCOLOR_FIRE "TEXTCOLOR_FIRE\n"); - consoleWindow.AddText(TEXTCOLOR_SAPPHIRE "TEXTCOLOR_SAPPHIRE\n" TEXTCOLOR_TEAL "TEXTCOLOR_TEAL\n"); - consoleWindow.AddText(TEXTCOLOR_NORMAL "TEXTCOLOR_NORMAL\n" TEXTCOLOR_BOLD "TEXTCOLOR_BOLD\n"); - consoleWindow.AddText(TEXTCOLOR_CHAT "TEXTCOLOR_CHAT\n" TEXTCOLOR_TEAMCHAT "TEXTCOLOR_TEAMCHAT\n"); - consoleWindow.AddText("----------------------------------------------------------------\n"); -#endif // _DEBUG -} - -FBasicStartupScreen::~FBasicStartupScreen() -{ - FConsoleWindow::GetInstance().SetProgressBar(false); -} - - -void FBasicStartupScreen::Progress(int advance) -{ - CurPos = min(CurPos + advance, MaxPos); - FConsoleWindow::GetInstance().Progress(CurPos, MaxPos); -} - - -void FBasicStartupScreen::NetInit(const char* const message, const bool host) -{ - FConsoleWindow::GetInstance().NetInit(message, host); -} - -void FBasicStartupScreen::NetMessage(const char* const message) -{ - FConsoleWindow::GetInstance().NetMessage(message); -} - -void FBasicStartupScreen::NetConnect(const int client, const char* const name, const unsigned flags, const int status) -{ - FConsoleWindow::GetInstance().NetConnect(client, name, flags, status); -} - -void FBasicStartupScreen::NetUpdate(const int client, const int status) -{ - FConsoleWindow::GetInstance().NetUpdate(client, status); -} - -void FBasicStartupScreen::NetDisconnect(const int client) -{ - FConsoleWindow::GetInstance().NetDisconnect(client); -} - -void FBasicStartupScreen::NetProgress(const int cur, const int limit) -{ - FConsoleWindow::GetInstance().NetProgress(cur, limit); -} - -void FBasicStartupScreen::NetDone() -{ - FConsoleWindow::GetInstance().NetDone(); -} - -void FBasicStartupScreen::NetClose() -{ - FConsoleWindow::GetInstance().NetClose(); -} - -bool FBasicStartupScreen::ShouldStartNet() -{ - return FConsoleWindow::GetInstance().ShouldStartNet(); -} - -int FBasicStartupScreen::GetNetKickClient() -{ - return FConsoleWindow::GetInstance().GetNetKickClient(); -} - -int FBasicStartupScreen::GetNetBanClient() -{ - return FConsoleWindow::GetInstance().GetNetBanClient(); -} - -bool FBasicStartupScreen::NetLoop(bool (*loopCallback)(void*), void* const data) -{ - while (true) - { - if (loopCallback(data)) - { - break; - } - - [[NSRunLoop currentRunLoop] limitDateForMode:NSDefaultRunLoopMode]; - - // Do not poll to often - usleep(50000); - } - - return true; -} - - -// --------------------------------------------------------------------------- - - -FStartupScreen *FStartupScreen::CreateInstance(const int maxProgress) -{ - return new FBasicStartupScreen(maxProgress); -} diff --git a/src/common/platform/posix/sdl/i_system.cpp b/src/common/platform/posix/sdl/i_system.cpp index 897808158..3e5fe9b10 100644 --- a/src/common/platform/posix/sdl/i_system.cpp +++ b/src/common/platform/posix/sdl/i_system.cpp @@ -67,7 +67,6 @@ #include "v_font.h" #include "c_cvars.h" #include "palutil.h" -#include "st_start.h" #include "printf.h" #include "launcherwindow.h" diff --git a/src/common/platform/posix/sdl/st_start.cpp b/src/common/platform/posix/sdl/st_start.cpp deleted file mode 100644 index 4653f4ff9..000000000 --- a/src/common/platform/posix/sdl/st_start.cpp +++ /dev/null @@ -1,338 +0,0 @@ -/* -** st_start.cpp -** Handles the startup screen. -** -**--------------------------------------------------------------------------- -** Copyright 2006-2007 Randy Heit -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. -** 3. The name of the author may not be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -**--------------------------------------------------------------------------- -** -*/ - -// HEADER FILES ------------------------------------------------------------ - -#include -#include -#include - -#include "st_start.h" -#include "i_system.h" -#include "c_cvars.h" -#include "engineerrors.h" - -// MACROS ------------------------------------------------------------------ - -// TYPES ------------------------------------------------------------------- - -class FTTYStartupScreen : public FStartupScreen -{ - public: - FTTYStartupScreen(int max_progress); - ~FTTYStartupScreen(); - - void Progress(int amount = 1) override; - - void NetInit(const char* message, bool host) override; - void NetMessage(const char* message) override; - void NetConnect(int client, const char* name, unsigned flags, int status) override; - void NetUpdate(int client, int status) override; - void NetDisconnect(int client) override; - void NetProgress(int cur, int limit) override; - void NetDone() override; - void NetClose() override; - bool ShouldStartNet() override; - int GetNetKickClient() override; - int GetNetBanClient() override; - bool NetLoop(bool (*loopCallback)(void*), void* data) override; - - protected: - bool DidNetInit; - int NetMaxPos, NetCurPos; - const char *TheNetMessage; - termios OldTermIOS; -}; - -// EXTERNAL FUNCTION PROTOTYPES -------------------------------------------- - -extern void RedrawProgressBar(int CurPos, int MaxPos); -extern void CleanProgressBar(); - -// PRIVATE DATA DEFINITIONS ------------------------------------------------ - -static const char SpinnyProgressChars[4] = { '|', '/', '-', '\\' }; - -// CODE -------------------------------------------------------------------- - -//========================================================================== -// -// FStartupScreen :: CreateInstance -// -// Initializes the startup screen for the detected game. -// Sets the size of the progress bar and displays the startup screen. -// -//========================================================================== - -FStartupScreen *FStartupScreen::CreateInstance(int max_progress) -{ - return new FTTYStartupScreen(max_progress); -} - -//=========================================================================== -// -// FTTYStartupScreen Constructor -// -// Sets the size of the progress bar and displays the startup screen. -// -//=========================================================================== - -FTTYStartupScreen::FTTYStartupScreen(int max_progress) - : FStartupScreen(max_progress) -{ - DidNetInit = false; - NetMaxPos = 0; - NetCurPos = 0; - TheNetMessage = NULL; -} - -//=========================================================================== -// -// FTTYStartupScreen Destructor -// -// Called just before entering graphics mode to deconstruct the startup -// screen. -// -//=========================================================================== - -FTTYStartupScreen::~FTTYStartupScreen() -{ - NetDone(); // Just in case it wasn't called yet and needs to be. -} - -//=========================================================================== -// -// FTTYStartupScreen :: Progress -// -//=========================================================================== - -void FTTYStartupScreen::Progress(int advance) -{ - CurPos = min(CurPos + advance, MaxPos); - RedrawProgressBar(CurPos, MaxPos); -} - -//=========================================================================== -// -// FTTYStartupScreen :: NetInit -// -// Sets stdin for unbuffered I/O, displays the given message, and shows -// a progress meter. -// -//=========================================================================== - -void FTTYStartupScreen::NetInit(const char* message, bool host) -{ - if (!DidNetInit) - { - termios rawtermios; - - CleanProgressBar(); - fprintf (stderr, "Press 'Q' to abort network game synchronization."); - // Set stdin to raw mode so we can get keypresses in ST_CheckNetAbort() - // immediately without waiting for an EOL. - tcgetattr (STDIN_FILENO, &OldTermIOS); - rawtermios = OldTermIOS; - rawtermios.c_lflag &= ~(ICANON | ECHO); - tcsetattr (STDIN_FILENO, TCSANOW, &rawtermios); - DidNetInit = true; - } - fprintf(stderr, "\n%s.", message); - fflush (stderr); - TheNetMessage = message; - NetCurPos = 0; -} - -void FTTYStartupScreen::NetMessage(const char* message) -{ - TheNetMessage = message; -} - -void FTTYStartupScreen::NetConnect(int client, const char* name, unsigned flags, int status) -{ - -} - -void FTTYStartupScreen::NetUpdate(int client, int status) -{ - -} - -void FTTYStartupScreen::NetDisconnect(int client) -{ - -} - -//=========================================================================== -// -// FTTYStartupScreen :: NetProgress -// -// Sets the network progress meter. -// -//=========================================================================== - -void FTTYStartupScreen::NetProgress(int cur, int limit) -{ - int i; - - NetMaxPos = limit; - NetCurPos = cur; - if (NetMaxPos == 0) - { - // Spinny-type progress meter, because we're a guest waiting for the host. - fprintf(stderr, "\r%s: %c", TheNetMessage, SpinnyProgressChars[NetCurPos & 3]); - fflush(stderr); - } - else if (NetMaxPos > 1) - { - // Dotty-type progress meter. - fprintf(stderr, "\r%s: ", TheNetMessage); - for (i = 0; i < NetCurPos; ++i) - { - fputc('.', stderr); - } - fprintf(stderr, "%*c[%2d/%2d]", NetMaxPos + 1 - NetCurPos, ' ', NetCurPos, NetMaxPos); - fflush(stderr); - } -} - -//=========================================================================== -// -// FTTYStartupScreen :: NetDone -// -// Restores the old stdin tty settings. -// -//=========================================================================== - -void FTTYStartupScreen::NetDone() -{ - CurPos = MaxPos; - CleanProgressBar(); - // Restore stdin settings - if (DidNetInit) - { - tcsetattr (STDIN_FILENO, TCSANOW, &OldTermIOS); - printf ("\n"); - DidNetInit = false; - } -} - -void FTTYStartupScreen::NetClose() -{ - // TODO: Implement this -} - -bool FTTYStartupScreen::ShouldStartNet() -{ - return false; -} - -int FTTYStartupScreen::GetNetKickClient() -{ - return -1; -} - -int FTTYStartupScreen::GetNetBanClient() -{ - return -1; -} - -//=========================================================================== -// -// FTTYStartupScreen :: NetLoop -// -// The timer_callback function is called at least two times per second -// and passed the userdata value. It should return true to stop the loop and -// return control to the caller or false to continue the loop. -// -// ST_NetLoop will return true if the loop was halted by the callback and -// false if the loop was halted because the user wants to abort the -// network synchronization. -// -//=========================================================================== - -bool FTTYStartupScreen::NetLoop(bool (*loopCallback)(void *), void *data) -{ - fd_set rfds; - struct timeval tv; - int retval; - char k; - bool stdin_eof = false; - - for (;;) - { - // Don't flood the network with packets on startup. - tv.tv_sec = 0; - tv.tv_usec = 500000; - - FD_ZERO (&rfds); - if (!stdin_eof) - { - FD_SET (STDIN_FILENO, &rfds); - } - - retval = select (1, &rfds, NULL, NULL, &tv); - - if (retval == -1) - { - // Error - } - else if (retval == 0) - { - if (loopCallback (data)) - { - fputc ('\n', stderr); - return true; - } - } - else - { - ssize_t amt = read (STDIN_FILENO, &k, 1); // Check input on stdin - if (amt == 0) - { - // EOF. Stop reading - stdin_eof = true; - } - else if (amt == 1) - { - if (k == 'q' || k == 'Q') - { - fprintf (stderr, "\nNetwork game synchronization aborted."); - return false; - } - } - } - } -} - diff --git a/src/common/platform/win32/base_sysfb.cpp b/src/common/platform/win32/base_sysfb.cpp index dbea719cf..e31b2efeb 100644 --- a/src/common/platform/win32/base_sysfb.cpp +++ b/src/common/platform/win32/base_sysfb.cpp @@ -32,7 +32,9 @@ ** */ +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include #include #include "wglext.h" diff --git a/src/common/platform/win32/hardware.cpp b/src/common/platform/win32/hardware.cpp index 6fca6681d..ef87b5322 100644 --- a/src/common/platform/win32/hardware.cpp +++ b/src/common/platform/win32/hardware.cpp @@ -32,7 +32,9 @@ ** */ +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include #include diff --git a/src/common/platform/win32/i_crash.cpp b/src/common/platform/win32/i_crash.cpp index 527018c97..c8ea8db14 100644 --- a/src/common/platform/win32/i_crash.cpp +++ b/src/common/platform/win32/i_crash.cpp @@ -19,7 +19,9 @@ ** 3. This notice may not be removed or altered from any source distribution. */ +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include #include #include diff --git a/src/common/platform/win32/i_dijoy.cpp b/src/common/platform/win32/i_dijoy.cpp index 2340bfc84..07c16eb88 100644 --- a/src/common/platform/win32/i_dijoy.cpp +++ b/src/common/platform/win32/i_dijoy.cpp @@ -33,7 +33,9 @@ // HEADER FILES ------------------------------------------------------------ +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #define DIRECTINPUT_VERSION 0x800 #include #include diff --git a/src/common/platform/win32/i_input.cpp b/src/common/platform/win32/i_input.cpp index 053384c86..4fee4e11a 100644 --- a/src/common/platform/win32/i_input.cpp +++ b/src/common/platform/win32/i_input.cpp @@ -35,7 +35,9 @@ // DI3 only supports up to 4 mouse buttons, and I want the joystick to // be read using DirectInput instead of winmm. +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #define __BYTEBOOL__ #ifndef __GNUC__ #define INITGUID diff --git a/src/common/platform/win32/i_keyboard.cpp b/src/common/platform/win32/i_keyboard.cpp index 33cf6da5b..24d5fd586 100644 --- a/src/common/platform/win32/i_keyboard.cpp +++ b/src/common/platform/win32/i_keyboard.cpp @@ -33,7 +33,9 @@ // HEADER FILES ------------------------------------------------------------ +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #define DIRECTINPUT_VERSION 0x800 #include #include diff --git a/src/common/platform/win32/i_main.cpp b/src/common/platform/win32/i_main.cpp index 2f400e435..b456edab7 100644 --- a/src/common/platform/win32/i_main.cpp +++ b/src/common/platform/win32/i_main.cpp @@ -32,7 +32,9 @@ ** */ +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include #include #include @@ -72,7 +74,6 @@ #include "s_music.h" #include "stats.h" -#include "st_start.h" #include "i_interface.h" #include "startupinfo.h" #include "printf.h" diff --git a/src/common/platform/win32/i_mainwindow.cpp b/src/common/platform/win32/i_mainwindow.cpp index 4dfb15e0d..c5ac3a990 100644 --- a/src/common/platform/win32/i_mainwindow.cpp +++ b/src/common/platform/win32/i_mainwindow.cpp @@ -4,7 +4,6 @@ #include "startupinfo.h" #include "gstrings.h" #include "palentry.h" -#include "st_start.h" #include "i_input.h" #include "version.h" #include "utf8.h" diff --git a/src/common/platform/win32/i_mainwindow.h b/src/common/platform/win32/i_mainwindow.h index 8f9b56e6f..b2d949030 100644 --- a/src/common/platform/win32/i_mainwindow.h +++ b/src/common/platform/win32/i_mainwindow.h @@ -5,7 +5,9 @@ #include +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include // The WndProc used when the game view is active diff --git a/src/common/platform/win32/i_mouse.cpp b/src/common/platform/win32/i_mouse.cpp index e0050cc3a..4087b0d55 100644 --- a/src/common/platform/win32/i_mouse.cpp +++ b/src/common/platform/win32/i_mouse.cpp @@ -33,7 +33,9 @@ // HEADER FILES ------------------------------------------------------------ +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #define DIRECTINPUT_VERSION 0x800 #include #include diff --git a/src/common/platform/win32/i_rawps2.cpp b/src/common/platform/win32/i_rawps2.cpp index 09bb314b0..544c498b4 100644 --- a/src/common/platform/win32/i_rawps2.cpp +++ b/src/common/platform/win32/i_rawps2.cpp @@ -33,7 +33,9 @@ // HEADER FILES ------------------------------------------------------------ +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include #include "i_input.h" diff --git a/src/common/platform/win32/i_system.cpp b/src/common/platform/win32/i_system.cpp index b9e75fa8e..20e26307c 100644 --- a/src/common/platform/win32/i_system.cpp +++ b/src/common/platform/win32/i_system.cpp @@ -58,7 +58,9 @@ #include +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include #include #include diff --git a/src/common/platform/win32/i_xinput.cpp b/src/common/platform/win32/i_xinput.cpp index 890888a4b..769475444 100644 --- a/src/common/platform/win32/i_xinput.cpp +++ b/src/common/platform/win32/i_xinput.cpp @@ -33,7 +33,9 @@ // HEADER FILES ------------------------------------------------------------ +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include #include #include diff --git a/src/common/platform/win32/st_start.cpp b/src/common/platform/win32/st_start.cpp deleted file mode 100644 index f74aca3ae..000000000 --- a/src/common/platform/win32/st_start.cpp +++ /dev/null @@ -1,224 +0,0 @@ -/* -** st_start.cpp -** Handles the startup screen. -** -**--------------------------------------------------------------------------- -** Copyright 2006-2007 Randy Heit -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. -** 3. The name of the author may not be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -**--------------------------------------------------------------------------- -** -*/ - -// HEADER FILES ------------------------------------------------------------ - -#define WIN32_LEAN_AND_MEAN -#include -#include -#include "resource.h" - -#include "st_start.h" -#include "cmdlib.h" - -#include "i_system.h" -#include "i_input.h" -#include "hardware.h" -#include "filesystem.h" -#include "m_argv.h" -#include "engineerrors.h" -#include "s_music.h" -#include "printf.h" -#include "startupinfo.h" -#include "i_interface.h" -#include "texturemanager.h" -#include "common/widgets/netstartwindow.h" - -// EXTERNAL FUNCTION PROTOTYPES -------------------------------------------- - -void ST_Util_SizeWindowForBitmap (int scale); - -// EXTERNAL DATA DECLARATIONS ---------------------------------------------- - -extern HINSTANCE g_hInst; - -// PRIVATE DATA DEFINITIONS ------------------------------------------------ - -// CODE -------------------------------------------------------------------- - -//========================================================================== -// -// FStartupScreen :: CreateInstance -// -// Initializes the startup screen for the detected game. -// Sets the size of the progress bar and displays the startup screen. -// -//========================================================================== - -FStartupScreen *FStartupScreen::CreateInstance(int max_progress) -{ - return new FBasicStartupScreen(max_progress); -} - -//========================================================================== -// -// FBasicStartupScreen Constructor -// -// Shows a progress bar at the bottom of the window. -// -//========================================================================== - -FBasicStartupScreen::FBasicStartupScreen(int max_progress) -: FStartupScreen(max_progress) -{ -} - -//========================================================================== -// -// FBasicStartupScreen Destructor -// -// Called just before entering graphics mode to deconstruct the startup -// screen. -// -//========================================================================== - -FBasicStartupScreen::~FBasicStartupScreen() -{ -} - -//========================================================================== -// -// FBasicStartupScreen :: Progress -// -// Bumps the progress meter one notch. -// -//========================================================================== - -void FBasicStartupScreen::Progress(int advance) -{ - CurPos = min(CurPos + advance, MaxPos); -} - -//========================================================================== -// -// FBasicStartupScreen :: NetInit -// -// Shows the network startup pane if it isn't visible. Sets the message in -// the pane to the one provided. If numplayers is 0, then the progress bar -// is a scrolling marquee style. If numplayers is 1, then the progress bar -// is just a full bar. If numplayers is >= 2, then the progress bar is a -// normal one, and a progress count is also shown in the pane. -// -//========================================================================== - -void FBasicStartupScreen::NetInit(const char *message, bool host) -{ - NetStartWindow::NetInit(message, host); -} - -void FBasicStartupScreen::NetMessage(const char* message) -{ - NetStartWindow::NetMessage(message); -} - -void FBasicStartupScreen::NetConnect(int client, const char* name, unsigned flags, int status) -{ - NetStartWindow::NetConnect(client, name, flags, status); -} - -void FBasicStartupScreen::NetUpdate(int client, int status) -{ - NetStartWindow::NetUpdate(client, status); -} - -void FBasicStartupScreen::NetDisconnect(int client) -{ - NetStartWindow::NetDisconnect(client); -} - -//========================================================================== -// -// FBasicStartupScreen :: NetProgress -// -// Sets the network progress meter. If count is 0, it gets bumped by 1. -// Otherwise, it is set to count. -// -//========================================================================== - -void FBasicStartupScreen::NetProgress(int cur, int limit) -{ - NetStartWindow::NetProgress(cur, limit); -} - -//========================================================================== -// -// FBasicStartupScreen :: NetDone -// -// Removes the network startup pane. -// -//========================================================================== - -void FBasicStartupScreen::NetDone() -{ - NetStartWindow::NetDone(); -} - -void FBasicStartupScreen::NetClose() -{ - NetStartWindow::NetClose(); -} - -bool FBasicStartupScreen::ShouldStartNet() -{ - return NetStartWindow::ShouldStartNet(); -} - -int FBasicStartupScreen::GetNetKickClient() -{ - return NetStartWindow::GetNetKickClient(); -} - -int FBasicStartupScreen::GetNetBanClient() -{ - return NetStartWindow::GetNetBanClient(); -} - -//========================================================================== -// -// FBasicStartupScreen :: NetLoop -// -// The timer_callback function is called at least two times per second -// and passed the userdata value. It should return true to stop the loop and -// return control to the caller or false to continue the loop. -// -// ST_NetLoop will return true if the loop was halted by the callback and -// false if the loop was halted because the user wants to abort the -// network synchronization. -// -//========================================================================== - -bool FBasicStartupScreen::NetLoop(bool (*loopCallback)(void*), void* data) -{ - return NetStartWindow::NetLoop(loopCallback, data); -} diff --git a/src/common/utility/i_module.cpp b/src/common/utility/i_module.cpp index 5b5153f1d..448ea9317 100644 --- a/src/common/utility/i_module.cpp +++ b/src/common/utility/i_module.cpp @@ -34,7 +34,9 @@ #include "i_module.h" #ifdef _WIN32 +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include #else #include diff --git a/src/common/utility/zstring.cpp b/src/common/utility/zstring.cpp index ef129abc7..55aa10809 100644 --- a/src/common/utility/zstring.cpp +++ b/src/common/utility/zstring.cpp @@ -1301,8 +1301,12 @@ void FString::Split(TArray& tokens, const char *delimiter, EmptyTokenTy } #ifdef _WIN32 +#ifndef NOMINMAX #define NOMINMAX +#endif +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include // Convert from and to Windows wide strings so that we can interface with the Unicode version of the Windows API. diff --git a/src/common/widgets/widgetresourcedata.cpp b/src/common/widgets/widgetresourcedata.cpp index 849b6d553..8783ff24d 100644 --- a/src/common/widgets/widgetresourcedata.cpp +++ b/src/common/widgets/widgetresourcedata.cpp @@ -6,7 +6,9 @@ #include "zstring.h" #ifdef _WIN32 +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include #endif diff --git a/src/d_main.cpp b/src/d_main.cpp index 7f4d57b2d..cfed83897 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -80,7 +80,7 @@ #include "sbar.h" #include "decallib.h" #include "version.h" -#include "st_start.h" +#include "common/widgets/netstartwindow.h" #include "teaminfo.h" #include "hardware.h" #include "sbarinfo.h" @@ -3418,14 +3418,6 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector& allw } if (!batchrun && !RunningAsTool) Printf ("ST_Init: Init startup screen.\n"); - if (!restart) - { - StartWindow = FStartupScreen::CreateInstance(max_progress); - } - else - { - StartWindow = new FStartupScreen(0); - } CheckCmdLine(); @@ -3453,7 +3445,6 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector& allw SpriteFrames.Clear(); TexMan.AddTextures([]() { - StartWindow->Progress(); if (StartScreen) StartScreen->Progress(1); }, CheckForHacks, InitBuildTiles); PatchTextures(); @@ -3462,7 +3453,6 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector& allw FixWideStatusBar(); - StartWindow->Progress(); if (StartScreen) StartScreen->Progress(1); V_InitFonts(); InitDoomFonts(); @@ -3491,7 +3481,6 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector& allw I_FatalError ("No player classes defined"); } - StartWindow->Progress(); if (StartScreen) StartScreen->Progress (1); ParseGLDefs(); @@ -3499,7 +3488,6 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector& allw if (!batchrun && !RunningAsTool) Printf ("R_Init: Init %s refresh subsystem.\n", gameinfo.ConfigName.GetChars()); if (StartScreen) StartScreen->LoadingStatus ("Loading graphics", 0x3f); if (StartScreen) StartScreen->Progress(1); - StartWindow->Progress(); R_Init (); if (!batchrun && !RunningAsTool) Printf ("DecalLibrary: Load decals.\n"); @@ -3640,7 +3628,6 @@ static int D_InitGame(const FIWADInfo* iwad_info, std::vector& allw if (RunningAsTool) return 0; - StartWindow->Progress(max_progress); if (StartScreen) { StartScreen->Progress(max_progress); // advance progress bar to the end. @@ -4065,7 +4052,6 @@ int GameMain() I_ShutdownGraphics(); I_ShutdownInput(); M_SaveDefaultsFinal(); - DeleteStartupScreen(); C_UninitCVars(); // must come last so that nothing will access the CVARs anymore after deletion. if(ret != 1337) { diff --git a/src/d_net.cpp b/src/d_net.cpp index fe6e3727d..d2f60cab8 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -48,7 +48,7 @@ #include "p_acs.h" #include "p_trace.h" #include "a_sharedglobal.h" -#include "st_start.h" +#include "common/widgets/netstartwindow.h" #include "teaminfo.h" #include "p_conversation.h" #include "d_eventbase.h" diff --git a/src/rendering/r_utility.cpp b/src/rendering/r_utility.cpp index 1df164692..5eaa80dc1 100644 --- a/src/rendering/r_utility.cpp +++ b/src/rendering/r_utility.cpp @@ -49,7 +49,6 @@ #include "r_data/r_interpolate.h" #include "po_man.h" #include "p_effect.h" -#include "st_start.h" #include "v_font.h" #include "swrenderer/r_renderer.h" #include "serializer.h" diff --git a/src/win32/i_steam.cpp b/src/win32/i_steam.cpp index 0c0512b07..919dc8f82 100644 --- a/src/win32/i_steam.cpp +++ b/src/win32/i_steam.cpp @@ -52,7 +52,9 @@ #include +#ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN +#endif #include #include #include