aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/hopkins/hopkins.cpp19
-rw-r--r--engines/hopkins/script.cpp32
-rw-r--r--engines/hopkins/sound.cpp25
-rw-r--r--engines/hopkins/sound.h1
4 files changed, 58 insertions, 19 deletions
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp
index b0487c1cfc..062337df4d 100644
--- a/engines/hopkins/hopkins.cpp
+++ b/engines/hopkins/hopkins.cpp
@@ -126,6 +126,8 @@ Common::Error HopkinsEngine::run() {
}
bool HopkinsEngine::runWin95Demo() {
+ _globals.SVGA = 1;
+
_globals.CHARGE_OBJET();
_objectsManager.CHANGE_OBJET(14);
_objectsManager.AJOUTE_OBJET(14);
@@ -225,7 +227,7 @@ LABEL_18:
if (!_globals.FR)
_graphicsManager.LOAD_IMAGE("fondan");
_graphicsManager.FADE_INW();
- _eventsManager.delay(0x1F4u);
+ _eventsManager.delay(500);
_graphicsManager.FADE_OUTW();
_globals.iRegul = 1;
_soundManager.SPECIAL_SOUND = 2;
@@ -234,9 +236,9 @@ LABEL_18:
_graphicsManager.DD_UNLOCK();
_graphicsManager.Cls_Pal();
if (!_globals.CENSURE)
- _animationManager.PLAY_ANM("BANQUE.ANM", 200, 200, 28);
+ _animationManager.PLAY_ANM("BANQUE.ANM", 200, 28, 200);
else
- _animationManager.PLAY_ANM("BANKUK.ANM", 200, 200, 28);
+ _animationManager.PLAY_ANM("BANKUK.ANM", 200, 28, 200);
_soundManager.SPECIAL_SOUND = 0;
_soundManager.DEL_SAMPLE(1);
_soundManager.DEL_SAMPLE(2);
@@ -2063,6 +2065,13 @@ void HopkinsEngine::PASS() {
}
}
+void HopkinsEngine::NO_DISPO(int sortie) {
+ // Use the code of the linux demo instead of the code of the Windows demo.
+ // The behavior is somewhat better, and common code is easier to maintain.
+ PASS();
+ _globals.SORTIE = sortie;
+}
+
void HopkinsEngine::ENDEMO() {
_soundManager.WSOUND(28);
if (_globals.FR == 1)
@@ -3094,10 +3103,6 @@ void HopkinsEngine::syncSoundSettings() {
_soundManager.syncSoundSettings();
}
-void HopkinsEngine::NO_DISPO(int sortie) {
- warning("STUB - NO_DISPO");
-}
-
bool HopkinsEngine::ADULT() {
int xp, yp;
int buttonIndex;
diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp
index d0b086c6e7..0898556e41 100644
--- a/engines/hopkins/script.cpp
+++ b/engines/hopkins/script.cpp
@@ -630,11 +630,13 @@ LABEL_1141:
_vm->_graphicsManager.AFFICHE_SPEED(_vm->_globals.SPRITE_ECRAN, 513, 163, 7);
_vm->_globals.NO_VISU = false;
_vm->_objectsManager.OPTI_ONE(6, 0, 16, 4);
- if (_vm->_globals.SVGA == 1)
- _vm->_animationManager.PLAY_ANM("BOMBE3.ANM", 50, 14, 500);
- if (_vm->_globals.SVGA == 2)
- _vm->_animationManager.PLAY_ANM("BOMBE3A.ANM", 50, 14, 500);
- memset(_vm->_graphicsManager.VESA_BUFFER, 0, 0x96000u);
+ if ((_vm->getPlatform() != Common::kPlatformWindows) || !_vm->getIsDemo()) {
+ if (_vm->_globals.SVGA == 1)
+ _vm->_animationManager.PLAY_ANM("BOMBE3.ANM", 50, 14, 500);
+ if (_vm->_globals.SVGA == 2)
+ _vm->_animationManager.PLAY_ANM("BOMBE3A.ANM", 50, 14, 500);
+ memset(_vm->_graphicsManager.VESA_BUFFER, 0, 0x96000u);
+ }
_vm->_globals.SORTIE = 6;
}
if (v76 == 607) {
@@ -697,9 +699,15 @@ LABEL_1141:
_vm->_fontManager.TEXTE_OFF(9);
_vm->_graphicsManager.FIN_VISU();
_vm->_objectsManager.CLEAR_ECRAN();
- _vm->_soundManager.PLAY_SOUND("SOUND17.WAV");
- _vm->_graphicsManager.FADE_LINUX = 2;
- _vm->_animationManager.PLAY_SEQ2("HELICO.SEQ", 10, 4, 10);
+
+ if ((_vm->getPlatform() == Common::kPlatformWindows) && _vm->getIsDemo()) {
+ _vm->_graphicsManager.FADE_OUTW();
+ } else {
+ _vm->_soundManager.PLAY_SOUND("SOUND17.WAV");
+ _vm->_graphicsManager.FADE_LINUX = 2;
+ _vm->_animationManager.PLAY_SEQ2("HELICO.SEQ", 10, 4, 10);
+ }
+
_vm->_animationManager.CHARGE_ANIM("otage");
_vm->_graphicsManager.LOAD_IMAGE("IM05");
_vm->_graphicsManager.VISU_ALL();
@@ -744,10 +752,18 @@ LABEL_1141:
_vm->_objectsManager.SCI_OPTI_ONE(1, 0, 17, 3);
_vm->_graphicsManager.FADE_OUTW_LINUX(_vm->_graphicsManager.VESA_BUFFER);
_vm->_graphicsManager.FIN_VISU();
+
+ if ((_vm->getPlatform() == Common::kPlatformWindows) && _vm->getIsDemo())
+ _vm->_soundManager.PLAY_SOUND("SOUND17.WAV");
+
_vm->_soundManager.SPECIAL_SOUND = 14;
_vm->_graphicsManager.FADE_LINUX = 2;
_vm->_animationManager.PLAY_SEQ2("ASSOM.SEQ", 10, 4, 500);
_vm->_soundManager.SPECIAL_SOUND = 0;
+
+ if ((_vm->getPlatform() == Common::kPlatformWindows) && _vm->getIsDemo())
+ _vm->_graphicsManager.FADE_OUTW();
+
_vm->_globals.DESACTIVE_INVENT = false;
_vm->_globals.HELICO = 1;
}
diff --git a/engines/hopkins/sound.cpp b/engines/hopkins/sound.cpp
index 08f6f4abff..6b2f5b3053 100644
--- a/engines/hopkins/sound.cpp
+++ b/engines/hopkins/sound.cpp
@@ -426,8 +426,11 @@ void SoundManager::checkVoices() {
void SoundManager::LOAD_MSAMPLE(int mwavIndex, const Common::String &file) {
if (!Mwav[mwavIndex]._active) {
Common::File f;
- if (!f.open(file))
- error("Could not open %s for reading", file.c_str());
+ if (!f.open(file)) {
+ // Fallback from WAV to APC...
+ if (!f.open(setExtension(file, ".APC")))
+ error("Could not open %s for reading", file.c_str());
+ }
Mwav[mwavIndex]._audioStream = makeSoundStream(f.readStream(f.size()));
Mwav[mwavIndex]._active = true;
@@ -722,8 +725,11 @@ bool SoundManager::DEL_SAMPLE_SDL(int wavIndex) {
bool SoundManager::SDL_LoadVoice(const Common::String &filename, size_t fileOffset, size_t entryLength, SwavItem &item) {
Common::File f;
- if (!f.open(filename))
- error("Could not open %s for reading", filename.c_str());
+ if (!f.open(filename)) {
+ // Fallback from WAV to APC...
+ if (!f.open(setExtension(filename, ".APC")))
+ error("Could not open %s for reading", filename.c_str());
+ }
f.seek(fileOffset);
item._audioStream = makeSoundStream(f.readStream((entryLength == 0) ? f.size() : entryLength));
@@ -836,4 +842,15 @@ Audio::RewindableAudioStream *SoundManager::makeSoundStream(Common::SeekableRead
return Audio::makeWAVStream(stream, DisposeAfterUse::YES);
}
+// Blatant rip from gob engine. Hi DrMcCoy!
+Common::String SoundManager::setExtension(const Common::String &str, const Common::String &ext) {
+ if (str.empty())
+ return str;
+
+ const char *dot = strrchr(str.c_str(), '.');
+ if (dot)
+ return Common::String(str.c_str(), dot - str.c_str()) + ext;
+
+ return str + ext;
+}
} // End of namespace Hopkins
diff --git a/engines/hopkins/sound.h b/engines/hopkins/sound.h
index 75cb29789c..e5562437ef 100644
--- a/engines/hopkins/sound.h
+++ b/engines/hopkins/sound.h
@@ -168,6 +168,7 @@ public:
void syncSoundSettings();
void updateScummVMSoundSettings();
void checkSounds();
+ Common::String setExtension(const Common::String &str, const Common::String &ext);
};
} // End of namespace Hopkins