aboutsummaryrefslogtreecommitdiff
path: root/engines
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
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')
-rw-r--r--engines/cine/object.cpp17
-rw-r--r--engines/cine/object.h2
2 files changed, 15 insertions, 4 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);
}
diff --git a/engines/cine/object.h b/engines/cine/object.h
index 12e72927e1..103b2f50ba 100644
--- a/engines/cine/object.h
+++ b/engines/cine/object.h
@@ -60,7 +60,7 @@ void loadObject(char *pObjectName);
void setupObject(byte objIdx, uint16 param1, uint16 param2, uint16 param3, uint16 param4);
void modifyObjectParam(byte objIdx, byte paramIdx, int16 newValue);
-void addOverlay(uint16 objIdx, uint16 param);
+void addOverlay(uint16 objIdx, uint16 type);
int removeOverlay(uint16 objIdx, uint16 param);
void addGfxElement(int16 objIdx, int16 param, int16 type);
void removeGfxElement(int16 objIdx, int16 param, int16 type);