diff options
| author | uruk | 2013-07-24 17:52:57 +0200 |
|---|---|---|
| committer | uruk | 2013-07-24 17:52:57 +0200 |
| commit | 8c5ce549e655a0f739cd161ed33efa6750a8fd95 (patch) | |
| tree | 525e6ca10cc2b01b2905ef7b12c73694b9d59c4a /engines/avalanche/avalanche.cpp | |
| parent | ba581b0b325d14684dcb9a302fd06c098cacea05 (diff) | |
| download | scummvm-rg350-8c5ce549e655a0f739cd161ed33efa6750a8fd95.tar.gz scummvm-rg350-8c5ce549e655a0f739cd161ed33efa6750a8fd95.tar.bz2 scummvm-rg350-8c5ce549e655a0f739cd161ed33efa6750a8fd95.zip | |
AVALANCHE: Change _graphics into a pointer, modify the rest of the code accordingly. Introduce AvalanhceEngine::initialize(), use it in AvalancheEninge::run(), modify rest of the code accordingly.
Diffstat (limited to 'engines/avalanche/avalanche.cpp')
| -rw-r--r-- | engines/avalanche/avalanche.cpp | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp index aa9fe9f627..4b51c8babd 100644 --- a/engines/avalanche/avalanche.cpp +++ b/engines/avalanche/avalanche.cpp @@ -45,12 +45,22 @@ AvalancheEngine *AvalancheEngine::s_Engine = 0; AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *gd) : Engine(syst), _gameDescription(gd) { _system = syst; + s_Engine = this; _console = new AvalancheConsole(this); _rnd = new Common::RandomSource("avalanche"); _rnd->setSeed(42); +} + +AvalancheEngine::~AvalancheEngine() { + delete _console; + delete _rnd; + + delete _graphics; +} - _graph.setParent(this); +Common::ErrorCode AvalancheEngine::initialize() { + _graphics = new Graphics(this); _gyro.setParent(this); _enhanced.setParent(this); @@ -69,13 +79,19 @@ AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription * _dropdown.setParent(this); _closing.setParent(this); _avalot.setParent(this); -} -AvalancheEngine::~AvalancheEngine() { - delete _console; - delete _rnd; + _graphics->init(); + + _scrolls.init(); + _lucerna.init(); + _acci.init(); + _basher.init(); + + + return Common::kNoError; } + GUI::Debugger *AvalancheEngine::getDebugger() { return _console; } @@ -252,17 +268,10 @@ void AvalancheEngine::run_avalot() { Common::Error AvalancheEngine::run() { - s_Engine = this; + Common::ErrorCode err = initialize(); + if (err != Common::kNoError) + return err; - _console = new AvalancheConsole(this); - - _scrolls.init(); - _lucerna.init(); - _acci.init(); - _basher.init(); - _graph.init(); - - // From bootstrp: |
