diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/gob/demos/demoplayer.cpp | 45 | ||||
-rw-r--r-- | engines/gob/demos/demoplayer.h | 2 | ||||
-rw-r--r-- | engines/gob/demos/scnplayer.cpp | 2 | ||||
-rw-r--r-- | engines/gob/detection.cpp | 2 |
4 files changed, 50 insertions, 1 deletions
diff --git a/engines/gob/demos/demoplayer.cpp b/engines/gob/demos/demoplayer.cpp index 7f65721ce5..13b7aa5327 100644 --- a/engines/gob/demos/demoplayer.cpp +++ b/engines/gob/demos/demoplayer.cpp @@ -34,6 +34,7 @@ #include "gob/draw.h" #include "gob/inter.h" #include "gob/videoplayer.h" +#include "gob/sound/sound.h" namespace Gob { @@ -186,6 +187,30 @@ void DemoPlayer::playVideo(const char *fileName) { free(filePtr); } +void DemoPlayer::playADL(const char *params) { + const char *end; + + end = strchr(params, ' '); + if (!end) + end = params + strlen(params); + + Common::String fileName(params, end); + bool waitEsc = true; + int32 repeat = -1; + + if (*end != '\0') { + const char *start = end + 1; + + waitEsc = (*start != '0'); + + end = strchr(start, ' '); + if (end) + repeat = atoi(end + 1); + } + + playADL(fileName, waitEsc, repeat); +} + void DemoPlayer::playVideoNormal() { _vm->_vidPlayer->primaryPlay(); } @@ -233,6 +258,26 @@ void DemoPlayer::playVideoDoubled() { } } +void DemoPlayer::playADL(const Common::String &fileName, bool waitEsc, int32 repeat) { + debugC(1, kDebugDemo, "Playing ADL \"%s\" (%d, %d)", fileName.c_str(), waitEsc, repeat); + + _vm->_sound->adlibUnload(); + _vm->_sound->adlibLoadADL(fileName.c_str()); + _vm->_sound->adlibSetRepeating(repeat); + _vm->_sound->adlibPlay(); + + if (!waitEsc) + return; + + int16 key = 0; + while (!_vm->shouldQuit() && (key != kKeyEscape) && _vm->_sound->adlibIsPlaying()) { + _vm->_util->longDelay(1); + while (_vm->_util->checkKey(key)) + if (key == kKeyEscape) + break; + } +} + void DemoPlayer::evaluateVideoMode(const char *mode) { debugC(2, kDebugDemo, "Video mode \"%s\"", mode); diff --git a/engines/gob/demos/demoplayer.h b/engines/gob/demos/demoplayer.h index 64c98b58c5..f0672b9645 100644 --- a/engines/gob/demos/demoplayer.h +++ b/engines/gob/demos/demoplayer.h @@ -57,9 +57,11 @@ protected: void evaluateVideoMode(const char *mode); void clearScreen(); void playVideo(const char *fileName); + void playADL(const char *params); void playVideoNormal(); void playVideoDoubled(); + void playADL(const Common::String &fileName, bool waitEsc = true, int32 repeat = -1); private: enum ScriptSource { diff --git a/engines/gob/demos/scnplayer.cpp b/engines/gob/demos/scnplayer.cpp index 616da3272a..bf81773a15 100644 --- a/engines/gob/demos/scnplayer.cpp +++ b/engines/gob/demos/scnplayer.cpp @@ -66,6 +66,8 @@ bool SCNPlayer::playStream(Common::SeekableReadStream &scn) { _rebase0 = true; } else if (lineStartsWith(line, "REBASE0:OFF")) { _rebase0 = false; + } else if (lineStartsWith(line, "ADL ")) { + playADL(line.c_str() + 4); } // Mind user input diff --git a/engines/gob/detection.cpp b/engines/gob/detection.cpp index 8e5867b46d..6088d622f8 100644 --- a/engines/gob/detection.cpp +++ b/engines/gob/detection.cpp @@ -4299,7 +4299,7 @@ static const GOBGameDescription fallbackDescs[] = { GUIO_NONE }, kGameTypeUrban, - kFeatures640 | kFeaturesSCNDemo, + kFeaturesAdlib | kFeatures640 | kFeaturesSCNDemo, "", "", 8 } }; |