diff options
-rw-r--r-- | engines/parallaction/callables_ns.cpp | 12 | ||||
-rw-r--r-- | engines/parallaction/exec_ns.cpp | 6 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 2 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 42 | ||||
-rw-r--r-- | engines/parallaction/parallaction_ns.cpp | 3 | ||||
-rw-r--r-- | engines/parallaction/parser_ns.cpp | 18 | ||||
-rw-r--r-- | engines/parallaction/walk.cpp | 8 | ||||
-rw-r--r-- | engines/parallaction/walk.h | 4 |
8 files changed, 49 insertions, 46 deletions
diff --git a/engines/parallaction/callables_ns.cpp b/engines/parallaction/callables_ns.cpp index 72b5de28f4..ae7b485d8d 100644 --- a/engines/parallaction/callables_ns.cpp +++ b/engines/parallaction/callables_ns.cpp @@ -36,14 +36,6 @@ namespace Parallaction { -/* - game callables data members -*/ - -static ZonePtr _moveSarcZone0; -static int16 _introSarcData1 = 0; -static ZonePtr _moveSarcZone1; - // part completion messages static const char *endMsg0[] = {"COMPLIMENTI!", "BRAVO!", "CONGRATULATIONS!", "PRIMA!"}; static const char *endMsg1[] = {"HAI FINITO QUESTA PARTE", "TU AS COMPLETE' CETTE AVENTURE", "YOU HAVE COMPLETED THIS PART", "DU HAST EIN ABENTEUER ERFOLGREICH"}; @@ -55,15 +47,11 @@ static const char *endMsg5[] = {"HAI FINITO LE TRE PARTI", "TU AS COMPLETE' LES static const char *endMsg6[] = {"DELL' AVVENTURA", "DE L'AVENTURE", "OF THIS ADVENTURE", "ZU ENDE GEFUHRT"}; static const char *endMsg7[] = {"ED ORA IL GRAN FINALE ", "ET MAINTENANT LE GRAND FINAL", "NOW THE GREAT FINAL", "UND YETZT DER GROSSE SCHLUSS!"}; -static uint16 num_foglie = 0; -static ZonePtr _moveSarcZones[5]; -static ZonePtr _moveSarcExaZones[5]; /* intro callables data members */ -static AnimationPtr _rightHandAnim; static uint16 _rightHandPositions[684] = { 0x0064, 0x0046, 0x006c, 0x0046, 0x0074, 0x0046, 0x007c, 0x0046, diff --git a/engines/parallaction/exec_ns.cpp b/engines/parallaction/exec_ns.cpp index c383920f18..ed4592646b 100644 --- a/engines/parallaction/exec_ns.cpp +++ b/engines/parallaction/exec_ns.cpp @@ -496,7 +496,7 @@ void Parallaction::displayComment(ExamineData *data) { -uint16 Parallaction::runZone(ZonePtr& z) { +uint16 Parallaction::runZone(ZonePtr z) { debugC(3, kDebugExec, "runZone (%s)", z->_name); uint16 subtype = z->_type & 0xFFFF; @@ -542,7 +542,7 @@ uint16 Parallaction::runZone(ZonePtr& z) { // // ZONE TYPE: DOOR // -void Parallaction::updateDoor(ZonePtr& z) { +void Parallaction::updateDoor(ZonePtr z) { if (z->u.door->gfxobj) { uint frame = (z->_flags & kFlagsClosed ? 0 : 1); @@ -559,7 +559,7 @@ void Parallaction::updateDoor(ZonePtr& z) { // ZONE TYPE: GET // -int16 Parallaction::pickupItem(ZonePtr &z) { +int16 Parallaction::pickupItem(ZonePtr z) { int r = addInventoryItem(z->u.get->_icon); if (r != -1) { _gfx->showGfxObj(z->u.get->gfxobj, false); diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 9a70956f8b..1b69b163f4 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -620,7 +620,7 @@ void Parallaction::parseStatement() { -AnimationPtr& Parallaction::findAnimation(const char *name) { +AnimationPtr Parallaction::findAnimation(const char *name) { for (AnimationList::iterator it = _animations.begin(); it != _animations.end(); it++) if (!scumm_stricmp((*it)->_name, name)) return *it; diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index ba1d0701b7..3673f047fb 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -341,19 +341,19 @@ public: void resumeJobs(); void finalizeWalk(WalkNodeList *list); - int16 selectWalkFrame(const Common::Point& pos, const WalkNodePtr& from); - void clipMove(Common::Point& pos, const WalkNodePtr& from); + int16 selectWalkFrame(const Common::Point& pos, const WalkNodePtr from); + void clipMove(Common::Point& pos, const WalkNodePtr from); ZonePtr findZone(const char *name); ZonePtr hitZone(uint32 type, uint16 x, uint16 y); - uint16 runZone(ZonePtr& z); + uint16 runZone(ZonePtr z); void freeZones(); void runDialogue(SpeakData*); void runCommands(CommandList& list, ZonePtr z = nullZonePtr); - AnimationPtr &findAnimation(const char *name); + AnimationPtr findAnimation(const char *name); void freeAnimations(); void setBackground(const char *background, const char *mask, const char *path); @@ -481,7 +481,7 @@ protected: // members void freeCharacter(); - int16 pickupItem(ZonePtr &z); + int16 pickupItem(ZonePtr z); public: virtual void callFunction(uint index, void* parm) { } @@ -491,7 +491,7 @@ public: virtual void parseLocation(const char* name) = 0; - void updateDoor(ZonePtr &z); + void updateDoor(ZonePtr z); virtual void runScripts() = 0; virtual void walk() = 0; @@ -621,6 +621,18 @@ private: static const Callable _dosCallables[25]; static const Callable _amigaCallables[25]; + /* + game callables data members + */ + + ZonePtr _moveSarcZone0; + int16 _introSarcData1; + ZonePtr _moveSarcZone1; + uint16 num_foglie; + ZonePtr _moveSarcZones[5]; + ZonePtr _moveSarcExaZones[5]; + AnimationPtr _rightHandAnim; + // common callables void _c_play_boogie(void*); void _c_startIntro(void*); @@ -734,12 +746,12 @@ protected: DECLARE_UNQUALIFIED_COMMAND_PARSER(move); DECLARE_UNQUALIFIED_COMMAND_PARSER(endcommands); - virtual void parseGetData(Script &script, ZonePtr& z); - virtual void parseExamineData(Script &script, ZonePtr& z); - virtual void parseDoorData(Script &script, ZonePtr& z); - virtual void parseMergeData(Script &script, ZonePtr& z); - virtual void parseHearData(Script &script, ZonePtr& z); - virtual void parseSpeakData(Script &script, ZonePtr& z); + virtual void parseGetData(Script &script, ZonePtr z); + virtual void parseExamineData(Script &script, ZonePtr z); + virtual void parseDoorData(Script &script, ZonePtr z); + virtual void parseMergeData(Script &script, ZonePtr z); + virtual void parseHearData(Script &script, ZonePtr z); + virtual void parseSpeakData(Script &script, ZonePtr z); void parseLocation(const char *filename); char *parseComment(Script &script); @@ -755,7 +767,7 @@ protected: void parseAnimation(Script &script, AnimationList &list, char *name); void parseCommands(Script &script, CommandList&); void parseCommandFlags(); - void saveCommandForward(const char *name, CommandPtr &cmd); + void saveCommandForward(const char *name, CommandPtr cmd); void resolveCommandForwards(); void createCommand(uint id); void addCommand(); @@ -799,8 +811,8 @@ protected: DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(null); DECLARE_UNQUALIFIED_INSTRUCTION_PARSER(endscript); - void parseInstruction(ProgramPtr &program); - void loadProgram(AnimationPtr &a, const char *filename); + void parseInstruction(ProgramPtr program); + void loadProgram(AnimationPtr a, const char *filename); void parseLValue(ScriptVar &var, const char *str); virtual void parseRValue(ScriptVar &var, const char *str); void wrapLocalVar(LocalVariable *local); diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp index 573306e525..b354be4f49 100644 --- a/engines/parallaction/parallaction_ns.cpp +++ b/engines/parallaction/parallaction_ns.cpp @@ -137,6 +137,9 @@ int Parallaction_ns::init() { initOpcodes(); initParsers(); + _introSarcData1 = 0; + num_foglie = 0; + _animations.push_front(_char._ani); Parallaction::init(); diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp index 8ed4709bd0..5e4bdf25cf 100644 --- a/engines/parallaction/parser_ns.cpp +++ b/engines/parallaction/parser_ns.cpp @@ -194,7 +194,7 @@ void Parallaction_ns::parseAnimation(Script& script, AnimationList &list, char * pushParserTables(&_locationAnimParsers, _locationAnimStmt); } -void Parallaction_ns::parseInstruction(ProgramPtr &program) { +void Parallaction_ns::parseInstruction(ProgramPtr program) { InstructionPtr inst(new Instruction); @@ -219,7 +219,7 @@ void Parallaction_ns::parseInstruction(ProgramPtr &program) { return; } -void Parallaction_ns::loadProgram(AnimationPtr &a, const char *filename) { +void Parallaction_ns::loadProgram(AnimationPtr a, const char *filename) { debugC(1, kDebugParser, "loadProgram(Animation: %s, script: %s)", a->_name, filename); Script *script = _disk->loadScript(filename); @@ -653,7 +653,7 @@ void Parallaction_ns::createCommand(uint id) { } -void Parallaction_ns::saveCommandForward(const char *name, CommandPtr &cmd) { +void Parallaction_ns::saveCommandForward(const char *name, CommandPtr cmd) { assert(_numForwardedCommands < MAX_FORWARDS); strcpy(_forwardedCommands[_numForwardedCommands].name, name); @@ -1282,7 +1282,7 @@ void Parallaction_ns::parseZone(Script &script, ZoneList &list, char *name) { -void Parallaction_ns::parseGetData(Script &script, ZonePtr &z) { +void Parallaction_ns::parseGetData(Script &script, ZonePtr z) { GetData *data = new GetData; @@ -1313,7 +1313,7 @@ void Parallaction_ns::parseGetData(Script &script, ZonePtr &z) { } -void Parallaction_ns::parseExamineData(Script &script, ZonePtr &z) { +void Parallaction_ns::parseExamineData(Script &script, ZonePtr z) { ExamineData *data = new ExamineData; @@ -1334,7 +1334,7 @@ void Parallaction_ns::parseExamineData(Script &script, ZonePtr &z) { } -void Parallaction_ns::parseDoorData(Script &script, ZonePtr &z) { +void Parallaction_ns::parseDoorData(Script &script, ZonePtr z) { DoorData *data = new DoorData; @@ -1378,7 +1378,7 @@ void Parallaction_ns::parseDoorData(Script &script, ZonePtr &z) { } -void Parallaction_ns::parseMergeData(Script &script, ZonePtr &z) { +void Parallaction_ns::parseMergeData(Script &script, ZonePtr z) { MergeData *data = new MergeData; @@ -1401,7 +1401,7 @@ void Parallaction_ns::parseMergeData(Script &script, ZonePtr &z) { } -void Parallaction_ns::parseHearData(Script &script, ZonePtr &z) { +void Parallaction_ns::parseHearData(Script &script, ZonePtr z) { HearData *data = new HearData; @@ -1422,7 +1422,7 @@ void Parallaction_ns::parseHearData(Script &script, ZonePtr &z) { } -void Parallaction_ns::parseSpeakData(Script &script, ZonePtr &z) { +void Parallaction_ns::parseSpeakData(Script &script, ZonePtr z) { SpeakData *data = new SpeakData; diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp index e10a5785f5..3272a16179 100644 --- a/engines/parallaction/walk.cpp +++ b/engines/parallaction/walk.cpp @@ -208,7 +208,7 @@ WalkNodeList *PathBuilder::buildPath(uint16 x, uint16 y) { // 1 : Point reachable in a straight line // other values: square distance to target (point not reachable in a straight line) // -uint16 PathBuilder::walkFunc1(int16 x, int16 y, WalkNodePtr &Node) { +uint16 PathBuilder::walkFunc1(int16 x, int16 y, WalkNodePtr Node) { Common::Point arg(x, y); @@ -259,7 +259,7 @@ uint16 PathBuilder::walkFunc1(int16 x, int16 y, WalkNodePtr &Node) { return 1; } -void Parallaction::clipMove(Common::Point& pos, const WalkNodePtr& from) { +void Parallaction::clipMove(Common::Point& pos, const WalkNodePtr from) { if ((pos.x < from->_x) && (pos.x < _pathBuffer->w) && (_pathBuffer->getValue(pos.x + 2, pos.y) != 0)) { pos.x = (pos.x + 2 < from->_x) ? pos.x + 2 : from->_x; @@ -280,7 +280,7 @@ void Parallaction::clipMove(Common::Point& pos, const WalkNodePtr& from) { return; } -int16 Parallaction::selectWalkFrame(const Common::Point& pos, const WalkNodePtr& from) { +int16 Parallaction::selectWalkFrame(const Common::Point& pos, const WalkNodePtr from) { Common::Point dist(from->_x - pos.x, from->_y - pos.y); @@ -442,7 +442,7 @@ void WalkNode::getPoint(Common::Point &p) const { p.y = _y; } -PathBuilder::PathBuilder(AnimationPtr &anim) : _anim(anim), _list(0) { +PathBuilder::PathBuilder(AnimationPtr anim) : _anim(anim), _list(0) { } diff --git a/engines/parallaction/walk.h b/engines/parallaction/walk.h index f4684cb822..788a6e1375 100644 --- a/engines/parallaction/walk.h +++ b/engines/parallaction/walk.h @@ -58,10 +58,10 @@ class PathBuilder { void correctPathPoint(Common::Point &to); uint32 buildSubPath(const Common::Point& pos, const Common::Point& stop); - uint16 walkFunc1(int16 x, int16 y, WalkNodePtr& Node); + uint16 walkFunc1(int16 x, int16 y, WalkNodePtr Node); public: - PathBuilder(AnimationPtr &anim); + PathBuilder(AnimationPtr anim); WalkNodeList* buildPath(uint16 x, uint16 y); }; |