aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2007-06-17 01:00:06 +0000
committerEugene Sandulenko2007-06-17 01:00:06 +0000
commitf7b28b95adc5d5492d9a16f93404fd97ce5ecf5d (patch)
tree87f852bcc5f5ded83987e20347f93381113638c4 /engines
parente01c9392291ce60a37717f90426ee4a4bd5b98d0 (diff)
downloadscummvm-rg350-f7b28b95adc5d5492d9a16f93404fd97ce5ecf5d.tar.gz
scummvm-rg350-f7b28b95adc5d5492d9a16f93404fd97ce5ecf5d.tar.bz2
scummvm-rg350-f7b28b95adc5d5492d9a16f93404fd97ce5ecf5d.zip
More efforts to implement proper fade after cutaway. One little glitch is left.
svn-id: r27502
Diffstat (limited to 'engines')
-rw-r--r--engines/saga/animation.cpp22
-rw-r--r--engines/saga/events.cpp3
-rw-r--r--engines/saga/events.h1
-rw-r--r--engines/saga/interface.cpp9
-rw-r--r--engines/saga/interface.h2
-rw-r--r--engines/saga/script.h3
-rw-r--r--engines/saga/sfuncs.cpp1
7 files changed, 23 insertions, 18 deletions
diff --git a/engines/saga/animation.cpp b/engines/saga/animation.cpp
index 0f948f38c4..54d7a7e373 100644
--- a/engines/saga/animation.cpp
+++ b/engines/saga/animation.cpp
@@ -236,7 +236,7 @@ void Anim::returnFromCutaway(void) {
event.code = kPalEvent;
event.op = kEventPalToBlack;
event.time = 0;
- event.duration = kNormalFadeDuration;
+ event.duration = 5000; //kNormalFadeDuration;
event.data = cur_pal;
q_event = _vm->_events->queue(&event);
@@ -257,14 +257,7 @@ void Anim::returnFromCutaway(void) {
else
q_event = _vm->_events->queue(&event);
- // Restore the scene
- event.type = kEvTImmediate;
- event.code = kSceneEvent;
- event.op = kEventRestore;
- event.time = 0;
- event.duration = 0;
-
- q_event = _vm->_events->chain(q_event, &event); // chain with the other events
+ _vm->_scene->restoreScene();
// Restore the animations
event.type = kEvTImmediate;
@@ -281,15 +274,24 @@ void Anim::returnFromCutaway(void) {
event.code = kPalEvent;
event.op = kEventBlackToPal;
event.time = 0;
- event.duration = 3000; //kNormalFadeDuration;
+ event.duration = 5000; //kNormalFadeDuration;
event.data = saved_pal;
q_event = _vm->_events->chain(q_event, &event);
+
}
+
+ event.type = kEvTOneshot;
+ event.code = kScriptEvent;
+ event.op = kEventThreadWake;
+ event.param = kWaitTypeWakeUp;
+
+ q_event = _vm->_events->chain(q_event, &event);
}
}
void Anim::clearCutaway(void) {
+ debug(1, "clearCutaway()");
if (_cutawayActive) {
_cutawayActive = false;
diff --git a/engines/saga/events.cpp b/engines/saga/events.cpp
index 2f786dd7b8..a30c0bf15d 100644
--- a/engines/saga/events.cpp
+++ b/engines/saga/events.cpp
@@ -372,9 +372,6 @@ int Events::handleOneShot(Event *event) {
case kEventEnd:
_vm->_scene->nextScene();
return kEvStBreak;
- case kEventRestore:
- _vm->_scene->restoreScene();
- return kEvStBreak;
default:
break;
}
diff --git a/engines/saga/events.h b/engines/saga/events.h
index 4b0d6fcc52..b8eb240143 100644
--- a/engines/saga/events.h
+++ b/engines/saga/events.h
@@ -79,7 +79,6 @@ enum EventOps {
kEventStop = 2,
// SCENE events
kEventEnd = 2,
- kEventRestore = 3,
// TEXT events
kEventHide = 2,
kEventRemove = 3,
diff --git a/engines/saga/interface.cpp b/engines/saga/interface.cpp
index 4018c070fa..8194f14b05 100644
--- a/engines/saga/interface.cpp
+++ b/engines/saga/interface.cpp
@@ -340,15 +340,20 @@ void Interface::rememberMode() {
assert (_savedMode == -1);
_savedMode = _panelMode;
+
+ debug(1, "rememberMode(%d)", _savedMode);
}
-void Interface::restoreMode() {
+void Interface::restoreMode(bool draw_) {
assert (_savedMode != -1);
+ debug(1, "restoreMode(%d)", _savedMode);
+
_panelMode = _savedMode;
_savedMode = -1;
- draw();
+ if (draw_)
+ draw();
}
void Interface::setMode(int mode) {
diff --git a/engines/saga/interface.h b/engines/saga/interface.h
index 4de17a258b..7ae225219a 100644
--- a/engines/saga/interface.h
+++ b/engines/saga/interface.h
@@ -197,7 +197,7 @@ public:
return _fadeMode;
}
void rememberMode();
- void restoreMode();
+ void restoreMode(bool draw_ = true);
bool isInMainMode() { return _inMainMode; }
void setStatusText(const char *text, int statusColor = -1);
void loadScenePortraits(int resourceId);
diff --git a/engines/saga/script.h b/engines/saga/script.h
index 6c8d057848..ec3a7e1cf4 100644
--- a/engines/saga/script.h
+++ b/engines/saga/script.h
@@ -105,7 +105,8 @@ enum ThreadWaitTypes {
kWaitTypePause = 7,
kWaitTypePlacard = 8,
kWaitTypeStatusTextInput = 9,
- kWaitTypeWaitFrames = 10 // IHNM. waiting for a frame count
+ kWaitTypeWaitFrames = 10, // IHNM. waiting for a frame count
+ kWaitTypeWakeUp = 11 // IHNM. wait until get waken up
};
enum OpCodes {
diff --git a/engines/saga/sfuncs.cpp b/engines/saga/sfuncs.cpp
index eae0001702..2b936844cc 100644
--- a/engines/saga/sfuncs.cpp
+++ b/engines/saga/sfuncs.cpp
@@ -1900,6 +1900,7 @@ void Script::sfScriptStartCutAway(SCRIPTFUNC_PARAMS) {
void Script::sfReturnFromCutAway(SCRIPTFUNC_PARAMS) {
_vm->_anim->returnFromCutaway();
+ thread->wait(kWaitTypeWakeUp);
}
void Script::sfEndCutAway(SCRIPTFUNC_PARAMS) {