mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-31 07:53:36 +00:00
Added clipping to drawLine(). This fixes a regression that caused the
debug console to crash ScummVM. (I'm not sure, but I think it was trying to draw the scrollbar arrows outside the screen when the console was sliding into view.) svn-id: r18138
This commit is contained in:
parent
8d782007c1
commit
bfbbf48585
@ -27,14 +27,18 @@ namespace Graphics {
|
||||
|
||||
static void plotPoint1(int x, int y, int color, void *data) {
|
||||
Surface *s = (Surface *)data;
|
||||
byte *ptr = (byte *)s->getBasePtr(x, y);
|
||||
*ptr = (byte)color;
|
||||
if (x >= 0 && x < s->w && y >= 0 && y < s->h) {
|
||||
byte *ptr = (byte *)s->getBasePtr(x, y);
|
||||
*ptr = (byte)color;
|
||||
}
|
||||
}
|
||||
|
||||
static void plotPoint2(int x, int y, int color, void *data) {
|
||||
Surface *s = (Surface *)data;
|
||||
uint16 *ptr = (uint16 *)s->getBasePtr(x, y);
|
||||
*ptr = (uint16)color;
|
||||
if (x >= 0 && x < s->w && y >= 0 && y < s->h) {
|
||||
uint16 *ptr = (uint16 *)s->getBasePtr(x, y);
|
||||
*ptr = (uint16)color;
|
||||
}
|
||||
}
|
||||
|
||||
void Surface::drawLine(int x0, int y0, int x1, int y1, uint32 color) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user