DREAMWEB: Rename a member of SetObject & DynObject to objId

SetObject::name and DynObject::id are stored at the exact same offset,
and have the exact same meaning (see also objectMatches()). Now they
also have the same name, objId.
This commit is contained in:
Max Horn 2011-12-28 16:21:30 +01:00
parent c10ea611e8
commit ca7da4cffc
5 changed files with 11 additions and 11 deletions

View file

@ -400,7 +400,7 @@ void DreamWebEngine::loadCart() {
uint16 objectIndex = findSetObject("INTF");
uint16 cartridgeIndex = checkInside(objectIndex, 1);
if (cartridgeIndex != kNumexobjects)
cartridgeId = getExAd(cartridgeIndex)->id[3] + 1;
cartridgeId = getExAd(cartridgeIndex)->objId[3] + 1;
if (cartridgeId == 0)
loadTextFile(_textFile3, "DREAMWEB.T20"); // monitor file 20

View file

@ -57,7 +57,7 @@ void DreamWebEngine::fillRyan() {
}
bool DreamWebEngine::isItWorn(const DynObject *object) {
return (object->id[0] == 'W'-'A') && (object->id[1] == 'E'-'A');
return (object->objId[0] == 'W'-'A') && (object->objId[1] == 'E'-'A');
}
void DreamWebEngine::wornError() {
@ -74,8 +74,8 @@ void DreamWebEngine::wornError() {
}
void DreamWebEngine::makeWorn(DynObject *object) {
object->id[0] = 'W'-'A';
object->id[1] = 'E'-'A';
object->objId[0] = 'W'-'A';
object->objId[1] = 'E'-'A';
}
void DreamWebEngine::obToInv(uint8 index, uint8 flag, uint16 x, uint16 y) {

View file

@ -71,7 +71,7 @@ struct SetObject {
uint8 b9;
uint8 b10;
uint8 b11;
uint8 name[4];
uint8 objId[4];
uint8 b16;
uint8 index;
uint8 frames[13]; // Table mapping animFrame to sprite frame number
@ -116,7 +116,7 @@ struct DynObject {
uint8 objectSize; // the size of an object
uint8 turnedOn;
uint8 initialLocation;
uint8 id[4];
uint8 objId[4];
};
struct ObjPos {

View file

@ -3696,7 +3696,7 @@ void DreamWebEngine::purgeAnItem() {
const DynObject *extraObjects = _exData;
for (size_t i = 0; i < kNumexobjects; ++i) {
if (extraObjects[i].mapad[0] && extraObjects[i].id[0] == 255 &&
if (extraObjects[i].mapad[0] && extraObjects[i].objId[0] == 255 &&
extraObjects[i].initialLocation != _realLocation) {
deleteExObject(i);
return;
@ -3704,7 +3704,7 @@ void DreamWebEngine::purgeAnItem() {
}
for (size_t i = 0; i < kNumexobjects; ++i) {
if (extraObjects[i].mapad[0] && extraObjects[i].id[0] == 255) {
if (extraObjects[i].mapad[0] && extraObjects[i].objId[0] == 255) {
deleteExObject(i);
return;
}

View file

@ -1396,7 +1396,7 @@ void DreamWebEngine::usePipe() {
showPuzText(36, 300);
putBackObStuff();
DynObject *exObject = getExAd(_withObject);
exObject->id[3] = 'F'-'A'; // CUPE (empty cup) -> CUPF (full cup)
exObject->objId[3] = 'F'-'A'; // CUPE (empty cup) -> CUPF (full cup)
return;
} else if (compare(_withObject, _withType, "CUPF")) {
// Already full
@ -1419,7 +1419,7 @@ void DreamWebEngine::useOpenBox() {
_vars._progressPoints++;
showPuzText(37, 300);
DynObject *exObject = getExAd(_withObject);
exObject->id[3] = 'E'-'A'; // CUPF (full cup) -> CUPE (empty cup)
exObject->objId[3] = 'E'-'A'; // CUPF (full cup) -> CUPE (empty cup)
_vars._watchingTime = 140;
_vars._reelToWatch = 105;
_vars._endWatchReel = 181;
@ -1449,7 +1449,7 @@ void DreamWebEngine::runTap() {
if (compare(_withObject, _withType, "CUPE")) {
// Fill cup from tap
DynObject *exObject = getExAd(_withObject);
exObject->id[3] = 'F'-'A'; // CUPE (empty cup) -> CUPF (full cup)
exObject->objId[3] = 'F'-'A'; // CUPE (empty cup) -> CUPF (full cup)
playChannel1(8);
showPuzText(57, 300);
putBackObStuff();