diff options
author | Eugene Sandulenko | 2016-12-11 15:58:11 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2016-12-11 15:58:11 +0100 |
commit | 817ca2a15fca1fd8f82afe35be3adccf2aa9f59a (patch) | |
tree | e2059e7ffb5717673210a9ccf3abd254085b3459 /engines/fullpipe/modal.cpp | |
parent | df896e40a71b92061b36f4eee974dd730be88974 (diff) | |
download | scummvm-rg350-817ca2a15fca1fd8f82afe35be3adccf2aa9f59a.tar.gz scummvm-rg350-817ca2a15fca1fd8f82afe35be3adccf2aa9f59a.tar.bz2 scummvm-rg350-817ca2a15fca1fd8f82afe35be3adccf2aa9f59a.zip |
FULLPIPE: Initial support for Russian Demo. The demo starts
Diffstat (limited to 'engines/fullpipe/modal.cpp')
-rw-r--r-- | engines/fullpipe/modal.cpp | 130 |
1 files changed, 128 insertions, 2 deletions
diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp index c4c30cb1fb..1c216477ca 100644 --- a/engines/fullpipe/modal.cpp +++ b/engines/fullpipe/modal.cpp @@ -226,8 +226,7 @@ void ModalIntro::update() { } void ModalIntro::finish() { - if (!(g_fp->getFeatures() & ADGF_DEMO && g_fp->getLanguage() == Common::RU_RUS)) - g_fp->_gameLoader->unloadScene(SC_INTRO2); + g_fp->_gameLoader->unloadScene(SC_INTRO2); g_fp->_currentScene = g_fp->accessScene(SC_INTRO1); g_fp->_gameLoader->preloadScene(SC_INTRO1, TrubaDown); @@ -236,6 +235,133 @@ void ModalIntro::finish() { g_fp->_gameLoader->updateSystems(42); } +ModalIntroDemo::ModalIntroDemo() { + _field_8 = 0; + _countDown = 50; + _stillRunning = 0; + _introFlags = 9; + g_vars->sceneIntro_skipIntro = false; + _sfxVolume = g_fp->_sfxVolume; +} + +ModalIntroDemo::~ModalIntroDemo() { + g_fp->stopAllSounds(); + g_fp->_sfxVolume = _sfxVolume; +} + +bool ModalIntroDemo::handleMessage(ExCommand *message) { + if (message->_messageKind != 17) + return false; + + if (message->_messageNum != 36) + return false; + + if (message->_param != 13 && message->_param != 27 && message->_param != 32) + return false; + + if (_introFlags & 0x8) { + _countDown = 0; + g_vars->sceneIntro_needBlackout = true; + return true; + } else if (_stillRunning) { + g_vars->sceneIntro_playing = false; + g_vars->sceneIntro_needBlackout = true; + } + + return true; +} + +bool ModalIntroDemo::init(int counterdiff) { + if (!g_vars->sceneIntro_playing) { + if (!_stillRunning) { + finish(); + return false; + } + + if (_introFlags & 0x10) + g_fp->_gameLoader->updateSystems(42); + + _introFlags |= 2; + + return true; + } + + if (_introFlags & 8) { + _countDown--; + + if (_countDown > 0) + return true; + + if (_stillRunning > 0) { + _introFlags |= 2; + return true; + } + + _countDown = 150; + _introFlags = (_introFlags & 0xf7) | 0x21; + g_fp->accessScene(SC_INTRO1)->getPictureObjectById(522, 0)->_flags &= 0xfffb; + } else { + if (!(_introFlags & 0x20)) + return true; + + _countDown--; + + if (_countDown > 0) + return true; + + if (_stillRunning > 0) { + _introFlags |= 2; + return true; + } + + _introFlags &= 0xDF; + + g_vars->sceneIntro_playing = false; + _stillRunning = 0; + } + + return true; +} + +void ModalIntroDemo::update() { + if (g_fp->_currentScene) { + if (_introFlags & 1) { + if (g_vars->sceneIntro_needBlackout) { + g_fp->drawAlphaRectangle(0, 0, 800, 600, 0); + g_vars->sceneIntro_needBlackout = 0; + } else { + g_fp->sceneFade(g_fp->_currentScene, true); + } + _stillRunning = 255; + _introFlags &= 0xfe; + + if (_introFlags & 0x20) + g_fp->playSound(SND_INTR_019, 0); + } else if (_introFlags & 2) { + if (g_vars->sceneIntro_needBlackout) { + g_fp->drawAlphaRectangle(0, 0, 800, 600, 0); + g_vars->sceneIntro_needBlackout = 0; + _stillRunning = 0; + _introFlags &= 0xfd; + } else { + g_fp->sceneFade(g_fp->_currentScene, false); + _stillRunning = 0; + _introFlags &= 0xfd; + } + } else if (_stillRunning) { + g_fp->_currentScene->draw(); + } + } +} + +void ModalIntroDemo::finish() { + g_fp->_currentScene = g_fp->accessScene(SC_INTRO1); + g_fp->_gameLoader->preloadScene(SC_INTRO1, TrubaDown); + + if (g_fp->_currentScene) + g_fp->_gameLoader->updateSystems(42); +} + void ModalVideoPlayer::play(const char *filename) { Video::AVIDecoder *aviDecoder = new Video::AVIDecoder(); |