Attached are two screenshots from two apps, one using allegro and the loadpng library and the other using the FOX GUI toolkit, and also the tileset itself (from RPG Maker XP) so you can see how it is supposed to look. I suspect it might be the semi transparent shadows from the trees and such that causes it, because other images with just transparent backgrounds work fine (and images similar to the attached are broken).
Anyone know what's wrong? Is my libpng broken?
Whats the problem? The gigantic black box on the right side in the Allegro application? Other than that the gui and allegro look the same to me.
You'll see the problem if you look at the third attachment; the loaded image is all screwed up.
... all screwed up how? The third attachment looks fine to me.
The third attachment is how it's supposed to look... "the loaded image" = the image as it shows up in the applications.
Simply doing
tileset = load_png( ..., 0) ... blit(tileset, buffer, ... )
Also, just tested loading in SDL and it works fine there.
The PNG is being loaded without an alpha channel, apparently.
I don't know anything about loadpng or FOX GUI though, so I can't help more than that.
[append]
Here's the same image drawn with Allegro's magic pink as the background. Try using it, instead.
You will need to used masked_blit instead of blit.
Convert you PNG files to TGA and load it using Allegro.
Converting it to TGA isn't necessary. He could keep it as PNG like I suggested in my post, or he could use Allegro's software blending techniques:
[append]
I vote that we call this problem the Invisible Pink Unicorn Syndrome
set_alpha_blender
Doh, hadn't noticed that function before. Calling that makes it work perfectly, obviously.
Thanks!