[Scummvm-cvs-logs] SF.net SVN: scummvm: [32816] scummvm/trunk/engines/cine

buddha_ at users.sourceforge.net buddha_ at users.sourceforge.net
Fri Jun 27 01:30:46 CEST 2008


Revision: 32816
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32816&view=rev
Author:   buddha_
Date:     2008-06-26 16:30:45 -0700 (Thu, 26 Jun 2008)

Log Message:
-----------
Implemented Operation Stealth's version of addOverlay(objectIndex, overlayType).

Modified Paths:
--------------
    scummvm/trunk/engines/cine/object.cpp
    scummvm/trunk/engines/cine/object.h

Modified: scummvm/trunk/engines/cine/object.cpp
===================================================================
--- scummvm/trunk/engines/cine/object.cpp	2008-06-26 23:22:28 UTC (rev 32815)
+++ scummvm/trunk/engines/cine/object.cpp	2008-06-26 23:30:45 UTC (rev 32816)
@@ -99,21 +99,32 @@
 
 /*! \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);
 }

Modified: scummvm/trunk/engines/cine/object.h
===================================================================
--- scummvm/trunk/engines/cine/object.h	2008-06-26 23:22:28 UTC (rev 32815)
+++ scummvm/trunk/engines/cine/object.h	2008-06-26 23:30:45 UTC (rev 32816)
@@ -60,7 +60,7 @@
 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);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list