diff options
-rw-r--r-- | engines/parallaction/parser.h | 14 | ||||
-rw-r--r-- | engines/parallaction/parser_br.cpp | 37 | ||||
-rw-r--r-- | engines/parallaction/parser_ns.cpp | 33 |
3 files changed, 44 insertions, 40 deletions
diff --git a/engines/parallaction/parser.h b/engines/parallaction/parser.h index b7c8a9e029..3672fd3b09 100644 --- a/engines/parallaction/parser.h +++ b/engines/parallaction/parser.h @@ -172,14 +172,14 @@ protected: DECLARE_UNQUALIFIED_COMMAND_PARSER(simple); DECLARE_UNQUALIFIED_COMMAND_PARSER(move); DECLARE_UNQUALIFIED_COMMAND_PARSER(endcommands); - +public: virtual void parseGetData(ZonePtr z); virtual void parseExamineData(ZonePtr z); virtual void parseDoorData(ZonePtr z); virtual void parseMergeData(ZonePtr z); virtual void parseHearData(ZonePtr z); virtual void parseSpeakData(ZonePtr z); - +protected: Common::String parseComment(); Common::String parseDialogueString(); Dialogue *parseDialogue(); @@ -289,10 +289,12 @@ protected: DECLARE_UNQUALIFIED_ANIM_PARSER(endanimation); virtual void parseZoneTypeBlock(ZonePtr z); - void parsePathData(ZonePtr z); - void parseGetData(ZonePtr z); - void parseDoorData(ZonePtr z); - void parseAnswerCounter(Answer *answer); +public: + virtual void parsePathData(ZonePtr z); + virtual void parseGetData(ZonePtr z); + virtual void parseDoorData(ZonePtr z); +protected: + void parseAnswerCounter(Answer *answer); virtual Answer *parseAnswer(); public: diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp index b1dd86a693..563faa16e6 100644 --- a/engines/parallaction/parser_br.cpp +++ b/engines/parallaction/parser_br.cpp @@ -808,26 +808,27 @@ void LocationParser_br::parseDoorData(ZonePtr z) { } } +typedef void (LocationParser_br::*ZoneTypeParser)(ZonePtr); +static ZoneTypeParser parsers[] = { + 0, // no type + &LocationParser_br::parseExamineData, + &LocationParser_br::parseDoorData, + &LocationParser_br::parseGetData, + &LocationParser_br::parseMergeData, + 0, // taste + &LocationParser_br::parseHearData, + 0, // feel + &LocationParser_br::parseSpeakData, + 0, // none + 0, // trap + 0, // you + 0, // command + &LocationParser_br::parsePathData, + 0, // box +}; + void LocationParser_br::parseZoneTypeBlock(ZonePtr z) { debugC(7, kDebugParser, "parseZoneTypeBlock(name: %s, type: %x)", z->_name, z->_type); - typedef void (LocationParser_br::*ZoneTypeParser)(ZonePtr); - ZoneTypeParser parsers[] = { - 0, // no type - &LocationParser_br::parseExamineData, - &LocationParser_br::parseDoorData, - &LocationParser_br::parseGetData, - &LocationParser_br::parseMergeData, - 0, // taste - &LocationParser_br::parseHearData, - 0, // feel - &LocationParser_br::parseSpeakData, - 0, // none - 0, // trap - 0, // you - 0, // command - &LocationParser_br::parsePathData, - 0, // box - }; ZoneTypeParser p = parsers[ACTIONTYPE(z)]; do { diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp index 9971828c31..1c06f86bfa 100644 --- a/engines/parallaction/parser_ns.cpp +++ b/engines/parallaction/parser_ns.cpp @@ -1411,24 +1411,25 @@ void LocationParser_ns::parseSpeakData(ZonePtr z) { } } +typedef void (LocationParser_ns::*ZoneTypeParser)(ZonePtr); +static ZoneTypeParser parsers[] = { + 0, // no type + &LocationParser_ns::parseExamineData, + &LocationParser_ns::parseDoorData, + &LocationParser_ns::parseGetData, + &LocationParser_ns::parseMergeData, + 0, // taste + &LocationParser_ns::parseHearData, + 0, // feel + &LocationParser_ns::parseSpeakData, + 0, // none + 0, // trap + 0, // you + 0 // command +}; + void LocationParser_ns::parseZoneTypeBlock(ZonePtr z) { debugC(7, kDebugParser, "parseZoneTypeBlock(name: %s, type: %x)", z->_name, z->_type); - typedef void (LocationParser_ns::*ZoneTypeParser)(ZonePtr); - ZoneTypeParser parsers[] = { - 0, // no type - &LocationParser_ns::parseExamineData, - &LocationParser_ns::parseDoorData, - &LocationParser_ns::parseGetData, - &LocationParser_ns::parseMergeData, - 0, // taste - &LocationParser_ns::parseHearData, - 0, // feel - &LocationParser_ns::parseSpeakData, - 0, // none - 0, // trap - 0, // you - 0 // command - }; ZoneTypeParser p = parsers[ACTIONTYPE(z)]; do { |