[Scummvm-cvs-logs] SF.net SVN: scummvm: [26117] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Mon Mar 12 23:52:27 CET 2007
Revision: 26117
http://scummvm.svn.sourceforge.net/scummvm/?rev=26117&view=rev
Author: peres001
Date: 2007-03-12 15:52:27 -0700 (Mon, 12 Mar 2007)
Log Message:
-----------
moved background path buffer management into walk.cpp
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/disk.cpp
scummvm/trunk/engines/parallaction/graphics.cpp
scummvm/trunk/engines/parallaction/graphics.h
scummvm/trunk/engines/parallaction/parallaction.cpp
scummvm/trunk/engines/parallaction/walk.cpp
Modified: scummvm/trunk/engines/parallaction/disk.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/disk.cpp 2007-03-12 22:45:50 UTC (rev 26116)
+++ scummvm/trunk/engines/parallaction/disk.cpp 2007-03-12 22:52:27 UTC (rev 26117)
@@ -24,6 +24,7 @@
#include "parallaction/graphics.h"
#include "parallaction/parallaction.h"
#include "parallaction/disk.h"
+#include "parallaction/walk.h"
namespace Parallaction {
@@ -412,7 +413,7 @@
_vm->_gfx->setBackground(bg);
_vm->_gfx->setMask(mask);
- _vm->_gfx->setPath(path);
+ setPath(path);
free(v4);
@@ -445,7 +446,7 @@
_archive.read(maskBuf, SCREENMASK_WIDTH*SCREEN_HEIGHT);
_vm->_gfx->setMask(maskBuf);
- _vm->_gfx->setPath(pathBuf);
+ setPath(pathBuf);
return;
}
Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp 2007-03-12 22:45:50 UTC (rev 26116)
+++ scummvm/trunk/engines/parallaction/graphics.cpp 2007-03-12 22:52:27 UTC (rev 26117)
@@ -934,9 +934,6 @@
memcpy(_buffers[kMask0], mask, SCREENMASK_WIDTH*SCREEN_HEIGHT);
}
-void Gfx::setPath(byte *path) {
- memcpy(_buffers[kPath0], path, SCREENPATH_WIDTH*SCREEN_HEIGHT);
-}
void Gfx::copyRect(Gfx::Buffers dstbuffer, uint16 x, uint16 y, uint16 w, uint16 h, byte *src, uint16 pitch) {
@@ -1019,17 +1016,6 @@
return;
}
-uint16 Gfx::queryPath(uint16 x, uint16 y) {
-
- byte *v6 = _buffers[kPath0];
-
- byte _al = v6[y*40 + x/8];
- byte _dl = 1 << (x % 8);
-
- return _al & _dl;
-
-}
-
int16 Gfx::queryMask(int16 v) {
for (uint16 _si = 0; _si < 3; _si++) {
@@ -1047,7 +1033,6 @@
_buffers[kBit3] = (byte*)malloc(SCREEN_SIZE); // this buffer is also used by menu so it must stay this size
_buffers[kMask0] = (byte*)malloc(SCREENMASK_WIDTH * SCREEN_HEIGHT);
- _buffers[kPath0] = (byte*)malloc(SCREENPATH_WIDTH * SCREEN_HEIGHT);
return;
}
@@ -1079,7 +1064,6 @@
Gfx::~Gfx() {
free(_buffers[kMask0]);
- free(_buffers[kPath0]);
free(_buffers[kBitFront]);
free(_buffers[kBitBack]);
Modified: scummvm/trunk/engines/parallaction/graphics.h
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.h 2007-03-12 22:45:50 UTC (rev 26116)
+++ scummvm/trunk/engines/parallaction/graphics.h 2007-03-12 22:52:27 UTC (rev 26117)
@@ -74,9 +74,7 @@
kBit2,
kBit3,
// mask buffers
- kMask0,
- // path buffers
- kPath0
+ kMask0
};
public:
@@ -100,11 +98,8 @@
// location
void setBackground(byte *background);
void setMask(byte *mask);
- void setPath(byte *path);
void parseDepths(Common::SeekableReadStream &stream);
void parseBackground(Common::SeekableReadStream &stream);
- void loadMaskAndPath(const char *filename);
- uint16 queryPath(uint16 x, uint16 y);
int16 queryMask(int16 v);
void intGrottaHackMask();
void restoreBackground(int16 left, int16 top, uint16 width, uint16 height);
Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp 2007-03-12 22:45:50 UTC (rev 26116)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp 2007-03-12 22:52:27 UTC (rev 26117)
@@ -36,6 +36,7 @@
#include "parallaction/music.h"
#include "parallaction/inventory.h"
#include "parallaction/graphics.h"
+#include "parallaction/walk.h"
#include "parallaction/zone.h"
@@ -226,6 +227,7 @@
_location._comment = NULL;
_location._endComment = NULL;
+ initWalk();
_yourTalk._width = 0;
_yourTalk._height = 0;
Modified: scummvm/trunk/engines/parallaction/walk.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/walk.cpp 2007-03-12 22:45:50 UTC (rev 26116)
+++ scummvm/trunk/engines/parallaction/walk.cpp 2007-03-12 22:52:27 UTC (rev 26117)
@@ -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 @@
}
-uint16 queryPath(uint16 x, uint16 y) {
- return _vm->_gfx->queryPath(x, y);
-}
-
-
//
// x,y : top left coordinates
//
@@ -481,5 +479,22 @@
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
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list