diff options
Diffstat (limited to 'engines/gob')
-rw-r--r-- | engines/gob/pregob/onceupon/abracadabra.cpp | 2 | ||||
-rw-r--r-- | engines/gob/pregob/onceupon/babayaga.cpp | 2 | ||||
-rw-r--r-- | engines/gob/pregob/onceupon/onceupon.cpp | 87 | ||||
-rw-r--r-- | engines/gob/pregob/onceupon/onceupon.h | 7 |
4 files changed, 96 insertions, 2 deletions
diff --git a/engines/gob/pregob/onceupon/abracadabra.cpp b/engines/gob/pregob/onceupon/abracadabra.cpp index d8dd8b3be0..8ece3d1c27 100644 --- a/engines/gob/pregob/onceupon/abracadabra.cpp +++ b/engines/gob/pregob/onceupon/abracadabra.cpp @@ -61,7 +61,7 @@ void Abracadabra::run() { if (_vm->shouldQuit() || !correctCP) return; - warning("TODO: Abracadabra::run()"); + showTitle(); } } // End of namespace OnceUpon diff --git a/engines/gob/pregob/onceupon/babayaga.cpp b/engines/gob/pregob/onceupon/babayaga.cpp index aad1fc6aca..1eb603492b 100644 --- a/engines/gob/pregob/onceupon/babayaga.cpp +++ b/engines/gob/pregob/onceupon/babayaga.cpp @@ -61,7 +61,7 @@ void BabaYaga::run() { if (_vm->shouldQuit() || !correctCP) return; - warning("TODO: BabaYaga::run()"); + showTitle(); } } // End of namespace OnceUpon diff --git a/engines/gob/pregob/onceupon/onceupon.cpp b/engines/gob/pregob/onceupon/onceupon.cpp index aa85e1c095..a5d05ce8c3 100644 --- a/engines/gob/pregob/onceupon/onceupon.cpp +++ b/engines/gob/pregob/onceupon/onceupon.cpp @@ -30,6 +30,8 @@ #include "gob/anifile.h" #include "gob/aniobject.h" +#include "gob/sound/sound.h" + #include "gob/pregob/onceupon/onceupon.h" static const int kPaletteSize = 16; @@ -487,6 +489,91 @@ void OnceUpon::setAnimState(ANIObject &ani, uint16 state, bool once, bool pause) ani.setPosition(); } +void OnceUpon::showTitle() { + // Show the Once Upon A Time title animation + // NOTE: This is currently only a mock-up. The real animation is in "ville.seq". + + fadeOut(); + setGamePalette(10); + + warning("OnceUpon::showTitle(): Actually play the SEQ"); + + clearScreen(); + + _vm->_video->drawPackedSprite("ville.cmp", *_vm->_draw->_backSurface); + _vm->_draw->forceBlit(); + + ANIFile ani (_vm, "pres.ani", 320); + ANIObject title(ani); + + setAnimState(title, 8, false, false); + + playTitleMusic(); + + while (!_vm->shouldQuit()) { + redrawAnim(title); + + fadeIn(); + + endFrame(true); + + if (hasInput()) + break; + } + + fadeOut(); + stopTitleMusic(); +} + +void OnceUpon::playTitleMusic() { + if (_vm->getPlatform() == Common::kPlatformPC) + playTitleMusicDOS(); + else if (_vm->getPlatform() == Common::kPlatformAmiga) + playTitleMusicAmiga(); + else if (_vm->getPlatform() == Common::kPlatformAtariST) + playTitleMusicAtariST(); +} + +void OnceUpon::playTitleMusicDOS() { + // Play an AdLib track + + _vm->_sound->adlibLoadTBR("babayaga.tbr"); + _vm->_sound->adlibLoadMDY("babayaga.mdy"); + _vm->_sound->adlibSetRepeating(-1); + _vm->_sound->adlibPlay(); +} + +void OnceUpon::playTitleMusicAmiga() { + // Play a Protracker track + + _vm->_sound->protrackerPlay("mod.babayaga"); +} + +void OnceUpon::playTitleMusicAtariST() { + // Play a Soundblaster composition + + static const int16 titleMusic[21] = { 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 2, 0, 1, 0, 0, 0, 0, 0, -1}; + static const char * const titleFiles[ 3] = {"baba1.snd", "baba2.snd", "baba3.snd"}; + + for (uint i = 0; i < ARRAYSIZE(titleFiles); i++) + _vm->_sound->sampleLoad(_vm->_sound->sampleGetBySlot(i), SOUND_SND, titleFiles[i]); + + _vm->_sound->blasterPlayComposition(titleMusic, 0); + _vm->_sound->blasterRepeatComposition(-1); +} + +void OnceUpon::stopTitleMusic() { + _vm->_sound->adlibSetRepeating(0); + _vm->_sound->blasterRepeatComposition(0); + + _vm->_sound->adlibStop(); + _vm->_sound->blasterStopComposition(); + _vm->_sound->protrackerStop(); + + for (int i = 0; i < Sound::kSoundsCount; i++) + _vm->_sound->sampleFree(_vm->_sound->sampleGetBySlot(i)); +} + } // End of namespace OnceUpon } // End of namespace Gob diff --git a/engines/gob/pregob/onceupon/onceupon.h b/engines/gob/pregob/onceupon/onceupon.h index abcde68b81..8b454e01f3 100644 --- a/engines/gob/pregob/onceupon/onceupon.h +++ b/engines/gob/pregob/onceupon/onceupon.h @@ -49,6 +49,8 @@ protected: bool doCopyProtection(const uint8 colors[7], const uint8 shapes[7 * 20], const uint8 obfuscate[4]); + void showTitle(); + Font *_jeudak; Font *_lettre; @@ -65,6 +67,11 @@ private: int8 cpFindShape(int16 x, int16 y) const; void cpWrong(); + void playTitleMusic(); + void playTitleMusicDOS(); + void playTitleMusicAmiga(); + void playTitleMusicAtariST(); + void stopTitleMusic(); bool _openedArchives; }; |