aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/op_cmd.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2010-06-15 10:30:54 +0000
committerEugene Sandulenko2010-06-15 10:30:54 +0000
commit7034d071b6f44fb77f3379535f146a095357c5be (patch)
treebc810f51aee852827024c75628cbdabbd54bc0aa /engines/agi/op_cmd.cpp
parent295edafdc4b266a7283ba494e685dfb22f132c6a (diff)
downloadscummvm-rg350-7034d071b6f44fb77f3379535f146a095357c5be.tar.gz
scummvm-rg350-7034d071b6f44fb77f3379535f146a095357c5be.tar.bz2
scummvm-rg350-7034d071b6f44fb77f3379535f146a095357c5be.zip
AGI: proper fix for sprite leftover-related bugs. Removed workarounds.
svn-id: r49741
Diffstat (limited to 'engines/agi/op_cmd.cpp')
-rw-r--r--engines/agi/op_cmd.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp
index f31e1d156d..fb95c1cee1 100644
--- a/engines/agi/op_cmd.cpp
+++ b/engines/agi/op_cmd.cpp
@@ -889,7 +889,28 @@ cmd(erase) {
}
g_sprites->blitUpdSprites();
- g_sprites->commitBlock(vt.xPos, vt.yPos - vt.ySize + 1, vt.xPos + vt.xSize - 1, vt.yPos);
+ int x1, y1, x2, y2, w, h;
+
+ 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;
+ }
+
+ g_sprites->commitBlock(x1, y1, x2, y2);
}
cmd(position) {