diff options
author | Max Horn | 2011-12-20 11:23:51 +0100 |
---|---|---|
committer | Max Horn | 2011-12-23 10:18:01 +0100 |
commit | b6e139d112b08d9280c145ae40f6324be6707efe (patch) | |
tree | b025b21b0f7eaf9f980569699e41fda580a734c0 /engines/dreamweb/object.cpp | |
parent | f41412186ba7bf3748428b572a3e5147d4313064 (diff) | |
download | scummvm-rg350-b6e139d112b08d9280c145ae40f6324be6707efe.tar.gz scummvm-rg350-b6e139d112b08d9280c145ae40f6324be6707efe.tar.bz2 scummvm-rg350-b6e139d112b08d9280c145ae40f6324be6707efe.zip |
DREAMWEB: Convert resetLocation and purgeALocation to C++
Diffstat (limited to 'engines/dreamweb/object.cpp')
-rw-r--r-- | engines/dreamweb/object.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp index 8553f41ee8..6aa1364002 100644 --- a/engines/dreamweb/object.cpp +++ b/engines/dreamweb/object.cpp @@ -631,4 +631,39 @@ void DreamGenContext::outOfInv() { delPointer(); } +void DreamBase::resetLocation(uint8 index) { + if (index == 5) { + // delete hotel + purgeALocation(5); + purgeALocation(21); + purgeALocation(22); + purgeALocation(27); + } else if (index == 8) { + // delete TV studio + purgeALocation(8); + purgeALocation(28); + } else if (index == 6) { + // delete sarters + purgeALocation(6); + purgeALocation(20); + purgeALocation(25); + } else if (index == 13) { + // delete boathouse + purgeALocation(13); + purgeALocation(29); + } + + data.byte(kRoomscango + index) = 0; +} + +void DreamBase::purgeALocation(uint8 index) { + // index == al + for (uint8 i = 0; i < kNumexobjects; ++i) { + DynObject *t = getExAd(i); + if (t->currentLocation == index && t->mapad[0] == 0) { + deleteExObject(i); + } + } +} + } // End of namespace DreamGen |