SCI: dont swap coordinates on rects when both are "wrong", will fix button placement and gfx corruption when challenging jones (caused by duplicate buttons having lower right 0, 0) - function needs some more work

svn-id: r47446
This commit is contained in:
Martin Kiewitz 2010-01-22 23:02:33 +00:00
parent fa80444a12
commit 81e85b3186

View File

@ -185,6 +185,14 @@ reg_t kPicNotValid(EngineState *s, int argc, reg_t *argv) {
}
Common::Rect kGraphCreateRect(int16 x, int16 y, int16 x1, int16 y1) {
// TODO: find out what to do when just one coordinate is wrong - if we should fix it the same way as in jones
// needs some serious work
if ((x > x1) && (y > y1)) {
// We get this in jones when challenging jones -> upper left is right, lower right is 0, 0
// If we "fix this" we will draw a box that isnt supposed to be there and also draw the button to the wrong
// space
return Common::Rect(x, y, x, y);
}
if (x > x1) SWAP(x, x1);
if (y > y1) SWAP(y, y1);
return Common::Rect(x, y, x1, y1);