aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2007-08-02 14:43:10 +0000
committerFilippos Karapetis2007-08-02 14:43:10 +0000
commit3e9c4be28026a4ef3c3a790073f2a42738374819 (patch)
treecd51ad17ef09d06c7be1a6fec84aa542039468b9 /engines
parentaf16be07a1dad35993d06056cf072b03ee5c63e9 (diff)
downloadscummvm-rg350-3e9c4be28026a4ef3c3a790073f2a42738374819.tar.gz
scummvm-rg350-3e9c4be28026a4ef3c3a790073f2a42738374819.tar.bz2
scummvm-rg350-3e9c4be28026a4ef3c3a790073f2a42738374819.zip
The help screen in the IHNM demo is shown correctly now
svn-id: r28406
Diffstat (limited to 'engines')
-rw-r--r--engines/saga/interface.cpp21
-rw-r--r--engines/saga/scene.cpp6
-rw-r--r--engines/saga/script.h6
-rw-r--r--engines/saga/sfuncs.cpp28
4 files changed, 33 insertions, 28 deletions
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp
index 6811f5ecd0..8cfd993391 100644
--- a/engines/saga/interface.cpp
+++ b/engines/saga/interface.cpp
@@ -694,14 +694,18 @@ bool Interface::processAscii(uint16 ascii) {
} else {
// In the IHNM demo, this panel mode is set by the scripts
// to flip through the pages of the help system
- // Any keypress here returns the user back to the game
- _vm->_scene->clearPsychicProfile();
}
break;
case kPanelPlacard:
if (_vm->getGameType() == GType_IHNM) {
// Any keypress here returns the user back to the game
- _vm->_scene->clearPsychicProfile();
+ if (_vm->getGameId() != GID_IHNM_DEMO) {
+ _vm->_scene->clearPsychicProfile();
+ } else {
+ setMode(kPanelConverse);
+ _vm->_scene->_textList.clear();
+ _vm->_script->wakeUpThreads(kWaitTypeDelay);
+ }
}
break;
}
@@ -1770,8 +1774,15 @@ void Interface::update(const Point& mousePoint, int updateFlag) {
case kPanelPlacard:
if (_vm->getGameType() == GType_IHNM) {
// Any mouse click here returns the user back to the game
- if (updateFlag & UPDATE_MOUSECLICK)
- _vm->_scene->clearPsychicProfile();
+ if (updateFlag & UPDATE_MOUSECLICK) {
+ if (_vm->getGameId() != GID_IHNM_DEMO) {
+ _vm->_scene->clearPsychicProfile();
+ } else {
+ setMode(kPanelConverse);
+ _vm->_scene->_textList.clear();
+ _vm->_script->wakeUpThreads(kWaitTypeDelay);
+ }
+ }
}
break;
diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp
index 3ae0e9c950..c49fe546ee 100644
--- a/engines/saga/scene.cpp
+++ b/engines/saga/scene.cpp
@@ -1411,6 +1411,8 @@ void Scene::showPsychicProfile(const char *text) {
q_event = _vm->_events->chain(q_event, &event);
+ _vm->_scene->_textList.clear();
+
if (text != NULL) {
textHeight = _vm->_font->getHeight(kKnownFontVerb, text, 226, kFontCentered);
@@ -1424,7 +1426,6 @@ void Scene::showPsychicProfile(const char *text) {
textEntry.flags = (FontEffectFlags)(kFontCentered);
textEntry.text = text;
- _vm->_scene->_textList.clear();
TextListEntry *_psychicProfileTextEntry = _vm->_scene->_textList.addEntry(textEntry);
event.type = kEvTOneshot;
@@ -1455,8 +1456,9 @@ void Scene::showPsychicProfile(const char *text) {
}
void Scene::clearPsychicProfile() {
- if (_vm->_interface->getMode() == kPanelPlacard) {
+ if (_vm->_interface->getMode() == kPanelPlacard || _vm->getGameId() == GID_IHNM_DEMO) {
_vm->_scene->clearPlacard();
+ _vm->_scene->_textList.clear();
_vm->_actor->showActors(false);
_vm->_gfx->restorePalette();
_vm->_scene->restoreScene();
diff --git a/engines/saga/script.h b/engines/saga/script.h
index 1c05182647..5e5e702132 100644
--- a/engines/saga/script.h
+++ b/engines/saga/script.h
@@ -592,9 +592,9 @@ private:
void sfScriptStartVideo(SCRIPTFUNC_PARAMS);
void sfScriptReturnFromVideo(SCRIPTFUNC_PARAMS);
void sfScriptEndVideo(SCRIPTFUNC_PARAMS);
- void sfShowIHNMDemoHelp(SCRIPTFUNC_PARAMS);
- void sfShowIHNMDemoHelpText(SCRIPTFUNC_PARAMS);
- void sfClearIHNMDemoHelpText(SCRIPTFUNC_PARAMS);
+ void sfShowIHNMDemoHelpBg(SCRIPTFUNC_PARAMS);
+ void sfAddIHNMDemoHelpTextLine(SCRIPTFUNC_PARAMS);
+ void sfShowIHNMDemoHelpPage(SCRIPTFUNC_PARAMS);
void sfGetPoints(SCRIPTFUNC_PARAMS);
void sfSetGlobalFlag(SCRIPTFUNC_PARAMS);
void sf92(SCRIPTFUNC_PARAMS);
diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp
index 0efbef0ca2..16a484a056 100644
--- a/engines/saga/sfuncs.cpp
+++ b/engines/saga/sfuncs.cpp
@@ -225,9 +225,9 @@ static const ScriptFunctionDescription IHNMscriptFunctionsList[IHNM_SCRIPT_FUNCT
OPCODE(sfScriptReturnFromVideo),
OPCODE(sfScriptEndVideo),
OPCODE(sfSetActorZ),
- OPCODE(sfShowIHNMDemoHelp),
- OPCODE(sfShowIHNMDemoHelpText),
- OPCODE(sfClearIHNMDemoHelpText),
+ OPCODE(sfShowIHNMDemoHelpBg),
+ OPCODE(sfAddIHNMDemoHelpTextLine),
+ OPCODE(sfShowIHNMDemoHelpPage),
OPCODE(sfVstopFX),
OPCODE(sfVstopLoopedFX),
OPCODE(sf92), // only used in the demo version of IHNM
@@ -1998,14 +1998,12 @@ void Script::sfScriptEndVideo(SCRIPTFUNC_PARAMS) {
_vm->_anim->endVideo();
}
-void Script::sfShowIHNMDemoHelp(SCRIPTFUNC_PARAMS) {
- thread->wait(kWaitTypePlacard);
-
+void Script::sfShowIHNMDemoHelpBg(SCRIPTFUNC_PARAMS) {
_ihnmDemoCurrentY = 0;
_vm->_scene->showPsychicProfile(NULL);
}
-void Script::sfShowIHNMDemoHelpText(SCRIPTFUNC_PARAMS) {
+void Script::sfAddIHNMDemoHelpTextLine(SCRIPTFUNC_PARAMS) {
int stringId, textHeight;
TextListEntry textEntry;
Event event;
@@ -2039,17 +2037,11 @@ void Script::sfShowIHNMDemoHelpText(SCRIPTFUNC_PARAMS) {
_ihnmDemoCurrentY += 10;
}
-void Script::sfClearIHNMDemoHelpText(SCRIPTFUNC_PARAMS) {
- thread->wait(kWaitTypePlacard);
-
- warning("TODO: sfClearIHNMDemoHelpText");
-
- // This is called a while after the psychic profile is
- // opened in the IHNM demo, to flip through the help system pages
- _vm->_scene->clearPlacard();
- // FIXME: The demo uses mode 8 when changing pages
- //_vm->_interface->setMode(8);
- _vm->_interface->setMode(7);
+void Script::sfShowIHNMDemoHelpPage(SCRIPTFUNC_PARAMS) {
+ // Note: The IHNM demo changes panel mode to 8 (kPanelProtect in ITE)
+ // when changing pages
+ _vm->_interface->setMode(kPanelConverse);
+ _vm->_interface->setMode(kPanelPlacard);
_ihnmDemoCurrentY = 0;
}