blob: f626b5018085cede822a61b8ef96c50d69fc4ce3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
#define MAX_PATH_LEN 255
/* Macro for error checking and logging */
#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; \
}
/* Macro that check and set NULL texture pointer when destroying */
#define DESTROYTEXTURE_SAFE(t) \
if (t != NULL) { \
SDL_DestroyTexture(t); \
t=NULL; \
}
#define DESTROYSURFACE_SAFE(s) \
SDL_FreeSurface(s); \
s=NULL;
|