aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2012-12-26 00:31:42 +0100
committerStrangerke2012-12-26 00:31:42 +0100
commit59e85997b3debece5e920d7612fe33ccc9931934 (patch)
treebd9fd522919b3b1d9a917eeb89500c6edd15bfaa /engines
parent2b665c67cb85feec4e273162a38275f86d26f08e (diff)
downloadscummvm-rg350-59e85997b3debece5e920d7612fe33ccc9931934.tar.gz
scummvm-rg350-59e85997b3debece5e920d7612fe33ccc9931934.tar.bz2
scummvm-rg350-59e85997b3debece5e920d7612fe33ccc9931934.zip
HOPKINS: Load correct voice ressource file in BeOS and OS/2 versions
Diffstat (limited to 'engines')
-rw-r--r--engines/hopkins/files.cpp25
-rw-r--r--engines/hopkins/sound.cpp43
-rw-r--r--engines/hopkins/sound.h2
3 files changed, 41 insertions, 29 deletions
diff --git a/engines/hopkins/files.cpp b/engines/hopkins/files.cpp
index 6fefd1eb22..1971b82a2a 100644
--- a/engines/hopkins/files.cpp
+++ b/engines/hopkins/files.cpp
@@ -221,16 +221,21 @@ byte *FileManager::searchCat(const Common::String &file, int a2) {
break;
case 9:
- switch (_vm->_globals._language) {
- case LANG_EN:
- constructFilename(_vm->_globals.HOPLINK, "RES_VAN.CAT");
- break;
- case LANG_FR:
- constructFilename(_vm->_globals.HOPLINK, "RES_VFR.CAT");
- break;
- case LANG_SP:
- constructFilename(_vm->_globals.HOPLINK, "RES_VES.CAT");
- break;
+ if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS)
+ _vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "ENG_VOI.RES");
+ // Win95 and Linux versions uses another set of names
+ else {
+ switch (_vm->_globals._language) {
+ case LANG_EN:
+ constructFilename(_vm->_globals.HOPLINK, "RES_VAN.CAT");
+ break;
+ case LANG_FR:
+ constructFilename(_vm->_globals.HOPLINK, "RES_VFR.CAT");
+ break;
+ case LANG_SP:
+ constructFilename(_vm->_globals.HOPLINK, "RES_VES.CAT");
+ break;
+ }
}
if (!f.exists(_vm->_globals.NFICHIER))
diff --git a/engines/hopkins/sound.cpp b/engines/hopkins/sound.cpp
index 87a588509f..e742b50be9 100644
--- a/engines/hopkins/sound.cpp
+++ b/engines/hopkins/sound.cpp
@@ -117,7 +117,7 @@ void SoundManager::WSOUND_INIT() {
void SoundManager::VERIF_SOUND() {
if (!_soundOffFl && _soundFl) {
if (!VOICE_STAT(1)) {
- STOP_VOICE(1);
+ stopVoice(1);
DEL_NWAV(SOUND_NUM);
}
}
@@ -359,9 +359,9 @@ void SoundManager::WSOUND(int soundNumber) {
}
void SoundManager::WSOUND_OFF() {
- STOP_VOICE(0);
- STOP_VOICE(1);
- STOP_VOICE(2);
+ stopVoice(0);
+ stopVoice(1);
+ stopVoice(2);
if (_vm->_soundManager._soundFl)
DEL_NWAV(SOUND_NUM);
@@ -472,6 +472,7 @@ void SoundManager::checkSounds() {
}
void SoundManager::checkMusic() {
+ // OS2 and BeOS versions use MOD files.
if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS)
return;
@@ -616,7 +617,10 @@ bool SoundManager::mixVoice(int voiceId, int voiceMode) {
filename = Common::String::format("%s%d", prefix.c_str(), fileNumber);
if (!_vm->_fileManager.searchCat(filename + ".WAV", 9)) {
- if (_vm->_globals._language == LANG_FR)
+ if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS)
+ _vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "ENG_VOI.RES");
+ // Win95 and Linux versions uses another set of names
+ else if (_vm->_globals._language == LANG_FR)
_vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "RES_VFR.RES");
else if (_vm->_globals._language == LANG_EN)
_vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "RES_VAN.RES");
@@ -626,7 +630,10 @@ bool SoundManager::mixVoice(int voiceId, int voiceMode) {
catPos = _vm->_globals._catalogPos;
catLen = _vm->_globals._catalogSize;
} else if (!_vm->_fileManager.searchCat(filename + ".APC", 9)) {
- if (_vm->_globals._language == LANG_FR)
+ if (_vm->getPlatform() == Common::kPlatformOS2 || _vm->getPlatform() == Common::kPlatformBeOS)
+ _vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "ENG_VOI.RES");
+ // Win95 and Linux versions uses another set of names
+ else if (_vm->_globals._language == LANG_FR)
_vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "RES_VFR.RES");
else if (_vm->_globals._language == LANG_EN)
_vm->_fileManager.constructFilename(_vm->_globals.HOPVOICE, "RES_VAN.RES");
@@ -669,7 +676,7 @@ bool SoundManager::mixVoice(int voiceId, int voiceMode) {
} while (!_vm->shouldQuit() && !breakFlag);
- STOP_VOICE(2);
+ stopVoice(2);
DEL_SAMPLE_SDL(20);
MUSICVOL = oldMusicVol;
_vm->_eventsManager._escKeyFl = false;
@@ -679,11 +686,11 @@ bool SoundManager::mixVoice(int voiceId, int voiceMode) {
void SoundManager::DEL_SAMPLE(int soundIndex) {
if (VOICE_STAT(1) == 1)
- STOP_VOICE(1);
+ stopVoice(1);
if (VOICE_STAT(2) == 2)
- STOP_VOICE(2);
+ stopVoice(2);
if (VOICE_STAT(3) == 3)
- STOP_VOICE(3);
+ stopVoice(3);
DEL_SAMPLE_SDL(soundIndex);
SOUND[soundIndex]._active = false;
}
@@ -728,22 +735,22 @@ void SoundManager::PLAY_SAMPLE(int wavIndex, int voiceMode) {
DEL_NWAV(SOUND_NUM);
if (voiceMode == 5) {
if (VOICE_STAT(1) == 1)
- STOP_VOICE(1);
+ stopVoice(1);
PLAY_SAMPLE_SDL(1, wavIndex);
}
if (voiceMode == 6) {
if (VOICE_STAT(2) == 1)
- STOP_VOICE(1);
+ stopVoice(1);
PLAY_SAMPLE_SDL(2, wavIndex);
}
if (voiceMode == 7) {
if (VOICE_STAT(3) == 1)
- STOP_VOICE(1);
+ stopVoice(1);
PLAY_SAMPLE_SDL(3, wavIndex);
}
if (voiceMode == 8) {
if (VOICE_STAT(1) == 1)
- STOP_VOICE(1);
+ stopVoice(1);
PLAY_SAMPLE_SDL(1, wavIndex);
}
}
@@ -754,7 +761,7 @@ void SoundManager::PLAY_SAMPLE2(int idx) {
if (_soundFl)
DEL_NWAV(SOUND_NUM);
if (VOICE_STAT(1) == 1)
- STOP_VOICE(1);
+ stopVoice(1);
PLAY_SAMPLE_SDL(1, idx);
}
}
@@ -771,13 +778,13 @@ int SoundManager::VOICE_STAT(int voiceIndex) {
if (Voice[voiceIndex]._status) {
int wavIndex = Voice[voiceIndex]._wavIndex;
if (Swav[wavIndex]._audioStream != NULL && Swav[wavIndex]._audioStream->endOfStream())
- STOP_VOICE(voiceIndex);
+ stopVoice(voiceIndex);
}
return Voice[voiceIndex]._status;
}
-void SoundManager::STOP_VOICE(int voiceIndex) {
+void SoundManager::stopVoice(int voiceIndex) {
if (Voice[voiceIndex]._status) {
Voice[voiceIndex]._status = 0;
int wavIndex = Voice[voiceIndex]._wavIndex;
@@ -864,7 +871,7 @@ void SoundManager::PLAY_NWAV(int wavIndex) {
void SoundManager::DEL_NWAV(int wavIndex) {
if (DEL_SAMPLE_SDL(wavIndex)) {
if (VOICE_STAT(1) == 1)
- STOP_VOICE(1);
+ stopVoice(1);
SOUND_NUM = 0;
_soundFl = false;
diff --git a/engines/hopkins/sound.h b/engines/hopkins/sound.h
index 23fac3f705..2fa4670d48 100644
--- a/engines/hopkins/sound.h
+++ b/engines/hopkins/sound.h
@@ -83,7 +83,7 @@ private:
HopkinsEngine *_vm;
int VOICE_STAT(int voiceIndex);
- void STOP_VOICE(int voiceIndex);
+ void stopVoice(int voiceIndex);
void SDL_LVOICE(size_t filePosition, size_t entryLength);
void PLAY_VOICE_SDL();
bool DEL_SAMPLE_SDL(int wavIndex);