aboutsummaryrefslogtreecommitdiff
path: root/sword1
diff options
context:
space:
mode:
authorTorbjörn Andersson2004-10-14 06:36:05 +0000
committerTorbjörn Andersson2004-10-14 06:36:05 +0000
commit5a0673c0de9fd849da235deb9627940399a109ca (patch)
treec9a4df3e736fb9ec7643498853577456eff4dd2e /sword1
parent086724d774399aa0b101d2503929e3fca54813d5 (diff)
downloadscummvm-rg350-5a0673c0de9fd849da235deb9627940399a109ca.tar.gz
scummvm-rg350-5a0673c0de9fd849da235deb9627940399a109ca.tar.bz2
scummvm-rg350-5a0673c0de9fd849da235deb9627940399a109ca.zip
The checkCdFiles() function still looked only for SPEECH1.CLU and
SPEECH2.CLU. Now it also looks for the corresponding CL3 and CLV files. svn-id: r15545
Diffstat (limited to 'sword1')
-rw-r--r--sword1/sword1.cpp37
1 files changed, 27 insertions, 10 deletions
diff --git a/sword1/sword1.cpp b/sword1/sword1.cpp
index 28ea10326c..3ba4dc926b 100644
--- a/sword1/sword1.cpp
+++ b/sword1/sword1.cpp
@@ -1070,20 +1070,37 @@ void SwordEngine::startPositions(int32 startNumber) {
}
void SwordEngine::checkCdFiles(void) { // check if we're running from cd, hdd or what...
+ const char *speechFiles[] = {
+#ifdef USE_MAD
+ "SPEECH%d.CL3",
+#endif
+#ifdef USE_VORBIS
+ "SPEECH%d.CLV",
+#endif
+ "SPEECH%d.CLU"
+ };
+ int numFiles = 0;
File test;
_systemVars.playSpeech = true;
- if (test.open("SPEECH1.CLU")) {
- test.close();
- if (test.open("SPEECH2.CLU")) {
- // both files exist, assume running from HDD and everything's fine.
- test.close();
- _systemVars.runningFromCd = false;
- _systemVars.playSpeech = true;
- return ;
- } else {
+
+ for (int i = 1; i <= 2; i++) {
+ for (int j = 0; j < ARRAYSIZE(speechFiles); j++) {
+ char fileName[12];
+ sprintf(fileName, speechFiles[j], i);
+ if (test.open(fileName)) {
+ test.close();
+ numFiles++;
+ break;
+ }
}
- } else { // speech1.clu & speech2.clu not present. are we running from cd?
+ }
+
+ if (numFiles == 2) {
+ // both files exist, assume running from HDD and everything's fine.
+ _systemVars.runningFromCd = false;
+ _systemVars.playSpeech = true;
+ } else { // speech1 & speech2 not present. are we running from cd?
if (test.open("cd1.id")) {
_systemVars.runningFromCd = true;
_systemVars.currentCD = 1;