aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/he/sound_he.cpp
diff options
context:
space:
mode:
authorMax Horn2006-04-23 17:33:16 +0000
committerMax Horn2006-04-23 17:33:16 +0000
commit0d67640a58b044ade0605319e091df9b2f666e4a (patch)
treefcec3906ad2abb5ea28072663193a7cce9282e83 /engines/scumm/he/sound_he.cpp
parentd11f5724f96107a07d462be2410d93f55bd1fba2 (diff)
downloadscummvm-rg350-0d67640a58b044ade0605319e091df9b2f666e4a.tar.gz
scummvm-rg350-0d67640a58b044ade0605319e091df9b2f666e4a.tar.bz2
scummvm-rg350-0d67640a58b044ade0605319e091df9b2f666e4a.zip
Behold, the new SCUMM detector finally has arrived. Unified detection & engine instantiation, reduced code duplication, more powerful detection in case MD5 is not known / can't be computed, and many other nifty improvements.
svn-id: r22110
Diffstat (limited to 'engines/scumm/he/sound_he.cpp')
-rw-r--r--engines/scumm/he/sound_he.cpp18
1 files changed, 3 insertions, 15 deletions
diff --git a/engines/scumm/he/sound_he.cpp b/engines/scumm/he/sound_he.cpp
index 57a03ed129..86221aea88 100644
--- a/engines/scumm/he/sound_he.cpp
+++ b/engines/scumm/he/sound_he.cpp
@@ -161,15 +161,9 @@ void Sound::setOverrideFreq(int freq) {
void Sound::setupHEMusicFile() {
int i, total_size;
- char buf[32], buf1[128];
Common::File musicFile;
+ Common::String buf(_vm->generateFilename(4));
- sprintf(buf, "%s.he4", _vm->getBaseName());
-
- if (_vm->_substResFileName.almostGameID != 0) {
- _vm->generateSubstResFileName(buf, buf1, sizeof(buf1));
- strcpy(buf, buf1);
- }
if (musicFile.open(buf) == true) {
musicFile.seek(4, SEEK_SET);
total_size = musicFile.readUint32BE();
@@ -360,17 +354,11 @@ void Sound::playHESound(int soundID, int heOffset, int heChannel, int heFlags) {
if (soundID > _vm->_numSounds) {
int music_offs;
- char buf[32], buf1[128];
Common::File musicFile;
+ Common::String buf(_vm->generateFilename(4));
- sprintf(buf, "%s.he4", _vm->getBaseName());
-
- if (_vm->_substResFileName.almostGameID != 0) {
- _vm->generateSubstResFileName(buf, buf1, sizeof(buf1));
- strcpy(buf, buf1);
- }
if (musicFile.open(buf) == false) {
- warning("playHESound: Can't open music file %s", buf);
+ warning("playHESound: Can't open music file %s", buf.c_str());
return;
}
if (!getHEMusicDetails(soundID, music_offs, size)) {