Re: [AD] float positions

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


--- Victor <vwss1984@xxxxxxxxxx> escreveu:

> 
> Converting "int -> float -> int" is indeed a waste of time, except if
> the compiler could optimize that to simple "int". It again could
> depend
> of what the programmer does and how.
> I assume that the first conversion is did in the parameter passing to
> puxtixel/getpixel/blit/whatever, so where is the second one? If it is
> in deep inside allegro there is no sense to use float there as it
> would
> always turns into a int. If it's inside OpenGL, i think is ok.
> 
> But, if i use al_getpixel(bmp, 4.5, 3.141592) what it should return?
> What does al_putpixel(bmp, some_color, 1.23, 7.777)?
> How the resulting bitmap of al_blit(bmp1, bmp2, 3.33, 3.141592, 0.5,
> 4.444, 653.21, 1234.567) will look?
> 

Responding to my own e-mail. I thought about it, and it actually makes
sense even if it is conveted to int down there.
Non-integer putpixel, getpixel, blits, etc could/would do an
antialiased behavior if working on non-integer coordinates. getpixel
should be easy to implement, putpixel is a bit harder, blit will be
very painfully to implement in a decent way if/when we do that by hand.

Victor Williams Stafusa da Silva

__________________________________________________
Fale com seus amigos  de graça com o novo Yahoo! Messenger 
http://br.messenger.yahoo.com/ 




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