diff options
Diffstat (limited to 'src/sandbox/sprite.c')
-rw-r--r-- | src/sandbox/sprite.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/sandbox/sprite.c b/src/sandbox/sprite.c index 57c6f06..ec33b36 100644 --- a/src/sandbox/sprite.c +++ b/src/sandbox/sprite.c @@ -90,7 +90,7 @@ void my_SDL_init_or_die(char title[], SDL_Rect win_pos, Uint32 init_flags, Uint3 Uint32 tf; res=SDL_Init(init_flags); - mpl_check( + MPL_CHECK( res==0, // Expression to evaluate {exit(1);} , // Code to execute if expression is not true SDL_LOG_PRIORITY_CRITICAL, // SDL_LogPriority (_CRITICAL, _ERROR, _WARN, _INFO, DEBUG, _VERBOSE) @@ -99,7 +99,7 @@ void my_SDL_init_or_die(char title[], SDL_Rect win_pos, Uint32 init_flags, Uint3 *win=SDL_CreateWindow(title,win_pos.x,win_pos.y,win_pos.w,win_pos.h,win_flags); - mpl_check( + MPL_CHECK( *win, // Just put the pointer if you want to check if it's not NULL {SDL_Quit(); exit(2);}, SDL_LOG_PRIORITY_CRITICAL, @@ -112,7 +112,7 @@ void my_SDL_init_or_die(char title[], SDL_Rect win_pos, Uint32 init_flags, Uint3 ); *rend=SDL_CreateRenderer(*win,-1, rend_flags); - mpl_check( + MPL_CHECK( *rend, {SDL_DestroyWindow(*win);SDL_Quit(); exit(3);}, SDL_LOG_PRIORITY_CRITICAL, @@ -120,7 +120,7 @@ void my_SDL_init_or_die(char title[], SDL_Rect win_pos, Uint32 init_flags, Uint3 ); res=SDL_GetRendererInfo(*rend, rend_info); - mpl_check( + MPL_CHECK( res==0, {SDL_DestroyRenderer(*rend);SDL_DestroyWindow(*win);SDL_Quit(); exit(4);}, SDL_LOG_PRIORITY_CRITICAL, @@ -169,13 +169,13 @@ SDL_Texture * my_sdl_load_texture(SDL_Renderer *rend, char *bmpfilepath, SDL_Rec int res; s = SDL_LoadBMP(bmpfilepath); - mpl_check( + MPL_CHECK( s, {return NULL;}, SDL_LOG_PRIORITY_WARN, "my_sdl_load_texture(rend, \"%s\") failed",bmpfilepath ); - mpl_check( + MPL_CHECK( s->format->BitsPerPixel==24, {SDL_FreeSurface(s); return NULL;}, SDL_LOG_PRIORITY_WARN, @@ -183,7 +183,7 @@ SDL_Texture * my_sdl_load_texture(SDL_Renderer *rend, char *bmpfilepath, SDL_Rec ); res=SDL_SetColorKey(s, SDL_TRUE, MPL_COLOR_KEY); - mpl_check( + MPL_CHECK( res==0, {SDL_FreeSurface(s); return NULL;}, SDL_LOG_PRIORITY_WARN, @@ -191,7 +191,7 @@ SDL_Texture * my_sdl_load_texture(SDL_Renderer *rend, char *bmpfilepath, SDL_Rec ); t = SDL_CreateTextureFromSurface(rend, s); - mpl_check( + MPL_CHECK( t, {SDL_FreeSurface(s); return NULL;}, SDL_LOG_PRIORITY_WARN, |