aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/inter_v1.cpp
diff options
context:
space:
mode:
authorSven Hesse2007-01-26 19:00:41 +0000
committerSven Hesse2007-01-26 19:00:41 +0000
commit8e6cd813337ca4ec7ba5124b361583219c151b90 (patch)
tree2b4c64b4a18a5f7161434288293e9f45ecd9501a /engines/gob/inter_v1.cpp
parentd2910fe758ef7dac8657a3a9faa85383a6cf0e9a (diff)
downloadscummvm-rg350-8e6cd813337ca4ec7ba5124b361583219c151b90.tar.gz
scummvm-rg350-8e6cd813337ca4ec7ba5124b361583219c151b90.tar.bz2
scummvm-rg350-8e6cd813337ca4ec7ba5124b361583219c151b90.zip
- Just warn, don't die, when a CD-Track isn't found
- Before using _vm->_adlib, first check whether it's actually there svn-id: r25205
Diffstat (limited to 'engines/gob/inter_v1.cpp')
-rw-r--r--engines/gob/inter_v1.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp
index 5a9862157f..408dcd481c 100644
--- a/engines/gob/inter_v1.cpp
+++ b/engines/gob/inter_v1.cpp
@@ -1210,7 +1210,8 @@ bool Inter_v1::o1_playComposition(char &cmdCount, int16 &counter, int16 &retFlag
}
bool Inter_v1::o1_stopSound(char &cmdCount, int16 &counter, int16 &retFlag) {
- _vm->_adlib->stopPlay();
+ if (_vm->_adlib)
+ _vm->_adlib->stopPlay();
_vm->_snd->stopSound(_vm->_parse->parseValExpr());
_soundEndTimeKey = 0;
return false;
@@ -1640,9 +1641,10 @@ void Inter_v1::o1_loadCurLayer(void) {
void Inter_v1::o1_playCDTrack(void) {
evalExpr(0);
- if (_vm->_features & GF_MAC)
- _vm->_adlib->playTrack(_vm->_global->_inter_resStr);
- else
+ if (_vm->_features & GF_MAC) {
+ if (_vm->_adlib)
+ _vm->_adlib->playTrack(_vm->_global->_inter_resStr);
+ } else
// Used in gob1 CD
_vm->_cdrom->startTrack(_vm->_global->_inter_resStr);
}
@@ -1663,9 +1665,10 @@ void Inter_v1::o1_getCDTrackPos(void) {
}
void Inter_v1::o1_stopCD(void) {
- if (_vm->_features & GF_MAC)
- _vm->_adlib->stopPlay();
- else
+ if (_vm->_features & GF_MAC) {
+ if (_vm->_adlib)
+ _vm->_adlib->stopPlay();
+ } else
// Used in gob1 CD
_vm->_cdrom->stopPlaying();
}
@@ -2587,9 +2590,10 @@ void Inter_v1::o1_animateObjects(int16 &extraData, int32 *retVarPtr, Goblin::Gob
void Inter_v1::o1_drawObjects(int16 &extraData, int32 *retVarPtr, Goblin::Gob_Object *objDesc) {
_vm->_goblin->drawObjects();
- if (_vm->_features & GF_MAC)
- _vm->_adlib->playBgMusic();
- else if (_vm->_cdrom->getTrackPos() == -1)
+ if (_vm->_features & GF_MAC) {
+ if (_vm->_adlib)
+ _vm->_adlib->playBgMusic();
+ } else if (_vm->_cdrom->getTrackPos() == -1)
_vm->_cdrom->playBgMusic();
}