#include "intensemarcus.h" /* SDL_Surface loads an image from a file, and converts it into the same format as the display, for faster blitting. */ SDL_Surface *loadImage(std::string filename) { // Image as it is loaded SDL_Surface* raw = NULL; // Image converted into same format as display SDL_Surface* image = NULL; raw = IMG_Load(filename.c_str()); if(raw != NULL) { // Convert the image, using the PNG's alpha channel image = SDL_DisplayFormatAlpha(raw); // Free raw image SDL_FreeSurface(raw); } return image; }