aboutsummaryrefslogtreecommitdiff
path: root/engines/agos
diff options
context:
space:
mode:
authorTravis Howell2009-05-16 05:34:16 +0000
committerTravis Howell2009-05-16 05:34:16 +0000
commitbce47e7eb68d62476fd2fcd6cc4ec1bf33618d51 (patch)
tree2acd4be22f7831560177835c0ca2397b6de9d5d7 /engines/agos
parente994b94c814ece7285228598c408b9939e2d3398 (diff)
downloadscummvm-rg350-bce47e7eb68d62476fd2fcd6cc4ec1bf33618d51.tar.gz
scummvm-rg350-bce47e7eb68d62476fd2fcd6cc4ec1bf33618d51.tar.bz2
scummvm-rg350-bce47e7eb68d62476fd2fcd6cc4ec1bf33618d51.zip
Add initial support for DOS non-interactive demos of The Feeble Files.
svn-id: r40619
Diffstat (limited to 'engines/agos')
-rw-r--r--engines/agos/agos.cpp47
-rw-r--r--engines/agos/agos.h42
-rw-r--r--engines/agos/animation.cpp47
-rw-r--r--engines/agos/animation.h17
-rw-r--r--engines/agos/charset-fontdata.cpp2
-rw-r--r--engines/agos/cursor.cpp10
-rw-r--r--engines/agos/detection.cpp8
-rw-r--r--engines/agos/detection_tables.h40
-rw-r--r--engines/agos/event.cpp9
-rw-r--r--engines/agos/feeble.cpp396
-rw-r--r--engines/agos/module.mk1
-rw-r--r--engines/agos/script_ff.cpp2
12 files changed, 539 insertions, 82 deletions
diff --git a/engines/agos/agos.cpp b/engines/agos/agos.cpp
index 5d27d9e90f..cdbeeecd8e 100644
--- a/engines/agos/agos.cpp
+++ b/engines/agos/agos.cpp
@@ -51,11 +51,6 @@ static const GameSpecificSettings simon2_settings = {
"SIMON2", // speech_filename
};
-static const GameSpecificSettings feeblefiles_settings = {
- "", // effects_filename
- "VOICES", // speech_filename
-};
-
static const GameSpecificSettings puzzlepack_settings = {
"", // effects_filename
"MUSIC", // speech_filename
@@ -75,12 +70,6 @@ AGOSEngine_PuzzlePack::AGOSEngine_PuzzlePack(OSystem *system)
_tSecondCount = 0;
}
-AGOSEngine_Feeble::AGOSEngine_Feeble(OSystem *system)
- : AGOSEngine_Simon2(system) {
-
- _vgaCurSpritePriority = 0;
-}
-
AGOSEngine_Simon2::AGOSEngine_Simon2(OSystem *system)
: AGOSEngine_Simon1(system) {
}
@@ -200,7 +189,6 @@ AGOSEngine::AGOSEngine(OSystem *syst)
_lastVgaTick = 0;
_marks = 0;
- _omniTV = false;
_scanFlag = false;
_scriptVar2 = 0;
@@ -477,7 +465,6 @@ AGOSEngine::AGOSEngine(OSystem *syst)
_vgaTickCounter = 0;
- _moviePlayer = 0;
_sound = 0;
_effectsPaused = false;
@@ -717,27 +704,6 @@ void AGOSEngine_PuzzlePack::setupGame() {
AGOSEngine::setupGame();
}
-void AGOSEngine_Feeble::setupGame() {
- gss = &feeblefiles_settings;
- _numVideoOpcodes = 85;
- _vgaMemSize = 7500000;
- _itemMemSize = 20000;
- _tableMemSize = 200000;
- _frameCount = 1;
- _vgaBaseDelay = 5;
- _vgaPeriod = 50;
- _numBitArray1 = 16;
- _numBitArray2 = 16;
- _numBitArray3 = 16;
- _numItemStore = 10;
- _numTextBoxes = 40;
- _numVars = 255;
-
- _numSpeech = 10000;
-
- AGOSEngine::setupGame();
-}
-
void AGOSEngine_Simon2::setupGame() {
gss = &simon2_settings;
_tableIndexBase = 1580 / 4;
@@ -968,7 +934,6 @@ AGOSEngine::~AGOSEngine() {
delete[] _windowList;
delete _debugger;
- delete _moviePlayer;
delete _sound;
}
@@ -1041,18 +1006,6 @@ Common::Error AGOSEngine::go() {
playMusic(0, 0);
}
- if ((getPlatform() == Common::kPlatformAmiga || getPlatform() == Common::kPlatformMacintosh) &&
- getGameType() == GType_FF) {
- _moviePlayer = makeMoviePlayer(this, (const char *)"epic.dxa");
- assert(_moviePlayer);
-
- _moviePlayer->load();
- _moviePlayer->play();
-
- delete _moviePlayer;
- _moviePlayer = NULL;
- }
-
runSubroutine101();
permitInput();
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index b48866d33c..3c03ea7be4 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -165,9 +165,6 @@ class Debugger;
class AGOSEngine : public Engine {
friend class Debugger;
- friend class MoviePlayer;
- friend class MoviePlayerDXA;
- friend class MoviePlayerSMK;
// Engine APIs
Common::Error init();
@@ -286,7 +283,6 @@ protected:
uint32 _lastVgaTick;
uint16 _marks;
- bool _omniTV;
bool _scanFlag;
bool _scriptVar2;
@@ -550,7 +546,6 @@ protected:
int _vgaTickCounter;
- MoviePlayer *_moviePlayer;
Audio::SoundHandle _modHandle;
Sound *_sound;
@@ -791,7 +786,7 @@ protected:
void killAllTimers();
void endCutscene();
- void runSubroutine101();
+ virtual void runSubroutine101();
virtual void inventoryUp(WindowBlock *window);
virtual void inventoryDown(WindowBlock *window);
@@ -1877,7 +1872,7 @@ protected:
class AGOSEngine_Feeble : public AGOSEngine_Simon2 {
public:
AGOSEngine_Feeble(OSystem *system);
- //~AGOSEngine_Feeble();
+ ~AGOSEngine_Feeble();
virtual void setupGame();
virtual void setupOpcodes();
@@ -1920,6 +1915,10 @@ public:
void off_b3NotZero();
protected:
+ friend class MoviePlayer;
+ friend class MoviePlayerDXA;
+ friend class MoviePlayerSMK;
+
typedef void (AGOSEngine_Feeble::*OpcodeProcFeeble) ();
struct OpcodeEntryFeeble {
OpcodeProcFeeble proc;
@@ -1928,12 +1927,18 @@ protected:
const OpcodeEntryFeeble *_opcodesFeeble;
+ MoviePlayer *_moviePlayer;
+
+ uint8 _interactiveVideo;
uint16 _vgaCurSpritePriority;
virtual uint16 to16Wrapper(uint value);
virtual uint16 readUint16Wrapper(const void *src);
virtual uint32 readUint32Wrapper(const void *src);
+ void playVideo(const char *filename, bool lastSceneUsed = false);
+ void stopInteractiveVideo();
+
virtual void drawImage(VC10_state *state);
void scaleClip(int16 h, int16 w, int16 y, int16 x, int16 scrollY);
@@ -1979,6 +1984,8 @@ protected:
void linksUp();
void linksDown();
+ virtual void runSubroutine101();
+
void checkUp(WindowBlock *window);
void checkDown(WindowBlock *window);
virtual void inventoryUp(WindowBlock *window);
@@ -1997,6 +2004,27 @@ protected:
virtual char *genSaveName(int slot);
};
+class AGOSEngine_FeebleDemo : public AGOSEngine_Feeble {
+public:
+ AGOSEngine_FeebleDemo(OSystem *system);
+
+protected:
+ bool _filmMenuUsed;
+
+ virtual Common::Error go();
+
+ virtual void initMouse();
+ virtual void drawMousePointer();
+
+ void exitMenu();
+ void filmMenu();
+ void handleText();
+ void handleWobble();
+ void mainMenu();
+ void startInteractiveVideo(const char *filename);
+ void waitForSpace();
+};
+
class AGOSEngine_PuzzlePack : public AGOSEngine_Feeble {
public:
AGOSEngine_PuzzlePack(OSystem *system);
diff --git a/engines/agos/animation.cpp b/engines/agos/animation.cpp
index cf02286e3e..143c1d7cff 100644
--- a/engines/agos/animation.cpp
+++ b/engines/agos/animation.cpp
@@ -43,7 +43,7 @@
namespace AGOS {
-MoviePlayer::MoviePlayer(AGOSEngine *vm)
+MoviePlayer::MoviePlayer(AGOSEngine_Feeble *vm)
: _vm(vm) {
_mixer = _vm->_mixer;
@@ -227,7 +227,7 @@ const char * MoviePlayerDXA::_sequenceList[90] = {
"wurbatak"
};
-MoviePlayerDXA::MoviePlayerDXA(AGOSEngine *vm, const char *name)
+MoviePlayerDXA::MoviePlayerDXA(AGOSEngine_Feeble *vm, const char *name)
: MoviePlayer(vm) {
debug(0, "Creating DXA cutscene player");
@@ -316,18 +316,28 @@ void MoviePlayerDXA::startSound() {
}
void MoviePlayerDXA::nextFrame() {
- if (_vm->_mixer->isSoundHandleActive(_bgSound) && (_vm->_mixer->getSoundElapsedTime(_bgSound) * getFrameRate()) / 1000 < (uint32)getCurFrame()) {
+ if (_bgSoundStream && _vm->_mixer->isSoundHandleActive(_bgSound) && (_vm->_mixer->getSoundElapsedTime(_bgSound) * getFrameRate()) / 1000 < (uint32)getCurFrame()) {
copyFrameToBuffer(_vm->getBackBuf(), 465, 222, _vm->_screenWidth);
return;
}
if (getCurFrame() < getFrameCount()) {
decodeNextFrame();
- copyFrameToBuffer(_vm->getBackBuf(), 465, 222, _vm->_screenWidth);
+ if (_vm->_interactiveVideo == TYPE_OMNITV) {
+ copyFrameToBuffer(_vm->getBackBuf(), 465, 222, _vm->_screenWidth);
+ } else if (_vm->_interactiveVideo == TYPE_LOOPING) {
+ copyFrameToBuffer(_vm->getBackBuf(), (_vm->_screenWidth - getWidth()) / 2, (_vm->_screenHeight - getHeight()) / 2, _vm->_screenWidth);
+ }
} else {
- closeFile();
- _vm->_omniTV = false;
- _vm->_variableArray[254] = 6747;
+ if (_vm->_interactiveVideo == TYPE_OMNITV) {
+ closeFile();
+ _vm->_interactiveVideo = 0;
+ _vm->_variableArray[254] = 6747;
+ } else if (_vm->_interactiveVideo == TYPE_LOOPING) {
+ _fileStream->seek(_videoInfo.frameOffs);
+ _videoInfo.currentFrame = 0;
+ startSound();
+ }
}
}
@@ -374,7 +384,7 @@ bool MoviePlayerDXA::processFrame() {
// sync case for the subsequent frames.
_ticks = _vm->_system->getMillis();
} else {
- _ticks += getFrameDelay();
+ _ticks += getFrameWaitTime();
while (_vm->_system->getMillis() < _ticks)
_vm->_system->delayMillis(10);
}
@@ -392,7 +402,7 @@ bool MoviePlayerDXA::processFrame() {
///////////////////////////////////////////////////////////////////////////////
-MoviePlayerSMK::MoviePlayerSMK(AGOSEngine *vm, const char *name)
+MoviePlayerSMK::MoviePlayerSMK(AGOSEngine_Feeble *vm, const char *name)
: MoviePlayer(vm), SmackerDecoder(vm->_mixer) {
debug(0, "Creating SMK cutscene player");
@@ -436,11 +446,20 @@ void MoviePlayerSMK::handleNextFrame() {
void MoviePlayerSMK::nextFrame() {
if (getCurFrame() < getFrameCount()) {
decodeNextFrame();
- copyFrameToBuffer(_vm->getBackBuf(), 465, 222, _vm->_screenWidth);
+ if (_vm->_interactiveVideo == TYPE_OMNITV) {
+ copyFrameToBuffer(_vm->getBackBuf(), 465, 222, _vm->_screenWidth);
+ } else if (_vm->_interactiveVideo == TYPE_LOOPING) {
+ copyFrameToBuffer(_vm->getBackBuf(), (_vm->_screenWidth - getWidth()) / 2, (_vm->_screenHeight - getHeight()) / 2, _vm->_screenWidth);
+ }
} else {
- closeFile();
- _vm->_omniTV = false;
- _vm->_variableArray[254] = 6747;
+ if (_vm->_interactiveVideo == TYPE_OMNITV) {
+ closeFile();
+ _vm->_interactiveVideo = 0;
+ _vm->_variableArray[254] = 6747;
+ } else if (_vm->_interactiveVideo == TYPE_LOOPING) {
+ _fileStream->seek(_videoInfo.frameOffs);
+ _videoInfo.currentFrame = 0;
+ }
}
}
@@ -481,7 +500,7 @@ bool MoviePlayerSMK::processFrame() {
// Factory function for creating the appropriate cutscene player
///////////////////////////////////////////////////////////////////////////////
-MoviePlayer *makeMoviePlayer(AGOSEngine *vm, const char *name) {
+MoviePlayer *makeMoviePlayer(AGOSEngine_Feeble *vm, const char *name) {
char baseName[40];
char filename[20];
diff --git a/engines/agos/animation.h b/engines/agos/animation.h
index fcef94d4bf..1077a1d907 100644
--- a/engines/agos/animation.h
+++ b/engines/agos/animation.h
@@ -35,13 +35,13 @@
namespace AGOS {
-class AGOSEngine;
+class AGOSEngine_Feeble;
class MoviePlayer {
friend class MoviePlayerDXA;
friend class MoviePlayerSMK;
- AGOSEngine *_vm;
+ AGOSEngine_Feeble *_vm;
Audio::Mixer *_mixer;
@@ -56,7 +56,12 @@ class MoviePlayer {
char baseName[40];
public:
- MoviePlayer(AGOSEngine *vm);
+ enum VideoFlags {
+ TYPE_OMNITV = 1,
+ TYPE_LOOPING = 2
+ };
+
+ MoviePlayer(AGOSEngine_Feeble *vm);
virtual ~MoviePlayer();
virtual bool load() = 0;
@@ -75,7 +80,7 @@ class MoviePlayerDXA : public MoviePlayer, ::Graphics::DXADecoder {
static const char *_sequenceList[90];
uint8 _sequenceNum;
public:
- MoviePlayerDXA(AGOSEngine *vm, const char *name);
+ MoviePlayerDXA(AGOSEngine_Feeble *vm, const char *name);
bool load();
void playVideo();
@@ -92,7 +97,7 @@ private:
class MoviePlayerSMK : public MoviePlayer, ::Graphics::SmackerDecoder {
public:
- MoviePlayerSMK(AGOSEngine *vm, const char *name);
+ MoviePlayerSMK(AGOSEngine_Feeble *vm, const char *name);
bool load();
void playVideo();
@@ -106,7 +111,7 @@ private:
void startSound();
};
-MoviePlayer *makeMoviePlayer(AGOSEngine *vm, const char *name);
+MoviePlayer *makeMoviePlayer(AGOSEngine_Feeble *vm, const char *name);
} // End of namespace AGOS
diff --git a/engines/agos/charset-fontdata.cpp b/engines/agos/charset-fontdata.cpp
index 6e8b6d2172..0c1e731d80 100644
--- a/engines/agos/charset-fontdata.cpp
+++ b/engines/agos/charset-fontdata.cpp
@@ -51,6 +51,8 @@ static const byte feebleFontSize[208] = {
};
uint AGOSEngine::getFeebleFontSize(byte chr) {
+ if (getGameType() == GType_FF && (getFeatures() & GF_DEMO) && chr == 32)
+ return 4;
return feebleFontSize[chr - 32];
}
diff --git a/engines/agos/cursor.cpp b/engines/agos/cursor.cpp
index 7dffe2f963..8d9cef38cd 100644
--- a/engines/agos/cursor.cpp
+++ b/engines/agos/cursor.cpp
@@ -644,6 +644,11 @@ void AGOSEngine_PuzzlePack::initMouse() {
_mouseData = (byte *)calloc(_maxCursorWidth * _maxCursorHeight, 1);
}
+void AGOSEngine_FeebleDemo::initMouse() {
+ // TODO: Add larger cursor
+ AGOSEngine_Simon1::initMouse();
+}
+
void AGOSEngine_Feeble::initMouse() {
_maxCursorWidth = 40;
_maxCursorHeight = 40;
@@ -723,6 +728,11 @@ void AGOSEngine_Feeble::drawMousePart(int image, byte x, byte y) {
}
}
+void AGOSEngine_FeebleDemo::drawMousePointer() {
+ // TODO: Add larger cursor
+ CursorMan.replaceCursor(_mouseData, 16, 16, 0, 0, 0xFF);
+}
+
void AGOSEngine_Feeble::drawMousePointer() {
uint cursor;
int image, offs;
diff --git a/engines/agos/detection.cpp b/engines/agos/detection.cpp
index 7ecd6d3374..23251fc9e3 100644
--- a/engines/agos/detection.cpp
+++ b/engines/agos/detection.cpp
@@ -30,6 +30,7 @@
#include "common/savefile.h"
#include "common/system.h"
+#include "agos/intern.h"
#include "agos/agos.h"
namespace AGOS {
@@ -100,6 +101,8 @@ static const ADParams detectionParams = {
0
};
+using namespace AGOS;
+
class AgosMetaEngine : public AdvancedMetaEngine {
public:
AgosMetaEngine() : AdvancedMetaEngine(detectionParams) {}
@@ -154,7 +157,10 @@ bool AgosMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGame
*engine = new AGOS::AGOSEngine_Simon2(syst);
break;
case AGOS::GType_FF:
- *engine = new AGOS::AGOSEngine_Feeble(syst);
+ if (gd->features & GF_DEMO)
+ *engine = new AGOS::AGOSEngine_FeebleDemo(syst);
+ else
+ *engine = new AGOS::AGOSEngine_Feeble(syst);
break;
case AGOS::GType_PP:
*engine = new AGOS::AGOSEngine_PuzzlePack(syst);
diff --git a/engines/agos/detection_tables.h b/engines/agos/detection_tables.h
index 19b070a379..8215d8242b 100644
--- a/engines/agos/detection_tables.h
+++ b/engines/agos/detection_tables.h
@@ -2236,6 +2236,46 @@ static const AGOSGameDescription gameDescriptions[] = {
GF_TALKIE
},
+ // The Feeble Files - English DOS Demo
+ {
+ {
+ "feeble",
+ "Demo",
+
+ {
+ { "MAINMENU.SMK", GAME_VGAFILE, "b62df52fc36f514eb0464120853f22b6", 968808},
+ { NULL, 0, NULL, 0}
+ },
+ Common::EN_ANY,
+ Common::kPlatformPC,
+ ADGF_DEMO
+ },
+
+ GType_FF,
+ GID_FEEBLEFILES,
+ GF_DEMO
+ },
+
+ // The Feeble Files - German DOS Demo
+ {
+ {
+ "feeble",
+ "Demo",
+
+ {
+ { "MAINMENU.SMK", GAME_VGAFILE, "e18d365044eabea7352934917bbfd2e4", 976436},
+ { NULL, 0, NULL, 0}
+ },
+ Common::DE_DEU,
+ Common::kPlatformPC,
+ ADGF_DEMO
+ },
+
+ GType_FF,
+ GID_FEEBLEFILES,
+ GF_DEMO
+ },
+
// The Feeble Files - English Amiga CD
{
{
diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp
index 6085bf4a09..ad7b079d53 100644
--- a/engines/agos/event.cpp
+++ b/engines/agos/event.cpp
@@ -581,13 +581,10 @@ void AGOSEngine_Feeble::timerProc() {
}
}
- if (getGameType() == GType_FF && _omniTV) {
+ if (getGameType() == GType_FF && _interactiveVideo) {
// Controls Omni TV videos
if (getBitFlag(42)) {
- _omniTV = false;
- _moviePlayer->stopVideo();
- delete _moviePlayer;
- _moviePlayer = NULL;
+ stopInteractiveVideo();
} else {
_moviePlayer->nextFrame();
}
@@ -597,7 +594,7 @@ void AGOSEngine_Feeble::timerProc() {
}
if (_displayScreen) {
- if (getGameType() == GType_FF) {
+ if (getGameType() == GType_FF && !(getFeatures() & GF_DEMO)) {
if (!getBitFlag(78)) {
oracleLogo();
}
diff --git a/engines/agos/feeble.cpp b/engines/agos/feeble.cpp
new file mode 100644
index 0000000000..90e4cbc003
--- /dev/null
+++ b/engines/agos/feeble.cpp
@@ -0,0 +1,396 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "common/config-manager.h"
+
+#include "agos/intern.h"
+#include "agos/agos.h"
+
+namespace AGOS {
+
+AGOSEngine_Feeble::AGOSEngine_Feeble(OSystem *system)
+ : AGOSEngine_Simon2(system) {
+
+ _interactiveVideo = 0;
+ _moviePlayer = 0;
+ _vgaCurSpritePriority = 0;
+}
+
+AGOSEngine_Feeble::~AGOSEngine_Feeble() {
+ delete _moviePlayer;
+}
+
+static const GameSpecificSettings feeblefiles_settings = {
+ "", // effects_filename
+ "VOICES", // speech_filename
+};
+
+void AGOSEngine_Feeble::setupGame() {
+ gss = &feeblefiles_settings;
+ _numVideoOpcodes = 85;
+ _vgaMemSize = 7500000;
+ _itemMemSize = 20000;
+ _tableMemSize = 200000;
+ _frameCount = 1;
+ _vgaBaseDelay = 5;
+ _vgaPeriod = 50;
+ _numBitArray1 = 16;
+ _numBitArray2 = 16;
+ _numBitArray3 = 16;
+ _numItemStore = 10;
+ _numTextBoxes = 40;
+ _numVars = 255;
+
+ _numSpeech = 10000;
+
+ AGOSEngine::setupGame();
+}
+
+void AGOSEngine_Feeble::runSubroutine101() {
+ if ((getPlatform() == Common::kPlatformAmiga || getPlatform() == Common::kPlatformMacintosh) &&
+ getGameType() == GType_FF) {
+ playVideo("epic.dxa");
+ }
+
+ AGOSEngine::runSubroutine101();
+}
+
+void AGOSEngine_Feeble::playVideo(const char *filename, bool lastSceneUsed) {
+ if (shouldQuit())
+ return;
+
+ if (lastSceneUsed)
+ setBitFlag(41, true);
+
+ _moviePlayer = makeMoviePlayer(this, filename);
+ assert(_moviePlayer);
+
+ _moviePlayer->load();
+ _moviePlayer->play();
+
+ delete _moviePlayer;
+ _moviePlayer = NULL;
+
+ if (lastSceneUsed)
+ setBitFlag(41, false);
+}
+
+void AGOSEngine_Feeble::stopInteractiveVideo() {
+ if (_interactiveVideo) {
+ _interactiveVideo = 0;
+ _moviePlayer->stopVideo();
+ delete _moviePlayer;
+ _moviePlayer = NULL;
+ }
+}
+
+AGOSEngine_FeebleDemo::AGOSEngine_FeebleDemo(OSystem *system)
+ : AGOSEngine_Feeble(system) {
+
+ _filmMenuUsed = 0;
+}
+
+Common::Error AGOSEngine_FeebleDemo::go() {
+ // Main menu
+ defineBox( 1, 80, 75, 81, 117, kBFBoxDead, 0, NULL);
+ defineBox( 2, 267, 21, 105, 97, kBFBoxDead, 0, NULL);
+ defineBox( 3, 456, 89, 125, 103, kBFBoxDead, 0, NULL);
+ defineBox( 4, 151, 225, 345, 41, kBFBoxDead, 0, NULL);
+ defineBox( 5, 169, 319, 109, 113, kBFBoxDead, 0, NULL);
+ defineBox( 6, 404, 308, 62, 117, kBFBoxDead, 0, NULL);
+
+ // Film menu
+ defineBox(11, 28, 81, 123, 93, kBFBoxDead, 0, NULL);
+ defineBox(12, 182, 81, 123, 93, kBFBoxDead, 0, NULL);
+ defineBox(13, 335, 81, 123, 93, kBFBoxDead, 0, NULL);
+ defineBox(14, 488, 81, 123, 93, kBFBoxDead, 0, NULL);
+ defineBox(15, 28, 201, 123, 93, kBFBoxDead, 0, NULL);
+ defineBox(16, 182, 201, 123, 93, kBFBoxDead, 0, NULL);
+ defineBox(17, 335, 201, 123, 93, kBFBoxDead, 0, NULL);
+ defineBox(18, 488, 201, 123, 93, kBFBoxDead, 0, NULL);
+ defineBox(19, 255, 357, 135, 45, kBFBoxDead, 0, NULL);
+
+ // Exit Menu
+ defineBox(21, 548, 421, 42, 21, kBFBoxDead, 0, NULL);
+
+ // Text Window used by Feeble Files Data section
+ if (_language ==Common::DE_DEU) {
+ _textWindow = openWindow(322, 457, 196, 15, 1, 0, 255);
+ } else {
+ _textWindow = openWindow(444, 452, 196, 15, 1, 0, 255);
+ }
+
+ playVideo("winasoft.smk");
+ playVideo("fbigtalk.smk");
+
+ while (!shouldQuit())
+ mainMenu();
+
+ return Common::kNoError;
+}
+
+void AGOSEngine_FeebleDemo::exitMenu() {
+ for (int i = 1; i <= 20; i++)
+ disableBox(i);
+
+ enableBox(21);
+
+ playVideo("fhypno.smk");
+ playVideo("fbye1.smk", true);
+
+ HitArea *ha;
+ while (!shouldQuit()) {
+ _lastHitArea = NULL;
+ _lastHitArea3 = NULL;
+
+ while (!shouldQuit()) {
+ if (_lastHitArea3 != 0)
+ break;
+ delay(1);
+ }
+
+ ha = _lastHitArea;
+
+ if (ha != NULL && ha->id == 21)
+ break;
+ }
+
+ playVideo("fbye2.smk");
+ quitGame();
+ delay(0);
+}
+
+void AGOSEngine_FeebleDemo::filmMenu() {
+ for (int i = 1; i <= 6; i++)
+ disableBox(i);
+
+ for (int i = 11; i <= 19; i++)
+ enableBox(i);
+
+ if (!_filmMenuUsed) {
+ playVideo("fclipsin.smk", true);
+ } else {
+ playVideo("fclipin2.smk", true);
+ }
+
+ _filmMenuUsed = true;
+
+ HitArea *ha;
+ while (!shouldQuit()) {
+ _lastHitArea = NULL;
+ _lastHitArea3 = NULL;
+
+ while (!shouldQuit()) {
+ if (_lastHitArea3 != 0)
+ break;
+ handleWobble();
+ delay(1);
+ }
+
+ ha = _lastHitArea;
+
+ if (ha == NULL)
+ continue;
+
+ stopInteractiveVideo();
+
+ if (ha->id == 11) {
+ playVideo("fgo1.smk");
+ playVideo("maze.smk");
+ } else if (ha->id == 12) {
+ playVideo("fgo2.smk");
+ playVideo("radioin.smk");
+ } else if (ha->id == 13) {
+ playVideo("fgo3.smk");
+ playVideo("pad.smk");
+ } else if (ha->id == 14) {
+ playVideo("fgo4.smk");
+ playVideo("bridge.smk");
+ } else if (ha->id == 15) {
+ playVideo("fgo5.smk");
+ playVideo("pilldie.smk");
+ } else if (ha->id == 16) {
+ playVideo("fgo6.smk");
+ playVideo("bikebust.smk");
+ } else if (ha->id == 17) {
+ playVideo("fgo7.smk");
+ playVideo("statue.smk");
+ } else if (ha->id == 18) {
+ playVideo("fgo8.smk");
+ playVideo("junkout.smk");
+ } else if (ha->id == 19) {
+ playVideo("fgo9.smk");
+ break;
+ }
+
+ playVideo("fclipin2.smk", true);
+ }
+}
+
+void AGOSEngine_FeebleDemo::handleText() {
+ if (_lastClickRem == _currentBox)
+ return;
+
+ if (_currentBox && (_currentBox->id >= 1 && _currentBox->id <= 6)) {
+ // TODO: Add the subtitles for menu options
+ }
+
+ _lastClickRem = _currentBox;
+}
+
+void AGOSEngine_FeebleDemo::handleWobble() {
+ if (_lastClickRem == _currentBox)
+ return;
+
+ stopInteractiveVideo();
+
+ if (_currentBox && (_currentBox->id >= 11 && _currentBox->id <= 19)) {
+ char filename[15];
+ sprintf(filename, "wobble%d.smk", _currentBox->id - 10);
+
+ startInteractiveVideo(filename);
+ }
+
+ _lastClickRem = _currentBox;
+}
+
+void AGOSEngine_FeebleDemo::mainMenu() {
+ for (int i = 1; i <= 6; i++)
+ enableBox(i);
+
+ for (int i = 11; i <= 19; i++)
+ disableBox(i);
+
+ playVideo("mmfadein.smk", true);
+
+ startInteractiveVideo("mainmenu.smk");
+
+ HitArea *ha;
+ while (!shouldQuit()) {
+ _lastHitArea = NULL;
+ _lastHitArea3 = NULL;
+
+ while (!shouldQuit()) {
+ if (_lastHitArea3 != 0)
+ break;
+ handleText();
+ delay(1);
+ }
+
+ ha = _lastHitArea;
+
+ if (ha == NULL) {
+ } else if (ha->id >= 1 && ha->id <= 6) {
+ break;
+ }
+ }
+
+ stopInteractiveVideo();
+
+ if (ha->id == 1) {
+ // Feeble Files Data
+ playVideo("ffade5.smk");
+ playVideo("ftext0.smk");
+ playVideo("ftext1.smk", true);
+ waitForSpace();
+ playVideo("ftext2.smk", true);
+ waitForSpace();
+ playVideo("ftext3.smk", true);
+ waitForSpace();
+ playVideo("ftext4.smk", true);
+ waitForSpace();
+ playVideo("ftext5.smk", true);
+ waitForSpace();
+ } else if (ha->id == 2) {
+ // Opening Sequence
+ playVideo("ffade1.smk");
+ playVideo("musosp1.smk");
+ playVideo("newcred.smk");
+ playVideo("fasall.smk");
+ playVideo("mus5p2.smk");
+ playVideo("coach.smk");
+ playVideo("outmin.smk");
+ } else if (ha->id == 3) {
+ // Technical Information
+ playVideo("ffade3.smk");
+ playVideo("idfx4a.smk");
+ playVideo("idfx4b.smk");
+ playVideo("idfx4c.smk");
+ playVideo("idfx4d.smk");
+ playVideo("idfx4e.smk");
+ playVideo("idfx4f.smk");
+ playVideo("idfx4g.smk");
+ } else if (ha->id == 4) {
+ // About AdventureSoft
+ playVideo("ffade2.smk");
+ playVideo("fscene3b.smk");
+ playVideo("fscene3a.smk");
+ playVideo("fscene3c.smk");
+ playVideo("fscene3g.smk");
+ } else if (ha->id == 5) {
+ // Video Clips
+ playVideo("ffade4.smk");
+ filmMenu();
+ } else if (ha->id == 6) {
+ // Exit InfoDisk
+ playVideo("ffade6.smk");
+ exitMenu();
+ }
+}
+
+void AGOSEngine_FeebleDemo::startInteractiveVideo(const char *filename) {
+ setBitFlag(40, true);
+ _interactiveVideo = MoviePlayer::TYPE_LOOPING;
+ _moviePlayer = makeMoviePlayer(this, filename);
+ assert(_moviePlayer);
+ _moviePlayer->load();
+ _moviePlayer->play();
+ setBitFlag(40, false);
+}
+
+void AGOSEngine_FeebleDemo::waitForSpace() {
+ const char *message;
+
+ if (_language == Common::DE_DEU) {
+ message = "Drcken Sie die <Leertaste>, um fortzufahren...";
+ } else {
+ message = "Press <SPACE> to continue...";
+ }
+
+ windowPutChar(_textWindow, 12);
+ for (; *message; message++)
+ windowPutChar(_textWindow, *message);
+
+ mouseOff();
+ while (!shouldQuit()) {
+ delay(1);
+ if (_keyPressed.keycode == Common::KEYCODE_SPACE)
+ break;
+ }
+ _keyPressed.reset();
+ mouseOn();
+}
+
+} // End of namespace AGOS
diff --git a/engines/agos/module.mk b/engines/agos/module.mk
index 0da19a4f88..a7042fa2ad 100644
--- a/engines/agos/module.mk
+++ b/engines/agos/module.mk
@@ -12,6 +12,7 @@ MODULE_OBJS := \
detection.o \
draw.o \
event.o \
+ feeble.o \
gfx.o \
icons.o \
input.o \
diff --git a/engines/agos/script_ff.cpp b/engines/agos/script_ff.cpp
index 4bf43050fc..f20086b268 100644
--- a/engines/agos/script_ff.cpp
+++ b/engines/agos/script_ff.cpp
@@ -575,7 +575,7 @@ void AGOSEngine_Feeble::off_playVideo() {
// Omni TV controls
if (_moviePlayer) {
setBitFlag(42, false);
- _omniTV = true;
+ _interactiveVideo = MoviePlayer::TYPE_OMNITV;
_moviePlayer->play();
} else {
_variableArray[254] = 6747;