From cee2a605698a14845de182aa7e3442015d4ae4e6 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 22 Sep 2007 23:56:08 +0000 Subject: Make sure that picture fill doesn't go out of the picture's bounds, since pre-AGI pictures have different dimensions svn-id: r29034 --- engines/agi/picture.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'engines/agi') diff --git a/engines/agi/picture.cpp b/engines/agi/picture.cpp index ff9477695a..b6f4b87fcf 100644 --- a/engines/agi/picture.cpp +++ b/engines/agi/picture.cpp @@ -291,7 +291,7 @@ void PictureMgr::fillScanline(int x, int y) { putVirtPixel(c, y); if (isOkFillHere(c, y - 1)) { if (newspanUp) { - lpush(c + 320 * (y - 1)); + lpush(c + (_width * 2) * (y - 1)); newspanUp = 0; } } else { @@ -300,7 +300,7 @@ void PictureMgr::fillScanline(int x, int y) { if (isOkFillHere(c, y + 1)) { if (newspanDown) { - lpush(c + 320 * (y + 1)); + lpush(c + (_width * 2) * (y + 1)); newspanDown = 0; } } else { @@ -310,7 +310,7 @@ void PictureMgr::fillScanline(int x, int y) { } void PictureMgr::agiFill(unsigned int x, unsigned int y) { - lpush(x + 320 * y); + lpush(x + (_width * 2) * y); for (;;) { uint16 c = lpop(); @@ -319,8 +319,8 @@ void PictureMgr::agiFill(unsigned int x, unsigned int y) { if (c == 0xffff) break; - x = c % 320; - y = c / 320; + x = c % (_width * 2); + y = c / (_width * 2); fillScanline(x, y); } @@ -477,7 +477,7 @@ void PictureMgr::plotPattern(int x, int y) { pen_x = (pen_x * 2) - pen_size; if (pen_x < 0) pen_x = 0; - temp16 = 320 - (2 * pen_size); + temp16 = (_width * 2) - (2 * pen_size); if (pen_x >= temp16) pen_x = temp16; -- cgit v1.2.3