From 77dfcacf38b14ce4c5a8223b40343c2bcea54dde Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Fri, 6 Nov 2015 14:17:26 +0000 Subject: Load images using freeimage --- loader.c | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 loader.c (limited to 'loader.c') diff --git a/loader.c b/loader.c deleted file mode 100644 index 9164074..0000000 --- a/loader.c +++ /dev/null @@ -1,30 +0,0 @@ -#include -#include - -SDL_Texture* imv_load_png(SDL_Renderer *r, const char* path); -SDL_Texture* imv_load_jpeg(SDL_Renderer *r, const char* path); -SDL_Texture* imv_load_tiff(SDL_Renderer *r, const char* path); - -SDL_Texture* imv_load_image(SDL_Renderer *r, const char* path) -{ - if(!path) - return NULL; - - const char* ext = strrchr(path, '.'); - - if(!ext) - return NULL; - - if(strcasecmp(ext, ".png") == 0) { - return imv_load_png(r, path); - } else if(strcasecmp(ext, ".jpeg") == 0 || strcasecmp(ext, ".jpg") == 0) { - return imv_load_jpeg(r, path); - } else if(strcasecmp(ext, ".tif") == 0 || strcasecmp(ext, ".tiff") == 0) { - return imv_load_tiff(r, path); - } - - fprintf(stderr, - "Could not determine filetype of '%s' from its extension.\n", - path); - return NULL; -} -- cgit v1.2.3