diff options
Diffstat (limited to 'engines/gob/pregob/onceupon/onceupon.cpp')
-rw-r--r-- | engines/gob/pregob/onceupon/onceupon.cpp | 87 |
1 files changed, 87 insertions, 0 deletions
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 |