FULLPIPE: Implemented support for German demo

This commit is contained in:
Eugene Sandulenko 2016-12-10 17:15:49 +01:00
parent 88a3a2bc4d
commit 5f26c445c9
6 changed files with 141 additions and 4 deletions

View File

@ -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

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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;