diff options
author | Bertrand Augereau | 2011-08-30 02:18:55 +0200 |
---|---|---|
committer | Bertrand Augereau | 2011-08-30 02:37:47 +0200 |
commit | 081bdece0c66aa900935e5bff9ed8f3eb70eb4ec (patch) | |
tree | c6c5ecc367aa0fd1b17ad3aa4054b6acc510bacb /engines/dreamweb | |
parent | c79984634474a0bfe564e2043652adf598f4cc73 (diff) | |
download | scummvm-rg350-081bdece0c66aa900935e5bff9ed8f3eb70eb4ec.tar.gz scummvm-rg350-081bdece0c66aa900935e5bff9ed8f3eb70eb4ec.tar.bz2 scummvm-rg350-081bdece0c66aa900935e5bff9ed8f3eb70eb4ec.zip |
DREAMWEB: More reversing of DynObject struct
Diffstat (limited to 'engines/dreamweb')
-rw-r--r-- | engines/dreamweb/backdrop.cpp | 12 | ||||
-rw-r--r-- | engines/dreamweb/structs.h | 10 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 8 |
3 files changed, 13 insertions, 17 deletions
diff --git a/engines/dreamweb/backdrop.cpp b/engines/dreamweb/backdrop.cpp index cfa4d571e8..4ffd58936c 100644 --- a/engines/dreamweb/backdrop.cpp +++ b/engines/dreamweb/backdrop.cpp @@ -305,14 +305,14 @@ void DreamGenContext::showallex() { data.word(kDataad) = kExframedata; data.word(kFramesad) = kExframes; data.byte(kCurrentex) = 0; - si = kExdata + 2; - for (size_t i = 0; i < 100; ++i, ++data.byte(kCurrentex), si +=16) { - es = data.word(kExtras); - if (es.byte(si) == 0xff) + 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) continue; - if (es.byte(si-2) != data.byte(kReallocation)) + if (object->currentLocation != data.byte(kReallocation)) continue; - if (getmapad((const uint8 *)es.ptr(si, 5)) == 0) + if (getmapad(object->b2) == 0) continue; data.word(kCurrentframe) = 3 * data.byte(kCurrentex); uint8 width, height; diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h index 6d3deacc6f..0b99b01be9 100644 --- a/engines/dreamweb/structs.h +++ b/engines/dreamweb/structs.h @@ -119,18 +119,14 @@ struct SetObject { }; struct DynObject { - uint8 b0; + uint8 currentLocation; uint8 index; - uint8 b2; - uint8 b3; - uint8 b4; - uint8 b5; - uint8 b6; + uint8 b2[5]; uint8 b7; uint8 b8; uint8 b9; uint8 b10; - uint8 location; + uint8 initialLocation; uint8 id[4]; }; diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 33f7a414f9..3c4c228471 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -1177,8 +1177,8 @@ void DreamGenContext::dochange(uint8 index, uint8 value, uint8 type) { getsetad(index)->b58[0] = value; } else if (type == 1) { //freeobject DynObject *freeObject = getfreead(index); - if (freeObject->b2 == 0xff) - freeObject->b2 = value; + if (freeObject->b2[0] == 0xff) + freeObject->b2[0] = value; } else { //path bx = kPathdata + (type - 100) * 144 + index * 8; es = data.word(kReels); @@ -1190,10 +1190,10 @@ void DreamGenContext::deletetaken() { const DynObject *extraObjects = (const DynObject *)segRef(data.word(kExtras)).ptr(kExdata, 0); DynObject *freeObjects = (DynObject *)segRef(data.word(kFreedat)).ptr(0, 0); for(size_t i = 0; i < kNumexobjects; ++i) { - uint8 location = extraObjects[i].location; + uint8 location = extraObjects[i].initialLocation; if (location == data.byte(kReallocation)) { uint8 index = extraObjects[i].index; - freeObjects[index].b2 = 254; + freeObjects[index].b2[0] = 254; } } } |