diff options
author | uruk | 2014-06-15 21:11:27 +0200 |
---|---|---|
committer | uruk | 2014-06-15 21:11:42 +0200 |
commit | baffdd97e22851ad050bbeb1e800e38606b8f4c1 (patch) | |
tree | 62b31a8062dad8da01aa715d6e97226e5fd874c3 /engines/cge2/bitmap.cpp | |
parent | ae96463036ff99540478b7355746d8fd653ff527 (diff) | |
download | scummvm-rg350-baffdd97e22851ad050bbeb1e800e38606b8f4c1.tar.gz scummvm-rg350-baffdd97e22851ad050bbeb1e800e38606b8f4c1.tar.bz2 scummvm-rg350-baffdd97e22851ad050bbeb1e800e38606b8f4c1.zip |
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.
Diffstat (limited to 'engines/cge2/bitmap.cpp')
-rw-r--r-- | engines/cge2/bitmap.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
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<uint16>(x) % 4; - uint16 n0 = (kScrWidth * y + x) / 4; + uint16 r = static_cast<uint16>(pos.x) % 4; + uint16 n0 = (kScrWidth * pos.y + pos.x) / 4; uint16 n = 0; while (r) { |