Skip to content

Commit

Permalink
Implemented Operation Stealth's version of addOverlay(objectIndex, ov…
Browse files Browse the repository at this point in the history
…erlayType).

svn-id: r32816
  • Loading branch information
Kari Salminen committed Jun 26, 2008
1 parent 0bea519 commit 8cd0378
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
17 changes: 14 additions & 3 deletions engines/cine/object.cpp
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion engines/cine/object.h
Expand Up @@ -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);
Expand Down

0 comments on commit 8cd0378

Please sign in to comment.