aboutsummaryrefslogtreecommitdiff
path: root/scumm/object.cpp
diff options
context:
space:
mode:
authorJames Brown2003-01-17 15:23:27 +0000
committerJames Brown2003-01-17 15:23:27 +0000
commit2810185599039df8006c3f7e437670d9d711669e (patch)
treef580af099c861e4cb25c7510e98be11e62a97b02 /scumm/object.cpp
parent945dee311e9d1cf798a7ad3fa996d6913f1d257d (diff)
downloadscummvm-rg350-2810185599039df8006c3f7e437670d9d711669e.tar.gz
scummvm-rg350-2810185599039df8006c3f7e437670d9d711669e.tar.bz2
scummvm-rg350-2810185599039df8006c3f7e437670d9d711669e.zip
Clip strip value when removing objects
svn-id: r6488
Diffstat (limited to 'scumm/object.cpp')
-rw-r--r--scumm/object.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/scumm/object.cpp b/scumm/object.cpp
index 600c176ed1..ea6c32e27b 100644
--- a/scumm/object.cpp
+++ b/scumm/object.cpp
@@ -763,13 +763,22 @@ void Scumm::clearOwnerOf(int obj)
void Scumm::removeObjectFromRoom(int obj)
{
- int i, j;
+ int i, j, strip;
for (i = 1; i < _numLocalObjects; i++) {
if (_objs[i].obj_nr == (uint16)obj) {
if (_objs[i].width != 0) {
- for (j = 0; j < _objs[i].width; j++)
- setGfxUsageBit((_objs[i].x_pos >> 3) + j, USAGE_BIT_DIRTY);
+ for (j = 0; j < _objs[i].width; j++) {
+ strip = (_objs[i].x_pos >> 3) + j;
+
+ // Clip value
+ if (strip < _screenStartStrip)
+ continue;
+ if (strip > _screenEndStrip)
+ break;
+
+ setGfxUsageBit(strip, USAGE_BIT_DIRTY);
+ }
}
_BgNeedsRedraw = true;
return;