diff options
author | Travis Howell | 2003-11-18 05:14:18 +0000 |
---|---|---|
committer | Travis Howell | 2003-11-18 05:14:18 +0000 |
commit | c90d4c4e08e8946589c84a1281ca582e84946f8f (patch) | |
tree | 9fe601bcf0734c085867186cfa3b4c1d0ee5afe5 | |
parent | 5589cdc10cc4389ea010b1362f51b6b907bc9ded (diff) | |
download | scummvm-rg350-c90d4c4e08e8946589c84a1281ca582e84946f8f.tar.gz scummvm-rg350-c90d4c4e08e8946589c84a1281ca582e84946f8f.tar.bz2 scummvm-rg350-c90d4c4e08e8946589c84a1281ca582e84946f8f.zip |
Alter old demo check
Stop crash on exit with comi demo
svn-id: r11341
-rw-r--r-- | scumm/charset.cpp | 5 | ||||
-rw-r--r-- | scumm/sound.cpp | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/scumm/charset.cpp b/scumm/charset.cpp index ff4ce0ea51..d4c8b4b893 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -1238,8 +1238,11 @@ CharsetRendererNut::CharsetRendererNut(ScummEngine *vm) } CharsetRendererNut::~CharsetRendererNut() { - for (int i = 0; i < 5; i++) + for (int i = 0; i < 5; i++) { + if ((_vm->_gameId == GID_CMI) && (_vm->_features & GF_DEMO) && (i == 4)) + break; delete _fr[i]; + } } void CharsetRendererNut::setCurID(byte id) { diff --git a/scumm/sound.cpp b/scumm/sound.cpp index 7f486ee209..6e63cb17c1 100644 --- a/scumm/sound.cpp +++ b/scumm/sound.cpp @@ -1242,10 +1242,10 @@ void Sound::playBundleSound(char *sound, PlayingSoundHandle *handle) { return; if (_scumm->_gameId == GID_CMI) { - char voxfile[20]; if (_scumm->_features & GF_DEMO) { result = _bundle->openVoiceFile("voice.bun", _scumm->getGameDataPath()); } else { + char voxfile[20]; sprintf(voxfile, "voxdisk%d.bun", _scumm->VAR(_scumm->VAR_CURRENTDISK)); if (_voiceDisk != _scumm->VAR(_scumm->VAR_CURRENTDISK)) _bundle->closeVoiceFile(); @@ -1270,7 +1270,7 @@ void Sound::playBundleSound(char *sound, PlayingSoundHandle *handle) { if (_scumm->_gameId == GID_CMI) { char name[20]; strcpy(name, sound); - if (_scumm->_maxRooms != 6) // CMI demo does not have .IMX for voice but does for music... + if (!(_scumm->_features & GF_DEMO)) // CMI demo does not have .IMX for voice but does for music... strcat(name, ".IMX"); output_size = _bundle->decompressVoiceSampleByName(name, &ptr); } else { |