[Scummvm-cvs-logs] SF.net SVN: scummvm:[49741] scummvm/trunk/engines/agi
sev at users.sourceforge.net
sev at users.sourceforge.net
Tue Jun 15 12:30:54 CEST 2010
Revision: 49741
http://scummvm.svn.sourceforge.net/scummvm/?rev=49741&view=rev
Author: sev
Date: 2010-06-15 10:30:54 +0000 (Tue, 15 Jun 2010)
Log Message:
-----------
AGI: proper fix for sprite leftover-related bugs. Removed workarounds.
Modified Paths:
--------------
scummvm/trunk/engines/agi/op_cmd.cpp
scummvm/trunk/engines/agi/sprite.cpp
scummvm/trunk/engines/agi/view.cpp
Modified: scummvm/trunk/engines/agi/op_cmd.cpp
===================================================================
--- scummvm/trunk/engines/agi/op_cmd.cpp 2010-06-15 10:30:26 UTC (rev 49740)
+++ scummvm/trunk/engines/agi/op_cmd.cpp 2010-06-15 10:30:54 UTC (rev 49741)
@@ -889,7 +889,28 @@
}
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) {
Modified: scummvm/trunk/engines/agi/sprite.cpp
===================================================================
--- scummvm/trunk/engines/agi/sprite.cpp 2010-06-15 10:30:26 UTC (rev 49740)
+++ scummvm/trunk/engines/agi/sprite.cpp 2010-06-15 10:30:54 UTC (rev 49741)
@@ -389,13 +389,9 @@
Sprite *s = *iter;
int x1, y1, x2, y2, w, h;
- w = (s->v->celData->width > s->v->celData2->width) ?
- s->v->celData->width : s->v->celData2->width;
+ w = MAX(s->v->celData->width, s->v->celData2->width);
+ h = MAX(s->v->celData->height, s->v->celData2->height);
- h = (s->v->celData->height >
- s->v->celData2->height) ? s->v->celData->
- height : s->v->celData2->height;
-
s->v->celData2 = s->v->celData;
if (s->v->xPos < s->v->xPos2) {
Modified: scummvm/trunk/engines/agi/view.cpp
===================================================================
--- scummvm/trunk/engines/agi/view.cpp 2010-06-15 10:30:26 UTC (rev 49740)
+++ scummvm/trunk/engines/agi/view.cpp 2010-06-15 10:30:54 UTC (rev 49741)
@@ -294,37 +294,6 @@
* @param n number of AGI view resource
*/
void AgiEngine::setView(VtEntry *v, int n) {
-
- uint16 viewFlags = 0;
-
- // WORKAROUND
- // When setting a view to the view table, if there's already another view set in that
- // view table entry and it's still drawn, erase the existing view before setting the new one
- // Fixes bug #1658643: AGI: SQ1 (2.2 DOS ENG) Graphic error, ego leaves behind copy
- // Update: Apparently, this makes ego dissapear at times, e.g. when textboxes are shown
- // Therefore, it's limited to view 118 in SQ1 (Roger climbing the ladder)
- // Fixes bug #1715284: Roger sometimes disappears
- // Update: Added case fot bug #2960557: AGI: (Fan) SQ0 - Sprite (Ego) not erased
- if (v->viewData != NULL) {
- if (((v->currentView == 118 && getGameID() == GID_SQ1) ||
- (v->currentView == 2 & (n == 254 || n == 255) && getGameID() == GID_SQ0)) && v->flags & DRAWN) {
- viewFlags = v->flags; // Store the flags for the view
- _sprites->eraseUpdSprites();
-
- if (v->flags & UPDATE) {
- v->flags &= ~DRAWN;
- } else {
- _sprites->eraseNonupdSprites();
- v->flags &= ~DRAWN;
- _sprites->blitNonupdSprites();
- }
- _sprites->blitUpdSprites();
-
- _sprites->commitBlock(v->xPos, v->yPos - v->ySize + 1, v->xPos + v->xSize - 1, v->yPos);
- v->flags = viewFlags; // Restore the view's flags
- }
- }
-
v->viewData = &_game.views[n];
v->currentView = n;
v->numLoops = v->viewData->numLoops;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list