1 // ============================================================================
2 // Artsoft Retro-Game Library
3 // ----------------------------------------------------------------------------
4 // (c) 1995-2014 by Artsoft Entertainment
7 // http://www.artsoft.org/
8 // ----------------------------------------------------------------------------
10 // ============================================================================
19 #if defined(PLATFORM_MACOSX)
21 #elif defined(PLATFORM_WIN32)
23 #elif defined(PLATFORM_ANDROID)
30 /* the additional 'b' is needed for Win32 to open files in binary mode */
31 #define MODE_READ "rb"
32 #define MODE_WRITE "wb"
33 #define MODE_APPEND "ab"
35 #define DEFAULT_DEPTH 0
39 #define BLIT_INVERSE 2
40 #define BLIT_ON_BACKGROUND 3
42 /* values for fullscreen status */
43 #define FULLSCREEN_NOT_AVAILABLE FALSE
44 #define FULLSCREEN_AVAILABLE TRUE
46 /* values for window scaling */
47 #define WINDOW_SCALING_NOT_AVAILABLE FALSE
48 #define WINDOW_SCALING_AVAILABLE TRUE
50 #define MIN_WINDOW_SCALING_PERCENT 30
51 #define STD_WINDOW_SCALING_PERCENT 100
52 #define MAX_WINDOW_SCALING_PERCENT 400
53 #define STEP_WINDOW_SCALING_PERCENT 10
55 /* values for window scaling quality */
56 #define SCALING_QUALITY_NEAREST "nearest"
57 #define SCALING_QUALITY_LINEAR "linear"
58 #define SCALING_QUALITY_BEST "best"
60 #define SCALING_QUALITY_DEFAULT SCALING_QUALITY_LINEAR
62 /* values for screen rendering mode */
63 #define STR_SPECIAL_RENDERING_OFF "stream_texture_only"
64 #define STR_SPECIAL_RENDERING_BITMAP "bitmap_and_stream_texture"
65 #define STR_SPECIAL_RENDERING_TARGET "target_texture_only"
66 #define STR_SPECIAL_RENDERING_DOUBLE "stream_and_target_texture"
68 #if defined(TARGET_SDL2)
69 #define STR_SPECIAL_RENDERING_DEFAULT STR_SPECIAL_RENDERING_DOUBLE
71 #define STR_SPECIAL_RENDERING_DEFAULT STR_SPECIAL_RENDERING_BITMAP
74 #define SPECIAL_RENDERING_OFF 0
75 #define SPECIAL_RENDERING_BITMAP 1
76 #define SPECIAL_RENDERING_TARGET 2
77 #define SPECIAL_RENDERING_DOUBLE 3
79 #if defined(TARGET_SDL2)
80 #define SPECIAL_RENDERING_DEFAULT SPECIAL_RENDERING_DOUBLE
82 #define SPECIAL_RENDERING_DEFAULT SPECIAL_RENDERING_BITMAP
85 /* values for touch control */
86 #define TOUCH_CONTROL_VIRTUAL_BUTTONS "virtual_buttons"
87 #define TOUCH_CONTROL_WIPE_GESTURES "wipe_gestures"
89 #define TOUCH_CONTROL_DEFAULT TOUCH_CONTROL_VIRTUAL_BUTTONS
91 #define TOUCH_MOVE_DISTANCE_DEFAULT 2
92 #define TOUCH_DROP_DISTANCE_DEFAULT 5
95 /* default input keys */
96 #define DEFAULT_KEY_LEFT KSYM_Left
97 #define DEFAULT_KEY_RIGHT KSYM_Right
98 #define DEFAULT_KEY_UP KSYM_Up
99 #define DEFAULT_KEY_DOWN KSYM_Down
100 #if defined(PLATFORM_MACOSX)
101 #define DEFAULT_KEY_SNAP KSYM_Control_L
102 #define DEFAULT_KEY_DROP KSYM_KP_Enter
104 #define DEFAULT_KEY_SNAP KSYM_Control_L
105 #define DEFAULT_KEY_DROP KSYM_Control_R
107 #define DEFAULT_KEY_OKAY KSYM_Return
108 #define DEFAULT_KEY_CANCEL KSYM_Escape
110 /* default shortcut keys */
111 #define DEFAULT_KEY_SAVE_GAME KSYM_F1
112 #define DEFAULT_KEY_LOAD_GAME KSYM_F2
113 #define DEFAULT_KEY_TOGGLE_PAUSE KSYM_space
114 #define DEFAULT_KEY_FOCUS_PLAYER_1 KSYM_F5
115 #define DEFAULT_KEY_FOCUS_PLAYER_2 KSYM_F6
116 #define DEFAULT_KEY_FOCUS_PLAYER_3 KSYM_F7
117 #define DEFAULT_KEY_FOCUS_PLAYER_4 KSYM_F8
118 #define DEFAULT_KEY_FOCUS_PLAYER_ALL KSYM_F9
119 #define DEFAULT_KEY_TAPE_EJECT KSYM_UNDEFINED
120 #define DEFAULT_KEY_TAPE_EXTRA KSYM_UNDEFINED
121 #define DEFAULT_KEY_TAPE_STOP KSYM_UNDEFINED
122 #define DEFAULT_KEY_TAPE_PAUSE KSYM_UNDEFINED
123 #define DEFAULT_KEY_TAPE_RECORD KSYM_UNDEFINED
124 #define DEFAULT_KEY_TAPE_PLAY KSYM_UNDEFINED
125 #define DEFAULT_KEY_SOUND_SIMPLE KSYM_UNDEFINED
126 #define DEFAULT_KEY_SOUND_LOOPS KSYM_UNDEFINED
127 #define DEFAULT_KEY_SOUND_MUSIC KSYM_UNDEFINED
128 #define DEFAULT_KEY_SNAP_LEFT KSYM_UNDEFINED
129 #define DEFAULT_KEY_SNAP_RIGHT KSYM_UNDEFINED
130 #define DEFAULT_KEY_SNAP_UP KSYM_UNDEFINED
131 #define DEFAULT_KEY_SNAP_DOWN KSYM_UNDEFINED
133 /* values for key_status */
134 #define KEY_NOT_PRESSED FALSE
135 #define KEY_RELEASED FALSE
136 #define KEY_PRESSED TRUE
138 /* values for button status */
139 #define MB_NOT_PRESSED FALSE
140 #define MB_NOT_RELEASED TRUE
141 #define MB_RELEASED FALSE
142 #define MB_PRESSED TRUE
143 #define MB_MENU_CHOICE FALSE
144 #define MB_MENU_MARK TRUE
145 #define MB_MENU_INITIALIZE (-1)
146 #define MB_MENU_LEAVE (-2)
147 #define MB_LEFTBUTTON 1
148 #define MB_MIDDLEBUTTON 2
149 #define MB_RIGHTBUTTON 3
150 #define MB_WHEEL_UP 4
151 #define MB_WHEEL_DOWN 5
152 #define MB_WHEEL_LEFT 6
153 #define MB_WHEEL_RIGHT 7
154 #define IS_WHEEL_BUTTON_VERTICAL(b) ((b) >= MB_WHEEL_UP && \
155 (b) <= MB_WHEEL_DOWN)
156 #define IS_WHEEL_BUTTON_HORIZONTAL(b) ((b) >= MB_WHEEL_LEFT && \
157 (b) <= MB_WHEEL_RIGHT)
158 #define IS_WHEEL_BUTTON(b) ((b) >= MB_WHEEL_UP && \
159 (b) <= MB_WHEEL_DOWN)
160 #define DEFAULT_WHEEL_STEPS 3
162 #define BUTTON_STEPSIZE(b) ((b) == MB_LEFTBUTTON ? 1 : \
163 (b) == MB_MIDDLEBUTTON ? 5 : \
164 (b) == MB_RIGHTBUTTON ? 10 : 1)
166 /* values for move directions */
167 #define MV_BIT_LEFT 0
168 #define MV_BIT_RIGHT 1
170 #define MV_BIT_DOWN 3
172 #define NUM_DIRECTIONS 4
174 /* diagonal movement directions are used in a different contect than buttons */
175 #define MV_BIT_UPLEFT 4
176 #define MV_BIT_UPRIGHT 5
177 #define MV_BIT_DOWNLEFT 6
178 #define MV_BIT_DOWNRIGHT 7
180 #define NUM_DIRECTIONS_FULL 8
182 /* values for special "button" bitmasks */
186 #define NUM_PLAYER_ACTIONS 6
188 /* values for special "focus player" bitmasks */
189 #define BIT_SET_FOCUS 6
191 /* values for drawing stages for global animations */
192 #define DRAW_GLOBAL_ANIM_STAGE_1 1
193 #define DRAW_GLOBAL_ANIM_STAGE_2 2
195 /* values for drawing target (various functions) */
196 #define DRAW_TO_BACKBUFFER 0
197 #define DRAW_TO_FIELDBUFFER 1
198 #define DRAW_TO_SCREEN 2
199 #define DRAW_TO_FADE_SOURCE 3
200 #define DRAW_TO_FADE_TARGET 4
202 /* values for move directions and special "button" key bitmasks */
204 #define MV_LEFT (1 << MV_BIT_LEFT)
205 #define MV_RIGHT (1 << MV_BIT_RIGHT)
206 #define MV_UP (1 << MV_BIT_UP)
207 #define MV_DOWN (1 << MV_BIT_DOWN)
209 #define MV_UPLEFT (MV_UP | MV_LEFT)
210 #define MV_UPRIGHT (MV_UP | MV_RIGHT)
211 #define MV_DOWNLEFT (MV_DOWN | MV_LEFT)
212 #define MV_DOWNRIGHT (MV_DOWN | MV_RIGHT)
214 #define MV_HORIZONTAL (MV_LEFT | MV_RIGHT)
215 #define MV_VERTICAL (MV_UP | MV_DOWN)
216 #define MV_ALL_DIRECTIONS (MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN)
217 #define MV_ANY_DIRECTION (MV_ALL_DIRECTIONS)
218 #define MV_NO_DIRECTION (MV_NONE)
220 #define KEY_BUTTON_1 (1 << BUTTON_1)
221 #define KEY_BUTTON_2 (1 << BUTTON_2)
222 #define KEY_BUTTON_SNAP KEY_BUTTON_1
223 #define KEY_BUTTON_DROP KEY_BUTTON_2
224 #define KEY_MOTION (MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN)
225 #define KEY_BUTTON (KEY_BUTTON_1 | KEY_BUTTON_2)
226 #define KEY_ACTION (KEY_MOTION | KEY_BUTTON)
228 #define KEY_SET_FOCUS (1 << BIT_SET_FOCUS)
230 #define MV_DIR_FROM_BIT(x) ((x) < NUM_DIRECTIONS ? 1 << (x) : \
231 (x) == MV_BIT_UPLEFT ? MV_UPLEFT : \
232 (x) == MV_BIT_UPRIGHT ? MV_UPRIGHT : \
233 (x) == MV_BIT_DOWNLEFT ? MV_DOWNLEFT : \
234 (x) == MV_BIT_DOWNRIGHT ? MV_DOWNRIGHT : \
237 #define MV_DIR_TO_BIT(x) ((x) == MV_LEFT ? MV_BIT_LEFT : \
238 (x) == MV_RIGHT ? MV_BIT_RIGHT : \
239 (x) == MV_UP ? MV_BIT_UP : \
240 (x) == MV_DOWN ? MV_BIT_DOWN : \
241 (x) == MV_UPLEFT ? MV_BIT_UPLEFT : \
242 (x) == MV_UPRIGHT ? MV_BIT_UPRIGHT : \
243 (x) == MV_DOWNLEFT ? MV_BIT_DOWNLEFT : \
244 (x) == MV_DOWNRIGHT ? MV_BIT_DOWNRIGHT : \
247 #define MV_DIR_OPPOSITE(x) ((x) == MV_LEFT ? MV_RIGHT : \
248 (x) == MV_RIGHT ? MV_LEFT : \
249 (x) == MV_UP ? MV_DOWN : \
250 (x) == MV_DOWN ? MV_UP : \
251 (x) == MV_UPLEFT ? MV_DOWNRIGHT : \
252 (x) == MV_UPRIGHT ? MV_DOWNLEFT : \
253 (x) == MV_DOWNLEFT ? MV_UPRIGHT : \
254 (x) == MV_DOWNRIGHT ? MV_UPLEFT : \
257 /* values for animation mode (frame order and direction) */
258 /* (stored in level files -- never change existing values) */
260 #define ANIM_LOOP (1 << 0)
261 #define ANIM_LINEAR (1 << 1)
262 #define ANIM_PINGPONG (1 << 2)
263 #define ANIM_PINGPONG2 (1 << 3)
264 #define ANIM_RANDOM (1 << 4)
265 #define ANIM_CE_VALUE (1 << 5)
266 #define ANIM_CE_SCORE (1 << 6)
267 #define ANIM_CE_DELAY (1 << 7)
268 #define ANIM_REVERSE (1 << 8)
269 #define ANIM_OPAQUE_PLAYER (1 << 9)
271 /* values for special (non game element) animation modes */
272 /* (not stored in level files -- can be changed, if needed) */
273 #define ANIM_HORIZONTAL (1 << 10)
274 #define ANIM_VERTICAL (1 << 11)
275 #define ANIM_CENTERED (1 << 12)
276 #define ANIM_STATIC_PANEL (1 << 13)
277 #define ANIM_ALL (1 << 14)
278 #define ANIM_ONCE (1 << 15)
280 #define ANIM_DEFAULT ANIM_LOOP
282 /* values for special drawing styles (currently only for crumbled graphics) */
284 #define STYLE_ACCURATE_BORDERS (1 << 0)
285 #define STYLE_INNER_CORNERS (1 << 1)
287 #define STYLE_DEFAULT STYLE_NONE
289 /* values for fade mode */
290 #define FADE_TYPE_NONE 0
291 #define FADE_TYPE_FADE_IN (1 << 0)
292 #define FADE_TYPE_FADE_OUT (1 << 1)
293 #define FADE_TYPE_TRANSFORM (1 << 2)
294 #define FADE_TYPE_CROSSFADE (1 << 3)
295 #define FADE_TYPE_MELT (1 << 4)
296 #define FADE_TYPE_CURTAIN (1 << 5)
297 #define FADE_TYPE_SKIP (1 << 6)
299 #define FADE_MODE_NONE (FADE_TYPE_NONE)
300 #define FADE_MODE_FADE_IN (FADE_TYPE_FADE_IN)
301 #define FADE_MODE_FADE_OUT (FADE_TYPE_FADE_OUT)
302 #define FADE_MODE_FADE (FADE_TYPE_FADE_IN | FADE_TYPE_FADE_OUT)
303 #define FADE_MODE_TRANSFORM (FADE_TYPE_TRANSFORM | FADE_TYPE_FADE_IN)
304 #define FADE_MODE_CROSSFADE (FADE_MODE_TRANSFORM | FADE_TYPE_CROSSFADE)
305 #define FADE_MODE_MELT (FADE_MODE_TRANSFORM | FADE_TYPE_MELT)
306 #define FADE_MODE_CURTAIN (FADE_MODE_TRANSFORM | FADE_TYPE_CURTAIN)
307 #define FADE_MODE_SKIP_FADE_IN (FADE_TYPE_SKIP | FADE_TYPE_FADE_IN)
308 #define FADE_MODE_SKIP_FADE_OUT (FADE_TYPE_SKIP | FADE_TYPE_FADE_OUT)
310 #define FADE_MODE_DEFAULT FADE_MODE_FADE
312 /* values for toon positions */
313 #define POS_UNDEFINED -1
323 /* values for text alignment */
324 #define ALIGN_LEFT (1 << 0)
325 #define ALIGN_RIGHT (1 << 1)
326 #define ALIGN_CENTER (1 << 2)
327 #define ALIGN_DEFAULT ALIGN_LEFT
329 #define VALIGN_TOP (1 << 0)
330 #define VALIGN_BOTTOM (1 << 1)
331 #define VALIGN_MIDDLE (1 << 2)
332 #define VALIGN_DEFAULT VALIGN_TOP
334 #define ALIGNED_XPOS(x,w,a) ((a) == ALIGN_CENTER ? (x) - (w) / 2 : \
335 (a) == ALIGN_RIGHT ? (x) - (w) : (x))
336 #define ALIGNED_YPOS(y,h,v) ((v) == VALIGN_MIDDLE ? (y) - (h) / 2 : \
337 (v) == VALIGN_BOTTOM ? (y) - (h) : (y))
338 #define ALIGNED_TEXT_XPOS(p) ALIGNED_XPOS((p)->x, (p)->width, (p)->align)
339 #define ALIGNED_TEXT_YPOS(p) ALIGNED_YPOS((p)->y, (p)->height, (p)->valign)
341 /* values for redraw_mask */
342 #define REDRAW_NONE (0)
343 #define REDRAW_ALL (1 << 0)
344 #define REDRAW_FIELD (1 << 1)
345 #define REDRAW_DOOR_1 (1 << 2)
346 #define REDRAW_DOOR_2 (1 << 3)
347 #define REDRAW_DOOR_3 (1 << 4)
348 #define REDRAW_FPS (1 << 5)
350 #define REDRAW_DOORS (REDRAW_DOOR_1 | \
354 #define IN_GFX_FIELD_PLAY(x, y) (x >= gfx.sx && x < gfx.sx + gfx.sxsize && \
355 y >= gfx.sy && y < gfx.sy + gfx.sysize)
356 #define IN_GFX_FIELD_FULL(x, y) (x >= gfx.real_sx && \
357 x < gfx.real_sx + gfx.full_sxsize && \
358 y >= gfx.real_sy && \
359 y < gfx.real_sy + gfx.full_sysize)
360 #define IN_GFX_DOOR_1(x, y) (x >= gfx.dx && x < gfx.dx + gfx.dxsize && \
361 y >= gfx.dy && y < gfx.dy + gfx.dysize)
362 #define IN_GFX_DOOR_2(x, y) (x >= gfx.vx && x < gfx.vx + gfx.vxsize && \
363 y >= gfx.vy && y < gfx.vy + gfx.vysize)
364 #define IN_GFX_DOOR_3(x, y) (x >= gfx.ex && x < gfx.ex + gfx.exsize && \
365 y >= gfx.ey && y < gfx.ey + gfx.eysize)
367 /* values for mouse cursor */
368 #define CURSOR_DEFAULT 0
369 #define CURSOR_NONE 1
370 #define CURSOR_PLAYFIELD 2
372 /* fundamental game speed values */
373 #define ONE_SECOND_DELAY 1000 /* delay value for one second */
374 #define GAME_FRAME_DELAY 20 /* frame delay in milliseconds */
375 #define FFWD_FRAME_DELAY 10 /* 200% speed for fast forward */
376 #define FRAMES_PER_SECOND (ONE_SECOND_DELAY / GAME_FRAME_DELAY)
377 #define FRAMES_PER_SECOND_SP 35
379 /* maximum playfield size supported by libgame functions */
380 #define MAX_PLAYFIELD_WIDTH 128
381 #define MAX_PLAYFIELD_HEIGHT 128
383 /* maximum number of parallel players supported by libgame functions */
384 #define MAX_PLAYERS 4
386 /* maximum allowed length of player name */
387 #define MAX_PLAYER_NAME_LEN 10
389 /* maximum number of levels in a level set */
390 #define MAX_LEVELS 1000
392 /* default name for empty highscore entry */
393 #define EMPTY_PLAYER_NAME "no name"
395 /* default name for unknown player names */
396 #define ANONYMOUS_NAME "anonymous"
398 /* default for other unknown names */
399 #define UNKNOWN_NAME "unknown"
401 /* default name for new levels */
402 #define NAMELESS_LEVEL_NAME "nameless level"
404 /* default text for non-existant artwork */
405 #define NOT_AVAILABLE "(not available)"
407 /* default value for undefined filename */
408 #define UNDEFINED_FILENAME "[NONE]"
410 /* default value for undefined levelset */
411 #define UNDEFINED_LEVELSET "[NONE]"
413 /* default value for undefined parameter */
414 #define ARG_DEFAULT "[DEFAULT]"
416 /* default values for undefined configuration file parameters */
417 #define ARG_UNDEFINED "-1000000"
418 #define ARG_UNDEFINED_VALUE (-1000000)
420 /* default value for off-screen positions */
421 #define POS_OFFSCREEN (-1000000)
423 /* definitions for game sub-directories */
425 #define RO_GAME_DIR "."
429 #define RW_GAME_DIR "."
432 #define RO_BASE_PATH RO_GAME_DIR
433 #define RW_BASE_PATH RW_GAME_DIR
435 /* directory names */
436 #define GRAPHICS_DIRECTORY "graphics"
437 #define SOUNDS_DIRECTORY "sounds"
438 #define MUSIC_DIRECTORY "music"
439 #define LEVELS_DIRECTORY "levels"
440 #define TAPES_DIRECTORY "tapes"
441 #define SCORES_DIRECTORY "scores"
442 #define DOCS_DIRECTORY "docs"
443 #define CACHE_DIRECTORY "cache"
445 #define GFX_CLASSIC_SUBDIR "gfx_classic"
446 #define SND_CLASSIC_SUBDIR "snd_classic"
447 #define MUS_CLASSIC_SUBDIR "mus_classic"
449 #define GFX_DEFAULT_SUBDIR (setup.internal.default_graphics_set)
450 #define SND_DEFAULT_SUBDIR (setup.internal.default_sounds_set)
451 #define MUS_DEFAULT_SUBDIR (setup.internal.default_music_set)
453 #define GFX_FALLBACK_FILENAME (setup.internal.fallback_graphics_file)
454 #define SND_FALLBACK_FILENAME (setup.internal.fallback_sounds_file)
455 #define MUS_FALLBACK_FILENAME (setup.internal.fallback_music_file)
457 #define DEFAULT_LEVELSET (setup.internal.default_level_series)
459 /* file names and filename extensions */
460 #define LEVELSETUP_DIRECTORY "levelsetup"
461 #define SETUP_FILENAME "setup.conf"
462 #define LEVELSETUP_FILENAME "levelsetup.conf"
463 #define EDITORSETUP_FILENAME "editorsetup.conf"
464 #define EDITORCASCADE_FILENAME "editorcascade.conf"
465 #define HELPANIM_FILENAME "helpanim.conf"
466 #define HELPTEXT_FILENAME "helptext.conf"
467 #define LEVELINFO_FILENAME "levelinfo.conf"
468 #define GRAPHICSINFO_FILENAME "graphicsinfo.conf"
469 #define SOUNDSINFO_FILENAME "soundsinfo.conf"
470 #define MUSICINFO_FILENAME "musicinfo.conf"
471 #define ARTWORKINFO_CACHE_FILE "artworkinfo.cache"
472 #define LEVELFILE_EXTENSION "level"
473 #define TAPEFILE_EXTENSION "tape"
474 #define SCOREFILE_EXTENSION "score"
476 #define LOG_OUT_BASENAME "stdout.txt"
477 #define LOG_ERR_BASENAME "stderr.txt"
483 #define STRING_PARENT_DIRECTORY ".."
484 #define STRING_TOP_DIRECTORY "/"
486 #define CHAR_PATH_SEPARATOR_UNIX '/'
487 #define CHAR_PATH_SEPARATOR_DOS '\\'
489 #define STRING_PATH_SEPARATOR_UNIX "/"
490 #define STRING_PATH_SEPARATOR_DOS "\\"
492 #define STRING_NEWLINE_UNIX "\n"
493 #define STRING_NEWLINE_DOS "\r\n"
495 #if defined(PLATFORM_WIN32)
496 #define CHAR_PATH_SEPARATOR CHAR_PATH_SEPARATOR_DOS
497 #define STRING_PATH_SEPARATOR STRING_PATH_SEPARATOR_DOS
498 #define STRING_NEWLINE STRING_NEWLINE_DOS
500 #define CHAR_PATH_SEPARATOR CHAR_PATH_SEPARATOR_UNIX
501 #define STRING_PATH_SEPARATOR STRING_PATH_SEPARATOR_UNIX
502 #define STRING_NEWLINE STRING_NEWLINE_UNIX
506 /* areas in bitmap PIX_DOOR */
507 /* meaning in PIX_DB_DOOR: (3 PAGEs)
508 PAGEX1: 1. buffer for DOOR_1
509 PAGEX2: 2. buffer for DOOR_1
510 PAGEX3: buffer for animations
513 /* these values are hard-coded to be able to use them in initialization */
514 #define DOOR_GFX_PAGE_WIDTH 100 /* should be set to "gfx.dxsize" */
515 #define DOOR_GFX_PAGE_HEIGHT 280 /* should be set to "gfx.dysize" */
517 #define DOOR_GFX_PAGESIZE (DOOR_GFX_PAGE_WIDTH)
518 #define DOOR_GFX_PAGEX1 (0 * DOOR_GFX_PAGESIZE)
519 #define DOOR_GFX_PAGEX2 (1 * DOOR_GFX_PAGESIZE)
520 #define DOOR_GFX_PAGEX3 (2 * DOOR_GFX_PAGESIZE)
521 #define DOOR_GFX_PAGEX4 (3 * DOOR_GFX_PAGESIZE)
522 #define DOOR_GFX_PAGEX5 (4 * DOOR_GFX_PAGESIZE)
523 #define DOOR_GFX_PAGEX6 (5 * DOOR_GFX_PAGESIZE)
524 #define DOOR_GFX_PAGEX7 (6 * DOOR_GFX_PAGESIZE)
525 #define DOOR_GFX_PAGEX8 (7 * DOOR_GFX_PAGESIZE)
526 #define DOOR_GFX_PAGEY1 (0)
527 #define DOOR_GFX_PAGEY2 (DOOR_GFX_PAGE_HEIGHT)
530 /* macros for version handling */
531 #define VERSION_MAJOR(x) ((x) / 1000000)
532 #define VERSION_MINOR(x) (((x) % 1000000) / 10000)
533 #define VERSION_PATCH(x) (((x) % 10000) / 100)
534 #define VERSION_BUILD(x) ((x) % 100)
535 #define VERSION_IDENT(a,b,c,d) ((a) * 1000000 + (b) * 10000 + (c) * 100 + (d))
538 /* macros for parent/child process identification */
539 #if defined(PLATFORM_UNIX)
540 #define IS_PARENT_PROCESS() (audio.mixer_pid != getpid())
541 #define IS_CHILD_PROCESS() (audio.mixer_pid == getpid())
542 #define HAS_CHILD_PROCESS() (audio.mixer_pid > 0)
544 #define IS_PARENT_PROCESS() TRUE
545 #define IS_CHILD_PROCESS() FALSE
546 #define HAS_CHILD_PROCESS() FALSE
550 /* values for artwork type */
551 #define ARTWORK_TYPE_GRAPHICS 0
552 #define ARTWORK_TYPE_SOUNDS 1
553 #define ARTWORK_TYPE_MUSIC 2
555 #define NUM_ARTWORK_TYPES 3
558 /* values for tree type (chosen to match artwork type) */
559 #define TREE_TYPE_UNDEFINED -1
560 #define TREE_TYPE_GRAPHICS_DIR ARTWORK_TYPE_GRAPHICS
561 #define TREE_TYPE_SOUNDS_DIR ARTWORK_TYPE_SOUNDS
562 #define TREE_TYPE_MUSIC_DIR ARTWORK_TYPE_MUSIC
563 #define TREE_TYPE_LEVEL_DIR 3
564 #define TREE_TYPE_LEVEL_NR 4
566 #define NUM_TREE_TYPES 5
568 #define INFOTEXT_UNDEFINED ""
569 #define INFOTEXT_GRAPHICS_DIR "Custom Graphics"
570 #define INFOTEXT_SOUNDS_DIR "Custom Sounds"
571 #define INFOTEXT_MUSIC_DIR "Custom Music"
572 #define INFOTEXT_LEVEL_DIR "Level Sets"
573 #define INFOTEXT_LEVEL_NR "Levels"
575 #define TREE_INFOTEXT(t) ((t) == TREE_TYPE_LEVEL_NR ? \
576 INFOTEXT_LEVEL_NR : \
577 (t) == TREE_TYPE_LEVEL_DIR ? \
578 INFOTEXT_LEVEL_DIR : \
579 (t) == TREE_TYPE_GRAPHICS_DIR ? \
580 INFOTEXT_GRAPHICS_DIR : \
581 (t) == TREE_TYPE_SOUNDS_DIR ? \
582 INFOTEXT_SOUNDS_DIR : \
583 (t) == TREE_TYPE_MUSIC_DIR ? \
584 INFOTEXT_MUSIC_DIR : \
587 /* values for artwork handling */
588 #define LEVELDIR_ARTWORK_SET_PTR(leveldir, type) \
589 ((type) == ARTWORK_TYPE_GRAPHICS ? \
590 &(leveldir)->graphics_set : \
591 (type) == ARTWORK_TYPE_SOUNDS ? \
592 &(leveldir)->sounds_set : \
593 &(leveldir)->music_set)
595 #define LEVELDIR_ARTWORK_SET(leveldir, type) \
596 ((type) == ARTWORK_TYPE_GRAPHICS ? \
597 (leveldir)->graphics_set : \
598 (type) == ARTWORK_TYPE_SOUNDS ? \
599 (leveldir)->sounds_set : \
600 (leveldir)->music_set)
602 #define LEVELDIR_ARTWORK_PATH_PTR(leveldir, type) \
603 ((type) == ARTWORK_TYPE_GRAPHICS ? \
604 &(leveldir)->graphics_path : \
605 (type) == ARTWORK_TYPE_SOUNDS ? \
606 &(leveldir)->sounds_path : \
607 &(leveldir)->music_path)
609 #define LEVELDIR_ARTWORK_PATH(leveldir, type) \
610 ((type) == ARTWORK_TYPE_GRAPHICS ? \
611 (leveldir)->graphics_path : \
612 (type) == ARTWORK_TYPE_SOUNDS ? \
613 (leveldir)->sounds_path : \
614 (leveldir)->music_path)
616 #define SETUP_ARTWORK_SET(setup, type) \
617 ((type) == ARTWORK_TYPE_GRAPHICS ? \
618 (setup).graphics_set : \
619 (type) == ARTWORK_TYPE_SOUNDS ? \
620 (setup).sounds_set : \
623 #define SETUP_OVERRIDE_ARTWORK(setup, type) \
624 ((type) == ARTWORK_TYPE_GRAPHICS ? \
625 (setup).override_level_graphics : \
626 (type) == ARTWORK_TYPE_SOUNDS ? \
627 (setup).override_level_sounds : \
628 (setup).override_level_music)
630 #define GFX_OVERRIDE_ARTWORK(type) \
631 ((type) == ARTWORK_TYPE_GRAPHICS ? \
632 gfx.override_level_graphics : \
633 (type) == ARTWORK_TYPE_SOUNDS ? \
634 gfx.override_level_sounds : \
635 gfx.override_level_music)
637 #define ARTWORK_FIRST_NODE(artwork, type) \
638 ((type) == ARTWORK_TYPE_GRAPHICS ? \
639 (artwork).gfx_first : \
640 (type) == ARTWORK_TYPE_SOUNDS ? \
641 (artwork).snd_first : \
644 #define ARTWORK_CURRENT_IDENTIFIER_PTR(artwork, type) \
645 ((type) == ARTWORK_TYPE_GRAPHICS ? \
646 &(artwork).gfx_current_identifier : \
647 (type) == ARTWORK_TYPE_SOUNDS ? \
648 &(artwork).snd_current_identifier : \
649 &(artwork).mus_current_identifier)
651 #define ARTWORK_CURRENT_IDENTIFIER(artwork, type) \
652 ((type) == ARTWORK_TYPE_GRAPHICS ? \
653 (artwork).gfx_current_identifier : \
654 (type) == ARTWORK_TYPE_SOUNDS ? \
655 (artwork).snd_current_identifier : \
656 (artwork).mus_current_identifier)
658 #define ARTWORKINFO_FILENAME(type) \
659 ((type) == ARTWORK_TYPE_GRAPHICS ? \
660 GRAPHICSINFO_FILENAME : \
661 (type) == ARTWORK_TYPE_SOUNDS ? \
662 SOUNDSINFO_FILENAME : \
663 (type) == ARTWORK_TYPE_MUSIC ? \
664 MUSICINFO_FILENAME : "")
666 #define ARTWORK_DIRECTORY(type) \
667 ((type) == ARTWORK_TYPE_GRAPHICS ? \
668 GRAPHICS_DIRECTORY : \
669 (type) == ARTWORK_TYPE_SOUNDS ? \
671 (type) == ARTWORK_TYPE_MUSIC ? \
672 MUSIC_DIRECTORY : "")
674 #define OPTIONS_ARTWORK_DIRECTORY(type) \
675 ((type) == ARTWORK_TYPE_GRAPHICS ? \
676 options.graphics_directory : \
677 (type) == ARTWORK_TYPE_SOUNDS ? \
678 options.sounds_directory : \
679 (type) == ARTWORK_TYPE_MUSIC ? \
680 options.music_directory : "")
682 #define UPDATE_BUSY_STATE() \
684 if (gfx.draw_busy_anim_function != NULL) \
685 gfx.draw_busy_anim_function(); \
689 /* type definitions */
690 #if defined(TARGET_SDL2)
691 typedef int (*EventFilter)(void *, Event *);
693 typedef int (*EventFilter)(const Event *);
697 /* structure definitions */
701 char *command_basepath; /* path to the program binary */
702 char *command_basename; /* base filename of the program binary */
704 char *config_filename; /* optional global program config filename */
706 char *maindata_path; /* main game data (installation) directory */
708 char *userdata_subdir; /* personal user game data directory */
709 char *userdata_path; /* resulting full path to game data directory */
719 char *log_filename[NUM_LOGS]; /* log filenames for out/err messages */
720 FILE *log_file[NUM_LOGS]; /* log file handles for out/err files */
721 FILE *log_file_default[NUM_LOGS]; /* default log file handles (out/err) */
729 char *(*window_title_function)(void);
730 void (*exit_message_function)(char *, va_list);
731 void (*exit_function)(int);
739 char *ro_base_directory;
740 char *rw_base_directory;
741 char *level_directory;
742 char *graphics_directory;
743 char *sounds_directory;
744 char *music_directory;
745 char *docs_directory;
747 char *execute_command;
757 struct VideoSystemInfo
760 int width, height, depth;
761 int window_width, window_height;
763 boolean fullscreen_available;
764 boolean fullscreen_enabled;
765 boolean fullscreen_initial;
767 boolean window_scaling_available;
768 int window_scaling_percent;
769 char *window_scaling_quality;
770 int screen_rendering_mode;
772 unsigned int frame_delay;
773 unsigned int frame_delay_value;
778 struct AudioSystemInfo
780 boolean sound_available;
781 boolean loops_available;
782 boolean music_available;
784 boolean sound_enabled;
785 boolean sound_deactivated; /* for temporarily disabling sound */
794 int first_sound_channel;
797 struct FontBitmapInfo
801 int src_x, src_y; /* start position of animation frames */
802 int width, height; /* width/height of each animation frame */
804 int draw_xoffset; /* offset for drawing font characters */
805 int draw_yoffset; /* offset for drawing font characters */
808 int num_chars_per_line;
815 int real_sx, real_sy;
816 int full_sxsize, full_sysize;
817 int scrollbuffer_width, scrollbuffer_height;
819 int game_tile_size, standard_tile_size;
830 int win_xsize, win_ysize;
832 int draw_deactivation_mask;
833 int draw_background_mask;
835 Bitmap *field_save_buffer;
837 Bitmap *background_bitmap;
838 int background_bitmap_mask;
840 Bitmap *fade_bitmap_source;
841 Bitmap *fade_bitmap_target;
842 Bitmap *fade_bitmap_black;
844 int fade_border_source_status;
845 int fade_border_target_status;
846 Bitmap *masked_border_bitmap_ptr;
848 Bitmap *final_screen_bitmap;
850 boolean clipping_enabled;
852 int clip_width, clip_height;
854 boolean override_level_graphics;
855 boolean override_level_sounds;
856 boolean override_level_music;
858 boolean draw_init_text;
861 struct FontBitmapInfo *font_bitmap_info;
862 int (*select_font_function)(int);
863 int (*get_font_from_token_function)(char *);
865 int anim_random_frame;
867 void (*draw_busy_anim_function)(void);
868 void (*draw_global_anim_function)(int, int);
869 void (*draw_global_border_function)(int);
877 int fd[MAX_PLAYERS]; /* file descriptor of player's joystick */
880 struct SetupJoystickInfo
882 char *device_name; /* device name of player's joystick */
884 int xleft, xmiddle, xright;
885 int yupper, ymiddle, ylower;
889 struct SetupKeyboardInfo
891 Key left, right, up, down;
895 struct SetupTouchInfo
902 struct SetupInputInfo
904 boolean use_joystick;
905 struct SetupJoystickInfo joy;
906 struct SetupKeyboardInfo key;
909 struct SetupEditorInfo
911 boolean el_boulderdash;
912 boolean el_emerald_mine;
913 boolean el_emerald_mine_club;
917 boolean el_diamond_caves;
918 boolean el_dx_boulderdash;
920 boolean el_steel_chars;
922 boolean el_user_defined;
925 boolean el_headlines;
930 boolean show_element_token;
933 struct SetupEditorCascadeInfo
944 boolean el_steel_chars;
952 struct SetupShortcutInfo
958 Key focus_player[MAX_PLAYERS];
959 Key focus_player_all;
978 struct SetupSystemInfo
980 char *sdl_videodriver;
981 char *sdl_audiodriver;
982 int audio_fragment_size;
985 struct SetupInternalInfo
988 char *program_author;
990 char *program_website;
991 char *program_copyright;
992 char *program_company;
994 char *program_icon_file;
996 char *default_graphics_set;
997 char *default_sounds_set;
998 char *default_music_set;
1000 char *fallback_graphics_file;
1001 char *fallback_sounds_file;
1002 char *fallback_music_file;
1004 char *default_level_series;
1006 int default_window_width;
1007 int default_window_height;
1009 boolean choose_from_top_leveldir;
1017 boolean sound_loops;
1018 boolean sound_music;
1019 boolean sound_simple;
1021 boolean scroll_delay;
1022 boolean scroll_delay_value;
1023 char *engine_snapshot_mode;
1024 boolean fade_screens;
1026 boolean show_titlescreen;
1027 boolean quick_doors;
1030 boolean skip_levels;
1033 int window_scaling_percent;
1034 char *window_scaling_quality;
1035 char *screen_rendering_mode;
1036 boolean ask_on_escape;
1037 boolean ask_on_escape_editor;
1038 boolean quick_switch;
1039 boolean input_on_focus;
1040 boolean prefer_aga_graphics;
1041 int game_frame_delay;
1042 boolean sp_show_border_elements;
1043 boolean small_game_graphics;
1044 boolean show_snapshot_buttons;
1049 int override_level_graphics; /* not boolean -- can also be "AUTO" */
1050 int override_level_sounds; /* not boolean -- can also be "AUTO" */
1051 int override_level_music; /* not boolean -- can also be "AUTO" */
1057 struct SetupEditorInfo editor;
1058 struct SetupEditorCascadeInfo editor_cascade;
1059 struct SetupShortcutInfo shortcut;
1060 struct SetupInputInfo input[MAX_PLAYERS];
1061 struct SetupTouchInfo touch;
1062 struct SetupSystemInfo system;
1063 struct SetupInternalInfo internal;
1064 struct OptionInfo options;
1069 struct TreeInfo **node_top; /* topmost node in tree */
1070 struct TreeInfo *node_parent; /* parent level directory info */
1071 struct TreeInfo *node_group; /* level group sub-directory info */
1072 struct TreeInfo *next; /* next level series structure node */
1074 int cl_first; /* internal control field for setup screen */
1075 int cl_cursor; /* internal control field for setup screen */
1077 int type; /* type of tree content */
1079 /* fields for "type == TREE_TYPE_LEVEL_DIR" */
1081 char *subdir; /* tree info sub-directory basename (may be ".") */
1082 char *fullpath; /* complete path relative to tree base directory */
1083 char *basepath; /* absolute base path of tree base directory */
1084 char *identifier; /* identifier string for configuration files */
1085 char *name; /* tree info name, as displayed in selection menues */
1086 char *name_sorting; /* optional sorting name for correct name sorting */
1087 char *author; /* level or artwork author name */
1088 char *year; /* optional year of creation for levels or artwork */
1089 char *imported_from; /* optional comment for imported levels or artwork */
1090 char *imported_by; /* optional comment for imported levels or artwork */
1091 char *tested_by; /* optional comment to name people who tested a set */
1093 char *graphics_set_ecs; /* special EMC custom graphics set (ECS graphics) */
1094 char *graphics_set_aga; /* special EMC custom graphics set (AGA graphics) */
1095 char *graphics_set; /* optional custom graphics set (level tree only) */
1096 char *sounds_set; /* optional custom sounds set (level tree only) */
1097 char *music_set; /* optional custom music set (level tree only) */
1098 char *graphics_path; /* path to optional custom graphics set (level only) */
1099 char *sounds_path; /* path to optional custom sounds set (level only) */
1100 char *music_path; /* path to optional custom music set (level only) */
1102 char *level_filename; /* filename of level file (for packed level file) */
1103 char *level_filetype; /* type of levels in level directory or level file */
1105 char *special_flags; /* flags for special actions performed on level file */
1107 int levels; /* number of levels in level series */
1108 int first_level; /* first level number (to allow start with 0 or 1) */
1109 int last_level; /* last level number (automatically calculated) */
1110 int sort_priority; /* sort levels by 'sort_priority' and then by name */
1112 boolean latest_engine;/* force level set to use the latest game engine */
1114 boolean level_group; /* directory contains more level series directories */
1115 boolean parent_link; /* entry links back to parent directory */
1116 boolean in_user_dir; /* user defined levels are stored in home directory */
1117 boolean user_defined; /* levels in user directory and marked as "private" */
1118 boolean readonly; /* readonly levels can not be changed with editor */
1119 boolean handicap; /* level set has no handicap when set to "false" */
1120 boolean skip_levels; /* levels can be skipped when set to "true" */
1122 int color; /* color to use on selection screen for this level */
1123 char *class_desc; /* description of level series class */
1124 int handicap_level; /* number of the lowest unsolved level */
1126 char *infotext; /* optional text to describe the tree type (headline) */
1129 typedef struct TreeInfo TreeInfo;
1130 typedef struct TreeInfo LevelDirTree;
1131 typedef struct TreeInfo ArtworkDirTree;
1132 typedef struct TreeInfo GraphicsDirTree;
1133 typedef struct TreeInfo SoundsDirTree;
1134 typedef struct TreeInfo MusicDirTree;
1138 GraphicsDirTree *gfx_first;
1139 GraphicsDirTree *gfx_current;
1140 SoundsDirTree *snd_first;
1141 SoundsDirTree *snd_current;
1142 MusicDirTree *mus_first;
1143 MusicDirTree *mus_current;
1145 char *gfx_current_identifier;
1146 char *snd_current_identifier;
1147 char *mus_current_identifier;
1150 struct ValueTextInfo
1162 struct ConfigTypeInfo
1169 struct TokenIntPtrInfo
1179 char *default_filename;
1182 char **default_parameter; /* array of file parameters */
1183 char **parameter; /* array of file parameters */
1186 boolean fallback_to_default;
1187 boolean default_is_cloned;
1190 struct SetupFileList
1195 struct SetupFileList *next;
1200 char *source_filename; /* primary key for node list */
1204 struct PropertyMapping
1214 struct ArtworkListInfo
1216 int type; /* type of artwork */
1218 int num_file_list_entries;
1219 int num_dynamic_file_list_entries;
1220 struct FileInfo *file_list; /* static artwork file array */
1221 struct FileInfo *dynamic_file_list; /* dynamic artwrk file array */
1223 int num_suffix_list_entries;
1224 struct ConfigTypeInfo *suffix_list; /* parameter suffixes array */
1226 int num_base_prefixes;
1227 int num_ext1_suffixes;
1228 int num_ext2_suffixes;
1229 int num_ext3_suffixes;
1230 char **base_prefixes; /* base token prefixes array */
1231 char **ext1_suffixes; /* property suffixes array 1 */
1232 char **ext2_suffixes; /* property suffixes array 2 */
1233 char **ext3_suffixes; /* property suffixes array 3 */
1235 int num_ignore_tokens;
1236 char **ignore_tokens; /* file tokens to be ignored */
1238 int num_property_mapping_entries;
1239 struct PropertyMapping *property_mapping; /* mapping token -> artwork */
1241 int sizeof_artwork_list_entry;
1243 struct ListNodeInfo **artwork_list; /* static artwork node array */
1244 struct ListNodeInfo **dynamic_artwork_list; /* dynamic artwrk node array */
1245 struct ListNode *content_list; /* dynamic artwork node list */
1247 void *(*load_artwork)(char *); /* constructor function */
1248 void (*free_artwork)(void *); /* destructor function */
1262 struct RectWithBorder
1276 struct DoorPartPosInfo
1283 int start_step_opening;
1284 int start_step_closing;
1285 boolean draw_masked;
1292 int xoffset; /* special case for tape date and time */
1293 int xoffset2; /* special case for tape date */
1296 int size; /* also used for suffix ".digits" */
1298 boolean draw_masked;
1299 boolean draw_player; /* special case for network player buttons */
1300 int sort_priority; /* also used for suffix ".draw_order" */
1311 /* ========================================================================= */
1312 /* exported variables */
1313 /* ========================================================================= */
1315 extern struct ProgramInfo program;
1316 extern struct OptionInfo options;
1317 extern struct VideoSystemInfo video;
1318 extern struct AudioSystemInfo audio;
1319 extern struct GfxInfo gfx;
1320 extern struct AnimInfo anim;
1321 extern struct ArtworkInfo artwork;
1322 extern struct JoystickInfo joystick;
1323 extern struct SetupInfo setup;
1325 extern LevelDirTree *leveldir_first_all;
1326 extern LevelDirTree *leveldir_first;
1327 extern LevelDirTree *leveldir_current;
1328 extern int level_nr;
1330 extern struct LevelStats level_stats[];
1332 extern DrawWindow *window;
1333 extern DrawBuffer *backbuffer;
1334 extern DrawBuffer *drawto;
1336 extern int button_status;
1337 extern boolean motion_status;
1338 #if defined(TARGET_SDL2)
1339 extern boolean keyrepeat_status;
1342 extern int redraw_mask;
1344 extern int FrameCounter;
1347 /* function definitions */
1349 void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *,
1352 void SetWindowTitle();
1354 void InitWindowTitleFunction(char *(*window_title_function)(void));
1355 void InitExitMessageFunction(void (*exit_message_function)(char *, va_list));
1356 void InitExitFunction(void (*exit_function)(int));
1357 void InitPlatformDependentStuff(void);
1358 void ClosePlatformDependentStuff(void);
1360 void InitGfxFieldInfo(int, int, int, int, int, int, int, int, Bitmap *);
1361 void InitGfxTileSizeInfo(int, int);
1362 void InitGfxDoor1Info(int, int, int, int);
1363 void InitGfxDoor2Info(int, int, int, int);
1364 void InitGfxDoor3Info(int, int, int, int);
1365 void InitGfxWindowInfo(int, int);
1366 void InitGfxScrollbufferInfo(int, int);
1367 void InitGfxClipRegion(boolean, int, int, int, int);
1368 void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(void));
1369 void InitGfxDrawGlobalAnimFunction(void (*draw_global_anim_function)(int, int));
1370 void InitGfxDrawGlobalBorderFunction(void (*draw_global_border_function)(int));
1371 void InitGfxCustomArtworkInfo();
1372 void InitGfxOtherSettings();
1373 void SetDrawDeactivationMask(int);
1374 void SetDrawBackgroundMask(int);
1375 void SetWindowBackgroundBitmap(Bitmap *);
1376 void SetMainBackgroundBitmap(Bitmap *);
1377 void SetDoorBackgroundBitmap(Bitmap *);
1378 void SetRedrawMaskFromArea(int, int, int, int);
1380 void LimitScreenUpdates(boolean);
1382 void InitVideoDisplay(void);
1383 void CloseVideoDisplay(void);
1384 void InitVideoBuffer(int, int, int, boolean);
1385 Bitmap *CreateBitmapStruct(void);
1386 Bitmap *CreateBitmap(int, int, int);
1387 void ReCreateBitmap(Bitmap **, int, int, int);
1388 void FreeBitmap(Bitmap *);
1389 void BlitBitmap(Bitmap *, Bitmap *, int, int, int, int, int, int);
1390 void BlitBitmapTiled(Bitmap *, Bitmap *, int, int, int, int, int, int, int,int);
1391 void FadeRectangle(Bitmap *bitmap, int, int, int, int, int, int, int,
1392 void (*draw_border_function)(void));
1393 void FillRectangle(Bitmap *, int, int, int, int, Pixel);
1394 void ClearRectangle(Bitmap *, int, int, int, int);
1395 void ClearRectangleOnBackground(Bitmap *, int, int, int, int);
1396 void BlitBitmapMasked(Bitmap *, Bitmap *, int, int, int, int, int, int);
1397 boolean DrawingOnBackground(int, int);
1398 boolean DrawingAreaChanged();
1399 void BlitBitmapOnBackground(Bitmap *, Bitmap *, int, int, int, int, int, int);
1400 void BlitTexture(Bitmap *, int, int, int, int, int, int);
1401 void BlitTextureMasked(Bitmap *, int, int, int, int, int, int);
1402 void BlitToScreen(Bitmap *, int, int, int, int, int, int);
1403 void BlitToScreenMasked(Bitmap *, int, int, int, int, int, int);
1404 void DrawSimpleBlackLine(Bitmap *, int, int, int, int);
1405 void DrawSimpleWhiteLine(Bitmap *, int, int, int, int);
1406 void DrawLines(Bitmap *, struct XY *, int, Pixel);
1407 Pixel GetPixel(Bitmap *, int, int);
1408 Pixel GetPixelFromRGB(Bitmap *, unsigned int,unsigned int,unsigned int);
1409 Pixel GetPixelFromRGBcompact(Bitmap *, unsigned int);
1411 void KeyboardAutoRepeatOn(void);
1412 void KeyboardAutoRepeatOff(void);
1413 boolean SetVideoMode(boolean);
1414 void SetVideoFrameDelay(unsigned int);
1415 unsigned int GetVideoFrameDelay();
1416 boolean ChangeVideoModeIfNeeded(boolean);
1418 Bitmap *LoadImage(char *);
1419 Bitmap *LoadCustomImage(char *);
1420 void ReloadCustomImage(Bitmap *, char *);
1422 Bitmap *ZoomBitmap(Bitmap *, int, int);
1423 void ReCreateGameTileSizeBitmap(Bitmap **);
1424 void CreateBitmapWithSmallBitmaps(Bitmap **, int, int);
1425 void CreateBitmapTextures(Bitmap **);
1426 void FreeBitmapTextures(Bitmap **);
1427 void ScaleBitmap(Bitmap **, int);
1429 void SetMouseCursor(int);
1431 void OpenAudio(void);
1432 void CloseAudio(void);
1433 void SetAudioMode(boolean);
1435 void InitEventFilter(EventFilter);
1436 boolean PendingEvent(void);
1437 void NextEvent(Event *event);
1438 void PeekEvent(Event *event);
1439 Key GetEventKey(KeyEvent *, boolean);
1440 KeyMod HandleKeyModState(Key, int);
1441 KeyMod GetKeyModState();
1442 KeyMod GetKeyModStateFromEvents();
1443 boolean CheckCloseWindowEvent(ClientMessageEvent *);
1445 void InitJoysticks();
1446 boolean ReadJoystick(int, int *, int *, boolean *, boolean *);
1448 #endif /* SYSTEM_H */