From ed400d57fce69a88c9cdaf6dde03c89e22925968 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Mon, 17 Feb 2014 11:57:18 +0200 Subject: SCI: Fix NS rect calculation in GK1 (and SCI32 in general) This fixes the regressions caused by refactoring in SCI32. Thanks to Timo Korvola for tracking down the issue and providing an initial patch in bug #6452 --- engines/sci/engine/kgraphics32.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'engines/sci/engine/kgraphics32.cpp') diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp index cd735d1233..0eb4fa856b 100644 --- a/engines/sci/engine/kgraphics32.cpp +++ b/engines/sci/engine/kgraphics32.cpp @@ -142,7 +142,15 @@ reg_t kIsOnMe(EngineState *s, int argc, reg_t *argv) { uint16 y = argv[1].toUint16(); reg_t targetObject = argv[2]; uint16 illegalBits = argv[3].getOffset(); - Common::Rect nsRect = g_sci->_gfxCompare->getNSRect(targetObject, true); + Common::Rect nsRect = g_sci->_gfxCompare->getNSRect(targetObject); + + uint16 itemX = readSelectorValue(s->_segMan, targetObject, SELECTOR(x)); + uint16 itemY = readSelectorValue(s->_segMan, targetObject, SELECTOR(y)); + // If top and left are negative, we need to adjust coordinates by the item's x and y + if (nsRect.left < 0) + nsRect.translate(itemX, 0); + if (nsRect.top < 0) + nsRect.translate(0, itemY); // we assume that x, y are local coordinates -- cgit v1.2.3 From 8fc7d60febcadcaff901b331c5d1f454c073aef2 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 18 Feb 2014 02:34:24 +0100 Subject: SCI: Make GPL headers consistent in themselves. --- engines/sci/engine/kgraphics32.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/sci/engine/kgraphics32.cpp') diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp index 0eb4fa856b..8953f45266 100644 --- a/engines/sci/engine/kgraphics32.cpp +++ b/engines/sci/engine/kgraphics32.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -- cgit v1.2.3