aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/inter_v6.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/gob/inter_v6.cpp')
-rw-r--r--engines/gob/inter_v6.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/engines/gob/inter_v6.cpp b/engines/gob/inter_v6.cpp
index 13b84639f5..453bbef6f2 100644
--- a/engines/gob/inter_v6.cpp
+++ b/engines/gob/inter_v6.cpp
@@ -689,6 +689,10 @@ void Inter_v6::o6_playVmdOrMusic() {
_vm->_sound->bgStop();
return;
} else if (lastFrame == -9) {
+ probe16bitMusic(fileName);
+
+ warning("==> %s", fileName);
+
_vm->_sound->bgStop();
_vm->_sound->bgPlay(fileName, SOUND_WAV);
return;
@@ -902,4 +906,24 @@ bool Inter_v6::o6_freeCollision(OpFuncParams &params) {
return false;
}
+void Inter_v6::probe16bitMusic(char *fileName) {
+ int len = strlen(fileName);
+
+ if (len < 4)
+ return;
+
+ if (scumm_stricmp(fileName + len - 4, ".WA8"))
+ return;
+
+ fileName[len - 1] = 'V';
+
+ int16 handle;
+ if ((handle = _vm->_dataIO->openData(fileName)) >= 0) {
+ _vm->_dataIO->closeData(handle);
+ return;
+ }
+
+ fileName[len - 1] = '8';
+}
+
} // End of namespace Gob