aboutsummaryrefslogtreecommitdiff
path: root/engines/cine/various.cpp
diff options
context:
space:
mode:
authorKari Salminen2008-08-07 19:04:19 +0000
committerKari Salminen2008-08-07 19:04:19 +0000
commitb8bfd5d04f0436b685ea36a845439e20bb756766 (patch)
tree4d5d512ec1c30515fdb615308a622ffee5248a8e /engines/cine/various.cpp
parenta30ecc96a070f46fe15f5e1114bc73fdc26b6f2c (diff)
downloadscummvm-rg350-b8bfd5d04f0436b685ea36a845439e20bb756766.tar.gz
scummvm-rg350-b8bfd5d04f0436b685ea36a845439e20bb756766.tar.bz2
scummvm-rg350-b8bfd5d04f0436b685ea36a845439e20bb756766.zip
Fix for popup boxes sometimes blocking animation when they shouldn't in Operation Stealth:
- Made waitForPlayerClick updating more like in the original. - Moved removeMessages to after the frame drawing in main loop hoping to be more like the original. - Added an additional test to Operation Stealth's implementation of overlay type 2 drawing. - Added an additional parameter incrementing and testing to Operation Stealth's removeMessages. Hopefully this won't cause any regressions in Future Wars! svn-id: r33686
Diffstat (limited to 'engines/cine/various.cpp')
-rw-r--r--engines/cine/various.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index ecff8b263b..371f1bcbee 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -141,7 +141,6 @@ void addPlayerCommandMessage(int16 cmd) {
tmp.type = 3;
overlayList.push_back(tmp);
- waitForPlayerClick = 1;
}
int16 getRelEntryForObject(uint16 param1, uint16 param2, SelectedObjStruct *pSelectedObject) {
@@ -2002,9 +2001,22 @@ void drawSprite(Common::List<overlay>::iterator it, const byte *spritePtr, const
void removeMessages() {
Common::List<overlay>::iterator it;
+ bool remove;
for (it = overlayList.begin(); it != overlayList.end(); ) {
- if (it->type == 2 || it->type == 3) {
+ if (g_cine->getGameType() == Cine::GType_OS) {
+ // NOTE: These are really removeOverlay calls that have been deferred.
+ // In Operation Stealth's disassembly elements are removed from the
+ // overlay list right in the drawOverlays function (And actually in
+ // some other places too) and that's where incrementing a the overlay's
+ // last parameter by one if it's negative and testing it for positivity
+ // comes from too.
+ remove = it->type == 3 || (it->type == 2 && (it->color >= 0 || ++it->color >= 0));
+ } else { // Future Wars
+ remove = it->type == 2 || it->type == 3;
+ }
+
+ if (remove) {
it = overlayList.erase(it);
} else {
++it;
@@ -2087,7 +2099,6 @@ void addMessage(byte param1, int16 param2, int16 param3, int16 param4, int16 par
tmp.color = param5;
overlayList.push_back(tmp);
- waitForPlayerClick = 1;
}
Common::List<SeqListElement> seqList;