diff options
author | James Brown | 2003-01-17 15:23:27 +0000 |
---|---|---|
committer | James Brown | 2003-01-17 15:23:27 +0000 |
commit | 2810185599039df8006c3f7e437670d9d711669e (patch) | |
tree | f580af099c861e4cb25c7510e98be11e62a97b02 /scumm/object.cpp | |
parent | 945dee311e9d1cf798a7ad3fa996d6913f1d257d (diff) | |
download | scummvm-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.cpp | 15 |
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; |