Turned ZoneTypes into a regular numeric id (no more a bitfield).
svn-id: r39648
This commit is contained in:
parent
52b1c9e32f
commit
d82aea1e54
4 changed files with 31 additions and 34 deletions
|
@ -56,20 +56,20 @@ typedef Common::List<Common::Point> PointList;
|
||||||
enum ZoneTypes {
|
enum ZoneTypes {
|
||||||
kZoneExamine = 1, // zone displays comment if activated
|
kZoneExamine = 1, // zone displays comment if activated
|
||||||
kZoneDoor = 2, // zone activated on click (after some walk if needed)
|
kZoneDoor = 2, // zone activated on click (after some walk if needed)
|
||||||
kZoneGet = 4, // for pickable items
|
kZoneGet = 3, // for pickable items
|
||||||
kZoneMerge = 8, // tags items which can be merged in inventory
|
kZoneMerge = 4, // tags items which can be merged in inventory
|
||||||
kZoneTaste = 0x10, // NEVER USED
|
kZoneTaste = 5, // NEVER USED
|
||||||
kZoneHear = 0x20, // NEVER USED: they ran out of time before integrating sfx
|
kZoneHear = 6, // NEVER USED: they ran out of time before integrating sfx
|
||||||
kZoneFeel = 0x40, // NEVER USED
|
kZoneFeel = 7, // NEVER USED
|
||||||
kZoneSpeak = 0x80, // tags NPCs the character can talk with
|
kZoneSpeak = 8, // tags NPCs the character can talk with
|
||||||
kZoneNone = 0x100, // used to prevent parsing on peculiar Animations
|
kZoneNone = 9, // used to prevent parsing on peculiar Animations
|
||||||
kZoneTrap = 0x200, // zone activated when character enters
|
kZoneTrap = 10, // zone activated when character enters
|
||||||
kZoneYou = 0x400, // marks the character
|
kZoneYou = 11, // marks the character
|
||||||
kZoneCommand = 0x800,
|
kZoneCommand = 12,
|
||||||
|
|
||||||
// BRA specific
|
// BRA specific
|
||||||
kZonePath = 0x1000, // defines nodes for assisting walk calculation routines
|
kZonePath = 13, // defines nodes for assisting walk calculation routines
|
||||||
kZoneBox = 0x2000
|
kZoneBox = 14
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -196,6 +196,8 @@ protected:
|
||||||
void parseAnswerBody(Answer *answer);
|
void parseAnswerBody(Answer *answer);
|
||||||
Question *parseQuestion();
|
Question *parseQuestion();
|
||||||
|
|
||||||
|
uint32 buildZoneType(const char *t0, const char* t1);
|
||||||
|
|
||||||
void parseZone(ZoneList &list, char *name);
|
void parseZone(ZoneList &list, char *name);
|
||||||
virtual void parseZoneTypeBlock(ZonePtr z);
|
virtual void parseZoneTypeBlock(ZonePtr z);
|
||||||
void parsePointList(PointList &list);
|
void parsePointList(PointList &list);
|
||||||
|
|
|
@ -737,15 +737,11 @@ DECLARE_ZONE_PARSER(moveto) {
|
||||||
DECLARE_ZONE_PARSER(type) {
|
DECLARE_ZONE_PARSER(type) {
|
||||||
debugC(7, kDebugParser, "ZONE_PARSER(type) ");
|
debugC(7, kDebugParser, "ZONE_PARSER(type) ");
|
||||||
|
|
||||||
if (_tokens[2][0] != '\0') {
|
ctxt.z->_type = buildZoneType(_tokens[1], _tokens[2]);
|
||||||
ctxt.z->_type = (4 + _vm->_objectsNames->lookup(_tokens[2])) << 16;
|
if (ACTIONTYPE(ctxt.z) != 0) {
|
||||||
}
|
|
||||||
int16 _si = _zoneTypeNames->lookup(_tokens[1]);
|
|
||||||
if (_si != Table::notFound) {
|
|
||||||
ctxt.z->_type |= 1 << (_si - 1);
|
|
||||||
parseZoneTypeBlock(ctxt.z);
|
parseZoneTypeBlock(ctxt.z);
|
||||||
|
|
||||||
// if (ctxt.z->_type & kZoneHear) {
|
// if (ACTIONTYPE(ctxt.z) == kZoneHear) {
|
||||||
// _soundMan->sfxCommand(START...);
|
// _soundMan->sfxCommand(START...);
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,15 +211,9 @@ DECLARE_ANIM_PARSER(commands) {
|
||||||
DECLARE_ANIM_PARSER(type) {
|
DECLARE_ANIM_PARSER(type) {
|
||||||
debugC(7, kDebugParser, "ANIM_PARSER(type) ");
|
debugC(7, kDebugParser, "ANIM_PARSER(type) ");
|
||||||
|
|
||||||
if (_tokens[2][0] != '\0') {
|
ctxt.a->_type = buildZoneType(_tokens[1], _tokens[2]);
|
||||||
ctxt.a->_type = PACK_ZONETYPE(0, 4 + _vm->_objectsNames->lookup(_tokens[2]));
|
if ((ACTIONTYPE(ctxt.a) != 0) && (ACTIONTYPE(ctxt.a) != kZoneCommand)) {
|
||||||
}
|
parseZoneTypeBlock(ctxt.a);
|
||||||
int16 _si = _zoneTypeNames->lookup(_tokens[1]);
|
|
||||||
if (_si != Table::notFound) {
|
|
||||||
ctxt.a->_type |= 1 << (_si-1);
|
|
||||||
if (/*(ACTIONTYPE(ctxt.a) != kZoneNone) &&*/ (ACTIONTYPE(ctxt.a) != kZoneCommand)) {
|
|
||||||
parseZoneTypeBlock(ctxt.a);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ctxt.a->_flags |= 0x1000000;
|
ctxt.a->_flags |= 0x1000000;
|
||||||
|
@ -1314,16 +1308,21 @@ DECLARE_ZONE_PARSER(moveto) {
|
||||||
ctxt.z->_moveTo.y = atoi(_tokens[2]);
|
ctxt.z->_moveTo.y = atoi(_tokens[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint32 LocationParser_ns::buildZoneType(const char *t0, const char* t1) {
|
||||||
|
uint16 it = 0;
|
||||||
|
if (t1[0] != '\0') {
|
||||||
|
it = 4 + _vm->_objectsNames->lookup(t1);
|
||||||
|
}
|
||||||
|
uint16 zt = _zoneTypeNames->lookup(t0);
|
||||||
|
return PACK_ZONETYPE(zt, it);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
DECLARE_ZONE_PARSER(type) {
|
DECLARE_ZONE_PARSER(type) {
|
||||||
debugC(7, kDebugParser, "ZONE_PARSER(type) ");
|
debugC(7, kDebugParser, "ZONE_PARSER(type) ");
|
||||||
|
|
||||||
if (_tokens[2][0] != '\0') {
|
ctxt.z->_type = buildZoneType(_tokens[1], _tokens[2]);
|
||||||
ctxt.z->_type = (4 + _vm->_objectsNames->lookup(_tokens[2])) << 16;
|
if (ACTIONTYPE(ctxt.z) != 0) {
|
||||||
}
|
|
||||||
int16 _si = _zoneTypeNames->lookup(_tokens[1]);
|
|
||||||
if (_si != Table::notFound) {
|
|
||||||
ctxt.z->_type |= 1 << (_si - 1);
|
|
||||||
parseZoneTypeBlock(ctxt.z);
|
parseZoneTypeBlock(ctxt.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue