aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorNicola Mettifogo2007-05-13 14:38:05 +0000
committerNicola Mettifogo2007-05-13 14:38:05 +0000
commitae63466446af9b906d7a1795aaeb866956bd0c13 (patch)
tree62ff3badf0d562ebec573d737948a33bee50fa85 /engines
parenta8c6dc6e7d1594791f0d47b1f4877b4a655053a3 (diff)
downloadscummvm-rg350-ae63466446af9b906d7a1795aaeb866956bd0c13.tar.gz
scummvm-rg350-ae63466446af9b906d7a1795aaeb866956bd0c13.tar.bz2
scummvm-rg350-ae63466446af9b906d7a1795aaeb866956bd0c13.zip
cleanup
svn-id: r26834
Diffstat (limited to 'engines')
-rw-r--r--engines/parallaction/animation.cpp8
-rw-r--r--engines/parallaction/callables.cpp5
-rw-r--r--engines/parallaction/commands.cpp5
-rw-r--r--engines/parallaction/commands.h1
-rw-r--r--engines/parallaction/debug.cpp3
-rw-r--r--engines/parallaction/dialogue.cpp11
-rw-r--r--engines/parallaction/disk.cpp12
-rw-r--r--engines/parallaction/font.cpp2
-rw-r--r--engines/parallaction/graphics.cpp5
-rw-r--r--engines/parallaction/intro.cpp2
-rw-r--r--engines/parallaction/inventory.cpp51
-rw-r--r--engines/parallaction/inventory.h2
-rw-r--r--engines/parallaction/location.cpp6
-rw-r--r--engines/parallaction/menu.cpp4
-rw-r--r--engines/parallaction/parallaction.cpp7
-rw-r--r--engines/parallaction/parallaction.h34
-rw-r--r--engines/parallaction/parser.cpp6
-rw-r--r--engines/parallaction/parser.h1
-rw-r--r--engines/parallaction/saveload.cpp4
-rw-r--r--engines/parallaction/staticres.cpp1
-rw-r--r--engines/parallaction/walk.cpp126
-rw-r--r--engines/parallaction/walk.h8
-rw-r--r--engines/parallaction/zone.cpp6
-rw-r--r--engines/parallaction/zone.h8
24 files changed, 125 insertions, 193 deletions
diff --git a/engines/parallaction/animation.cpp b/engines/parallaction/animation.cpp
index b2097c15d8..67dc25994e 100644
--- a/engines/parallaction/animation.cpp
+++ b/engines/parallaction/animation.cpp
@@ -20,13 +20,9 @@
*
*/
-#include "parallaction/disk.h"
+#include "common/stdafx.h"
+
#include "parallaction/parallaction.h"
-#include "parallaction/graphics.h"
-#include "parallaction/sound.h"
-#include "parallaction/parser.h"
-#include "parallaction/walk.h"
-#include "parallaction/zone.h"
namespace Parallaction {
diff --git a/engines/parallaction/callables.cpp b/engines/parallaction/callables.cpp
index 647e686636..3af7981293 100644
--- a/engines/parallaction/callables.cpp
+++ b/engines/parallaction/callables.cpp
@@ -26,13 +26,10 @@
#include "common/file.h"
-#include "parallaction/disk.h"
#include "parallaction/parallaction.h"
-#include "parallaction/graphics.h"
-#include "parallaction/inventory.h"
#include "parallaction/menu.h"
#include "parallaction/sound.h"
-#include "parallaction/zone.h"
+
namespace Parallaction {
diff --git a/engines/parallaction/commands.cpp b/engines/parallaction/commands.cpp
index 087abed156..d53763dfa8 100644
--- a/engines/parallaction/commands.cpp
+++ b/engines/parallaction/commands.cpp
@@ -23,10 +23,7 @@
#include "common/stdafx.h"
#include "parallaction/parallaction.h"
-#include "parallaction/parser.h"
-#include "parallaction/commands.h"
-#include "parallaction/walk.h"
-#include "parallaction/zone.h"
+
namespace Parallaction {
diff --git a/engines/parallaction/commands.h b/engines/parallaction/commands.h
index 91410218b9..dee063de66 100644
--- a/engines/parallaction/commands.h
+++ b/engines/parallaction/commands.h
@@ -73,7 +73,6 @@ struct Command {
~Command();
};
-//typedef Common::List<Command*> CommandList;
typedef ManagedList<Command*> CommandList;
} // namespace Parallaction
diff --git a/engines/parallaction/debug.cpp b/engines/parallaction/debug.cpp
index 58909d07fa..9b48a187cc 100644
--- a/engines/parallaction/debug.cpp
+++ b/engines/parallaction/debug.cpp
@@ -23,9 +23,8 @@
#include "common/stdafx.h"
#include "common/system.h"
-#include "parallaction/parallaction.h"
-#include "parallaction/graphics.h"
+#include "parallaction/parallaction.h"
#include "parallaction/debug.h"
namespace Parallaction {
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp
index f84bf48982..8d1d6e2643 100644
--- a/engines/parallaction/dialogue.cpp
+++ b/engines/parallaction/dialogue.cpp
@@ -22,15 +22,10 @@
#include "common/stdafx.h"
-#include "parallaction/commands.h"
+#include "common/events.h"
#include "parallaction/parallaction.h"
-#include "parallaction/graphics.h"
-#include "parallaction/disk.h"
-#include "parallaction/inventory.h"
-#include "parallaction/parser.h"
-#include "parallaction/zone.h"
-#include "common/events.h"
+
namespace Parallaction {
@@ -184,7 +179,7 @@ char *Parallaction::parseDialogueString(Script &script) {
} while (strlen(vD0) == 0);
- vD0[strlen(vD0)-1] = '\0'; // deletes the trailing '0xA' inserted by parseNextLine
+ vD0[strlen(vD0)-1] = '\0'; // deletes the trailing '0xA'
// this is critical for Gfx::displayBalloonString to work properly
char *vCC = (char*)malloc(strlen(vD0)+1);
diff --git a/engines/parallaction/disk.cpp b/engines/parallaction/disk.cpp
index 3cffbf05af..dab34460f1 100644
--- a/engines/parallaction/disk.cpp
+++ b/engines/parallaction/disk.cpp
@@ -23,12 +23,8 @@
#include "common/stdafx.h"
#include "graphics/iff.h"
-
-#include "parallaction/defs.h"
-#include "parallaction/graphics.h"
#include "parallaction/parallaction.h"
-#include "parallaction/disk.h"
-#include "parallaction/walk.h"
+
namespace Audio {
AudioStream *make8SVXStream(Common::ReadStream &input);
@@ -418,7 +414,7 @@ void DosDisk::loadBackground(const char *filename) {
_vm->_gfx->setBackground(bg);
_vm->_gfx->setMask(mask);
- setPath(path);
+ _vm->setPath(path);
free(bg);
free(mask);
@@ -449,7 +445,7 @@ void DosDisk::loadMaskAndPath(const char *name) {
_resArchive.read(maskBuf, SCREENMASK_WIDTH*SCREEN_HEIGHT);
_vm->_gfx->setMask(maskBuf);
- setPath(pathBuf);
+ _vm->setPath(pathBuf);
return;
}
@@ -1066,7 +1062,7 @@ void AmigaDisk::loadPath(const char *name) {
Graphics::PackBitsReadStream stream(*s);
byte *buf = (byte*)malloc(SCREENPATH_WIDTH*SCREEN_HEIGHT);
stream.read(buf, SCREENPATH_WIDTH*SCREEN_HEIGHT);
- setPath(buf);
+ _vm->setPath(buf);
free(buf);
delete s;
diff --git a/engines/parallaction/font.cpp b/engines/parallaction/font.cpp
index 12e5c757a7..ad06b2000b 100644
--- a/engines/parallaction/font.cpp
+++ b/engines/parallaction/font.cpp
@@ -24,8 +24,6 @@
#include "common/endian.h"
#include "common/stream.h"
-#include "parallaction/defs.h"
-#include "parallaction/graphics.h"
#include "parallaction/parallaction.h"
namespace Parallaction {
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index ef9f24c472..0a6d00f24b 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -24,11 +24,8 @@
#include "common/system.h"
#include "common/file.h"
-#include "parallaction/graphics.h"
-#include "parallaction/parser.h"
#include "parallaction/parallaction.h"
-#include "parallaction/disk.h"
-#include "parallaction/zone.h"
+
extern OSystem *g_system;
diff --git a/engines/parallaction/intro.cpp b/engines/parallaction/intro.cpp
index 3e8ffc421a..919b480634 100644
--- a/engines/parallaction/intro.cpp
+++ b/engines/parallaction/intro.cpp
@@ -25,8 +25,6 @@
#include "parallaction/parallaction.h"
#include "parallaction/menu.h"
#include "parallaction/sound.h"
-#include "parallaction/graphics.h"
-#include "parallaction/zone.h"
#include "graphics/primitives.h"
diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp
index 48d2ebdfcd..70a0349d89 100644
--- a/engines/parallaction/inventory.cpp
+++ b/engines/parallaction/inventory.cpp
@@ -23,10 +23,7 @@
#include "common/stdafx.h"
#include "parallaction/parallaction.h"
-#include "parallaction/disk.h"
-#include "parallaction/zone.h"
-#include "parallaction/graphics.h"
-#include "parallaction/inventory.h"
+
namespace Parallaction {
@@ -116,6 +113,21 @@ int16 Parallaction::getHoverInventoryItem(int16 x, int16 y) {
}
+void refreshInventory(const char *character) {
+ for (uint16 _si = 0; _si < INVENTORY_MAX_ITEMS; _si++) {
+ drawInventoryItem(_si, &_inventory[_si]);
+ }
+
+ return;
+}
+
+
+void refreshInventoryItem(const char *character, uint16 index) {
+ drawInventoryItem(index, &_inventory[index]);
+
+ return;
+}
+
int Parallaction::addInventoryItem(uint16 item) {
uint16 _si = 0;
@@ -164,6 +176,9 @@ int16 Parallaction::isItemInInventory(int32 v) {
+
+
+
void drawInventoryItem(uint16 pos, InventoryItem *item) {
uint16 line = pos / INVENTORY_ITEMS_PER_LINE;
@@ -325,19 +340,6 @@ void closeInventory() {
_engineFlags &= ~kEngineInventory;
}
-
-
-// refreshes inventory view
-//
-void redrawInventory() {
-
-
- for (uint16 _si = 0; _si < INVENTORY_MAX_ITEMS; _si++) {
- drawInventoryItem(_si, &_inventory[_si]);
- }
-
-}
-
void initInventory() {
_buffer = (byte*)malloc(INVENTORY_WIDTH * INVENTORY_HEIGHT); // this buffer is also used by menu so it must stay this size
@@ -354,19 +356,4 @@ void cleanInventory() {
}
-
-
-void refreshInventory(const char *character) {
- redrawInventory();
-
- return;
-}
-
-
-void refreshInventoryItem(const char *character, uint16 index) {
- drawInventoryItem(index, &_inventory[index]);
-
- return;
-}
-
} // namespace Parallaction
diff --git a/engines/parallaction/inventory.h b/engines/parallaction/inventory.h
index 8adf546529..89ec6db01e 100644
--- a/engines/parallaction/inventory.h
+++ b/engines/parallaction/inventory.h
@@ -47,9 +47,7 @@ int16 isItemInInventory(int32 v);
void cleanInventory();
void addInventoryItem(uint16 item);
-void redrawInventory();
void highlightInventoryItem(int16 pos, byte color);
-void refreshInventoryItem(const char *character, uint16 index);
void refreshInventory(const char *character);
void extractInventoryGraphics(int16 pos, byte *dst);
diff --git a/engines/parallaction/location.cpp b/engines/parallaction/location.cpp
index ade8f1a1d5..14d8a6ab43 100644
--- a/engines/parallaction/location.cpp
+++ b/engines/parallaction/location.cpp
@@ -23,13 +23,7 @@
#include "common/stdafx.h"
#include "parallaction/parallaction.h"
-#include "parallaction/graphics.h"
-#include "parallaction/disk.h"
-#include "parallaction/parser.h"
#include "parallaction/sound.h"
-#include "parallaction/commands.h"
-#include "parallaction/walk.h"
-#include "parallaction/zone.h"
namespace Parallaction {
diff --git a/engines/parallaction/menu.cpp b/engines/parallaction/menu.cpp
index 485c373bf8..ecd5f0157e 100644
--- a/engines/parallaction/menu.cpp
+++ b/engines/parallaction/menu.cpp
@@ -23,11 +23,9 @@
#include "common/stdafx.h"
#include "common/system.h"
+#include "parallaction/parallaction.h"
#include "parallaction/menu.h"
-#include "parallaction/disk.h"
#include "parallaction/sound.h"
-#include "parallaction/graphics.h"
-#include "parallaction/parallaction.h"
namespace Parallaction {
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index 2a93065eff..6095e43c40 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -33,13 +33,8 @@
#include "parallaction/parallaction.h"
#include "parallaction/debug.h"
#include "parallaction/menu.h"
-#include "parallaction/parser.h"
-#include "parallaction/disk.h"
#include "parallaction/sound.h"
-#include "parallaction/inventory.h"
-#include "parallaction/graphics.h"
-#include "parallaction/walk.h"
-#include "parallaction/zone.h"
+
namespace Parallaction {
diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h
index 022a7e3d1b..6a64ced769 100644
--- a/engines/parallaction/parallaction.h
+++ b/engines/parallaction/parallaction.h
@@ -315,6 +315,11 @@ public:
void resumeJobs();
void runJobs();
+ void setPath(byte *path);
+ void finalizeWalk(WalkNodeList *list);
+ int16 selectWalkFrame(const Common::Point& pos, const WalkNode* from);
+ void clipMove(Common::Point& pos, const WalkNode* from);
+
Zone *findZone(const char *name);
Zone *hitZone(uint32 type, uint16 x, uint16 y);
uint16 runZone(Zone*);
@@ -400,27 +405,26 @@ protected: // data
JobList _jobs;
+ Common::String _saveFileName;
+
+
protected: // members
bool detectGame(void);
void initGame();
void initGlobals();
-
- Common::String _saveFileName;
- int buildSaveFileList(Common::StringList& l);
- int selectSaveFile(uint16 arg_0, const char* caption, const char* button);
- void doLoadGame(uint16 slot);
- void doSaveGame(uint16 slot, const char* name);
-
+ void initResources();
void runGame();
+ uint32 getElapsedTime();
+ void resetTimer();
InputData *translateInput();
void processInput(InputData*);
- int16 getHoverInventoryItem(int16 x, int16 y);
-
- uint32 getElapsedTime();
- void resetTimer();
+ int buildSaveFileList(Common::StringList& l);
+ int selectSaveFile(uint16 arg_0, const char* caption, const char* button);
+ void doLoadGame(uint16 slot);
+ void doSaveGame(uint16 slot, const char* name);
void doLocationEnterTransition();
void changeLocation(char *location);
@@ -431,10 +435,13 @@ protected: // members
void parseZone(Script &script, ZoneList &list, char *name);
void parseZoneTypeBlock(Script &script, Zone *z);
- void parseWalkNodes(Script& script, WalkNodeList &list);
void displayCharacterComment(ExamineData *data);
void displayItemComment(ExamineData *data);
+ void parseWalkNodes(Script& script, WalkNodeList &list);
+ void initWalk();
+ uint16 checkDoor();
+
Animation * parseAnimation(Script &script, AnimationList &list, char *name);
void parseScriptLine(Instruction *inst, Animation *a, LocalVariable *locals);
void loadProgram(Animation *a, char *filename);
@@ -444,8 +451,6 @@ protected: // members
void freeCharacter();
- void initResources();
-
uint16 askDialoguePassword(Dialogue *q, StaticCnv *face);
bool displayAnswer(Dialogue *q, uint16 i);
bool displayAnswers(Dialogue *q);
@@ -459,6 +464,7 @@ protected: // members
void dropItem(uint16 item);
int16 pickupItem(Zone *z);
int16 isItemInInventory(int32 v);
+ int16 getHoverInventoryItem(int16 x, int16 y);
};
// FIXME: remove global
diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp
index 45b19544a3..f913e4abd0 100644
--- a/engines/parallaction/parser.cpp
+++ b/engines/parallaction/parser.cpp
@@ -20,10 +20,10 @@
*
*/
-#include "parallaction/defs.h"
-#include "parallaction/parser.h"
+#include "common/stdafx.h"
+
#include "parallaction/parallaction.h"
-#include "parallaction/disk.h"
+
namespace Parallaction {
diff --git a/engines/parallaction/parser.h b/engines/parallaction/parser.h
index a6a2019743..e5a2577ca2 100644
--- a/engines/parallaction/parser.h
+++ b/engines/parallaction/parser.h
@@ -29,7 +29,6 @@
namespace Parallaction {
-char *parseNextLine(char *s, uint16 count);
uint16 fillBuffers(Common::SeekableReadStream &stream, bool errorOnEOF = false);
char *parseNextToken(char *s, char *tok, uint16 count, const char *brk);
diff --git a/engines/parallaction/saveload.cpp b/engines/parallaction/saveload.cpp
index db1cd636b0..251f35a24e 100644
--- a/engines/parallaction/saveload.cpp
+++ b/engines/parallaction/saveload.cpp
@@ -28,9 +28,7 @@
#include "gui/message.h"
#include "parallaction/parallaction.h"
-#include "parallaction/disk.h"
-#include "parallaction/graphics.h"
-#include "parallaction/zone.h"
+
/* Nippon Safes savefiles are called 'game.0' to 'game.9'. The game conventiently allows users to
* give meanigful name to savegames, and it uses an extra file 'savegame' to keep track of these
diff --git a/engines/parallaction/staticres.cpp b/engines/parallaction/staticres.cpp
index 9d0eb33848..00317521a2 100644
--- a/engines/parallaction/staticres.cpp
+++ b/engines/parallaction/staticres.cpp
@@ -23,7 +23,6 @@
#include "common/stdafx.h"
#include "parallaction/parallaction.h"
-#include "parallaction/graphics.h"
namespace Parallaction {
diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp
index bd3d5945e0..aae5233e61 100644
--- a/engines/parallaction/walk.cpp
+++ b/engines/parallaction/walk.cpp
@@ -20,17 +20,12 @@
*
*/
-#include "parallaction/defs.h"
+#include "common/stdafx.h"
+
#include "parallaction/parallaction.h"
-#include "parallaction/commands.h"
-#include "parallaction/graphics.h"
-#include "parallaction/walk.h"
-#include "parallaction/zone.h"
namespace Parallaction {
-uint16 walkFunc1(int16, int16, WalkNode *);
-
static byte *_buffer;
static uint16 _doorData1 = 1000;
@@ -40,6 +35,17 @@ static uint16 walkData1 = 0;
static uint16 walkData2 = 0; // next walk frame
+uint16 queryPath(uint16 x, uint16 y) {
+
+ // NOTE: a better solution would have us mirror each byte in the mask in the loading routine
+ // AmigaDisk::loadPath() instead of doing it here.
+
+ byte _al = _buffer[y*40 + x/8];
+ byte _dl = (_vm->getPlatform() == Common::kPlatformPC) ? (x & 7) : (7 - (x & 7));
+
+ return _al & (1 << _dl);
+}
+
// adjusts position towards nearest walkable point
//
void PathBuilder::correctPathPoint(Common::Point &to) {
@@ -208,7 +214,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 walkFunc1(int16 x, int16 y, WalkNode *Node) {
+uint16 PathBuilder::walkFunc1(int16 x, int16 y, WalkNode *Node) {
Common::Point arg(x, y);
@@ -261,7 +267,7 @@ uint16 walkFunc1(int16 x, int16 y, WalkNode *Node) {
return 1;
}
-void clipMove(Common::Point& pos, const WalkNode* from) {
+void Parallaction::clipMove(Common::Point& pos, const WalkNode* from) {
if ((pos.x < from->_x) && (pos.x < SCREEN_WIDTH) && (queryPath(_vm->_char._ani.width()/2 + pos.x + 2, _vm->_char._ani.height() + pos.y) != 0)) {
pos.x = (pos.x + 2 < from->_x) ? pos.x + 2 : from->_x;
@@ -282,7 +288,7 @@ void clipMove(Common::Point& pos, const WalkNode* from) {
return;
}
-int16 selectWalkFrame(const Common::Point& pos, const WalkNode* from) {
+int16 Parallaction::selectWalkFrame(const Common::Point& pos, const WalkNode* from) {
Common::Point dist(from->_x - pos.x, from->_y - pos.y);
@@ -324,53 +330,7 @@ int16 selectWalkFrame(const Common::Point& pos, const WalkNode* from) {
return v16;
}
-void finalizeWalk(WalkNodeList *list) {
- checkDoor();
- delete list;
-}
-
-void jobWalk(void *parm, Job *j) {
- WalkNodeList *list = (WalkNodeList*)parm;
-
- Common::Point pos(_vm->_char._ani._left, _vm->_char._ani._top);
- _vm->_char._ani._oldPos = pos;
-
- WalkNodeList::iterator it = list->begin();
-
- if (it != list->end()) {
- if ((*it)->_x == pos.x && (*it)->_y == pos.y) {
- debugC(1, kDebugWalk, "jobWalk reached node (%i, %i)", (*it)->_x, (*it)->_y);
- it = list->erase(it);
- }
- }
- if (it == list->end()) {
- debugC(1, kDebugWalk, "jobWalk reached last node");
- j->_finished = 1;
- finalizeWalk(list);
- return;
- }
- j->_parm = list;
-
- // selectWalkFrame must be performed before position is changed by clipMove
- int16 v16 = selectWalkFrame(pos, *it);
- clipMove(pos, *it);
-
- _vm->_char._ani._left = pos.x;
- _vm->_char._ani._top = pos.y;
-
- if (pos == _vm->_char._ani._oldPos) {
- debugC(1, kDebugWalk, "jobWalk was blocked by an unforeseen obstacle");
- j->_finished = 1;
- finalizeWalk(list);
- } else {
- _vm->_char._ani._frame = v16 + walkData2 + 1;
- }
-
- return;
-}
-
-
-uint16 checkDoor() {
+uint16 Parallaction::checkDoor() {
// printf("checkDoor()...");
if (_vm->_currentLocationIndex != _doorData1) {
@@ -418,22 +378,58 @@ uint16 checkDoor() {
return _vm->_char._ani._frame;
}
-uint16 queryPath(uint16 x, uint16 y) {
- // NOTE: a better solution would have us mirror each byte in the mask in the loading routine
- // AmigaDisk::loadPath() instead of doing it here.
+void Parallaction::finalizeWalk(WalkNodeList *list) {
+ checkDoor();
+ delete list;
+}
- byte _al = _buffer[y*40 + x/8];
- byte _dl = (_vm->getPlatform() == Common::kPlatformPC) ? (x & 7) : (7 - (x & 7));
+void jobWalk(void *parm, Job *j) {
+ WalkNodeList *list = (WalkNodeList*)parm;
- return _al & (1 << _dl);
+ Common::Point pos(_vm->_char._ani._left, _vm->_char._ani._top);
+ _vm->_char._ani._oldPos = pos;
+
+ WalkNodeList::iterator it = list->begin();
+
+ if (it != list->end()) {
+ if ((*it)->_x == pos.x && (*it)->_y == pos.y) {
+ debugC(1, kDebugWalk, "jobWalk reached node (%i, %i)", (*it)->_x, (*it)->_y);
+ it = list->erase(it);
+ }
+ }
+ if (it == list->end()) {
+ debugC(1, kDebugWalk, "jobWalk reached last node");
+ j->_finished = 1;
+ _vm->finalizeWalk(list);
+ return;
+ }
+ j->_parm = list;
+
+ // selectWalkFrame must be performed before position is changed by clipMove
+ int16 v16 = _vm->selectWalkFrame(pos, *it);
+ _vm->clipMove(pos, *it);
+
+ _vm->_char._ani._left = pos.x;
+ _vm->_char._ani._top = pos.y;
+
+ if (pos == _vm->_char._ani._oldPos) {
+ debugC(1, kDebugWalk, "jobWalk was blocked by an unforeseen obstacle");
+ j->_finished = 1;
+ _vm->finalizeWalk(list);
+ } else {
+ _vm->_char._ani._frame = v16 + walkData2 + 1;
+ }
+
+ return;
}
-void setPath(byte *path) {
+
+void Parallaction::setPath(byte *path) {
memcpy(_buffer, path, SCREENPATH_WIDTH*SCREEN_HEIGHT);
}
-void initWalk() {
+void Parallaction::initWalk() {
_buffer = (byte*)malloc(SCREENPATH_WIDTH * SCREEN_HEIGHT);
}
diff --git a/engines/parallaction/walk.h b/engines/parallaction/walk.h
index b8c11b7a59..eb0aa3643f 100644
--- a/engines/parallaction/walk.h
+++ b/engines/parallaction/walk.h
@@ -44,12 +44,9 @@ public:
typedef ManagedList<WalkNode*> WalkNodeList;
-//WalkNode *buildWalkPath(uint16 x, uint16 y);
+
void jobWalk(void*, Job *j);
-uint16 checkDoor();
-void setPath(byte *path);
-void initWalk();
-uint16 queryPath(uint16 x, uint16 y);
+
class PathBuilder {
@@ -60,6 +57,7 @@ class PathBuilder {
void correctPathPoint(Common::Point &to);
uint32 buildSubPath(const Common::Point& pos, const Common::Point& stop);
+ uint16 walkFunc1(int16 x, int16 y, WalkNode *Node);
public:
PathBuilder(Animation *anim);
diff --git a/engines/parallaction/zone.cpp b/engines/parallaction/zone.cpp
index e4215eae02..176df5a9bc 100644
--- a/engines/parallaction/zone.cpp
+++ b/engines/parallaction/zone.cpp
@@ -21,11 +21,9 @@
*/
-#include "parallaction/parser.h"
+#include "common/stdafx.h"
+
#include "parallaction/parallaction.h"
-#include "parallaction/graphics.h"
-#include "parallaction/inventory.h"
-#include "parallaction/zone.h"
#include "parallaction/sound.h"
namespace Parallaction {
diff --git a/engines/parallaction/zone.h b/engines/parallaction/zone.h
index 707f24f7f2..a2a852f31c 100644
--- a/engines/parallaction/zone.h
+++ b/engines/parallaction/zone.h
@@ -26,6 +26,7 @@
#include "common/list.h"
#include "parallaction/defs.h"
+
#include "parallaction/commands.h"
#include "parallaction/graphics.h"
@@ -311,13 +312,6 @@ struct Animation : public Zone {
typedef Animation* AnimationPointer;
typedef ManagedList<AnimationPointer> AnimationList;
-void dropItem(uint16 v);
-int16 pickupItem(Zone *z);
-
-
-void loadProgram(Animation *, char *filename);
-
-
} // namespace Parallaction