aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gray2004-03-29 11:02:45 +0000
committerJonathan Gray2004-03-29 11:02:45 +0000
commitf12fbe17236698bd81f6bd856bf311eeb7ddbb14 (patch)
tree57b5b54a9b5f5f131e65e1be21d16111e73a569e
parent8f6b452a5028255157b6691943032e2bf85049ec (diff)
downloadscummvm-rg350-f12fbe17236698bd81f6bd856bf311eeb7ddbb14.tar.gz
scummvm-rg350-f12fbe17236698bd81f6bd856bf311eeb7ddbb14.tar.bz2
scummvm-rg350-f12fbe17236698bd81f6bd856bf311eeb7ddbb14.zip
clean up FMUS handling, fix not being able to enable sound debug messages
svn-id: r13425
-rw-r--r--scumm/resource.cpp9
-rw-r--r--scumm/scumm.h1
2 files changed, 5 insertions, 5 deletions
diff --git a/scumm/resource.cpp b/scumm/resource.cpp
index 7160ce14db..a762dff373 100644
--- a/scumm/resource.cpp
+++ b/scumm/resource.cpp
@@ -781,7 +781,6 @@ int ScummEngine::readSoundResource(int type, int idx) {
// Used in 3DO version of puttputt joins the parade and probably others
// Specifies a separate file to be used for music from what I gather.
int tmpsize;
- int i = 0;
File dmuFile;
char buffer[128];
debugC(DEBUG_SOUND, "Found base tag FMUS in sound %d, size %d", idx, total_size);
@@ -796,10 +795,10 @@ int ScummEngine::readSoundResource(int type, int idx) {
tmpsize = _fileHandle.readUint32BE();
// SDAT contains name of file we want
- for (i = 0; (buffer[i] != ' ') && (i < tmpsize - 8) ; i++) {
- buffer[i] = _fileHandle.readByte();
- }
- buffer[tmpsize - 11] = '\0';
+ _fileHandle.read(buffer, tmpsize - 8);
+ // files seem to be 11 chars (8.3) unused space is replaced by spaces
+ *(strstr(buffer, " ")) = '\0';
+
debugC(DEBUG_SOUND, "FMUS file %s", buffer);
if (dmuFile.open(buffer, getGameDataPath()) == false) {
warning("Can't open music file %s*", buffer);
diff --git a/scumm/scumm.h b/scumm/scumm.h
index ed91c0bc87..71af8d3840 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -143,6 +143,7 @@ static const dbgChannelDesc debugChannels[] = {
{"RESOURCE", "Track resource loading/management", DEBUG_RESOURCE},
{"VARS", "Track variable changes", DEBUG_VARS},
{"ACTORS", "Actor-related debug", DEBUG_ACTORS},
+ {"SOUND", "Sound related debug", DEBUG_SOUND},
{"INSANE", "Track INSANE", DEBUG_INSANE}
};