aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/events/maemosdl/maemosdl-events.cpp2
-rw-r--r--backends/platform/wince/CEActionsPocket.cpp2
-rw-r--r--backends/platform/wince/CEActionsSmartphone.cpp2
-rw-r--r--backends/platform/wince/CELauncherDialog.cpp4
-rw-r--r--backends/platform/wince/wince-sdl.cpp9
-rw-r--r--engines/fullpipe/constants.h2
-rw-r--r--engines/fullpipe/fullpipe.h3
-rw-r--r--engines/fullpipe/gfx.cpp4
-rw-r--r--engines/fullpipe/modal.cpp195
-rw-r--r--engines/fullpipe/modal.h48
-rw-r--r--engines/fullpipe/sound.cpp4
-rw-r--r--engines/mortevielle/mortevielle.cpp29
12 files changed, 293 insertions, 11 deletions
diff --git a/backends/events/maemosdl/maemosdl-events.cpp b/backends/events/maemosdl/maemosdl-events.cpp
index dcdf0384e3..eaf2f48b60 100644
--- a/backends/events/maemosdl/maemosdl-events.cpp
+++ b/backends/events/maemosdl/maemosdl-events.cpp
@@ -188,7 +188,7 @@ bool MaemoSdlEventSource::handleMouseButtonUp(SDL_Event &ev, Common::Event &even
bool MaemoSdlEventSource::toggleClickMode() {
_clickEnabled = !_clickEnabled;
- ((SurfaceSdlGraphicsManager *) _graphicsManager)->displayMessageOnOSD(
+ _graphicsManager->displayMessageOnOSD(
_clickEnabled ? _("Clicking Enabled") : _("Clicking Disabled"));
return _clickEnabled;
diff --git a/backends/platform/wince/CEActionsPocket.cpp b/backends/platform/wince/CEActionsPocket.cpp
index 5980a41caa..493a5e688c 100644
--- a/backends/platform/wince/CEActionsPocket.cpp
+++ b/backends/platform/wince/CEActionsPocket.cpp
@@ -236,7 +236,7 @@ CEActionsPocket::~CEActionsPocket() {
bool CEActionsPocket::perform(GUI::ActionType action, bool pushed) {
static bool keydialogrunning = false, quitdialog = false;
- _graphicsMan = ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager());
+ _graphicsMan = dynamic_cast<WINCESdlGraphicsManager *>(((OSystem_SDL *)g_system)->getGraphicsManager());
if (!pushed) {
switch (action) {
diff --git a/backends/platform/wince/CEActionsSmartphone.cpp b/backends/platform/wince/CEActionsSmartphone.cpp
index 2cce288323..d2bc449dfc 100644
--- a/backends/platform/wince/CEActionsSmartphone.cpp
+++ b/backends/platform/wince/CEActionsSmartphone.cpp
@@ -202,7 +202,7 @@ CEActionsSmartphone::~CEActionsSmartphone() {
bool CEActionsSmartphone::perform(GUI::ActionType action, bool pushed) {
static bool keydialogrunning = false, quitdialog = false;
- _graphicsMan = ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager());
+ _graphicsMan = dynamic_cast<WINCESdlGraphicsManager *>(((OSystem_SDL *)g_system)->getGraphicsManager());
if (!pushed) {
switch (action) {
diff --git a/backends/platform/wince/CELauncherDialog.cpp b/backends/platform/wince/CELauncherDialog.cpp
index dd6076e0af..3908294682 100644
--- a/backends/platform/wince/CELauncherDialog.cpp
+++ b/backends/platform/wince/CELauncherDialog.cpp
@@ -65,12 +65,12 @@ public:
};
CELauncherDialog::CELauncherDialog() : GUI::LauncherDialog() {
- ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->reset_panel();
+ dynamic_cast<WINCESdlGraphicsManager *>(((OSystem_SDL *)g_system)->getGraphicsManager())->reset_panel();
}
void CELauncherDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
if ((cmd == 'STRT') || (cmd == kListItemActivatedCmd) || (cmd == kListItemDoubleClickedCmd)) {
- ((WINCESdlGraphicsManager *)((OSystem_SDL *)g_system)->getGraphicsManager())->init_panel();
+ dynamic_cast<WINCESdlGraphicsManager *>(((OSystem_SDL *)g_system)->getGraphicsManager())->init_panel();
}
LauncherDialog::handleCommand(sender, cmd, data);
if (cmd == 'ABOU') {
diff --git a/backends/platform/wince/wince-sdl.cpp b/backends/platform/wince/wince-sdl.cpp
index 1c5cd5565b..1c9c178460 100644
--- a/backends/platform/wince/wince-sdl.cpp
+++ b/backends/platform/wince/wince-sdl.cpp
@@ -422,7 +422,7 @@ void OSystem_WINCE3::initBackend() {
if (_graphicsManager == 0)
_graphicsManager = new WINCESdlGraphicsManager(_eventSource);
- ((WINCESdlEventSource *)_eventSource)->init((WINCESdlGraphicsManager *)_graphicsManager);
+ ((WINCESdlEventSource *)_eventSource)->init(dynamic_cast<WINCESdlGraphicsManager *>(_graphicsManager));
// Call parent implementation of this method
OSystem_SDL::initBackend();
@@ -486,15 +486,16 @@ void OSystem_WINCE3::swap_sound_master() {
//WINCESdlGraphicsManager _graphicsManager
- if (((WINCESdlGraphicsManager *)_graphicsManager)->_toolbarHandler.activeName() == NAME_MAIN_PANEL)
- ((WINCESdlGraphicsManager *)_graphicsManager)->_toolbarHandler.forceRedraw(); // redraw sound icon
+ WINCESdlGraphicsManager *graphicsManager = dynamic_cast<WINCESdlGraphicsManager *>(_graphicsManager);
+ if (graphicsManager->_toolbarHandler.activeName() == NAME_MAIN_PANEL)
+ graphicsManager->_toolbarHandler.forceRedraw(); // redraw sound icon
}
void OSystem_WINCE3::engineInit() {
check_mappings(); // called here to initialize virtual keys handling
- ((WINCESdlGraphicsManager *)_graphicsManager)->update_game_settings();
+ dynamic_cast<WINCESdlGraphicsManager *>(_graphicsManager)->update_game_settings();
// finalize mixer init
_mixerManager->init();
}
diff --git a/engines/fullpipe/constants.h b/engines/fullpipe/constants.h
index e25a6f464a..dfc2146332 100644
--- a/engines/fullpipe/constants.h
+++ b/engines/fullpipe/constants.h
@@ -160,6 +160,7 @@ namespace Fullpipe {
#define PIC_MAP_S36 5260
#define PIC_MAP_S37 5261
#define PIC_MAP_S38 5262
+#define PIC_TTL_CREDITS 5172
#define QU_INTR_STARTINTRO 5133
#define SC_1 301
#define SC_2 302
@@ -210,6 +211,7 @@ namespace Fullpipe {
#define SC_INV 858
#define SC_LDR 635
#define SC_MAP 5222
+#define SC_TITLES 5166
#define SND_CMN_031 3516
#define SND_CMN_060 4921
#define SND_CMN_061 4922
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index aa6e0dac3a..0fc69c2de3 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -157,6 +157,7 @@ public:
void stopSoundStream2();
void stopAllSoundStreams();
void stopAllSoundInstances(int id);
+ void updateSoundVolume();
int _sfxVolume;
@@ -224,6 +225,8 @@ public:
int (*_updateScreenCallback)();
int (*_updateCursorCallback)();
+ void drawAlphaRectangle(int x1, int y1, int x2, int y2, int alpha);
+
int _cursorId;
int _minCursorId;
int _maxCursorId;
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index a67a4d7b19..2d68600dbb 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -1295,4 +1295,8 @@ DynamicPhase *Shadows::findSize(int width, int height) {
return _items[idx].dynPhase;
}
+void FullpipeEngine::drawAlphaRectangle(int x1, int y1, int x2, int y2, int alpha) {
+ warning("STUB: FullpipeEngine::drawAlphaRectangle()");
+}
+
} // End of namespace Fullpipe
diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp
index ddb5b63d6a..2c2252811d 100644
--- a/engines/fullpipe/modal.cpp
+++ b/engines/fullpipe/modal.cpp
@@ -195,6 +195,8 @@ bool ModalIntro::init(int counterdiff) {
}
void ModalIntro::update() {
+ warning("STUB: ModalIntro::update()");
+
if (g_fp->_currentScene) {
if (_introFlags & 1) {
//sceneFade(virt, g_currentScene, 1);
@@ -560,6 +562,199 @@ void FullpipeEngine::openMap() {
}
}
+ModalFinal::ModalFinal() {
+ _flags = 0;
+ _counter = 255;
+ _sfxVolume = g_fp->_sfxVolume;
+}
+
+ModalFinal::~ModalFinal() {
+ if (g_vars->sceneFinal_var01) {
+ g_fp->_gameLoader->unloadScene(SC_FINAL2);
+ g_fp->_gameLoader->unloadScene(SC_FINAL3);
+ g_fp->_gameLoader->unloadScene(SC_FINAL4);
+
+ g_fp->_currentScene = g_fp->accessScene(SC_FINAL1);
+
+ g_fp->stopAllSounds();
+
+ g_vars->sceneFinal_var01 = 0;
+ }
+
+ g_fp->_sfxVolume = _sfxVolume;
+}
+
+bool ModalFinal::init(int counterdiff) {
+ if (g_vars->sceneFinal_var01) {
+ g_fp->_gameLoader->updateSystems(42);
+
+ return true;
+ }
+
+ if (_counter > 0) {
+ _flags |= 2u;
+
+ g_fp->_gameLoader->updateSystems(42);
+
+ return true;
+ }
+
+ unloadScenes();
+
+ g_fp->_modalObject = new ModalCredits();
+
+ return true;
+}
+
+void ModalFinal::unloadScenes() {
+ g_fp->_gameLoader->unloadScene(SC_FINAL2);
+ g_fp->_gameLoader->unloadScene(SC_FINAL3);
+ g_fp->_gameLoader->unloadScene(SC_FINAL4);
+
+ g_fp->_currentScene = g_fp->accessScene(SC_FINAL1);
+
+ g_fp->stopAllSounds();
+}
+
+bool ModalFinal::handleMessage(ExCommand *cmd) {
+ if (cmd->_messageKind == 17 && cmd->_messageNum == 36 && cmd->_keyCode == 27) {
+ g_fp->_modalObject = new ModalMainMenu();
+ g_fp->_modalObject->_parentObj = this;
+
+ return true;
+ }
+
+ return false;
+}
+
+void ModalFinal::update() {
+ if (g_fp->_currentScene) {
+ g_fp->_currentScene->draw();
+
+ if (_flags & 1) {
+ g_fp->drawAlphaRectangle(0, 0, 800, 600, 0xff - _counter);
+
+ _counter += 10;
+
+ if (_counter >= 255) {
+ _counter = 255;
+ _flags &= 0xfe;
+ }
+ } else {
+ if (!(_flags & 2))
+ return;
+
+ g_fp->drawAlphaRectangle(0, 0, 800, 600, 0xff - _counter);
+ _counter -= 10;
+
+ if (_counter <= 0) {
+ _counter = 0;
+ _flags &= 0xFD;
+ }
+ }
+
+ g_fp->_sfxVolume = _counter * (_sfxVolume + 3000) / 255 - 3000;
+
+ g_fp->updateSoundVolume();
+ }
+}
+
+ModalCredits::ModalCredits() {
+ Common::Point point;
+
+ _sceneTitles = g_fp->accessScene(SC_TITLES);
+
+ _creditsPic = _sceneTitles->getPictureObjectById(PIC_TTL_CREDITS, 0);
+ _creditsPic->_flags |= 4;
+
+ _fadeIn = true;
+ _fadeOut = false;
+
+ _creditsPic->getDimensions(&point);
+
+ _countdown = point.y / 2 + 470;
+ _sfxVolume = g_fp->_sfxVolume;
+
+ _currY = 630;
+ _maxY = -1000 - point.y;
+
+ _currX = 400 - point.x / 2;
+
+ _creditsPic->setOXY(_currX, _currY);
+}
+
+ModalCredits::~ModalCredits() {
+ g_fp->_gameLoader->unloadScene(SC_TITLES);
+
+ g_fp->_sfxVolume = _sfxVolume;
+}
+
+bool ModalCredits::handleMessage(ExCommand *cmd) {
+ if (cmd->_messageKind == 17 && cmd->_messageNum == 36 && cmd->_keyCode == 27) {
+ _fadeIn = false;
+
+ return true;
+ }
+
+ return false;
+}
+
+bool ModalCredits::init(int counterdiff) {
+ if (_fadeIn || _fadeOut) {
+ _countdown--;
+
+ if (_countdown < 0)
+ _fadeIn = false;
+
+ _creditsPic->setOXY(_currX, _currY);
+
+ if (_currY > _maxY)
+ _currY -= 2;
+ } else {
+ if (_parentObj)
+ return 0;
+
+ ModalMainMenu *menu = new ModalMainMenu;
+
+ g_fp->_modalObject = menu;
+
+ menu->_field_34 = 1;
+ }
+
+ return true;
+}
+
+void ModalCredits::update() {
+ warning("STUB: ModalCredits::update()");
+
+ if (_fadeOut) {
+ if (_fadeIn) {
+ _sceneTitles->draw();
+
+ return;
+ }
+ } else if (_fadeIn) {
+ //sceneFade(virt, this->_sceneTitles, 1); // TODO
+ _fadeOut = 1;
+
+ return;
+ }
+
+ if (_fadeOut) {
+ //sceneFade(virt, this->_sceneTitles, 0); // TODO
+ _fadeOut = 0;
+ return;
+ }
+
+ _sceneTitles->draw();
+}
+
+ModalMainMenu::ModalMainMenu() {
+ warning("STUB: ModalMainMenu::ModalMainMenu()");
+
+ _field_34 = 0;
+}
+
void FullpipeEngine::openHelp() {
warning("STUB: FullpipeEngine::openHelp()");
}
diff --git a/engines/fullpipe/modal.h b/engines/fullpipe/modal.h
index 65210aaab3..438e341c1c 100644
--- a/engines/fullpipe/modal.h
+++ b/engines/fullpipe/modal.h
@@ -107,9 +107,52 @@ class ModalMap : public BaseModalObject {
};
class ModalFinal : public BaseModalObject {
+ int _flags;
+ int _counter;
+ int _sfxVolume;
+
+ public:
+ ModalFinal();
+ virtual ~ModalFinal();
+
+ virtual bool pollEvent() { return true; }
+ virtual bool handleMessage(ExCommand *message);
+ virtual bool init(int counterdiff);
+ virtual void update();
+ virtual void saveload() {}
+
+ void unloadScenes();
+};
+
+class ModalCredits : public BaseModalObject {
+ Scene *_sceneTitles;
+ PictureObject *_creditsPic;
+ bool _fadeIn;
+ bool _fadeOut;
+ int _countdown;
+ int _sfxVolume;
+ int _currX;
+ int _currY;
+ int _maxY;
+
public:
- ModalFinal() {}
- virtual ~ModalFinal() {}
+ ModalCredits();
+ virtual ~ModalCredits();
+
+ virtual bool pollEvent() { return true; }
+ virtual bool handleMessage(ExCommand *message);
+ virtual bool init(int counterdiff);
+ virtual void update();
+ virtual void saveload() {}
+};
+
+class ModalMainMenu : public BaseModalObject {
+public:
+ int _field_34;
+
+public:
+ ModalMainMenu();
+ virtual ~ModalMainMenu() {}
virtual bool pollEvent() { return true; }
virtual bool handleMessage(ExCommand *message) { return false; }
@@ -118,6 +161,7 @@ class ModalFinal : public BaseModalObject {
virtual void saveload() {}
};
+
} // End of namespace Fullpipe
#endif /* FULLPIPE_MODAL_H */
diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp
index cf66cb40a1..fd25e2c903 100644
--- a/engines/fullpipe/sound.cpp
+++ b/engines/fullpipe/sound.cpp
@@ -199,4 +199,8 @@ void FullpipeEngine::stopAllSoundInstances(int id) {
}
}
+void FullpipeEngine::updateSoundVolume() {
+ debug(3, "STUB FullpipeEngine::updateSoundVolume()");
+}
+
} // End of namespace Fullpipe
diff --git a/engines/mortevielle/mortevielle.cpp b/engines/mortevielle/mortevielle.cpp
index f198bcc718..492ce63b41 100644
--- a/engines/mortevielle/mortevielle.cpp
+++ b/engines/mortevielle/mortevielle.cpp
@@ -106,6 +106,35 @@ MortevielleEngine::MortevielleEngine(OSystem *system, const MortevielleGameDescr
_maff = 0;
_crep = 0;
+
+ _minute = 0;
+ _curSearchObjId = 0;
+ _controlMenu = 0;
+ _startTime = 0;
+ _endTime = 0;
+ _roomDoorId = OWN_ROOM;
+ _openObjCount = 0;
+ _takeObjCount = 0;
+ _num = 0;
+ _searchCount = 0;
+ _introSpeechPlayed = false;
+ _inGameHourDuration = 0;
+ _x = 0;
+ _y = 0;
+ _currentHourCount = 0;
+ _currentTime = 0;
+ _cfiecBuffer = nullptr;
+ _cfiecBufferSize = 0;
+ for (int i = 0; i < 601; i++) {
+ _dialogHintArray[i]._hintId = 0;
+ _dialogHintArray[i]._point = 0;
+ }
+ _currMenu = OPCODE_NONE;
+ _currAction = OPCODE_NONE;
+ _addFix = 0;
+ _savedBitIndex = 0;
+ _numpal = 0;
+ _key = 0;
}
MortevielleEngine::~MortevielleEngine() {