Skip to content
Permalink
Browse files

KYRA: (MR) - fix animation glitch (bug #11312)

  • Loading branch information
athrxx committed Jan 14, 2020
1 parent fc4f59b commit f9872c4faecbdd9259db879f8e9a405132468384
Showing with 9 additions and 5 deletions.
  1. +9 −5 engines/kyra/graphics/screen_mr.cpp
@@ -37,13 +37,17 @@ int Screen_MR::getLayer(int x, int y) {
x = 0;
else if (x >= 320)
x = 319;
if (y < 0)

if (y < 0) {
y = 0;
else if (y >= 188)
} else if (y >= 188) {
y = 187;

if (y < _maskMinY || y > _maskMaxY)
return 15;
// The original actually limits the _maskMin/MaxY check to cases where y has already been clipped to 187.
// Whether this was intentional or not: Scenes actually require that we do it that way or animations may
// be drawn on the wrong layer (bug #11312).
if (y < _maskMinY || y > _maskMaxY)
return 15;
}

uint8 pixel = *(getCPagePtr(5) + y * 320 + x);
pixel &= 0x7F;

0 comments on commit f9872c4

Please sign in to comment.
You can’t perform that action at this time.