mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
DREAMWEB: 'getanyad' ported to C++
This commit is contained in:
@@ -77,6 +77,8 @@ struct SetObject {
|
||||
uint8 b3;
|
||||
uint8 b4;
|
||||
uint8 priority;
|
||||
uint16 w4() const { return READ_LE_UINT16(&b4); }
|
||||
void setW4(uint16 v) { WRITE_LE_UINT16(&b4, v); }
|
||||
uint8 b6;
|
||||
uint8 delay;
|
||||
uint8 type;
|
||||
@@ -124,6 +126,9 @@ struct DynObject {
|
||||
uint8 mapad[5];
|
||||
uint8 b7;
|
||||
uint8 b8;
|
||||
uint16 w7() const { return READ_LE_UINT16(&b7); }
|
||||
void setW7(uint16 v) { WRITE_LE_UINT16(&b7, v); }
|
||||
|
||||
uint8 b9;
|
||||
uint8 b10;
|
||||
uint8 initialLocation;
|
||||
|
||||
@@ -1188,6 +1188,22 @@ DynObject *DreamGenContext::geteitheradCPP() {
|
||||
return getfreead(data.byte(kItemframe));
|
||||
}
|
||||
|
||||
void *DreamGenContext::getanyad(uint16 *value) {
|
||||
if (data.byte(kObjecttype) == 4) {
|
||||
DynObject *exObject = getexad(data.byte(kCommand));
|
||||
*value = exObject->w7();
|
||||
return exObject;
|
||||
} else if (data.byte(kObjecttype) == 2) {
|
||||
DynObject *freeObject = getfreead(data.byte(kCommand));
|
||||
*value = freeObject->w7();
|
||||
return freeObject;
|
||||
} else {
|
||||
SetObject *setObject = getsetad(data.byte(kCommand));
|
||||
*value = setObject->w4(); // Suspicious : conflicts with priority being a byte?
|
||||
return setObject;
|
||||
}
|
||||
}
|
||||
|
||||
SetObject *DreamGenContext::getsetad(uint8 index) {
|
||||
return (SetObject *)segRef(data.word(kSetdat)).ptr(0, 0) + index;
|
||||
}
|
||||
|
||||
@@ -162,6 +162,7 @@
|
||||
DynObject *getexad(uint8 index);
|
||||
DynObject *geteitheradCPP();
|
||||
SetObject *getsetad(uint8 index);
|
||||
void *getanyad(uint16 *value);
|
||||
void setallchanges();
|
||||
void dochange();
|
||||
void dochange(uint8 index, uint8 value, uint8 type);
|
||||
|
||||
Reference in New Issue
Block a user