Issue432

Title mouse_cursor_is_over_that_image ignores transparency
Priority idea Status postponed
Assigned To Keywords graphics, opengl, sdl
Linked issues Watchers

Submitted on 2011-08-03 23h26 by hail, last changed by hail.

Files
File name Uploaded Type Edit Remove
corners.jpg hail, 2011-08-03.23:26:30 image/jpeg
Messages
Author: hail Date: 2011-08-03   23h26
mouse_cursor_is_over_that_image returns misleading positives when hovering over an image with 
transparent padding/corners.

I don't think the work is worth the payoff here, but it I also know in my heart that this is a bug.

This could be trivial to solve in SDL mode (image->surface->pixels) but in OpenGL mode there is no copy 
of images stored in RAM (only in VRAM)

To implement this in OGL mode using OGL calls (with no framework in the fdrpg engine) is simply out of 
the question (because we only support a super old version of OGL which lacks the functions and data 
structures required to do this quickly).

One possible OGL implementation would be to generate a stencil of object images based on the images' 
alpha channel. We would only need this for clickable objects, but we would need one for all of each 
object's frames. The memory overhead would be at least:

(1 bit * image_w * image_h) * frames_per_clickable_object * clickable_objects

and if we did it like that it would still be a little messy (bit padding would be required)

I'm torn because this is a noticeable defect in the highlighting fix I've written, but as I said 
earlier I'm not sure the pain is worth the gain. So I'd like some direction on whether or not this is a 
good use of my time.

Attached corners.jpg.
Author: ahuillet Date: 2011-08-04   06h57
This is most definitely not a bug, but a limitation of the system. There is no
easy way to know if the cursor is "on" the obstacle or not, the only information
we have available is whether the cursor is on the obstacle's image.

The pain is not worth the gain.
Author: hail Date: 2011-08-04   17h43
Just to correct you, alpha checking is actually very easy.
History
Date User Action Args
2011-08-04 17:43:00hailsetmessages: + msg1487
2011-08-04 06:57:18ahuilletsetstatus: open -> postponed
priority: minor -> idea
messages: + msg1464
2011-08-03 23:26:30hailcreate