diff options
Diffstat (limited to 'engines/fullpipe')
-rw-r--r-- | engines/fullpipe/constants.h | 6 | ||||
-rw-r--r-- | engines/fullpipe/detection.cpp | 8 | ||||
-rw-r--r-- | engines/fullpipe/fullpipe.h | 4 | ||||
-rw-r--r-- | engines/fullpipe/modal.cpp | 95 | ||||
-rw-r--r-- | engines/fullpipe/modal.h | 20 | ||||
-rw-r--r-- | engines/fullpipe/scenes/scene08.cpp | 12 |
6 files changed, 141 insertions, 4 deletions
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h index 236b4be7cc..da80ef3c5f 100644 --- a/engines/fullpipe/constants.h +++ b/engines/fullpipe/constants.h @@ -368,6 +368,12 @@ namespace Fullpipe { #define PIC_MSV_SPACE_D 5190 #define PIC_MSV_SPACE_L 5191 +// Demo screen +#define PIC_POST_BGR 5396 +#define PIC_POST_TEXT 5397 +#define PIC_POST_BUTTON 5398 +#define SND_CMN_069 4969 + // Intro #define ANI_IN1MAN 5110 #define MSG_INTR_ENDINTRO 5139 diff --git a/engines/fullpipe/detection.cpp b/engines/fullpipe/detection.cpp index e42de65543..ceda26a656 100644 --- a/engines/fullpipe/detection.cpp +++ b/engines/fullpipe/detection.cpp @@ -31,8 +31,12 @@ namespace Fullpipe { -const char *FullpipeEngine::getGameId() const { - return _gameDescription->gameId; +uint32 FullpipeEngine::getFeatures() const { + return _gameDescription->flags; +} + +Common::Language FullpipeEngine::getLanguage() const { + return _gameDescription->language; } } diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index 0b7bf7819a..f7ad9f78c1 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -112,8 +112,8 @@ public: // Detection related functions const ADGameDescription *_gameDescription; - const char *getGameId() const; - Common::Platform getPlatform() const; + uint32 getFeatures() const; + Common::Language getLanguage() const; Common::RandomSource *_rnd; diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp index 6bfd9efea0..6202ad85e5 100644 --- a/engines/fullpipe/modal.cpp +++ b/engines/fullpipe/modal.cpp @@ -2132,6 +2132,101 @@ void ModalSaveGame::saveload() { } } +ModalDemo::ModalDemo() { + _bg = 0; + _button = 0; + _text = 0; + _clickedQuit = -1; + _countdown = 1000; +} + +ModalDemo::~ModalDemo() { + _bg->_flags &= 0xFFFB; + _button->_flags &= 0xFFFB; + _text->_flags &= 0xFFFB; +} + +bool ModalDemo::launch() { + Scene *sc = g_fp->accessScene(SC_MAINMENU); + + _bg = sc->getPictureObjectById(PIC_POST_BGR, 0); + + if (!_bg) + return false; + + _button = sc->getPictureObjectById(PIC_POST_BUTTON, 0); + _text = sc->getPictureObjectById(PIC_POST_TEXT, 0); + + _clickedQuit = -1; + + // fadeout + warning("STUB: ModelDemo: fadeout"); + update(); + + g_fp->stopAllSoundStreams(); + g_fp->stopAllSounds(); + g_fp->playSound(SND_CMN_056, 0); + g_fp->playSound(SND_CMN_069, 1); + + return true; +} + +bool ModalDemo::init(int counterDiff) { + g_fp->_cursorId = PIC_CSR_DEFAULT; + + if (_button->isPointInside(g_fp->_mouseScreenPos.x, g_fp->_mouseScreenPos.y)) { + if (!(_button->_flags & 4)) + g_fp->playSound(SND_CMN_070, 0); + + _button->_flags |= 4; + + g_fp->_cursorId = PIC_CSR_ITN; + } else { + _button->_flags &= 0xFFFB; + } + + g_fp->setCursor(g_fp->_cursorId); + + _countdown -= counterDiff; + + if (_countdown <= 0) + _countdown = 1000; + + if (_clickedQuit == -1) + return true; + + // open URL + // http://www.amazon.de/EuroVideo-Bildprogramm-GmbH-Full-Pipe/dp/B003TO51YE/ref=sr_1_1?ie=UTF8&s=videogames&qid=1279207213&sr=8-1 + + g_fp->_gameContinue = false; + + return false; +} + +void ModalDemo::update() { + _bg->draw(); + + if (_button->_flags & 4) + _button->draw(); + + if (_text->_flags & 4) + _text->draw(); +} + +bool ModalDemo::handleMessage(ExCommand *cmd) { + if (cmd->_messageKind != 17) + return false; + + if (cmd->_messageNum == 29) { + if (_button->isPointInside(g_fp->_mouseScreenPos.x, g_fp->_mouseScreenPos.y)) + _clickedQuit = 1; + } else if (cmd->_messageNum == 36 && cmd->_param == 27) { + _clickedQuit = 1; + } + + return false; +} + void FullpipeEngine::openHelp() { if (!_modalObject) { ModalHelp *help = new ModalHelp; diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h index 2e7c4f9677..dd5faa8940 100644 --- a/engines/fullpipe/modal.h +++ b/engines/fullpipe/modal.h @@ -300,6 +300,26 @@ public: int _queryRes; }; +class ModalDemo : public BaseModalObject { + PictureObject *_bg; + PictureObject *_button; + PictureObject *_text; + int _clickedQuit; + int _countdown; + + public: + ModalDemo(); + virtual ~ModalDemo(); + + bool launch(); + + virtual bool pollEvent() { return true; } + virtual bool handleMessage(ExCommand *message); + virtual bool init(int counterdiff); + virtual void update(); + virtual void saveload() {} +}; + } // End of namespace Fullpipe diff --git a/engines/fullpipe/scenes/scene08.cpp b/engines/fullpipe/scenes/scene08.cpp index e64ef28900..0c8b68b17e 100644 --- a/engines/fullpipe/scenes/scene08.cpp +++ b/engines/fullpipe/scenes/scene08.cpp @@ -20,6 +20,8 @@ * */ +#include "engines/advancedDetector.h" + #include "fullpipe/fullpipe.h" #include "fullpipe/objects.h" @@ -33,6 +35,7 @@ #include "fullpipe/gameloader.h" #include "fullpipe/behavior.h" #include "fullpipe/interaction.h" +#include "fullpipe/modal.h" namespace Fullpipe { @@ -409,6 +412,15 @@ void sceneHandler08_checkEndArcade() { if (y < 80) { sceneHandler08_finishArcade(); + if (g_fp->getFeatures() & ADGF_DEMO && g_fp->getLanguage() == Common::DE_DEU) { + ModalDemo *demo = new ModalDemo; + demo->launch(); + + g_fp->_modalObject = demo; + + return; + } + ExCommand *ex = new ExCommand(SC_8, 17, 0, 0, 0, 0, 1, 0, 0, 0); ex->_messageNum = 61; ex->_excFlags |= 2; |