From be6b640b92d83b606efb7a926dfa6172f153e31e Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Wed, 10 May 2006 20:45:42 +0000 Subject: Adds clipping to the workaround in "preserveOrRestoreBackground", so it does not overwrite the interface. svn-id: r22404 --- engines/kyra/animator.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'engines') diff --git a/engines/kyra/animator.cpp b/engines/kyra/animator.cpp index 7c9860cdae..c45d745f0f 100644 --- a/engines/kyra/animator.cpp +++ b/engines/kyra/animator.cpp @@ -196,7 +196,7 @@ void ScreenAnimator::preserveOrRestoreBackground(AnimObject *obj, bool restore) int temp; temp = x + width; - if (temp >= 40) { + if (temp >= 39) { x = 39 - width; } temp = y + height; @@ -211,6 +211,18 @@ void ScreenAnimator::preserveOrRestoreBackground(AnimObject *obj, bool restore) // isn't updated on the front buffer in that special scene, so we update // the frontbuffer (screen page 0) too if the object get's redrawn this time if (obj->refreshFlag) { + // do not overwrite the interface + if (x <= 1) { + width--; + x = 1; + } else if (x >= 39) { + x = 39 - width; + } + if (y <= 8) { + y = 8; + } else if (y >= 136) { + y = 136 - height; + } _screen->copyBlockToPage(0, x << 3, y, width << 3, height, obj->background); } } else { -- cgit v1.2.3