aboutsummaryrefslogtreecommitdiff
path: root/engines/cine/object.cpp
diff options
context:
space:
mode:
authorKari Salminen2008-06-26 23:30:45 +0000
committerKari Salminen2008-06-26 23:30:45 +0000
commit8cd03780f68a8558fd6b816629b0c2e3c9517a41 (patch)
tree847b3f6648f494506b8209aff4691d93e30551db /engines/cine/object.cpp
parent0bea51974e4173cd7432348c334a6bb49f4aca6f (diff)
downloadscummvm-rg350-8cd03780f68a8558fd6b816629b0c2e3c9517a41.tar.gz
scummvm-rg350-8cd03780f68a8558fd6b816629b0c2e3c9517a41.tar.bz2
scummvm-rg350-8cd03780f68a8558fd6b816629b0c2e3c9517a41.zip
Implemented Operation Stealth's version of addOverlay(objectIndex, overlayType).
svn-id: r32816
Diffstat (limited to 'engines/cine/object.cpp')
-rw-r--r--engines/cine/object.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/engines/cine/object.cpp b/engines/cine/object.cpp
index b00a636ae6..57a328eef9 100644
--- a/engines/cine/object.cpp
+++ b/engines/cine/object.cpp
@@ -99,21 +99,32 @@ int removeOverlay(uint16 objIdx, uint16 param) {
/*! \brief Add new overlay sprite to the list
* \param objIdx Associate the overlay with this object
- * \param param Type of new overlay
+ * \param type Type of new overlay
* \todo Why are x, y, width and color left uninitialized?
*/
-void addOverlay(uint16 objIdx, uint16 param) {
+void addOverlay(uint16 objIdx, uint16 type) {
Common::List<overlay>::iterator it;
overlay tmp;
for (it = overlayList.begin(); it != overlayList.end(); ++it) {
+ // This is done for both Future Wars and Operation Stealth
if (objectTable[it->objIdx].mask >= objectTable[objIdx].mask) {
break;
}
+
+ // There are additional checks in Operation Stealth's implementation
+ if (g_cine->getGameType() == Cine::GType_OS && (it->type == 2 || it->type == 3)) {
+ break;
+ }
+ }
+
+ // In Operation Stealth's implementation we might bail out early
+ if (g_cine->getGameType() == Cine::GType_OS && it != overlayList.end() && it->objIdx == objIdx && it->type == type) {
+ return;
}
tmp.objIdx = objIdx;
- tmp.type = param;
+ tmp.type = type;
overlayList.insert(it, tmp);
}