Skip to content

Commit

Permalink
SCUMM HE: Moonbase FOW rendering fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed May 30, 2016
1 parent 2674bfa commit 1fc54e0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion engines/scumm/he/moonbase/moonbase.h
Expand Up @@ -98,7 +98,7 @@ class Moonbase {

bool _fowBlackMode;

int _fowRenderTable[32768];
int32 _fowRenderTable[32768];

Common::PEResources _exe;
Common::String _fileName;
Expand Down
19 changes: 17 additions & 2 deletions engines/scumm/he/moonbase/moonbase_fow.cpp
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 1fc54e0

Please sign in to comment.