diff options
author | Willem Jan Palenstijn | 2011-12-17 21:02:31 +0100 |
---|---|---|
committer | Willem Jan Palenstijn | 2011-12-17 21:02:31 +0100 |
commit | 5958d2d29af136a7adcbc4dc2abbb8ee5e0fcbba (patch) | |
tree | 5d08b74934511ca2212edee19abb26da831a48f4 /engines | |
parent | b8ab0e62177916f82131b884d118a23e1afb3407 (diff) | |
download | scummvm-rg350-5958d2d29af136a7adcbc4dc2abbb8ee5e0fcbba.tar.gz scummvm-rg350-5958d2d29af136a7adcbc4dc2abbb8ee5e0fcbba.tar.bz2 scummvm-rg350-5958d2d29af136a7adcbc4dc2abbb8ee5e0fcbba.zip |
DREAMWEB: Name some DynObject/SetObject fields
Also change getAnyAd() behaviour to be consistent between Free/Ex and
Set objects, diverging from the original.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/object.cpp | 6 | ||||
-rw-r--r-- | engines/dreamweb/structs.h | 8 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 16 |
3 files changed, 17 insertions, 13 deletions
diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp index 5bdfc07496..e4abac14f2 100644 --- a/engines/dreamweb/object.cpp +++ b/engines/dreamweb/object.cpp @@ -311,11 +311,11 @@ byte DreamGenContext::getOpenedSizeCPP() { byte obj = data.byte(kOpenedob); switch (data.byte(kOpenedtype)) { case 4: - return getExAd(obj)->b8; + return getExAd(obj)->slotCount; case 2: - return getFreeAd(obj)->b8; + return getFreeAd(obj)->slotCount; default: - return getSetAd(obj)->b4; + return getSetAd(obj)->slotCount; } } diff --git a/engines/dreamweb/structs.h b/engines/dreamweb/structs.h index 30962a272c..28c462ef7d 100644 --- a/engines/dreamweb/structs.h +++ b/engines/dreamweb/structs.h @@ -76,8 +76,8 @@ struct SetObject { uint8 b0; uint8 b1; uint8 b2; - uint8 b3; - uint8 b4; + uint8 slotSize; + uint8 slotCount; uint8 priority; uint8 b6; uint8 delay; @@ -125,8 +125,8 @@ struct DynObject { uint8 currentLocation; uint8 index; uint8 mapad[5]; - uint8 b7; - uint8 b8; + uint8 slotSize; + uint8 slotCount; uint8 b9; uint8 b10; uint8 initialLocation; diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 21d1038f3c..1ba88405bc 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -1363,18 +1363,22 @@ DynObject *DreamBase::getEitherAdCPP() { void *DreamBase::getAnyAd(uint8 *value1, uint8 *value2) { if (data.byte(kObjecttype) == 4) { DynObject *exObject = getExAd(data.byte(kCommand)); - *value1 = exObject->b7; - *value2 = exObject->b8; + *value1 = exObject->slotSize; + *value2 = exObject->slotCount; return exObject; } else if (data.byte(kObjecttype) == 2) { DynObject *freeObject = getFreeAd(data.byte(kCommand)); - *value1 = freeObject->b7; - *value2 = freeObject->b8; + *value1 = freeObject->slotSize; + *value2 = freeObject->slotCount; return freeObject; } else { SetObject *setObject = getSetAd(data.byte(kCommand)); - *value1 = setObject->b4; - *value2 = setObject->priority; + // Note: the original returned slotCount/priority (bytes 4 and 5) + // instead of slotSize/slotCount (bytes 3 and 4). + // Changed this for consistency with the Ex/Free cases, and also + // with getOpenedSize() + *value1 = setObject->slotSize; + *value2 = setObject->slotCount; return setObject; } } |