aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2011-12-24 00:34:56 +0200
committerFilippos Karapetis2011-12-24 00:37:13 +0200
commitf6d63ae6a8adeb182d404274b856c03bb40bae4a (patch)
tree0e2785bfaac283c897280a20589d7f772535a4e1 /engines
parentd40201103e277dcaa55b98bca46157b80624d417 (diff)
downloadscummvm-rg350-f6d63ae6a8adeb182d404274b856c03bb40bae4a.tar.gz
scummvm-rg350-f6d63ae6a8adeb182d404274b856c03bb40bae4a.tar.bz2
scummvm-rg350-f6d63ae6a8adeb182d404274b856c03bb40bae4a.zip
DREAMWEB: Use the C++ versions of getAnyAd and makeWorn in some places
This allows us to remove the ASM style version of makeWorn()
Diffstat (limited to 'engines')
-rw-r--r--engines/dreamweb/object.cpp7
-rw-r--r--engines/dreamweb/stubs.h1
-rw-r--r--engines/dreamweb/use.cpp16
3 files changed, 9 insertions, 15 deletions
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp
index 207f4889db..cdd612001f 100644
--- a/engines/dreamweb/object.cpp
+++ b/engines/dreamweb/object.cpp
@@ -79,10 +79,6 @@ void DreamGenContext::wornError() {
workToScreenM();
}
-void DreamGenContext::makeWorn() {
- makeWorn((DynObject *)es.ptr(bx, sizeof(DynObject)));
-}
-
void DreamGenContext::makeWorn(DynObject *object) {
object->id[0] = 'W'-'A';
object->id[1] = 'E'-'A';
@@ -419,8 +415,7 @@ void DreamGenContext::selectOb() {
void DreamGenContext::setPickup() {
if (data.byte(kObjecttype) != kSetObjectType1 && data.byte(kObjecttype) != kSetObjectType3) {
- // The original called getAnyAd() here. However, since object types
- // 1 and 3 are excluded, the resulting object is a DynObject
+ // Object types 1 and 3 are excluded, so the resulting object is a DynObject
uint8 dummy;
DynObject *object = (DynObject *)getAnyAd(&dummy, &dummy);
if (object->mapad[0] == 4) {
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index c94cb02a3c..a58bb259be 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -104,7 +104,6 @@
return DreamBase::isItWorn(object);
}
void wornError();
- void makeWorn();
void makeWorn(DynObject *object);
void obToInv();
void obToInv(uint8 index, uint8 flag, uint16 x, uint16 y) {
diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp
index d3dda0e0a0..b642598589 100644
--- a/engines/dreamweb/use.cpp
+++ b/engines/dreamweb/use.cpp
@@ -363,8 +363,8 @@ void DreamGenContext::wearWatch() {
showFirstUse();
data.byte(kWatchon) = 1;
data.byte(kGetback) = 1;
- getAnyAd();
- makeWorn();
+ uint8 dummy;
+ makeWorn((DynObject *)getAnyAd(&dummy, &dummy));
}
}
@@ -377,8 +377,8 @@ void DreamGenContext::wearShades() {
data.byte(kShadeson) = 1;
showFirstUse();
data.byte(kGetback) = 1;
- getAnyAd();
- makeWorn();
+ uint8 dummy;
+ makeWorn((DynObject *)getAnyAd(&dummy, &dummy));
}
}
@@ -1027,13 +1027,13 @@ void DreamGenContext::useCart() {
}
void DreamGenContext::useTrainer() {
- // TODO: Use the C++ version of getAnyAd()
- getAnyAd();
- if (es.byte(bx + 2) != 4) {
+ uint8 dummy;
+ DynObject *object = (DynObject *)getAnyAd(&dummy, &dummy);
+ if (object->mapad[0] != 4) {
notHeldError();
} else {
data.byte(kProgresspoints)++;
- makeWorn();
+ makeWorn(object);
showSecondUse();
putBackObStuff();
}