google-code-export / nekonme

Automatically exported from code.google.com/p/nekonme
1 stars 0 forks source link

Tilesheet rounds co-ords to integer #128

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm providing floating point values for the x and y co-ordinates at which I 
want the tile to display, however it seems that these are in some way converted 
to integers before drawing as all my images are drawn with integer x and y 
positions. Adding a child bitmap with the same inputs produces correct results.

Latest SVN. iPhone target.

Original issue reported on code.google.com by ja351...@googlemail.com on 14 Aug 2011 at 5:09

GoogleCodeExporter commented 9 years ago
See attached file.

All images are of a 20x20 black rect rotated 30 degrees. Tilesheet have to be 
pre-rotated, Bitmaps are rotated at display time.
Image 1: Tilesheet, no smoothing - snaps to nearest pixel
Image 2: Tilesheet, smoothing - the same as image 1. (What does smoothing 
actually do?)
Image 3: Bitmap, no smoothing - handles pixel snapping but is aliased badly.
Image 4: Bitmap, smoothing - looks lovely.

Image 4 is obviously ideal. It would appear that somewhere along the way when 
rendering bitmaps the translation part becomes integer. If you pre-rotate this 
makes things rather ugly, but if the rotation is part of the transformation 
matrix everything looks fine. I would expect 1) and 3) to be the same, and 2) 
and 4) to be the same.

Even if the solution is elsewhere it seems to me it would be very nice to have 
an extension to tilesheet to be able to handle arbitrary transformation 
matrices for each element. My application already generates >400 pre-rotated 
images just to pass to tilesheet, so it'd not only solve the smoothing 
problems, but also cut down on the increased memory usage/initialisation time.

Original comment by ja351...@googlemail.com on 17 Aug 2011 at 8:18

Attachments: