aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/agi.cpp
diff options
context:
space:
mode:
authorAlyssa Milburn2011-08-22 20:03:05 +0200
committerAlyssa Milburn2011-08-22 20:03:05 +0200
commit84063dc9727a9f55e09d39574027beab695680e6 (patch)
treed71a9599cb550d9f7949a2d3209574064e054d85 /engines/agi/agi.cpp
parentc6e89df3d940747a85d447f172e2323c800f5eaf (diff)
parenta39a3eda46aea108a51556f001617ad28d29e520 (diff)
downloadscummvm-rg350-84063dc9727a9f55e09d39574027beab695680e6.tar.gz
scummvm-rg350-84063dc9727a9f55e09d39574027beab695680e6.tar.bz2
scummvm-rg350-84063dc9727a9f55e09d39574027beab695680e6.zip
Merge remote-tracking branch 'origin/master' into soltys_wip2
Diffstat (limited to 'engines/agi/agi.cpp')
-rw-r--r--engines/agi/agi.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp
index 0eefbab04d..4bebf97e95 100644
--- a/engines/agi/agi.cpp
+++ b/engines/agi/agi.cpp
@@ -504,6 +504,7 @@ AgiBase::AgiBase(OSystem *syst, const AGIGameDescription *gameDesc) : Engine(sys
_noSaveLoadAllowed = false;
_rnd = new Common::RandomSource("agi");
+ _sound = 0;
initFeatures();
initVersion();
@@ -511,6 +512,11 @@ AgiBase::AgiBase(OSystem *syst, const AGIGameDescription *gameDesc) : Engine(sys
AgiBase::~AgiBase() {
delete _rnd;
+
+ if (_sound) {
+ _sound->deinitSound();
+ delete _sound;
+ }
}
AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBase(syst, gameDesc) {
@@ -536,6 +542,8 @@ AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBas
memset(&_debug, 0, sizeof(struct AgiDebug));
memset(&_mouse, 0, sizeof(struct Mouse));
+ _game._vm = this;
+
_game.clockEnabled = false;
_game.state = STATE_INIT;
@@ -571,7 +579,7 @@ AgiEngine::AgiEngine(OSystem *syst, const AGIGameDescription *gameDesc) : AgiBas
_game.controllerOccured[i] = false;
setupOpcodes();
- _curLogic = NULL;
+ _game._curLogic = NULL;
_timerHack = 0;
}
@@ -680,8 +688,6 @@ AgiEngine::~AgiEngine() {
agiDeinit();
delete _loader;
- _sound->deinitSound();
- delete _sound;
_gfx->deinitVideo();
delete _sprites;
delete _picture;