mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 21:59:17 +00:00
Work around crash in drawSpriteRaw(). In Future Wars, when going to the future,
I walked back to the room where I first arrived. At that point, maskPtr was NULL for reasons yet unknown. svn-id: r21839
This commit is contained in:
parent
a4c5a691cc
commit
4ee82b0caf
@ -324,12 +324,16 @@ void drawSpriteRaw(byte *spritePtr, byte *maskPtr, int16 width, int16 height,
|
||||
int16 i;
|
||||
int16 j;
|
||||
|
||||
// FIXME: Is it a bug if maskPtr == NULL?
|
||||
if (!maskPtr)
|
||||
warning("drawSpriteRaw: maskPtr == NULL");
|
||||
|
||||
for (i = 0; i < height; i++) {
|
||||
byte *destPtr = page + x + y * 320;
|
||||
destPtr += i * 320;
|
||||
|
||||
for (j = 0; j < width * 8; j++) {
|
||||
if (((gameType == Cine::GID_FW && !(*maskPtr)) || (gameType == Cine::GID_OS)) && (x + j >= 0
|
||||
if (((gameType == Cine::GID_FW && (!maskPtr || !(*maskPtr))) || (gameType == Cine::GID_OS)) && (x + j >= 0
|
||||
&& x + j < 320 && i + y >= 0 && i + y < 200)) {
|
||||
*(destPtr++) = *(spritePtr++);
|
||||
} else {
|
||||
@ -337,7 +341,8 @@ void drawSpriteRaw(byte *spritePtr, byte *maskPtr, int16 width, int16 height,
|
||||
spritePtr++;
|
||||
}
|
||||
|
||||
maskPtr++;
|
||||
if (maskPtr)
|
||||
maskPtr++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user