diff options
author | Max Horn | 2004-01-11 20:15:05 +0000 |
---|---|---|
committer | Max Horn | 2004-01-11 20:15:05 +0000 |
commit | 0712cb95af1bbadb99aea44a53addc48c3f9a6ce (patch) | |
tree | 186216b4d76fdd0484b9b236bd06226a50ee0362 | |
parent | 6574feefb1714f72809754e055d36b7b98e3f369 (diff) | |
download | scummvm-rg350-0712cb95af1bbadb99aea44a53addc48c3f9a6ce.tar.gz scummvm-rg350-0712cb95af1bbadb99aea44a53addc48c3f9a6ce.tar.bz2 scummvm-rg350-0712cb95af1bbadb99aea44a53addc48c3f9a6ce.zip |
renamed removeObjectFromRoom to forceObjectRedraw
svn-id: r12325
-rw-r--r-- | scumm/debugger.cpp | 2 | ||||
-rw-r--r-- | scumm/object.cpp | 7 | ||||
-rw-r--r-- | scumm/script_v2.cpp | 6 | ||||
-rw-r--r-- | scumm/script_v5.cpp | 6 | ||||
-rw-r--r-- | scumm/script_v6.cpp | 4 | ||||
-rw-r--r-- | scumm/scumm.h | 2 |
6 files changed, 16 insertions, 11 deletions
diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp index 12e1e32eec..03e9414d6f 100644 --- a/scumm/debugger.cpp +++ b/scumm/debugger.cpp @@ -486,7 +486,7 @@ bool ScummDebugger::Cmd_Object(int argc, const char **argv) { _vm->putOwner(obj, _vm->VAR(_vm->VAR_EGO)); _vm->putClass(obj, kObjectClassUntouchable, 1); _vm->putState(obj, 1); - _vm->removeObjectFromRoom(obj); + _vm->forceObjectRedraw(obj); _vm->clearDrawObjectQueue(); _vm->runInventoryScript(obj); } else if (!strcmp(argv[2], "state")) { diff --git a/scumm/object.cpp b/scumm/object.cpp index b892dd6589..c64e3177f5 100644 --- a/scumm/object.cpp +++ b/scumm/object.cpp @@ -850,7 +850,12 @@ void ScummEngine::clearOwnerOf(int obj) { } } -void ScummEngine::removeObjectFromRoom(int obj) { +/** + * Force a screen redraw at the location of the specifed object. This is + * typically called when an object was just removed from the room, or when its + * state changed. + */ +void ScummEngine::forceObjectRedraw(int obj) { int i, j, strip; for (i = 1; i < _numLocalObjects; i++) { diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index ed18a72802..979ddac2a6 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -468,14 +468,14 @@ void ScummEngine_v2::clearStateCommon(byte type) { void ScummEngine_v2::o2_setState08() { int obj = getVarOrDirectWord(PARAM_1); putState(obj, getState(obj) | 0x08); - removeObjectFromRoom(obj); + forceObjectRedraw(obj); clearDrawObjectQueue(); } void ScummEngine_v2::o2_clearState08() { int obj = getVarOrDirectWord(PARAM_1); putState(obj, getState(obj) & ~0x08); - removeObjectFromRoom(obj); + forceObjectRedraw(obj); clearDrawObjectQueue(); } @@ -1449,7 +1449,7 @@ void ScummEngine_v2::o2_pickupObject() { return; /* object twice */ addObjectToInventory(obj, _roomResource); - removeObjectFromRoom(obj); + forceObjectRedraw(obj); putOwner(obj, VAR(VAR_EGO)); putState(obj, getState(obj) | 0xA); clearDrawObjectQueue(); diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index ac56754927..93d6251dac 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -1592,7 +1592,7 @@ void ScummEngine_v5::o5_pickupObject() { putOwner(obj, VAR(VAR_EGO)); putClass(obj, kObjectClassUntouchable, 1); putState(obj, 1); - removeObjectFromRoom(obj); + forceObjectRedraw(obj); clearDrawObjectQueue(); runInventoryScript(1); } @@ -2174,7 +2174,7 @@ void ScummEngine_v5::o5_setState() { obj = getVarOrDirectWord(PARAM_1); state = getVarOrDirectByte(PARAM_2); putState(obj, state); - removeObjectFromRoom(obj); + forceObjectRedraw(obj); if (_BgNeedsRedraw) clearDrawObjectQueue(); } @@ -2911,7 +2911,7 @@ void ScummEngine_v5::o5_pickupObjectOld() { // warning("adding %d from %d to inventoryOld", obj, _currentRoom); addObjectToInventory(obj, _roomResource); - removeObjectFromRoom(obj); + forceObjectRedraw(obj); putOwner(obj, VAR(VAR_EGO)); putClass(obj, kObjectClassUntouchable, 1); putState(obj, 1); diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index 53af8c0553..ad23cb83f1 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -916,7 +916,7 @@ void ScummEngine_v6::o6_setState() { } putState(obj, state); - removeObjectFromRoom(obj); + forceObjectRedraw(obj); if (_BgNeedsRedraw) clearDrawObjectQueue(); } @@ -1151,7 +1151,7 @@ void ScummEngine_v6::o6_pickupObject() { putOwner(obj, VAR(VAR_EGO)); putClass(obj, kObjectClassUntouchable, 1); putState(obj, 1); - removeObjectFromRoom(obj); + forceObjectRedraw(obj); clearDrawObjectQueue(); runInventoryScript(obj); /* Difference */ } diff --git a/scumm/scumm.h b/scumm/scumm.h index 4c7caa4195..6d0be49de6 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -672,7 +672,7 @@ protected: byte _numObjectsInRoom; void setupRoomObject(ObjectData *od, const byte *room, const byte *searchptr = NULL); - void removeObjectFromRoom(int obj); + void forceObjectRedraw(int obj); void loadFlObject(uint object, uint room); void nukeFlObjects(int min, int max); int findFlObjectSlot(); |