KYRA: (MR/Chinese) - minor interface fixes

Some more hardcoded things from disasm. I haven't seen any gltiches based on that so far, but that doesn't mean they can't happen.
This commit is contained in:
athrxx 2021-05-06 18:22:19 +02:00
parent 376df2f14c
commit 68e367b719
2 changed files with 6 additions and 6 deletions

View File

@ -168,7 +168,7 @@ bool KyraEngine_MR::processItemDrop(uint16 sceneId, Item item, int x, int y, int
bool needRepositioning = true;
while (needRepositioning) {
if ((_screen->getDrawLayer(posX, posY) <= 1 && _screen->getDrawLayer2(posX, posY, itemHeight) <= 1 && isDropable(posX, posY)) || posY == 187) {
if ((_screen->getDrawLayer(posX, posY) <= 1 && _screen->getDrawLayer2(posX, posY, itemHeight) <= 1 && isDropable(posX, posY)) || (posY == _interfaceCommandLineY1 - 1)) {
int posX2 = posX, posX3 = posX;
bool repositioning = true;
@ -197,10 +197,10 @@ bool KyraEngine_MR::processItemDrop(uint16 sceneId, Item item, int x, int y, int
}
}
if (posY == 187)
if (posY == _interfaceCommandLineY1 - 1)
needRepositioning = false;
else
posY = MIN(posY + 2, 187);
posY = MIN(posY + 2, _interfaceCommandLineY1 - 1);
}
if (itemX == -1 || itemY == -1)
@ -369,7 +369,7 @@ bool KyraEngine_MR::pickUpItem(int x, int y, int runScript) {
}
bool KyraEngine_MR::isDropable(int x, int y) {
if (y < 14 || y > 187)
if (y < 14 || (y > _interfaceCommandLineY1 - 1))
return false;
x -= 12;

View File

@ -40,8 +40,8 @@ int Screen_MR::getLayer(int x, int y) {
if (y < 0) {
y = 0;
} else if (y >= _interfaceCommandLineY1) {
y = _interfaceCommandLineY1 - 1;
} else if (y >= 187) {
y = 187;
// 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).