#include #include #include "logging.h" #include "image.h" SDL_Surface * load_png(const char *path) { SDL_RWops *rwops; SDL_Surface *img; debug("Loading PNG image \"%s\"...", path); rwops = SDL_RWFromFile(path, "rb"); img = IMG_LoadPNG_RW(rwops); if (!img) { err(1, "Failed to load image \"%s\" (%s)", path, IMG_GetError()); } return img; }