diff options
author | Filippos Karapetis | 2007-09-22 23:56:08 +0000 |
---|---|---|
committer | Filippos Karapetis | 2007-09-22 23:56:08 +0000 |
commit | cee2a605698a14845de182aa7e3442015d4ae4e6 (patch) | |
tree | af3258219d02e6338cfef71209eae554571b85be /engines/agi | |
parent | 62f69cff8a86598242ec08bf150633b920ff105a (diff) | |
download | scummvm-rg350-cee2a605698a14845de182aa7e3442015d4ae4e6.tar.gz scummvm-rg350-cee2a605698a14845de182aa7e3442015d4ae4e6.tar.bz2 scummvm-rg350-cee2a605698a14845de182aa7e3442015d4ae4e6.zip |
Make sure that picture fill doesn't go out of the picture's bounds, since pre-AGI pictures have different dimensions
svn-id: r29034
Diffstat (limited to 'engines/agi')
-rw-r--r-- | engines/agi/picture.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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; |