RCS file: /cvsroot/scummvm/scummvm/object.cpp,v
retrieving revision 1.13
diff -u -r1.13 object.cpp
|
|
|
45 | 45 | |
46 | 46 | int Scumm::getOwner(int obj) { |
47 | 47 | checkRange(_numGlobalObjects-1, 0, obj, "Object %d out of range in getOwner"); |
48 | | return _objectFlagTable[obj]&0xF; |
| 48 | return _objectFlagTable[obj]&OBJECTFLAG_OWNER_MASK; |
49 | 49 | } |
50 | 50 | |
51 | 51 | void Scumm::putOwner(int act, int owner) { |
52 | 52 | checkRange(_numGlobalObjects-1, 0, act, "Object %d out of range in putOwner"); |
53 | 53 | checkRange(15, 0, owner, "Owner %d out of range in putOwner"); |
54 | | _objectFlagTable[act] = (_objectFlagTable[act]&0xF0) | owner; |
| 54 | _objectFlagTable[act] = (_objectFlagTable[act]&OBJECTFLAG_STATE_MASK) | owner; |
55 | 55 | } |
56 | 56 | |
57 | 57 | int Scumm::getState(int act) { |
… |
… |
|
62 | 62 | void Scumm::putState(int act, int state) { |
63 | 63 | checkRange(_numGlobalObjects-1, 0, act, "Object %d out of range in putState"); |
64 | 64 | checkRange(15, 0, state, "State %d out of range in putState"); |
65 | | _objectFlagTable[act] = (_objectFlagTable[act]&0x0F) | (state<<4); |
| 65 | _objectFlagTable[act] = (_objectFlagTable[act]&OBJECTFLAG_OWNER_MASK) | (state<<4); |
66 | 66 | } |
67 | 67 | |
68 | 68 | int Scumm::getObjectIndex(int object) { |
69 | 69 | int i; |
70 | 70 | |
71 | | if ((_objectFlagTable[object]&0xF)!=0xF) { |
| 71 | if ((_objectFlagTable[object]&OBJECTFLAG_OWNER_MASK)!=OBJECTFLAG_OWNER_ROOM) { |
72 | 72 | for (i=0; i<_maxInventoryItems; i++) |
73 | 73 | if (_inventory[i] == object) |
74 | 74 | return i; |
… |
… |
|
88 | 88 | if (object >= _numGlobalObjects) |
89 | 89 | return -1; |
90 | 90 | |
91 | | if ((_objectFlagTable[object]&0xF)!=0xF) { |
| 91 | if ((_objectFlagTable[object]&OBJECTFLAG_OWNER_MASK)!=OBJECTFLAG_OWNER_ROOM) { |
92 | 92 | for (i=0; i<_maxInventoryItems; i++) |
93 | 93 | if (_inventory[i] == object) |
94 | 94 | return 0; |
… |
… |
|
112 | 112 | case -1: |
113 | 113 | return -1; |
114 | 114 | case 0: |
115 | | return getActorXYPos(derefActorSafe(_objectFlagTable[object]&0xF,"getObjectOrActorXY(2)")); |
| 115 | return getActorXYPos(derefActorSafe(_objectFlagTable[object]&OBJECTFLAG_OWNER_MASK,"getObjectOrActorXY(2)")); |
116 | 116 | } |
117 | 117 | getObjectXYPos(object); |
118 | 118 | return 0; |
… |
… |
|
223 | 223 | |
224 | 224 | do { |
225 | 225 | od = &_objs[num]; |
226 | | if (!od->obj_nr || !(od->ownerstate&0xF0)) |
| 226 | if (!od->obj_nr || !(od->ownerstate&OBJECTFLAG_STATE_MASK)) |
227 | 227 | continue; |
228 | 228 | |
229 | 229 | do { |
… |
… |
|
233 | 233 | break; |
234 | 234 | } |
235 | 235 | od = &_objs[od->parent]; |
236 | | } while ((od->ownerstate & 0xF0)==a); |
| 236 | } while ((od->ownerstate & OBJECTFLAG_STATE_MASK)==a); |
237 | 237 | |
238 | 238 | } while (--num); |
239 | 239 | } |
… |
… |
|
437 | 437 | |
438 | 438 | stopObjectScript(obj); |
439 | 439 | |
440 | | if (getOwner(obj)==0xF) { |
| 440 | if (getOwner(obj)==OBJECTFLAG_OWNER_ROOM) { |
441 | 441 | i = 0; |
442 | 442 | do { |
443 | 443 | if (_objs[i].obj_nr==obj) { |
… |
… |
|
518 | 518 | uint32 Scumm::getOBCDOffs(int object) { |
519 | 519 | int i; |
520 | 520 | |
521 | | if ((_objectFlagTable[object]&0xF)!=0xF) |
| 521 | if ((_objectFlagTable[object]&OBJECTFLAG_OWNER_MASK)!=OBJECTFLAG_OWNER_ROOM) |
522 | 522 | return 0; |
523 | 523 | for (i=_numObjectsInRoom; i>0; i--) { |
524 | 524 | if (_objs[i].obj_nr == object) { |
… |
… |
|
533 | 533 | byte *Scumm::getObjectAddress(int obj) { |
534 | 534 | int i; |
535 | 535 | |
536 | | if ((_objectFlagTable[obj]&0xF)!=0xF) { |
| 536 | if ((_objectFlagTable[obj]&OBJECTFLAG_OWNER_MASK)!=OBJECTFLAG_OWNER_ROOM) { |
537 | 537 | for(i=0; i<_maxInventoryItems; i++) { |
538 | 538 | if (_inventory[i] == obj) |
539 | 539 | return getResourceAddress(rtInventory, i); |
RCS file: /cvsroot/scummvm/scummvm/script.cpp,v
retrieving revision 1.10
diff -u -r1.10 script.cpp
|
|
|
573 | 573 | if (_newNames) { |
574 | 574 | for (i=0; i<50; i++) { |
575 | 575 | int j = _newNames[i]; |
576 | | if (j && (getOwner(j)&0xF) == 0) { |
| 576 | if (j && (getOwner(j)&OBJECTFLAG_OWNER_MASK) == 0) { |
577 | 577 | _newNames[i] = 0; |
578 | 578 | nukeResource(rtObjectName, i); |
579 | 579 | } |
RCS file: /cvsroot/scummvm/scummvm/scumm.h,v
retrieving revision 1.25
diff -u -r1.25 scumm.h
|
|
|
31 | 31 | #define NUM_SCRIPT_SLOT 25 |
32 | 32 | #define NUM_ACTORS 13 |
33 | 33 | |
| 34 | #define OBJECTFLAG_OWNER_MASK 0x0f |
| 35 | #define OBJECTFLAG_STATE_MASK 0xf0 |
| 36 | #define OBJECTFLAG_OWNER_ROOM 0x0f |
| 37 | |
34 | 38 | #pragma START_PACK_STRUCTS |
35 | 39 | |
36 | 40 | struct Point { |