aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2014-03-15 11:09:52 +0100
committerStrangerke2014-03-15 11:09:52 +0100
commit1cf283bfa7c460d4b73b2c896112ea5d5f41b3a8 (patch)
treefd4d8bd1fda6371f21c748abd1e6410eaa5602f5 /engines
parent531923241d26febbe2ec81db778baa1e0cf7d7f2 (diff)
downloadscummvm-rg350-1cf283bfa7c460d4b73b2c896112ea5d5f41b3a8.tar.gz
scummvm-rg350-1cf283bfa7c460d4b73b2c896112ea5d5f41b3a8.tar.bz2
scummvm-rg350-1cf283bfa7c460d4b73b2c896112ea5d5f41b3a8.zip
CGE: Move several variable initializations to the constructor
Diffstat (limited to 'engines')
-rw-r--r--engines/cge/cge.cpp74
1 files changed, 40 insertions, 34 deletions
diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp
index 49297b06ec..f63acc23c2 100644
--- a/engines/cge/cge.cpp
+++ b/engines/cge/cge.cpp
@@ -83,6 +83,37 @@ CGEEngine::CGEEngine(OSystem *syst, const ADGameDescription *gameDescription)
_miniShp = nullptr;
_miniShpList = nullptr;
_console = nullptr;
+
+ _lastFrame = 0;
+ _lastTick = 0;
+ _music = true;
+ _maxScene = 0;
+ _dark = false;
+ _game = false;
+ _endGame = false;
+ _now = 1;
+ _lev = -1;
+ _mode = 0;
+ _soundOk = 1;
+ _sprTv = nullptr;
+ _gameCase2Cpt = 0;
+ _offUseCount = 0;
+ _sprK1 = nullptr;
+ _sprK2 = nullptr;
+ _sprK3 = nullptr;
+ _font = nullptr;
+ _vga = nullptr;
+ _sys = nullptr;
+
+ for (int i = 0; i < kPocketNX; i++)
+ _pocref[i] = -1;
+ _volume[0] = 0;
+ _volume[1] = 0;
+
+ for (int i = 0; i < 4; i++)
+ _flag[i] = false;
+
+ initSceneValues();
}
void CGEEngine::initSceneValues() {
@@ -101,14 +132,13 @@ void CGEEngine::init() {
debugC(1, kCGEDebugEngine, "CGEEngine::init()");
// Initialize fields
- _lastFrame = 0;
- _lastTick = 0;
- _hero = NULL;
- _shadow = NULL;
- _miniScene = NULL;
- _miniShp = NULL;
- _miniShpList = NULL;
- _sprite = NULL;
+ _hero = nullptr;
+ _shadow = nullptr;
+ _miniScene = nullptr;
+ _miniShp = nullptr;
+ _miniShpList = nullptr;
+ _sprite = nullptr;
+
_resman = new ResourceManager();
// Create debugger console
@@ -117,12 +147,12 @@ void CGEEngine::init() {
// Initialize engine objects
_font = new Font(this, "CGE");
_text = new Text(this, "CGE");
- _talk = NULL;
+ _talk = nullptr;
_vga = new Vga(this);
_sys = new System(this);
_pocLight = new PocLight(this);
for (int i = 0; i < kPocketNX; i++)
- _pocket[i] = NULL;
+ _pocket[i] = nullptr;
_horzLine = new HorizLine(this);
_infoLine = new InfoLine(this, kInfoW);
_sceneLight = new SceneLight(this);
@@ -137,30 +167,6 @@ void CGEEngine::init() {
_sound = new Sound(this);
_offUseCount = atoi(_text->getText(kOffUseCount));
- _music = true;
-
- for (int i = 0; i < kPocketNX; i++)
- _pocref[i] = -1;
- _volume[0] = 0;
- _volume[1] = 0;
-
- initSceneValues();
-
- _maxScene = 0;
- _dark = false;
- _game = false;
- _endGame = false;
- _now = 1;
- _lev = -1;
- _recentStep = -2;
-
- for (int i = 0; i < 4; i++)
- _flag[i] = false;
-
- _mode = 0;
- _soundOk = 1;
- _sprTv = NULL;
- _gameCase2Cpt = 0;
_startGameSlot = ConfMan.hasKey("save_slot") ? ConfMan.getInt("save_slot") : -1;
}