diff options
author | yinsimei | 2017-07-04 17:09:46 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2017-07-13 18:27:45 +0200 |
commit | b5a77c93930cac9532eab4bb7a777424c7639e21 (patch) | |
tree | edf6a704f30498b16ce9208ce10ecf925e662578 /engines/sludge | |
parent | 91d2b5d31e72f635e0f7d498f632fcd942713a15 (diff) | |
download | scummvm-rg350-b5a77c93930cac9532eab4bb7a777424c7639e21.tar.gz scummvm-rg350-b5a77c93930cac9532eab4bb7a777424c7639e21.tar.bz2 scummvm-rg350-b5a77c93930cac9532eab4bb7a777424c7639e21.zip |
SLUDGE: check point to non transparent part of a character
Diffstat (limited to 'engines/sludge')
-rw-r--r-- | engines/sludge/sprites.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/engines/sludge/sprites.cpp b/engines/sludge/sprites.cpp index 161cb6237b..6d51b8fd83 100644 --- a/engines/sludge/sprites.cpp +++ b/engines/sludge/sprites.cpp @@ -609,8 +609,6 @@ void setDrawMode(onScreenPerson *thisPerson) { extern GLuint backdropTextureName; #endif -bool checkColourChange(bool reset); - bool scaleSprite(sprite &single, const spritePalette &fontPal, onScreenPerson *thisPerson, bool mirror) { float x = thisPerson->x; float y = thisPerson->y; @@ -660,7 +658,15 @@ bool scaleSprite(sprite &single, const spritePalette &fontPal, onScreenPerson *t if (input.mouseX >= x1 && input.mouseX <= x2 && input.mouseY >= y1 && input.mouseY <= y2) { if (thisPerson->extra & EXTRA_RECTANGULAR) return true; - return true; + + // check if point to non transparent part + int pixelx = (int)(single.surface.w * (input.mouseX - x1) / (x2 - x1)); + int pixely = (int)(single.surface.h * (input.mouseY - y1) / (y2 - y1)); + uint32 *colorPtr = (uint32 *)single.surface.getBasePtr(pixelx, pixely); + + uint8 a, r, g, b; + g_sludge->getScreenPixelFormat()->colorToARGB(*colorPtr, a, r, g, b); + return a != 0; } return false; |