From 87eb89ad334f87bf3da67f18e8e696f4dc7b7b21 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Mon, 19 Aug 2024 07:53:30 +0200 Subject: [PATCH] Remove some indirection --- src/common/platform/win32/i_mainwindow.cpp | 20 -------------------- src/common/platform/win32/i_mainwindow.h | 5 ----- src/common/platform/win32/st_start.cpp | 10 +++++----- 3 files changed, 5 insertions(+), 30 deletions(-) diff --git a/src/common/platform/win32/i_mainwindow.cpp b/src/common/platform/win32/i_mainwindow.cpp index abe46df5e..e13374056 100644 --- a/src/common/platform/win32/i_mainwindow.cpp +++ b/src/common/platform/win32/i_mainwindow.cpp @@ -128,26 +128,6 @@ void MainWindow::ShowErrorPane(const char* text) } } -void MainWindow::ShowNetStartPane(const char* message, int maxpos) -{ - NetStartWindow::ShowNetStartPane(message, maxpos); -} - -void MainWindow::HideNetStartPane() -{ - NetStartWindow::HideNetStartPane(); -} - -void MainWindow::SetNetStartProgress(int pos) -{ - NetStartWindow::SetNetStartProgress(pos); -} - -bool MainWindow::RunMessageLoop(bool (*timer_callback)(void*), void* userdata) -{ - return NetStartWindow::RunMessageLoop(timer_callback, userdata); -} - bool MainWindow::CheckForRestart() { bool result = restartrequest; diff --git a/src/common/platform/win32/i_mainwindow.h b/src/common/platform/win32/i_mainwindow.h index 3c0c7e55d..2e24619cc 100644 --- a/src/common/platform/win32/i_mainwindow.h +++ b/src/common/platform/win32/i_mainwindow.h @@ -25,11 +25,6 @@ public: void PrintStr(const char* cp); void GetLog(std::function writeFile); - void ShowNetStartPane(const char* message, int maxpos); - void SetNetStartProgress(int pos); - bool RunMessageLoop(bool (*timer_callback)(void*), void* userdata); - void HideNetStartPane(); - void SetWindowTitle(const char* caption); HWND GetHandle() { return Window; } diff --git a/src/common/platform/win32/st_start.cpp b/src/common/platform/win32/st_start.cpp index 8bc48d26e..b24fee867 100644 --- a/src/common/platform/win32/st_start.cpp +++ b/src/common/platform/win32/st_start.cpp @@ -53,7 +53,7 @@ #include "startupinfo.h" #include "i_interface.h" #include "texturemanager.h" -#include "i_mainwindow.h" +#include "common/widgets/netstartwindow.h" // EXTERNAL FUNCTION PROTOTYPES -------------------------------------------- @@ -140,7 +140,7 @@ void FBasicStartupScreen::Progress() void FBasicStartupScreen::NetInit(const char *message, int numplayers) { NetMaxPos = numplayers; - mainwindow.ShowNetStartPane(message, numplayers); + NetStartWindow::ShowNetStartPane(message, numplayers); NetMaxPos = numplayers; NetCurPos = 0; @@ -157,7 +157,7 @@ void FBasicStartupScreen::NetInit(const char *message, int numplayers) void FBasicStartupScreen::NetDone() { - mainwindow.HideNetStartPane(); + NetStartWindow::HideNetStartPane(); } //========================================================================== @@ -180,7 +180,7 @@ void FBasicStartupScreen::NetProgress(int count) NetCurPos = count; } - mainwindow.SetNetStartProgress(count); + NetStartWindow::SetNetStartProgress(count); } //========================================================================== @@ -199,5 +199,5 @@ void FBasicStartupScreen::NetProgress(int count) bool FBasicStartupScreen::NetLoop(bool (*timer_callback)(void *), void *userdata) { - return mainwindow.RunMessageLoop(timer_callback, userdata); + return NetStartWindow::RunMessageLoop(timer_callback, userdata); }