diff options
author | Nicola Mettifogo | 2007-03-12 22:52:27 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-03-12 22:52:27 +0000 |
commit | 88ed62270220560081c7b127e2afc6506a69adc5 (patch) | |
tree | 0fa2528485002e2b548cafa82d111f5954a1e107 /engines/parallaction/walk.cpp | |
parent | cf816f54d9bb8ca826d0950e165a99d732355a86 (diff) | |
download | scummvm-rg350-88ed62270220560081c7b127e2afc6506a69adc5.tar.gz scummvm-rg350-88ed62270220560081c7b127e2afc6506a69adc5.tar.bz2 scummvm-rg350-88ed62270220560081c7b127e2afc6506a69adc5.zip |
moved background path buffer management into walk.cpp
svn-id: r26117
Diffstat (limited to 'engines/parallaction/walk.cpp')
-rw-r--r-- | engines/parallaction/walk.cpp | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp index 8c456f595f..8a1f229cb2 100644 --- a/engines/parallaction/walk.cpp +++ b/engines/parallaction/walk.cpp @@ -24,15 +24,18 @@ #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 *); -uint16 queryPath(uint16 x, uint16 y); + WalkNode _NULL_WALKNODE = { {NULL, NULL}, 0, 0 }; +static byte *_buffer; + static uint16 _doorData1 = 1000; static Zone *_zoneTrap = NULL; @@ -230,11 +233,6 @@ WalkNode *buildWalkPath(uint16 x, uint16 y) { } -uint16 queryPath(uint16 x, uint16 y) { - return _vm->_gfx->queryPath(x, y); -} - - // // x,y : top left coordinates // @@ -481,5 +479,22 @@ uint16 checkDoor() { return _yourself._frame; } +uint16 queryPath(uint16 x, uint16 y) { + + byte _al = _buffer[y*40 + x/8]; + byte _dl = 1 << (x % 8); + + return _al & _dl; + +} + +void setPath(byte *path) { + memcpy(_buffer, path, SCREENPATH_WIDTH*SCREEN_HEIGHT); +} + +void initWalk() { + _buffer = (byte*)malloc(SCREENPATH_WIDTH * SCREEN_HEIGHT); +} + } // namespace Parallaction |