aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2007-09-18 23:15:48 +0000
committerFilippos Karapetis2007-09-18 23:15:48 +0000
commitf1091ec8bb7b0f1a9892ade6c04fa445b6d52391 (patch)
tree13e0d73ef00a0f8b35602aca5d59f4ca38c03b97
parent2ed777d64137226cd0ccc5a13b10f9ab9ea14965 (diff)
downloadscummvm-rg350-f1091ec8bb7b0f1a9892ade6c04fa445b6d52391.tar.gz
scummvm-rg350-f1091ec8bb7b0f1a9892ade6c04fa445b6d52391.tar.bz2
scummvm-rg350-f1091ec8bb7b0f1a9892ade6c04fa445b6d52391.zip
Fixed some glitches which occured when closing the psychic profile in IHNM
svn-id: r28953
-rw-r--r--engines/saga/events.cpp3
-rw-r--r--engines/saga/events.h1
-rw-r--r--engines/saga/scene.cpp62
3 files changed, 53 insertions, 13 deletions
diff --git a/engines/saga/events.cpp b/engines/saga/events.cpp
index 50297b7ef0..f00f23df2c 100644
--- a/engines/saga/events.cpp
+++ b/engines/saga/events.cpp
@@ -474,6 +474,9 @@ int Events::handleOneShot(Event *event) {
case kEventRestoreMode:
_vm->_interface->restoreMode();
break;
+ case kEventSetMode:
+ _vm->_interface->setMode(event->param);
+ break;
default:
break;
}
diff --git a/engines/saga/events.h b/engines/saga/events.h
index de4d296eab..d433db6e9a 100644
--- a/engines/saga/events.h
+++ b/engines/saga/events.h
@@ -93,6 +93,7 @@ enum EventOps {
kEventClearStatus = 4,
kEventSetFadeMode = 5,
kEventRestoreMode = 6,
+ kEventSetMode = 7,
// ACTOR events
kEventMove = 1,
// SCRIPT events
diff --git a/engines/saga/scene.cpp b/engines/saga/scene.cpp
index a80b482e47..9a5bea8ed6 100644
--- a/engines/saga/scene.cpp
+++ b/engines/saga/scene.cpp
@@ -1310,7 +1310,6 @@ void Scene::loadSceneEntryList(const byte* resourcePointer, size_t resourceLengt
void Scene::clearPlacard() {
static PalEntry cur_pal[PAL_ENTRIES];
- PalEntry *pal;
Event event;
Event *q_event;
@@ -1335,11 +1334,15 @@ void Scene::clearPlacard() {
event.duration = 0;
q_event = _vm->_events->chain(q_event, &event);
- event.type = kEvTOneshot;
- event.code = kTextEvent;
- event.op = kEventRemove;
- event.data = _vm->_script->getPlacardTextEntry();
- q_event = _vm->_events->chain(q_event, &event);
+ if (_vm->getGameType() == GType_ITE) {
+ event.type = kEvTOneshot;
+ event.code = kTextEvent;
+ event.op = kEventRemove;
+ event.data = _vm->_script->getPlacardTextEntry();
+ q_event = _vm->_events->chain(q_event, &event);
+ } else {
+ _vm->_scene->_textList.clear();
+ }
event.type = kEvTImmediate;
event.code = kInterfaceEvent;
@@ -1348,14 +1351,51 @@ void Scene::clearPlacard() {
event.duration = 0;
q_event = _vm->_events->chain(q_event, &event);
- _vm->_scene->getBGPal(pal);
+ if (_vm->getGameType() == GType_IHNM) {
+ // set mode to main
+ event.type = kEvTImmediate;
+ event.code = kInterfaceEvent;
+ event.op = kEventSetMode;
+ event.param = kPanelMain;
+ event.time = 0;
+ event.duration = 0;
+ q_event = _vm->_events->chain(q_event, &event);
+ }
+
+ // Display scene background, but stay with black palette
+ event.type = kEvTImmediate;
+ event.code = kBgEvent;
+ event.op = kEventDisplay;
+ event.param = kEvPNoSetPalette;
+ event.time = 0;
+ event.duration = 0;
+ q_event = _vm->_events->chain(q_event, &event);
+
+ // set fade mode
+ event.type = kEvTImmediate;
+ event.code = kInterfaceEvent;
+ event.op = kEventSetFadeMode;
+ event.param = kFadeIn;
+ event.time = 0;
+ event.duration = 0;
+ q_event = _vm->_events->chain(q_event, &event);
+ // Fade in from black to the scene background palette
event.type = kEvTImmediate;
event.code = kPalEvent;
event.op = kEventBlackToPal;
event.time = 0;
event.duration = kNormalFadeDuration;
- event.data = pal;
+ event.data = _bg.pal;
+ q_event = _vm->_events->chain(q_event, &event);
+
+ // set fade mode
+ event.type = kEvTImmediate;
+ event.code = kInterfaceEvent;
+ event.op = kEventSetFadeMode;
+ event.param = kNoFade;
+ event.time = 0;
+ event.duration = 0;
q_event = _vm->_events->chain(q_event, &event);
event.type = kEvTOneshot;
@@ -1464,12 +1504,8 @@ void Scene::showPsychicProfile(const char *text) {
void Scene::clearPsychicProfile() {
if (_vm->_interface->getMode() == kPanelPlacard || _vm->getGameId() == GID_IHNM_DEMO) {
- _vm->_interface->restoreMode();
- _vm->_scene->clearPlacard();
- _vm->_scene->_textList.clear();
_vm->_render->setFlag(RF_DISABLE_ACTORS);
- _vm->_gfx->restorePalette();
- _vm->_scene->restoreScene();
+ _vm->_scene->clearPlacard();
_vm->_interface->activate();
}
}