summaryrefslogtreecommitdiffhomepage
path: root/Stars45/Game.cpp
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2022-02-16 23:36:18 +0100
committerAki <please@ignore.pl>2022-02-16 23:36:18 +0100
commit5412bc10447bc0154f6c813d029d5c1c1d835388 (patch)
treebe111a898374ab6c3b44444f5f02f0a362ccfc1e /Stars45/Game.cpp
parent084d3b4e049bf1014088772bc79559fd3b06fd11 (diff)
downloadstarshatter-5412bc10447bc0154f6c813d029d5c1c1d835388.zip
starshatter-5412bc10447bc0154f6c813d029d5c1c1d835388.tar.gz
starshatter-5412bc10447bc0154f6c813d029d5c1c1d835388.tar.bz2
Changed static members to instance for a Game singleton
Diffstat (limited to 'Stars45/Game.cpp')
-rw-r--r--Stars45/Game.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/Stars45/Game.cpp b/Stars45/Game.cpp
index ad364d7..9632d6a 100644
--- a/Stars45/Game.cpp
+++ b/Stars45/Game.cpp
@@ -29,25 +29,11 @@
Game* game = 0;
-bool Game::active = false;
-bool Game::paused = false;
-bool Game::server = false;
-bool Game::show_mouse = false;
-DWORD Game::base_game_time = 0;
-DWORD Game::real_time = 0;
-DWORD Game::game_time = 0;
-DWORD Game::time_comp = 1;
-DWORD Game::frame_number = 0;
-
const int VIDEO_FPS = 30;
const double MAX_FRAME_TIME_VIDEO = 1.0 / (double) VIDEO_FPS;
const double MAX_FRAME_TIME_NORMAL = 1.0 / 5.0;
const double MIN_FRAME_TIME_NORMAL = 1.0 / 60.0;
-double Game::max_frame_length = MAX_FRAME_TIME_NORMAL;
-double Game::min_frame_length = MIN_FRAME_TIME_NORMAL;
-
-char Game::panicbuf[256];
static LARGE_INTEGER perf_freq;
static LARGE_INTEGER perf_cnt1;
@@ -63,9 +49,23 @@ Game::Game()
status(Game::OK), exit_code(0), window_style(0)
{
if (!game) {
- panicbuf[0] = 0;
game = this;
+ active = false;
+ paused = false;
+ server = false;
+ show_mouse = false;
+ base_game_time = 0;
+ real_time = 0;
+ game_time = 0;
+ time_comp = 1;
+ frame_number = 0;
+
+ max_frame_length = MAX_FRAME_TIME_NORMAL;
+ min_frame_length = MIN_FRAME_TIME_NORMAL;
+
+ panicbuf[0] = 0;
+
video_settings = new(__FILE__,__LINE__) VideoSettings;
is_windowed = false;