aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2019-08-08 00:05:02 +0200
committerEugene Sandulenko2019-09-03 17:17:32 +0200
commit4406d89743edf6ee8c97bfa87442b02d60196868 (patch)
treec066853e7f43ed9eb780352c72f41347a7fc8111
parente514a6c8c1f16f1f81a9b66a5c4d88ac39d49bc6 (diff)
downloadscummvm-rg350-4406d89743edf6ee8c97bfa87442b02d60196868.tar.gz
scummvm-rg350-4406d89743edf6ee8c97bfa87442b02d60196868.tar.bz2
scummvm-rg350-4406d89743edf6ee8c97bfa87442b02d60196868.zip
HDB: Move heavy lifting out of HDBGame constructor
-rw-r--r--engines/hdb/hdb.cpp32
1 files changed, 22 insertions, 10 deletions
diff --git a/engines/hdb/hdb.cpp b/engines/hdb/hdb.cpp
index f620bd378c..f64ef4e22e 100644
--- a/engines/hdb/hdb.cpp
+++ b/engines/hdb/hdb.cpp
@@ -44,6 +44,7 @@ namespace HDB {
HDBGame* g_hdb;
HDBGame::HDBGame(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
+ g_hdb = this;
if (isPPC()) {
_screenWidth = 240;
_screenHeight = 320;
@@ -60,16 +61,16 @@ HDBGame::HDBGame(OSystem *syst, const ADGameDescription *gameDesc) : Engine(syst
_format = Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0);
_systemInit = false;
- g_hdb = this;
- _fileMan = new FileMan;
- _gfx = new Gfx;
- _lua = new LuaScript;
- _menu = new Menu;
- _map = new Map;
- _ai = new AI;
- _input = new Input;
- _sound = new Sound;
- _window = new Window;
+
+ _fileMan = nullptr;
+ _gfx = nullptr;
+ _lua = nullptr;
+ _menu = nullptr;
+ _map = nullptr;
+ _ai = nullptr;
+ _input = nullptr;
+ _sound = nullptr;
+ _window = nullptr;
_rnd = new Common::RandomSource("hdb");
_cheating = false;
@@ -123,6 +124,17 @@ bool HDBGame::init() {
Game Subsystem Initializations
*/
+ _systemInit = false;
+ _fileMan = new FileMan;
+ _gfx = new Gfx;
+ _lua = new LuaScript;
+ _menu = new Menu;
+ _map = new Map;
+ _ai = new AI;
+ _input = new Input;
+ _sound = new Sound;
+ _window = new Window;
+
// Init fileMan
if (!_fileMan->openMPC(getGameFile())) {