aboutsummaryrefslogtreecommitdiff
path: root/engines/pegasus
diff options
context:
space:
mode:
authorMatthew Hoops2011-09-27 12:24:45 -0400
committerMatthew Hoops2011-09-27 12:24:45 -0400
commitfe03cd1bfabeab154573b55216c581bb0af41e9a (patch)
treeed8dd85583afb4ca17afe4c55a727f42900b992e /engines/pegasus
parent96198e7bdd01c4ef642c148db4bd567fb12b9519 (diff)
downloadscummvm-rg350-fe03cd1bfabeab154573b55216c581bb0af41e9a.tar.gz
scummvm-rg350-fe03cd1bfabeab154573b55216c581bb0af41e9a.tar.bz2
scummvm-rg350-fe03cd1bfabeab154573b55216c581bb0af41e9a.zip
PEGASUS: Partially revert 4aed723368b9a4e82205bc3ed950a4e04ba3d8dc
startFaderSync does indeed to hold the main thread.
Diffstat (limited to 'engines/pegasus')
-rwxr-xr-xengines/pegasus/fader.cpp30
-rwxr-xr-xengines/pegasus/fader.h3
2 files changed, 13 insertions, 20 deletions
diff --git a/engines/pegasus/fader.cpp b/engines/pegasus/fader.cpp
index 8eb1c0176a..fe292d91f7 100755
--- a/engines/pegasus/fader.cpp
+++ b/engines/pegasus/fader.cpp
@@ -24,6 +24,7 @@
*/
#include "pegasus/fader.h"
+#include "pegasus/pegasus.h"
#include "pegasus/sound.h"
#include "pegasus/util.h"
@@ -32,7 +33,6 @@ namespace Pegasus {
Fader::Fader() {
_currentValue = 0;
_currentFaderMove._numKnots = 0;
- _syncMode = false;
}
void Fader::setFaderValue(const uint32 newValue) {
@@ -86,14 +86,22 @@ void Fader::startFader(const FaderMoveSpec &spec) {
}
void Fader::startFaderSync(const FaderMoveSpec &spec) {
- if (initFaderMove(spec)) {
- _syncMode = true;
-
+ if (initFaderMove(spec)) {
setFlags(0);
setScale(spec._faderScale);
setSegment(spec._knots[0].knotTime, spec._knots[spec._numKnots - 1].knotTime);
setTime(spec._knots[0].knotTime);
- start();
+ start();
+
+ while (isFading()) {
+ ((PegasusEngine *)g_engine)->checkCallBacks();
+ useIdleTime();
+ }
+
+ // Once more, for good measure, to make sure that there are no boundary
+ // condition problems.
+ useIdleTime();
+ stopFader();
}
}
@@ -140,18 +148,6 @@ void Fader::timeChanged(const TimeValue newTime) {
}
}
-void Fader::checkCallBacks() {
- IdlerTimeBase::checkCallBacks();
-
- if (_syncMode && !isRunning()) {
- // Once more, for good measure, to make sure that there are no boundary
- // condition problems.
- useIdleTime();
- stopFader();
- _syncMode = false;
- }
-}
-
void FaderMoveSpec::makeOneKnotFaderSpec(const uint32 knotValue) {
_numKnots = 1;
_knots[0].knotTime = 0;
diff --git a/engines/pegasus/fader.h b/engines/pegasus/fader.h
index 83f5a819c2..fe5b1ae1ba 100755
--- a/engines/pegasus/fader.h
+++ b/engines/pegasus/fader.h
@@ -89,15 +89,12 @@ public:
void getCurrentFaderMove(FaderMoveSpec &spec) { spec = _currentFaderMove; }
- virtual void checkCallBacks();
-
protected:
bool initFaderMove(const FaderMoveSpec &);
virtual void timeChanged(const TimeValue);
uint32 _currentValue;
FaderMoveSpec _currentFaderMove;
- bool _syncMode;
};
class FaderAnimation : public DisplayElement, public Fader {