52 #ifndef TUX4KIDS_COMMON_H
53 #define TUX4KIDS_COMMON_H
56 #include <sys/types.h>
63 #include "SDL_image.h"
64 #include "SDL_mixer.h"
78 #define DEBUGVAR(mask, Expr) \
79 if((mask) & (debug_status)) \
81 fprintf(stderr, #Expr ": %s\n", (Expr)); fflush(stderr); \
85 #define DEBUGVARX(mask, Expr) \
86 if((mask) & (debug_status)) \
88 fprintf(stderr, #Expr ": %x\n", (Expr)); fflush(stderr); \
92 #define DEBUGVARF(mask, Expr) \
93 if((mask) & (debug_status)) \
95 fprintf(stderr, #Expr ": %f\n", (Expr)); fflush(stderr); \
99 #define DEBUGCODE(mask) if((mask) & debug_status)
102 #define DEBUGMSG(mask, ...) \
103 if((mask) & debug_status) \
105 fprintf(stderr, __VA_ARGS__); fflush(stderr); \
109 #if SDL_BYTEORDER == SDL_BIG_ENDIAN
110 #define rmask 0xff000000
111 #define gmask 0x00ff0000
112 #define bmask 0x0000ff00
113 #define amask 0x000000ff
115 #define rmask 0x000000ff
116 #define gmask 0x0000ff00
117 #define bmask 0x00ff0000
118 #define amask 0xff000000
136 #define DEBUGCODE(mask) if((mask) & debug_status)
137 #define DEBUGMSG(mask, ...) \
138 if((mask) & debug_status) \
140 fprintf(stderr, __VA_ARGS__); fflush(stderr); \
144 static const int debug_loaders = 1 << 0;
145 static const int debug_menu = 1 << 1;
146 static const int debug_menu_parser = 1 << 2;
147 static const int debug_sdl = 1 << 3;
148 static const int debug_linewrap = 1 << 4;
149 static const int debug_i18n = 1 << 5;
150 static const int debug_all = ~0;
164 #define START_CUSTOM_DEBUG 4
168 extern SDL_Surface*
screen;
173 #define MAX_SPRITE_FRAMES 15
231 #define IMG_REGULAR 0x01
232 #define IMG_COLORKEY 0x02
233 #define IMG_ALPHA 0x04
234 #define IMG_MODES 0x07
236 #define IMG_NOT_REQUIRED 0x10
237 #define IMG_NO_PNG_FALLBACK 0x20
239 #define MAX_LINES 128
240 #define MAX_LINEWIDTH 256
432 void (*draw_background)(),
433 int (*handle_event)(SDL_Event*),
434 void (*handle_animations)(),
435 int (*handle_activity)(
int,
int)
486 const char* file_name
621 SDL_Rect* target_rect,
702 SDL_Surface*
T4K_Flip( SDL_Surface* in,
929 SDL_Surface*
T4K_zoom( SDL_Surface* src,
1104 SDL_Surface* curr_bkgd,
1131 SDL_Surface* curr_bkgd,
1464 SDL_Surface** fs_bkgd,
1465 SDL_Surface** win_bkgd
1638 const static int T4K_AUDIO_PLAY_ONCE = 0;
1639 const static int T4K_AUDIO_LOOP_FOREVER = -1;
1892 char str_list[
MAX_LINES][MAX_LINEWIDTH],
1957 const char* UTF8_word,