aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/akos.cpp31
1 files changed, 26 insertions, 5 deletions
diff --git a/scumm/akos.cpp b/scumm/akos.cpp
index c866dc4969..169076d4f5 100644
--- a/scumm/akos.cpp
+++ b/scumm/akos.cpp
@@ -1223,13 +1223,34 @@ byte AkosRenderer::codec32(int xmoveCur, int ymoveCur) {
src.bottom = _height - 1;
dst.top = _actorY + ymoveCur;
- dst.right = dst.left + _width;
- dst.bottom = dst.top + _height;
-
- dst.clip(_clipOverride);
+ dst.right = dst.left + _width - 1;
+ dst.bottom = dst.top + _height - 1;
+
+ int diff;
+ diff = dst.left - _clipOverride.left;
+ if (diff < 0) {
+ src.left -= diff;
+ dst.left -= diff;
+ }
+ diff = dst.right - _clipOverride.right;
+ if (diff > 0) {
+ src.right -= diff;
+ dst.right -= diff;
+ }
+ diff = dst.top - _clipOverride.top;
+ if (diff < 0) {
+ src.top -= diff;
+ dst.top -= diff;
+ }
+ diff = dst.bottom - _clipOverride.bottom;
+ if (diff > 0) {
+ src.bottom -= diff;
+ dst.bottom -= diff;
+ }
- _vm->markRectAsDirty(kMainVirtScreen, dst, _actorID);
+ _vm->markRectAsDirty(kMainVirtScreen, dst);
+ // cyx: are these variables really useful ?
if (_draw_top > dst.top)
_draw_top = dst.top;
if (_draw_bottom < dst.bottom)