diff options
Diffstat (limited to 'src/include/utils.h')
-rw-r--r-- | src/include/utils.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/include/utils.h b/src/include/utils.h index 7f43d8f..11fdeee 100644 --- a/src/include/utils.h +++ b/src/include/utils.h @@ -1,4 +1,6 @@ +#define MAX_PATH_LEN 255 + /* Macro for error checking and logging */ #define MPL_CHECK(expr, fail_code, priority, ...) \ if (! (expr)) { \ @@ -8,4 +10,10 @@ fail_code; \ } -#define MAX_PATH_LEN 255 +/* Macro that check and set NULL texture pointer when destroying */ +#define DESTROYTEXTURE_SAFE(t) \ +if (t != NULL) { \ + SDL_DestroyTexture(t); \ + t=NULL; \ +} + |