Skip to content

Commit

Permalink
DREAMWEB: Structs member renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
tramboi committed Aug 30, 2011
1 parent 2fc467d commit 25675e8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions engines/dreamweb/backdrop.cpp
Expand Up @@ -153,7 +153,7 @@ void DreamGenContext::showallobs() {
SetObject *setEntries = (SetObject *)segRef(data.word(kSetdat)).ptr(0, 128 * sizeof(SetObject));
for (size_t i = 0; i < 128; ++i) {
SetObject *setEntry = setEntries + i;
if (getmapad(setEntry->b58) == 0)
if (getmapad(setEntry->mapad) == 0)
continue;
uint8 currentFrame = setEntry->b18[0];
data.word(kCurrentframe) = currentFrame;
Expand Down Expand Up @@ -308,11 +308,11 @@ void DreamGenContext::showallex() {
DynObject *objects = (DynObject *)segRef(data.word(kExtras)).ptr(kExdata, sizeof(DynObject));
for (size_t i = 0; i < 100; ++i, ++data.byte(kCurrentex)) {
DynObject *object = objects + i;
if (object->b2[0] == 0xff)
if (object->mapad[0] == 0xff)
continue;
if (object->currentLocation != data.byte(kReallocation))
continue;
if (getmapad(object->b2) == 0)
if (getmapad(object->mapad) == 0)
continue;
data.word(kCurrentframe) = 3 * data.byte(kCurrentex);
uint8 width, height;
Expand Down
4 changes: 2 additions & 2 deletions engines/dreamweb/structs.h
Expand Up @@ -114,14 +114,14 @@ struct SetObject {
uint8 b55;
uint8 b56;
uint8 b57;
uint8 b58[5];
uint8 mapad[5];
uint8 b63;
};

struct DynObject {
uint8 currentLocation;
uint8 index;
uint8 b2[5];
uint8 mapad[5];
uint8 b7;
uint8 b8;
uint8 b9;
Expand Down
14 changes: 7 additions & 7 deletions engines/dreamweb/stubs.cpp
Expand Up @@ -1198,11 +1198,11 @@ void DreamGenContext::dochange() {

void DreamGenContext::dochange(uint8 index, uint8 value, uint8 type) {
if (type == 0) { //object
getsetad(index)->b58[0] = value;
getsetad(index)->mapad[0] = value;
} else if (type == 1) { //freeobject
DynObject *freeObject = getfreead(index);
if (freeObject->b2[0] == 0xff)
freeObject->b2[0] = value;
if (freeObject->mapad[0] == 0xff)
freeObject->mapad[0] = value;
} else { //path
bx = kPathdata + (type - 100) * 144 + index * 8;
es = data.word(kReels);
Expand All @@ -1217,15 +1217,15 @@ void DreamGenContext::deletetaken() {
uint8 location = extraObjects[i].initialLocation;
if (location == data.byte(kReallocation)) {
uint8 index = extraObjects[i].index;
freeObjects[index].b2[0] = 254;
freeObjects[index].mapad[0] = 0xfe;
}
}
}

void DreamGenContext::getexpos() {
const DynObject *objects = (const DynObject *)segRef(data.word(kExtras)).ptr(kExdata, sizeof(DynObject));
for (size_t i = 0; i < kNumexobjects; ++i) {
if (objects[i].b2[0] == 0xff) {
if (objects[i].mapad[0] == 0xff) {
data.byte(kExpos) = i;
return;
}
Expand All @@ -1239,7 +1239,7 @@ void DreamGenContext::placesetobject() {

void DreamGenContext::placesetobject(uint8 index) {
findormake(index, 0, 0);
getsetad(index)->b58[0] = 0;
getsetad(index)->mapad[0] = 0;
}

void DreamGenContext::removesetobject() {
Expand All @@ -1248,7 +1248,7 @@ void DreamGenContext::removesetobject() {

void DreamGenContext::removesetobject(uint8 index) {
findormake(index, 0xff, 0);
getsetad(index)->b58[0] = 0xff;
getsetad(index)->mapad[0] = 0xff;
}

void DreamGenContext::finishedwalking() {
Expand Down

0 comments on commit 25675e8

Please sign in to comment.