diff options
Diffstat (limited to 'src/sandbox/sprite_gif.c')
-rw-r--r-- | src/sandbox/sprite_gif.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/src/sandbox/sprite_gif.c b/src/sandbox/sprite_gif.c index eb7f58a..28c57aa 100644 --- a/src/sandbox/sprite_gif.c +++ b/src/sandbox/sprite_gif.c @@ -5,6 +5,7 @@ #error "This code is only for SDL 2+. No backward compatibility with previous SDL versions, sorry." #endif +#include "utils.h" #define MPL_WINDOW_TITLE __FILE__ #define MPL_WINDOW_WIDTH 640 @@ -85,14 +86,6 @@ int main(int argc, char *argv[]) { } -#define mpl_check(expr, fail_code, priority, ...) \ - if (! (expr)) { \ - SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION,priority,__VA_ARGS__); \ - SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION,priority, \ - "-> last SDL error : %s\n", SDL_GetError()); \ - fail_code; \ - } - void my_SDL_init_or_die(char title[], SDL_Rect win_pos, Uint32 init_flags, Uint32 win_flags, Uint32 rend_flags, SDL_Window **win, SDL_Renderer **rend, SDL_RendererInfo *rend_info, SDL_Rect *viewport) { int res, i; @@ -188,21 +181,7 @@ SDL_Texture * my_sdl_load_texture(SDL_Renderer *rend, char *giffilepath, SDL_Rec SDL_LOG_PRIORITY_WARN, "my_sdl_load_texture(rend, \"%s\") failed",giffilepath ); -/* mpl_check( - s->format->BitsPerPixel==24, - {SDL_FreeSurface(s); return NULL;}, - SDL_LOG_PRIORITY_WARN, - "my_sdl_load_texture(rend, \"%s\") : BitsPerPixel == %i",bmpfilepath,s->format->BitsPerPixel - ); - res=SDL_SetColorKey(s, SDL_TRUE, MPL_COLOR_KEY); - mpl_check( - res==0, - {SDL_FreeSurface(s); return NULL;}, - SDL_LOG_PRIORITY_WARN, - "my_sdl_load_texture(rend, \"%s\") : can't set colorkey %x",bmpfilepath,MPL_COLOR_KEY - ); -*/ t = SDL_CreateTextureFromSurface(rend, s); mpl_check( t, @@ -219,3 +198,4 @@ SDL_Texture * my_sdl_load_texture(SDL_Renderer *rend, char *giffilepath, SDL_Rec SDL_FreeSurface(s); return t; } + |