From ffc390e64c1adc8bd863ecd0bfe72ff7ecba6832 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 15 Jun 2010 10:31:18 +0000 Subject: 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 --- engines/agi/op_cmd.cpp | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'engines/agi/op_cmd.cpp') 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); } -- cgit v1.2.3