Skip to content

Commit

Permalink
DREAMWEB: Use the C++ versions of getAnyAd and makeWorn in some places
Browse files Browse the repository at this point in the history
This allows us to remove the ASM style version of makeWorn()
  • Loading branch information
bluegr committed Dec 23, 2011
1 parent d402011 commit f6d63ae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
7 changes: 1 addition & 6 deletions engines/dreamweb/object.cpp
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion engines/dreamweb/stubs.h
Expand Up @@ -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) {
Expand Down
16 changes: 8 additions & 8 deletions engines/dreamweb/use.cpp
Expand Up @@ -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));
}
}

Expand All @@ -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));
}
}

Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit f6d63ae

Please sign in to comment.