[AD] Native image loader/OS X

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


I stumbled on a problem with the native image loader on OS X the other day.
The image in question is a bitmap font where some of the characters represent chess figurines. I found that I could use the image just fine if I used libpng to load it, but using the native loader, things would break. A quick look at the image with ex_bitmap showed why: the image was loaded as a 61x27 pixel bitmap, whereas the bitmap is actually 257x113 pixels.
Other images were fine.

Clearly, something somewhere has a notion that the bitmap should be a certain size (or be displayed using a certain DPI) which is typically not what we want. Doing some background reading I found that you can query the actual pixel size of an image "representation". I modified the loader so that it now does this and sure enough that fixes the issue.

I'll commit the attached patch, but perhaps someone should have another look at this to see if there are any pitfalls I may have missed.

Evert

Attachment: native_bitmap_loader_osx.diff
Description: Binary data



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