From baffdd97e22851ad050bbeb1e800e38606b8f4c1 Mon Sep 17 00:00:00 2001 From: uruk Date: Sun, 15 Jun 2014 21:11:27 +0200 Subject: CGE2: Fix coordinates of mouse handling. Now infoLine is working properly. Rework solidAt() to achieve that. Also move spriteAt from talk.cpp to cge2_main.cpp, and remove the older version which didn't use V2D as a parameter. --- engines/cge2/bitmap.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'engines/cge2/bitmap.cpp') diff --git a/engines/cge2/bitmap.cpp b/engines/cge2/bitmap.cpp index 7a7a88430c..c62a784110 100644 --- a/engines/cge2/bitmap.cpp +++ b/engines/cge2/bitmap.cpp @@ -274,13 +274,16 @@ BitmapPtr Bitmap::code(uint8 *map) { return this; } -bool Bitmap::solidAt(int16 x, int16 y) { - if ((x >= _w) || (y >= _h)) +bool Bitmap::solidAt(V2D pos) { + pos.x += _w >> 1; + pos.y = _h - pos.y; + + if (!pos.limited(V2D(_vm, _w, _h))) return false; uint8 *m = _v; - uint16 r = static_cast(x) % 4; - uint16 n0 = (kScrWidth * y + x) / 4; + uint16 r = static_cast(pos.x) % 4; + uint16 n0 = (kScrWidth * pos.y + pos.x) / 4; uint16 n = 0; while (r) { -- cgit v1.2.3