From 1fc54e0086f6d5de6b85f5be46de8a8068f4046c Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Mon, 30 May 2016 10:51:43 +0200 Subject: SCUMM HE: Moonbase FOW rendering fixes --- engines/scumm/he/moonbase/moonbase.h | 2 +- engines/scumm/he/moonbase/moonbase_fow.cpp | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) (limited to 'engines/scumm') diff --git a/engines/scumm/he/moonbase/moonbase.h b/engines/scumm/he/moonbase/moonbase.h index 243d53a11d..1d87eed7d9 100644 --- a/engines/scumm/he/moonbase/moonbase.h +++ b/engines/scumm/he/moonbase/moonbase.h @@ -98,7 +98,7 @@ private: bool _fowBlackMode; - int _fowRenderTable[32768]; + int32 _fowRenderTable[32768]; Common::PEResources _exe; Common::String _fileName; diff --git a/engines/scumm/he/moonbase/moonbase_fow.cpp b/engines/scumm/he/moonbase/moonbase_fow.cpp index 48c2219926..0c29d5709e 100644 --- a/engines/scumm/he/moonbase/moonbase_fow.cpp +++ b/engines/scumm/he/moonbase/moonbase_fow.cpp @@ -169,6 +169,21 @@ void Moonbase::setFOWInfo(int fowInfoArray, int downDim, int acrossDim, int view if (!_fowImage) return; + for (int y = 0; y < downDim; y++) { + Common::String s; + + for (int x = 0; x < acrossDim; x++) + if (readFOWVisibilityArray(fowInfoArray, x, y)) + s += "@"; + else + s+= " "; + + debug(0, "%s", s.c_str()); + } + debug(0, ""); + + memset(_fowRenderTable, 0, sizeof(_fowRenderTable)); + _fowDrawX = clipX1; _fowDrawY = clipY1; @@ -228,7 +243,7 @@ void Moonbase::setFOWInfo(int fowInfoArray, int downDim, int acrossDim, int view int visibility = readFOWVisibilityArray(fowInfoArray, m, c); if (visibility == FOW_EMPTY) { - int bits = 0; + uint32 bits = 0; if (readFOWVisibilityArray(fowInfoArray, t, l) != 0) bits |= FF_T_L; if (readFOWVisibilityArray(fowInfoArray, t, c) != 0) bits |= FF_T; @@ -333,7 +348,7 @@ static void blackRect_16bpp(uint8 *destSurface, int dstPitch, int dstw, int dsth int h = y2 - y1; int w = ((x2 - x1) + 1) * 2; - while ( --h >= 0 ) { + while (--h >= 0) { memset(dst, 0, w); dst += dstPitch; } -- cgit v1.2.3