mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-10-04 02:08:32 +03:00
7284104fd1
These issues are fixed: * loadPNG gave RGBA surfaces unconditionally. Now it gives RGB surfaces if its second parameter, defaulting to true, is false. This fixes adding per- surface alpha values, because an RGBA surface ignores its per-surface value. * Surface::loadImage is updated to receive a third parameter, defaulting to true, to determine whether alpha is loaded. * SurfaceCollection::defaultAlpha was never used. * SurfaceCollection::defaultAlpha defaulted to false, so even if it were used, it would have loaded images without alpha.
13 lines
238 B
C++
13 lines
238 B
C++
#ifndef IMAGEIO_H
|
|
#define IMAGEIO_H
|
|
|
|
#include <string>
|
|
|
|
struct SDL_Surface;
|
|
|
|
/** Loads an image from a PNG file into a newly allocated 32bpp RGBA surface.
|
|
*/
|
|
SDL_Surface *loadPNG(const std::string &path, bool loadAlpha = true);
|
|
|
|
#endif
|