Re: [AD] scare_mouse_area

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Vincent Penquerc'h <lyrian@xxxxxxxxxx> writes:
> Here is a scare_mouse_area routine, which scares the mouse only if it is 
> in the specified bounds. 

Cool.

> However, when I tested it, it sometimes leaves artifacts on the screen

I think that's because you don't freeze the mouse before checking 
coordinates, so it can move in between when you decide that it's outside the 
box, and when you freeze it.

I've also changed it to use a separate flag stack for remembering the freeze 
states: it seems a bit hackish to put that in a magic pointer value :-) Also 
having a dedicated place to store this allows it to respect the existing 
freeze state, in case the user had already frozen the mouse before calling 
this routine.

I wonder if it would be worth making all the GUI objects use this? On the 
one hand that would reduce flicker quite a bit, but on the other hand, not 
all the standard objects draw entirely inside their rectangle (some have a 
one pixel shadow, or grab handles, etc), and it seems very likely that other 
widgets people have written might also be a bit lax about this, so I don't 
know whether we can risk assuming everyone will stick exactly to their 
stated widget sizes...


--
Shawn Hargreaves - shawn@xxxxxxxxxx - http://www.talula.demon.co.uk/
"A binary is barely software: it's more like hardware on a floppy disk."



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/