According to http://forums.libsdl.org/viewtopic.php?p=30317 apparently libSDL_image uses an Apple API to load PNGs, and Apple "helpfully" converts the image data so you don't get what you expect if you're depending on level data to be loaded from PNGs. That's why I'm seeing this level with no castle, no grass, no water, no trees. Just mountains, villages, and towers. Great.
one plus one
Shared publicly•View activity
View 7 previous comments
- Thanks, guys! I'll look into both of them.Jan 5, 2012
- It turns out there is a fix, but I guess not in a release candidate yet. http://forums.libsdl.org/viewtopic.php?p=31258Jan 5, 2012
- Stb beats sdl_image anyway, no need to wait for a fix :)Jan 5, 2012
- Between LodePNG and stb_image, I'm so far more pleased with LodePNG, if only because at a quick glance I know what to do. Include a header, call the appropriate functions. There's even examples. With stb_image.c, I immediately thought "How do I include that in my project?" And then I saw this part in the comments:
// To get a header file for this, either cut and paste the header,
// or create stb_image.h, #define STBI_HEADER_FILE_ONLY, and
// then include stb_image.c from it.
Wha-? Is this normal? I've never seen code that said I should create my own header file since header files are usually just provided.Jan 5, 2012
- Oh, and LodePNG also does encoding, so if I ever do make a level editor, I can save the files as well as load them.Jan 5, 2012
- Yeah, well, I have to admit that bit in stb has always been odd. =) I've written stb_image.h that only has that #define and includes the c. What's even odder is that the other bits in stb (the saving part) comes as a .h, and works in reverse. Still, it does pretty much everything sdl_image does, is public domain, and takes fraction of the size.Jan 5, 2012