aboutsummaryrefslogtreecommitdiff
path: root/engines/saga
diff options
context:
space:
mode:
authorFilippos Karapetis2007-07-30 23:37:18 +0000
committerFilippos Karapetis2007-07-30 23:37:18 +0000
commit889d1a4aeee83392b2b1fcfb252ac37156587434 (patch)
treef3c8eef0858441d9baca19badcd7f1d4f84a280d /engines/saga
parenta09a95c99a6a7ccb7ef66c60dace493eefb3eb86 (diff)
downloadscummvm-rg350-889d1a4aeee83392b2b1fcfb252ac37156587434.tar.gz
scummvm-rg350-889d1a4aeee83392b2b1fcfb252ac37156587434.tar.bz2
scummvm-rg350-889d1a4aeee83392b2b1fcfb252ac37156587434.zip
The interactive part of the IHNM demo fully works now. Also, made the options screen work in the non-interactive part of the demo
svn-id: r28344
Diffstat (limited to 'engines/saga')
-rw-r--r--engines/saga/animation.cpp12
-rw-r--r--engines/saga/gfx.cpp3
-rw-r--r--engines/saga/interface.cpp83
-rw-r--r--engines/saga/scene.cpp15
-rw-r--r--engines/saga/scene.h1
5 files changed, 92 insertions, 22 deletions
diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp
index bad1155806..a8fa7005d8 100644
--- a/engines/saga/animation.cpp
+++ b/engines/saga/animation.cpp
@@ -316,7 +316,17 @@ void Anim::clearCutaway(void) {
}
_vm->_interface->restoreMode();
- _vm->_gfx->showCursor(true);
+
+ if (_vm->getGameId() != GID_IHNM_DEMO) {
+ if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149) {
+ // Don't show the mouse cursor in the non-interactive part of the IHNM demo
+ } else {
+ _vm->_gfx->showCursor(true);
+ }
+ } else {
+ // Enable the save reminder state after each cutaway for the IHNM demo
+ _vm->_interface->setSaveReminderState(true);
+ }
}
}
diff --git a/engines/saga/gfx.cpp b/engines/saga/gfx.cpp
index c19d71c13d..8d36ee0e12 100644
--- a/engines/saga/gfx.cpp
+++ b/engines/saga/gfx.cpp
@@ -406,8 +406,7 @@ void Gfx::blackToPal(PalEntry *srcPal, double percent) {
}
void Gfx::showCursor(bool state) {
- if (_vm->getGameId() != GID_IHNM_DEMO) // Don't show the mouse cursor in the IHNM demo
- CursorMan.showMouse(state);
+ CursorMan.showMouse(state);
}
void Gfx::setCursor(CursorType cursorType) {
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp
index 70d868cd80..19d9db7132 100644
--- a/engines/saga/interface.cpp
+++ b/engines/saga/interface.cpp
@@ -339,11 +339,21 @@ int Interface::activate() {
unlockMode();
if (_panelMode == kPanelMain || _panelMode == kPanelChapterSelection) {
_saveReminderState = 1;
+ } else if (_panelMode == kPanelNull && _vm->getGameId() == GID_IHNM_DEMO) {
+ _saveReminderState = 1;
}
draw();
}
- _vm->_gfx->showCursor(true);
+ if (_vm->getGameId() != GID_IHNM_DEMO) {
+ _vm->_gfx->showCursor(true);
+ } else {
+ if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149) {
+ // Don't show the mouse cursor in the non-interactive part of the IHNM demo
+ } else {
+ _vm->_gfx->showCursor(true);
+ }
+ }
return SUCCESS;
}
@@ -381,14 +391,6 @@ void Interface::restoreMode(bool draw_) {
void Interface::setMode(int mode) {
debug(1, "Interface::setMode %i", mode);
- // The non-interactive part of the IHNM demo does not have an options
- // screen - the psychic profile screen is displayed instead, with some
- // dialog options (help, play non-interactive demo, play interactive demo, quit)
- // TODO: Show the psychic profile screen in the non-interactive demo and show
- // the normal options screen in the interactive demo
- if (_vm->getGameId() == GID_IHNM_DEMO && mode == kPanelOption)
- mode = kPanelNull;
-
if (mode == kPanelMain) {
_inMainMode = true;
_saveReminderState = 1; //TODO: blinking timeout
@@ -398,16 +400,20 @@ void Interface::setMode(int mode) {
if (_vm->getGameId() == GID_IHNM_DEMO) {
_inMainMode = true;
_saveReminderState = 1;
- }
+ if ((_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149) ||
+ _vm->_scene->currentSceneNumber() == 0 || _vm->_scene->currentSceneNumber() == -1)
+ _vm->_gfx->showCursor(false);
+ }
+ } else if (mode == kPanelOption) {
+ // Show the cursor in the IHNM demo
+ if (_vm->getGameId() == GID_IHNM_DEMO)
+ _vm->_gfx->showCursor(true);
} else {
if (mode == kPanelConverse) {
_inMainMode = false;
}
- if (_vm->getGameId() != GID_IHNM_DEMO)
- _saveReminderState = 0;
- else
- _saveReminderState = 1;
+ _saveReminderState = 0;
}
_panelMode = mode;
@@ -493,6 +499,11 @@ bool Interface::processAscii(uint16 ascii) {
}
return true;
}
+
+ if (_vm->getGameId() == GID_IHNM_DEMO) {
+ if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149)
+ _vm->_scene->showIHNMDemoSpecialScreen();
+ }
break;
case kPanelCutaway:
if (ascii == 27) { // Esc
@@ -501,6 +512,11 @@ bool Interface::processAscii(uint16 ascii) {
_vm->_scene->cutawaySkip();
return true;
}
+
+ if (_vm->getGameId() == GID_IHNM_DEMO) {
+ if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149)
+ _vm->_scene->showIHNMDemoSpecialScreen();
+ }
break;
case kPanelVideo:
if (ascii == 27) { // Esc
@@ -511,6 +527,12 @@ bool Interface::processAscii(uint16 ascii) {
_vm->_actor->abortAllSpeeches();
}
_vm->_scene->cutawaySkip();
+ return true;
+ }
+
+ if (_vm->getGameId() == GID_IHNM_DEMO) {
+ if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149)
+ _vm->_scene->showIHNMDemoSpecialScreen();
}
break;
case kPanelOption:
@@ -679,8 +701,8 @@ void Interface::setStatusText(const char *text, int statusColor) {
if (_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 8)
return;
- // Disable the status text in the IHNM demo
- if (_vm->getGameId() == GID_IHNM_DEMO)
+ // Disable the status text in the introduction of the IHNM demo
+ if (_vm->getGameId() == GID_IHNM_DEMO && _vm->_scene->currentSceneNumber() == 0)
return;
assert(text != NULL);
@@ -1496,10 +1518,20 @@ void Interface::setOption(PanelButton *panelButton) {
switch (panelButton->id) {
case kTextContinuePlaying:
ConfMan.flushToDisk();
- if (!(_vm->getGameType() == GType_IHNM && _vm->_scene->currentChapterNumber() == 8))
+ if (_vm->getGameType() == GType_ITE) {
setMode(kPanelMain);
- else
- setMode(kPanelChapterSelection);
+ } else {
+ if (_vm->_scene->currentChapterNumber() == 8) {
+ setMode(kPanelChapterSelection);
+ } else if (_vm->getGameId() == GID_IHNM_DEMO) {
+ if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149)
+ setMode(kPanelNull);
+ else
+ setMode(kPanelMain);
+ } else {
+ setMode(kPanelMain);
+ }
+ }
break;
case kTextQuitGame:
setMode(kPanelQuit);
@@ -1515,6 +1547,12 @@ void Interface::setOption(PanelButton *panelButton) {
}
break;
case kTextSave:
+ // Disallow saving in the non-interactive part of the IHNM demo
+ if (_vm->getGameId() == GID_IHNM_DEMO) {
+ if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149)
+ return;
+ }
+
if (!_vm->isSaveListFull() && (_optionSaveFileTitleNumber == 0)) {
_textInputString[0] = 0;
} else {
@@ -1721,6 +1759,13 @@ void Interface::update(const Point& mousePoint, int updateFlag) {
_vm->_scene->clearPsychicProfile();
}
break;
+
+ case kPanelNull:
+ if (_vm->getGameId() == GID_IHNM_DEMO && (updateFlag & UPDATE_MOUSECLICK)) {
+ if (_vm->_scene->currentSceneNumber() >= 144 && _vm->_scene->currentSceneNumber() <= 149)
+ _vm->_scene->showIHNMDemoSpecialScreen();
+ }
+ break;
}
_lastMousePoint = mousePoint;
diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp
index 2d85642891..d615a2a387 100644
--- a/engines/saga/scene.cpp
+++ b/engines/saga/scene.cpp
@@ -642,6 +642,15 @@ void Scene::loadScene(LoadSceneParams *loadSceneParams) {
debug(3, "Loading scene number %d:", _sceneNumber);
+ if (_vm->getGameId() == GID_IHNM_DEMO && _sceneNumber == 144) {
+ // WORKAROUND for the non-interactive part of the IHNM demo: When restarting the
+ // non-interactive demo, opcode sfMainMode is incorrectly called. Therefore, if the
+ // starting scene of the non-interactive demo is loaded (scene 144), set panel to null
+ // and lock the user interface
+ _vm->_interface->deactivate();
+ _vm->_interface->setMode(kPanelNull);
+ }
+
// Load scene descriptor and resource list resources
if (_loadDescription) {
debug(3, "Loading scene resource %i", _sceneResourceId);
@@ -1351,4 +1360,10 @@ void Scene::clearPsychicProfile() {
_vm->_interface->activate();
}
+void Scene::showIHNMDemoSpecialScreen() {
+ _vm->_gfx->showCursor(true);
+ _vm->_interface->clearInventory();
+ _vm->_scene->changeScene(150, 0, kTransitionFade);
+}
+
} // End of namespace Saga
diff --git a/engines/saga/scene.h b/engines/saga/scene.h
index d6414e5759..9666a6a6e8 100644
--- a/engines/saga/scene.h
+++ b/engines/saga/scene.h
@@ -342,6 +342,7 @@ class Scene {
void clearPlacard();
void clearPsychicProfile();
+ void showIHNMDemoSpecialScreen();
private:
void loadScene(LoadSceneParams *loadSceneParams);