aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/animator.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2006-03-17 14:19:18 +0000
committerJohannes Schickel2006-03-17 14:19:18 +0000
commitbbd172559825d015cf308c5b2655c1496b82fb01 (patch)
tree2a8bbdad41fbc888f2e217f276e173c6808c12f8 /engines/kyra/animator.cpp
parent4df16b71b842c7777d1900b5494f4ede1d1bc8ef (diff)
downloadscummvm-rg350-bbd172559825d015cf308c5b2655c1496b82fb01.tar.gz
scummvm-rg350-bbd172559825d015cf308c5b2655c1496b82fb01.tar.bz2
scummvm-rg350-bbd172559825d015cf308c5b2655c1496b82fb01.zip
- Fixes bug #1401432 ("KYRA: Brandon graphics glitch when exiting castle catacombs")
- Fixes some sprite redraw bugs introduced with my last commits - Fixes wsa drawing bug in the cave too svn-id: r21346
Diffstat (limited to 'engines/kyra/animator.cpp')
-rw-r--r--engines/kyra/animator.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/engines/kyra/animator.cpp b/engines/kyra/animator.cpp
index 099ba9ef5c..8d7ac5d34c 100644
--- a/engines/kyra/animator.cpp
+++ b/engines/kyra/animator.cpp
@@ -175,13 +175,13 @@ void ScreenAnimator::preserveAnyChangedBackgrounds() {
void ScreenAnimator::preserveOrRestoreBackground(AnimObject *obj, bool restore) {
debugC(9, kDebugLevelAnimator, "ScreenAnimator::preserveOrRestoreBackground(%p, %d)", (const void *)obj, restore);
- int x = 0, y = 0, width = obj->width << 3, height = obj->height;
+ int x = 0, y = 0, width = obj->width, height = obj->height;
if (restore) {
- x = obj->x2;
+ x = obj->x2 >> 3;
y = obj->y2;
} else {
- x = obj->x1;
+ x = obj->x1 >> 3;
y = obj->y1;
}
@@ -193,8 +193,8 @@ void ScreenAnimator::preserveOrRestoreBackground(AnimObject *obj, bool restore)
int temp;
temp = x + width;
- if (temp >= 319) {
- x = 319 - width;
+ if (temp >= 40) {
+ x = 39 - width;
}
temp = y + height;
if (temp >= 136) {
@@ -202,9 +202,9 @@ void ScreenAnimator::preserveOrRestoreBackground(AnimObject *obj, bool restore)
}
if (restore) {
- _screen->copyBlockToPage(_screen->_curPage, x, y, width, height, obj->background);
+ _screen->copyBlockToPage(_screen->_curPage, x << 3, y, width << 3, height, obj->background);
} else {
- _screen->copyRegionToBuffer(_screen->_curPage, x, y, width, height, obj->background);
+ _screen->copyRegionToBuffer(_screen->_curPage, x << 3, y, width << 3, height, obj->background);
}
}
@@ -373,24 +373,24 @@ void ScreenAnimator::copyChangedObjectsForward(int refreshFlag) {
if (curObject->active) {
if (curObject->refreshFlag || refreshFlag) {
int xpos = 0, ypos = 0, width = 0, height = 0;
- xpos = curObject->x1 - curObject->width2 - 8;
+ xpos = (curObject->x1>>3) - (curObject->width2>>3) - 1;
ypos = curObject->y1 - curObject->height2;
- width = (curObject->width<<3) + curObject->width2 + 16;
+ width = curObject->width + (curObject->width2>>3) + 2;
height = curObject->height + curObject->height2*2;
- if (xpos < 8) {
- xpos = 8;
- } else if (xpos + width > 312) {
- width = 312 - xpos;
+ if (xpos < 1) {
+ xpos = 1;
+ } else if (xpos + width > 39) {
+ width = width - (xpos + width - 39);
}
if (ypos < 8) {
ypos = 8;
- } else if (ypos + height > 136) {
- height = 136 - ypos;
+ } else if (ypos + height > 135) {
+ height = height - (ypos + height - 136);
}
- _screen->copyRegion(xpos, ypos, xpos, ypos, width, height, 2, 0, Screen::CR_CLIPPED);
+ _screen->copyRegion(xpos << 3, ypos, xpos << 3, ypos, width << 3, height, 2, 0, Screen::CR_CLIPPED);
curObject->refreshFlag = 0;
_updateScreen = true;
}