Re: weird SDL Rect handling on SDL module
Asko Kauppi <[email protected]> Sun, 28 Aug 2005 21:59:28 +0300
| Newsgroups | gmane.comp.lang.lua.luacheia |
|---|---|
| Message-ID | <[email protected]> |
Yes, what beats me is why would one want to use negative sizes, and what kind of behaviour they actually have? -ak Rafael Jannone kirjoitti 28.8.2005 kello 17.45: > Asko Kauppi escreveu: > >> >> Yes, you certainly have found the source of the issue. >> >> The +0.5's are there to handle cases where coordinates have been >> calculated, and don't exactly match into integers. Originally, >> the SDL >> port was tested against Meteor Shower demo, and it most likely >> benefitted from them. >> >> Now, the proper solution would most likely involve some rounding >> function, suggestions welcome. :) >> > > how about this: > > #define glua_round(v) ((int)(((v) < 0) ? (v)-0.5 : (v)+0.5)) > > i changed all "+0.5" to this define, and now it seems to be working. > > i forgot to mention, there is another instance of this bug inside > function GLUA_FUNC( _Rect_settable ). just search for all "0.5" and > you'll get there. > > regards, > -- > Rafael Jannone > > > ------------------------------------------------------- > SF.Net email is Sponsored by the Better Software Conference & EXPO > September 19-22, 2005 * San Francisco, CA * Development Lifecycle > Practices > Agile & Plan-Driven Development * Managing Projects & Teams * > Testing & QA > Security * Process Improvement & Measurement * http://www.sqe.com/ > bsce5sf > _______________________________________________ > Luacheia-list mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/luacheia-list > ------------------------------------------------------- SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf