mirror of https://github.com/snes9xgit/snes9x.git
Fix crash when drawing crosshair on screen edges (remove old workaround)
This commit is contained in:
parent
2c3230a8da
commit
c188725ee4
8
gfx.cpp
8
gfx.cpp
|
@ -2242,12 +2242,7 @@ void S9xDrawCrosshair (const char *crosshair, uint8 fgcolor, uint8 bgcolor, int1
|
|||
fg = get_crosshair_color(fgcolor);
|
||||
bg = get_crosshair_color(bgcolor);
|
||||
|
||||
// XXX: FIXME: why does it crash without this on Linux port? There are no out-of-bound writes without it...
|
||||
#if (defined(__unix) || defined(__linux) || defined(__sun) || defined(__DJGPP))
|
||||
if (x >= 0 && y >= 0)
|
||||
#endif
|
||||
{
|
||||
uint16 *s = GFX.Screen + y * GFX.RealPPL + x;
|
||||
uint16 *s = GFX.Screen + y * (int32)GFX.RealPPL + x;
|
||||
|
||||
for (r = 0; r < 15 * rx; r++, s += GFX.RealPPL - 15 * cx)
|
||||
{
|
||||
|
@ -2280,7 +2275,6 @@ void S9xDrawCrosshair (const char *crosshair, uint8 fgcolor, uint8 bgcolor, int1
|
|||
*s = (bgcolor & 0x10) ? COLOR_ADD1_2(*s, bg) : bg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef GFX_MULTI_FORMAT
|
||||
|
|
Loading…
Reference in New Issue