1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-07-02 18:31:04 +03:00
gmenu2x/src/imageio.h
Nebuleon Fumika 7284104fd1 Fix issues with loading images with alpha disabled.
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.
2014-07-17 01:25:41 +02:00

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