aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction
diff options
context:
space:
mode:
authorNicola Mettifogo2009-02-03 10:42:27 +0000
committerNicola Mettifogo2009-02-03 10:42:27 +0000
commitd1b71335d65912a75e1f2bea4d56c73ba5400efc (patch)
tree698ce73ccf797cb796932c3191a413ecbd76a0b6 /engines/parallaction
parent0a42482fc3869d99d979c5f7f80c1cd90cb4c272 (diff)
downloadscummvm-rg350-d1b71335d65912a75e1f2bea4d56c73ba5400efc.tar.gz
scummvm-rg350-d1b71335d65912a75e1f2bea4d56c73ba5400efc.tar.bz2
scummvm-rg350-d1b71335d65912a75e1f2bea4d56c73ba5400efc.zip
Fixed support for walking zones in BRA:
* patches are not applied if the zone is not visible when loading * when applying a patch, always overwrite the existing data instead of OR'ing svn-id: r36209
Diffstat (limited to 'engines/parallaction')
-rw-r--r--engines/parallaction/gfxbase.cpp2
-rw-r--r--engines/parallaction/graphics.cpp19
-rw-r--r--engines/parallaction/graphics.h1
-rw-r--r--engines/parallaction/parser_br.cpp3
4 files changed, 4 insertions, 21 deletions
diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp
index 9a3d204569..968d705a5c 100644
--- a/engines/parallaction/gfxbase.cpp
+++ b/engines/parallaction/gfxbase.cpp
@@ -34,7 +34,7 @@ namespace Parallaction {
GfxObj::GfxObj(uint objType, Frames *frames, const char* name) :
_frames(frames), _keep(true), x(0), y(0), z(0), _flags(kGfxObjNormal),
- type(objType), frame(0), layer(3), scale(100), _hasMask(false) {
+ type(objType), frame(0), layer(3), scale(100), _hasMask(false), _hasPath(false) {
if (name) {
_name = strdup(name);
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index 42d6d39e84..c2b4a72cab 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -941,7 +941,7 @@ void BackgroundInfo::togglePathPatch(uint id, int x, int y, bool apply) {
}
PathBuffer *patch = _pathPatches[id];
if (apply) {
- _path->bltOr(x, y, *patch, 0, 0, patch->w, patch->h);
+ _path->bltCopy(x, y, *patch, 0, 0, patch->w, patch->h);
} else {
_path->bltCopy(x, y, _pathBackup, x, y, patch->w, patch->h);
}
@@ -1075,23 +1075,6 @@ byte* PathBuffer::getPtr(uint16 x, uint16 y) const {
return data + (x >> 3) + y * internalWidth;
}
-void PathBuffer::bltOr(uint16 dx, uint16 dy, const PathBuffer &src, uint16 sx, uint16 sy, uint width, uint height) {
- assert((width <= w) && (width <= src.w) && (height <= h) && (height <= src.h));
-
- byte *s = src.getPtr(sx, sy);
- byte *d = getPtr(dx, dy);
-
- // this code assumes buffers are aligned on 4-pixels boundaries, as the original does
- uint16 linewidth = width >> 3;
- for (uint16 i = 0; i < height; i++) {
- for (uint16 j = 0; j < linewidth; j++) {
- *d++ |= *s++;
- }
- d += internalWidth - linewidth;
- s += src.internalWidth - linewidth;
- }
-}
-
void PathBuffer::bltCopy(uint16 dx, uint16 dy, const PathBuffer &src, uint16 sx, uint16 sy, uint width, uint height) {
assert((width <= w) && (width <= src.w) && (height <= h) && (height <= src.h));
diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h
index e165f51da7..f029d54833 100644
--- a/engines/parallaction/graphics.h
+++ b/engines/parallaction/graphics.h
@@ -218,7 +218,6 @@ struct PathBuffer {
bool bigEndian;
byte* getPtr(uint16 x, uint16 y) const;
- void bltOr(uint16 dx, uint16 dy, const PathBuffer &src, uint16 sx, uint16 sy, uint width, uint height);
void bltCopy(uint16 dx, uint16 dy, const PathBuffer &src, uint16 sx, uint16 sy, uint width, uint height);
public:
diff --git a/engines/parallaction/parser_br.cpp b/engines/parallaction/parser_br.cpp
index 15f9d7a785..2721763383 100644
--- a/engines/parallaction/parser_br.cpp
+++ b/engines/parallaction/parser_br.cpp
@@ -1258,7 +1258,8 @@ void LocationParser_br::parse(Script *script) {
ZoneList::iterator it = _vm->_location._zones.begin();
for ( ; it != _vm->_location._zones.end(); it++) {
bool visible = ((*it)->_flags & kFlagsRemove) == 0;
- _vm->showZone((*it), visible);
+ if (visible)
+ _vm->showZone((*it), visible);
}
if (ctxt.characterName) {