diff options
author | Eugene Sandulenko | 2010-06-15 10:31:18 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2010-06-15 10:31:18 +0000 |
commit | ffc390e64c1adc8bd863ecd0bfe72ff7ecba6832 (patch) | |
tree | d20e4de81a37f6a9b02e9934435906e2e3e31233 /engines/agi/op_cmd.cpp | |
parent | 7034d071b6f44fb77f3379535f146a095357c5be (diff) | |
download | scummvm-rg350-ffc390e64c1adc8bd863ecd0bfe72ff7ecba6832.tar.gz scummvm-rg350-ffc390e64c1adc8bd863ecd0bfe72ff7ecba6832.tar.bz2 scummvm-rg350-ffc390e64c1adc8bd863ecd0bfe72ff7ecba6832.zip |
AGI: Fix bug #1945716.
Bug #1945716: "AGI: Fan(Kings Quest 2 1/4) - Sprite not erased".
Added a workaround, since it is design flaw of our rendering
system.
svn-id: r49742
Diffstat (limited to 'engines/agi/op_cmd.cpp')
-rw-r--r-- | engines/agi/op_cmd.cpp | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index fb95c1cee1..bb0799d92c 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -889,26 +889,12 @@ cmd(erase) { } g_sprites->blitUpdSprites(); - int x1, y1, x2, y2, w, h; + int x1, y1, x2, y2; - w = MAX(vt.celData->width, vt.celData2->width); - h = MAX(vt.celData->height, vt.celData2->height); - - if (vt.xPos < vt.xPos2) { - x1 = vt.xPos; - x2 = vt.xPos2 + w - 1; - } else { - x1 = vt.xPos2; - x2 = vt.xPos + w - 1; - } - - if (vt.yPos < vt.yPos2) { - y1 = vt.yPos - h + 1; - y2 = vt.yPos2; - } else { - y1 = vt.yPos2 - h + 1; - y2 = vt.yPos; - } + x1 = MIN((int)MIN(vt.xPos, vt.xPos2), MIN(vt.xPos + vt.celData->width, vt.xPos2 + vt.celData2->width)); + x2 = MAX((int)MAX(vt.xPos, vt.xPos2), MAX(vt.xPos + vt.celData->width, vt.xPos2 + vt.celData2->width)); + y1 = MIN((int)MIN(vt.yPos, vt.yPos2), MIN(vt.yPos - vt.celData->height, vt.yPos2 - vt.celData2->height)); + y2 = MAX((int)MAX(vt.yPos, vt.yPos2), MAX(vt.yPos - vt.celData->height, vt.yPos2 - vt.celData2->height)); g_sprites->commitBlock(x1, y1, x2, y2); } |