summaryrefslogtreecommitdiffhomepage
path: root/StarsEx
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-04-06 21:52:10 +0200
committerAki <please@ignore.pl>2022-04-06 21:54:35 +0200
commitb607369386ed3c410f9721a43b6145c9456af479 (patch)
treeacdf5539b55a46af71e7baf0c27c9c471b17d0f9 /StarsEx
parent4d7ca74c55edff30e34df1c36824a128211bfeb8 (diff)
downloadstarshatter-b607369386ed3c410f9721a43b6145c9456af479.zip
starshatter-b607369386ed3c410f9721a43b6145c9456af479.tar.gz
starshatter-b607369386ed3c410f9721a43b6145c9456af479.tar.bz2
Removed member variable used to indicate server instance
Diffstat (limited to 'StarsEx')
-rw-r--r--StarsEx/Game.cpp4
-rw-r--r--StarsEx/Game.h3
-rw-r--r--StarsEx/GameWinDX9.cpp16
-rw-r--r--StarsEx/StarServer.cpp3
-rw-r--r--StarsEx/StarServer.h1
5 files changed, 3 insertions, 24 deletions
diff --git a/StarsEx/Game.cpp b/StarsEx/Game.cpp
index 54f9204..8530126 100644
--- a/StarsEx/Game.cpp
+++ b/StarsEx/Game.cpp
@@ -33,7 +33,6 @@ Game::Game() :
game_mode {MENU_MODE},
active {false},
paused {false},
- server {false},
show_mouse {false},
frame_number {0}
{
@@ -78,9 +77,6 @@ Game::Init(HINSTANCE hi, HINSTANCE hpi, LPSTR cmdline, int nCmdShow)
bool
Game::InitGame()
{
- if (server) {
- Print(" InitGame() - server mode.\n");
- }
return true;
}
diff --git a/StarsEx/Game.h b/StarsEx/Game.h
index b350e2c..9e589c2 100644
--- a/StarsEx/Game.h
+++ b/StarsEx/Game.h
@@ -58,7 +58,7 @@ public:
bool Active() { return active; }
bool Paused() { return paused; }
- bool Server() { return server; }
+ virtual bool Server() { return false; }
bool ShowMouse() { return show_mouse; }
virtual void PumpEvents();
@@ -76,7 +76,6 @@ protected:
bool active;
bool paused;
- bool server;
bool show_mouse;
DWORD frame_number;
diff --git a/StarsEx/GameWinDX9.cpp b/StarsEx/GameWinDX9.cpp
index 7099b90..9571122 100644
--- a/StarsEx/GameWinDX9.cpp
+++ b/StarsEx/GameWinDX9.cpp
@@ -128,9 +128,6 @@ GameWinDX9::InitApplication(HINSTANCE hInstance)
WNDCLASS wc;
LOGBRUSH brush = { BS_SOLID, RGB(0,0,0), 0 };
- if (server)
- brush.lbColor = RGB(255,255,255);
-
// Fill in window class structure with parameters that
// describe the main window.
wc.style = CS_HREDRAW | CS_VREDRAW;
@@ -173,12 +170,7 @@ GameWinDX9::InitInstance(HINSTANCE hInstance, int nCmdShow)
int s_width = 800;
int s_height = 600;
- if (server) {
- s_width = 320;
- s_height = 200;
- }
-
- else if (video_settings) {
+ if (video_settings) {
s_width = video_settings->window_width;
s_height = video_settings->window_height;
}
@@ -244,7 +236,6 @@ GameWinDX9::InitInstance(HINSTANCE hInstance, int nCmdShow)
bool
GameWinDX9::InitGame()
{
- if (server) return true;
if (!SetupPalette()) {
Panic::Panic("Could not set up the palette.");
return false;
@@ -273,8 +264,6 @@ GameWinDX9::InitGame()
bool
GameWinDX9::InitVideo()
{
- if (server) return true;
-
// create a video factory, and video object:
video_factory = new VideoFactory(hwnd);
@@ -309,7 +298,6 @@ GameWinDX9::InitVideo()
bool
GameWinDX9::ResetVideo()
{
- if (server) return true;
if (!video_factory) return InitVideo();
Print(" Reset Video...\n");
@@ -624,8 +612,6 @@ GameWinDX9::Pause(bool f)
void
GameWinDX9::ShowStats()
{
- if (server) return;
-
auto total_time = Clock::GetInstance()->RealTime();
auto stats = Video::GetInstance()->GetStats();
diff --git a/StarsEx/StarServer.cpp b/StarsEx/StarServer.cpp
index 7d6d8bc..cb3ab21 100644
--- a/StarsEx/StarServer.cpp
+++ b/StarsEx/StarServer.cpp
@@ -77,7 +77,6 @@ StarServer::StarServer() :
throw "StarServer may have only one instance";
instance = this;
- server = true;
show_mouse = true;
DataLoader::Initialize();
@@ -130,8 +129,6 @@ StarServer::~StarServer()
NetServerConfig::Close();
ModConfig::Close();
- server = false;
-
if (instance == this)
instance = nullptr;
}
diff --git a/StarsEx/StarServer.h b/StarsEx/StarServer.h
index 7b13c13..f988ba3 100644
--- a/StarsEx/StarServer.h
+++ b/StarsEx/StarServer.h
@@ -42,6 +42,7 @@ public:
virtual bool InitGame();
virtual void GameState();
+ bool Server() override { return true; }
void SetGameMode(int mode) override;
void SetNextMission(const char* script);