aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb/object.cpp
diff options
context:
space:
mode:
authorMax Horn2011-12-20 11:23:51 +0100
committerMax Horn2011-12-23 10:18:01 +0100
commitb6e139d112b08d9280c145ae40f6324be6707efe (patch)
treeb025b21b0f7eaf9f980569699e41fda580a734c0 /engines/dreamweb/object.cpp
parentf41412186ba7bf3748428b572a3e5147d4313064 (diff)
downloadscummvm-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.cpp35
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