aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/gfxbase.cpp
diff options
context:
space:
mode:
authorTravis Howell2009-03-15 13:28:20 +0000
committerTravis Howell2009-03-15 13:28:20 +0000
commite48637415285b7d1197ef48c1910635e464de965 (patch)
treeb07ba0114db4745e9b2f0f27b2dac4e56417008c /engines/parallaction/gfxbase.cpp
parent1f299bb24ac9ab8ded2542aaeeffad77b53faa9b (diff)
downloadscummvm-rg350-e48637415285b7d1197ef48c1910635e464de965.tar.gz
scummvm-rg350-e48637415285b7d1197ef48c1910635e464de965.tar.bz2
scummvm-rg350-e48637415285b7d1197ef48c1910635e464de965.zip
Fix crash regression in the Amiga BRA demo, by checking if mask buffer exists, before using it.
svn-id: r39418
Diffstat (limited to 'engines/parallaction/gfxbase.cpp')
-rw-r--r--engines/parallaction/gfxbase.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp
index a0becfe70e..47bf0000db 100644
--- a/engines/parallaction/gfxbase.cpp
+++ b/engines/parallaction/gfxbase.cpp
@@ -349,8 +349,12 @@ void Gfx::bltMaskScale(const Common::Rect& r, byte *data, Graphics::Surface *sur
}
if (*s != transparentColor) {
- byte v = _backgroundInfo->_mask->getValue(dp.x + col, dp.y + line);
- if (z >= v) *d2 = *s;
+ if (_backgroundInfo->hasMask()) {
+ byte v = _backgroundInfo->_mask->getValue(dp.x + col, dp.y + line);
+ if (z >= v) *d2 = *s;
+ } else {
+ *d2 = *s;
+ }
}
s++;
@@ -395,8 +399,12 @@ void Gfx::bltMaskNoScale(const Common::Rect& r, byte *data, Graphics::Surface *s
for (uint16 j = 0; j < q.width(); j++) {
if (*s != transparentColor) {
- byte v = _backgroundInfo->_mask->getValue(dp.x + j, dp.y + i);
- if (z >= v) *d = *s;
+ if (_backgroundInfo->hasMask()) {
+ byte v = _backgroundInfo->_mask->getValue(dp.x + j, dp.y + i);
+ if (z >= v) *d = *s;
+ } else {
+ *d = *s;
+ }
}
s++;