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 for global border */
196 #define DRAW_BORDER_TO_BACKBUFFER 0
197 #define DRAW_BORDER_TO_SCREEN 1
198 #define DRAW_BORDER_TO_FADE_SOURCE 2
199 #define DRAW_BORDER_TO_FADE_TARGET 3
201 /* values for move directions and special "button" key bitmasks */
203 #define MV_LEFT (1 << MV_BIT_LEFT)
204 #define MV_RIGHT (1 << MV_BIT_RIGHT)
205 #define MV_UP (1 << MV_BIT_UP)
206 #define MV_DOWN (1 << MV_BIT_DOWN)
208 #define MV_UPLEFT (MV_UP | MV_LEFT)
209 #define MV_UPRIGHT (MV_UP | MV_RIGHT)
210 #define MV_DOWNLEFT (MV_DOWN | MV_LEFT)
211 #define MV_DOWNRIGHT (MV_DOWN | MV_RIGHT)
213 #define MV_HORIZONTAL (MV_LEFT | MV_RIGHT)
214 #define MV_VERTICAL (MV_UP | MV_DOWN)
215 #define MV_ALL_DIRECTIONS (MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN)
216 #define MV_ANY_DIRECTION (MV_ALL_DIRECTIONS)
217 #define MV_NO_DIRECTION (MV_NONE)
219 #define KEY_BUTTON_1 (1 << BUTTON_1)
220 #define KEY_BUTTON_2 (1 << BUTTON_2)
221 #define KEY_BUTTON_SNAP KEY_BUTTON_1
222 #define KEY_BUTTON_DROP KEY_BUTTON_2
223 #define KEY_MOTION (MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN)
224 #define KEY_BUTTON (KEY_BUTTON_1 | KEY_BUTTON_2)
225 #define KEY_ACTION (KEY_MOTION | KEY_BUTTON)
227 #define KEY_SET_FOCUS (1 << BIT_SET_FOCUS)
229 #define MV_DIR_FROM_BIT(x) ((x) < NUM_DIRECTIONS ? 1 << (x) : \
230 (x) == MV_BIT_UPLEFT ? MV_UPLEFT : \
231 (x) == MV_BIT_UPRIGHT ? MV_UPRIGHT : \
232 (x) == MV_BIT_DOWNLEFT ? MV_DOWNLEFT : \
233 (x) == MV_BIT_DOWNRIGHT ? MV_DOWNRIGHT : \
236 #define MV_DIR_TO_BIT(x) ((x) == MV_LEFT ? MV_BIT_LEFT : \
237 (x) == MV_RIGHT ? MV_BIT_RIGHT : \
238 (x) == MV_UP ? MV_BIT_UP : \
239 (x) == MV_DOWN ? MV_BIT_DOWN : \
240 (x) == MV_UPLEFT ? MV_BIT_UPLEFT : \
241 (x) == MV_UPRIGHT ? MV_BIT_UPRIGHT : \
242 (x) == MV_DOWNLEFT ? MV_BIT_DOWNLEFT : \
243 (x) == MV_DOWNRIGHT ? MV_BIT_DOWNRIGHT : \
246 #define MV_DIR_OPPOSITE(x) ((x) == MV_LEFT ? MV_RIGHT : \
247 (x) == MV_RIGHT ? MV_LEFT : \
248 (x) == MV_UP ? MV_DOWN : \
249 (x) == MV_DOWN ? MV_UP : \
250 (x) == MV_UPLEFT ? MV_DOWNRIGHT : \
251 (x) == MV_UPRIGHT ? MV_DOWNLEFT : \
252 (x) == MV_DOWNLEFT ? MV_UPRIGHT : \
253 (x) == MV_DOWNRIGHT ? MV_UPLEFT : \
256 /* values for animation mode (frame order and direction) */
257 /* (stored in level files -- never change existing values) */
259 #define ANIM_LOOP (1 << 0)
260 #define ANIM_LINEAR (1 << 1)
261 #define ANIM_PINGPONG (1 << 2)
262 #define ANIM_PINGPONG2 (1 << 3)
263 #define ANIM_RANDOM (1 << 4)
264 #define ANIM_CE_VALUE (1 << 5)
265 #define ANIM_CE_SCORE (1 << 6)
266 #define ANIM_CE_DELAY (1 << 7)
267 #define ANIM_REVERSE (1 << 8)
268 #define ANIM_OPAQUE_PLAYER (1 << 9)
270 /* values for special (non game element) animation modes */
271 /* (not stored in level files -- can be changed, if needed) */
272 #define ANIM_HORIZONTAL (1 << 10)
273 #define ANIM_VERTICAL (1 << 11)
274 #define ANIM_CENTERED (1 << 12)
275 #define ANIM_STATIC_PANEL (1 << 13)
276 #define ANIM_ALL (1 << 14)
277 #define ANIM_ONCE (1 << 15)
279 #define ANIM_DEFAULT ANIM_LOOP
281 /* values for special drawing styles (currently only for crumbled graphics) */
283 #define STYLE_ACCURATE_BORDERS (1 << 0)
284 #define STYLE_INNER_CORNERS (1 << 1)
286 #define STYLE_DEFAULT STYLE_NONE
288 /* values for fade mode */
289 #define FADE_TYPE_NONE 0
290 #define FADE_TYPE_FADE_IN (1 << 0)
291 #define FADE_TYPE_FADE_OUT (1 << 1)
292 #define FADE_TYPE_TRANSFORM (1 << 2)
293 #define FADE_TYPE_CROSSFADE (1 << 3)
294 #define FADE_TYPE_MELT (1 << 4)
295 #define FADE_TYPE_CURTAIN (1 << 5)
296 #define FADE_TYPE_SKIP (1 << 6)
298 #define FADE_MODE_NONE (FADE_TYPE_NONE)
299 #define FADE_MODE_FADE_IN (FADE_TYPE_FADE_IN)
300 #define FADE_MODE_FADE_OUT (FADE_TYPE_FADE_OUT)
301 #define FADE_MODE_FADE (FADE_TYPE_FADE_IN | FADE_TYPE_FADE_OUT)
302 #define FADE_MODE_TRANSFORM (FADE_TYPE_TRANSFORM | FADE_TYPE_FADE_IN)
303 #define FADE_MODE_CROSSFADE (FADE_MODE_TRANSFORM | FADE_TYPE_CROSSFADE)
304 #define FADE_MODE_MELT (FADE_MODE_TRANSFORM | FADE_TYPE_MELT)
305 #define FADE_MODE_CURTAIN (FADE_MODE_TRANSFORM | FADE_TYPE_CURTAIN)
306 #define FADE_MODE_SKIP_FADE_IN (FADE_TYPE_SKIP | FADE_TYPE_FADE_IN)
307 #define FADE_MODE_SKIP_FADE_OUT (FADE_TYPE_SKIP | FADE_TYPE_FADE_OUT)
309 #define FADE_MODE_DEFAULT FADE_MODE_FADE
311 /* values for toon positions */
312 #define POS_UNDEFINED -1
322 /* values for text alignment */
323 #define ALIGN_LEFT (1 << 0)
324 #define ALIGN_RIGHT (1 << 1)
325 #define ALIGN_CENTER (1 << 2)
326 #define ALIGN_DEFAULT ALIGN_LEFT
328 #define VALIGN_TOP (1 << 0)
329 #define VALIGN_BOTTOM (1 << 1)
330 #define VALIGN_MIDDLE (1 << 2)
331 #define VALIGN_DEFAULT VALIGN_TOP
333 #define ALIGNED_XPOS(x,w,a) ((a) == ALIGN_CENTER ? (x) - (w) / 2 : \
334 (a) == ALIGN_RIGHT ? (x) - (w) : (x))
335 #define ALIGNED_YPOS(y,h,v) ((v) == VALIGN_MIDDLE ? (y) - (h) / 2 : \
336 (v) == VALIGN_BOTTOM ? (y) - (h) : (y))
337 #define ALIGNED_TEXT_XPOS(p) ALIGNED_XPOS((p)->x, (p)->width, (p)->align)
338 #define ALIGNED_TEXT_YPOS(p) ALIGNED_YPOS((p)->y, (p)->height, (p)->valign)
340 /* values for redraw_mask */
341 #define REDRAW_NONE (0)
342 #define REDRAW_ALL (1 << 0)
343 #define REDRAW_FIELD (1 << 1)
344 #define REDRAW_DOOR_1 (1 << 2)
345 #define REDRAW_DOOR_2 (1 << 3)
346 #define REDRAW_DOOR_3 (1 << 4)
347 #define REDRAW_FPS (1 << 5)
349 #define REDRAW_DOORS (REDRAW_DOOR_1 | \
353 #define IN_GFX_FIELD_PLAY(x, y) (x >= gfx.sx && x < gfx.sx + gfx.sxsize && \
354 y >= gfx.sy && y < gfx.sy + gfx.sysize)
355 #define IN_GFX_FIELD_FULL(x, y) (x >= gfx.real_sx && \
356 x < gfx.real_sx + gfx.full_sxsize && \
357 y >= gfx.real_sy && \
358 y < gfx.real_sy + gfx.full_sysize)
359 #define IN_GFX_DOOR_1(x, y) (x >= gfx.dx && x < gfx.dx + gfx.dxsize && \
360 y >= gfx.dy && y < gfx.dy + gfx.dysize)
361 #define IN_GFX_DOOR_2(x, y) (x >= gfx.vx && x < gfx.vx + gfx.vxsize && \
362 y >= gfx.vy && y < gfx.vy + gfx.vysize)
363 #define IN_GFX_DOOR_3(x, y) (x >= gfx.ex && x < gfx.ex + gfx.exsize && \
364 y >= gfx.ey && y < gfx.ey + gfx.eysize)
366 /* values for mouse cursor */
367 #define CURSOR_DEFAULT 0
368 #define CURSOR_NONE 1
369 #define CURSOR_PLAYFIELD 2
371 /* fundamental game speed values */
372 #define ONE_SECOND_DELAY 1000 /* delay value for one second */
373 #define GAME_FRAME_DELAY 20 /* frame delay in milliseconds */
374 #define FFWD_FRAME_DELAY 10 /* 200% speed for fast forward */
375 #define FRAMES_PER_SECOND (ONE_SECOND_DELAY / GAME_FRAME_DELAY)
376 #define FRAMES_PER_SECOND_SP 35
378 /* maximum playfield size supported by libgame functions */
379 #define MAX_PLAYFIELD_WIDTH 128
380 #define MAX_PLAYFIELD_HEIGHT 128
382 /* maximum number of parallel players supported by libgame functions */
383 #define MAX_PLAYERS 4
385 /* maximum allowed length of player name */
386 #define MAX_PLAYER_NAME_LEN 10
388 /* maximum number of levels in a level set */
389 #define MAX_LEVELS 1000
391 /* default name for empty highscore entry */
392 #define EMPTY_PLAYER_NAME "no name"
394 /* default name for unknown player names */
395 #define ANONYMOUS_NAME "anonymous"
397 /* default for other unknown names */
398 #define UNKNOWN_NAME "unknown"
400 /* default name for new levels */
401 #define NAMELESS_LEVEL_NAME "nameless level"
403 /* default text for non-existant artwork */
404 #define NOT_AVAILABLE "(not available)"
406 /* default value for undefined filename */
407 #define UNDEFINED_FILENAME "[NONE]"
409 /* default value for undefined levelset */
410 #define UNDEFINED_LEVELSET "[NONE]"
412 /* default value for undefined parameter */
413 #define ARG_DEFAULT "[DEFAULT]"
415 /* default values for undefined configuration file parameters */
416 #define ARG_UNDEFINED "-1000000"
417 #define ARG_UNDEFINED_VALUE (-1000000)
419 /* default value for off-screen positions */
420 #define POS_OFFSCREEN (-1000000)
422 /* definitions for game sub-directories */
424 #define RO_GAME_DIR "."
428 #define RW_GAME_DIR "."
431 #define RO_BASE_PATH RO_GAME_DIR
432 #define RW_BASE_PATH RW_GAME_DIR
434 /* directory names */
435 #define GRAPHICS_DIRECTORY "graphics"
436 #define SOUNDS_DIRECTORY "sounds"
437 #define MUSIC_DIRECTORY "music"
438 #define LEVELS_DIRECTORY "levels"
439 #define TAPES_DIRECTORY "tapes"
440 #define SCORES_DIRECTORY "scores"
441 #define DOCS_DIRECTORY "docs"
442 #define CACHE_DIRECTORY "cache"
444 #define GFX_CLASSIC_SUBDIR "gfx_classic"
445 #define SND_CLASSIC_SUBDIR "snd_classic"
446 #define MUS_CLASSIC_SUBDIR "mus_classic"
448 #define GFX_DEFAULT_SUBDIR (setup.internal.default_graphics_set)
449 #define SND_DEFAULT_SUBDIR (setup.internal.default_sounds_set)
450 #define MUS_DEFAULT_SUBDIR (setup.internal.default_music_set)
452 #define GFX_FALLBACK_FILENAME (setup.internal.fallback_graphics_file)
453 #define SND_FALLBACK_FILENAME (setup.internal.fallback_sounds_file)
454 #define MUS_FALLBACK_FILENAME (setup.internal.fallback_music_file)
456 #define DEFAULT_LEVELSET (setup.internal.default_level_series)
458 /* file names and filename extensions */
459 #define LEVELSETUP_DIRECTORY "levelsetup"
460 #define SETUP_FILENAME "setup.conf"
461 #define LEVELSETUP_FILENAME "levelsetup.conf"
462 #define EDITORSETUP_FILENAME "editorsetup.conf"
463 #define EDITORCASCADE_FILENAME "editorcascade.conf"
464 #define HELPANIM_FILENAME "helpanim.conf"
465 #define HELPTEXT_FILENAME "helptext.conf"
466 #define LEVELINFO_FILENAME "levelinfo.conf"
467 #define GRAPHICSINFO_FILENAME "graphicsinfo.conf"
468 #define SOUNDSINFO_FILENAME "soundsinfo.conf"
469 #define MUSICINFO_FILENAME "musicinfo.conf"
470 #define ARTWORKINFO_CACHE_FILE "artworkinfo.cache"
471 #define LEVELFILE_EXTENSION "level"
472 #define TAPEFILE_EXTENSION "tape"
473 #define SCOREFILE_EXTENSION "score"
475 #define LOG_OUT_BASENAME "stdout.txt"
476 #define LOG_ERR_BASENAME "stderr.txt"
482 #define STRING_PARENT_DIRECTORY ".."
483 #define STRING_TOP_DIRECTORY "/"
485 #define CHAR_PATH_SEPARATOR_UNIX '/'
486 #define CHAR_PATH_SEPARATOR_DOS '\\'
488 #define STRING_PATH_SEPARATOR_UNIX "/"
489 #define STRING_PATH_SEPARATOR_DOS "\\"
491 #define STRING_NEWLINE_UNIX "\n"
492 #define STRING_NEWLINE_DOS "\r\n"
494 #if defined(PLATFORM_WIN32)
495 #define CHAR_PATH_SEPARATOR CHAR_PATH_SEPARATOR_DOS
496 #define STRING_PATH_SEPARATOR STRING_PATH_SEPARATOR_DOS
497 #define STRING_NEWLINE STRING_NEWLINE_DOS
499 #define CHAR_PATH_SEPARATOR CHAR_PATH_SEPARATOR_UNIX
500 #define STRING_PATH_SEPARATOR STRING_PATH_SEPARATOR_UNIX
501 #define STRING_NEWLINE STRING_NEWLINE_UNIX
505 /* areas in bitmap PIX_DOOR */
506 /* meaning in PIX_DB_DOOR: (3 PAGEs)
507 PAGEX1: 1. buffer for DOOR_1
508 PAGEX2: 2. buffer for DOOR_1
509 PAGEX3: buffer for animations
512 /* these values are hard-coded to be able to use them in initialization */
513 #define DOOR_GFX_PAGE_WIDTH 100 /* should be set to "gfx.dxsize" */
514 #define DOOR_GFX_PAGE_HEIGHT 280 /* should be set to "gfx.dysize" */
516 #define DOOR_GFX_PAGESIZE (DOOR_GFX_PAGE_WIDTH)
517 #define DOOR_GFX_PAGEX1 (0 * DOOR_GFX_PAGESIZE)
518 #define DOOR_GFX_PAGEX2 (1 * DOOR_GFX_PAGESIZE)
519 #define DOOR_GFX_PAGEX3 (2 * DOOR_GFX_PAGESIZE)
520 #define DOOR_GFX_PAGEX4 (3 * DOOR_GFX_PAGESIZE)
521 #define DOOR_GFX_PAGEX5 (4 * DOOR_GFX_PAGESIZE)
522 #define DOOR_GFX_PAGEX6 (5 * DOOR_GFX_PAGESIZE)
523 #define DOOR_GFX_PAGEX7 (6 * DOOR_GFX_PAGESIZE)
524 #define DOOR_GFX_PAGEX8 (7 * DOOR_GFX_PAGESIZE)
525 #define DOOR_GFX_PAGEY1 (0)
526 #define DOOR_GFX_PAGEY2 (DOOR_GFX_PAGE_HEIGHT)
529 /* macros for version handling */
530 #define VERSION_MAJOR(x) ((x) / 1000000)
531 #define VERSION_MINOR(x) (((x) % 1000000) / 10000)
532 #define VERSION_PATCH(x) (((x) % 10000) / 100)
533 #define VERSION_BUILD(x) ((x) % 100)
534 #define VERSION_IDENT(a,b,c,d) ((a) * 1000000 + (b) * 10000 + (c) * 100 + (d))
537 /* macros for parent/child process identification */
538 #if defined(PLATFORM_UNIX)
539 #define IS_PARENT_PROCESS() (audio.mixer_pid != getpid())
540 #define IS_CHILD_PROCESS() (audio.mixer_pid == getpid())
541 #define HAS_CHILD_PROCESS() (audio.mixer_pid > 0)
543 #define IS_PARENT_PROCESS() TRUE
544 #define IS_CHILD_PROCESS() FALSE
545 #define HAS_CHILD_PROCESS() FALSE
549 /* values for artwork type */
550 #define ARTWORK_TYPE_GRAPHICS 0
551 #define ARTWORK_TYPE_SOUNDS 1
552 #define ARTWORK_TYPE_MUSIC 2
554 #define NUM_ARTWORK_TYPES 3
557 /* values for tree type (chosen to match artwork type) */
558 #define TREE_TYPE_UNDEFINED -1
559 #define TREE_TYPE_GRAPHICS_DIR ARTWORK_TYPE_GRAPHICS
560 #define TREE_TYPE_SOUNDS_DIR ARTWORK_TYPE_SOUNDS
561 #define TREE_TYPE_MUSIC_DIR ARTWORK_TYPE_MUSIC
562 #define TREE_TYPE_LEVEL_DIR 3
563 #define TREE_TYPE_LEVEL_NR 4
565 #define NUM_TREE_TYPES 5
567 #define INFOTEXT_UNDEFINED ""
568 #define INFOTEXT_GRAPHICS_DIR "Custom Graphics"
569 #define INFOTEXT_SOUNDS_DIR "Custom Sounds"
570 #define INFOTEXT_MUSIC_DIR "Custom Music"
571 #define INFOTEXT_LEVEL_DIR "Level Sets"
572 #define INFOTEXT_LEVEL_NR "Levels"
574 #define TREE_INFOTEXT(t) ((t) == TREE_TYPE_LEVEL_NR ? \
575 INFOTEXT_LEVEL_NR : \
576 (t) == TREE_TYPE_LEVEL_DIR ? \
577 INFOTEXT_LEVEL_DIR : \
578 (t) == TREE_TYPE_GRAPHICS_DIR ? \
579 INFOTEXT_GRAPHICS_DIR : \
580 (t) == TREE_TYPE_SOUNDS_DIR ? \
581 INFOTEXT_SOUNDS_DIR : \
582 (t) == TREE_TYPE_MUSIC_DIR ? \
583 INFOTEXT_MUSIC_DIR : \
586 /* values for artwork handling */
587 #define LEVELDIR_ARTWORK_SET_PTR(leveldir, type) \
588 ((type) == ARTWORK_TYPE_GRAPHICS ? \
589 &(leveldir)->graphics_set : \
590 (type) == ARTWORK_TYPE_SOUNDS ? \
591 &(leveldir)->sounds_set : \
592 &(leveldir)->music_set)
594 #define LEVELDIR_ARTWORK_SET(leveldir, type) \
595 ((type) == ARTWORK_TYPE_GRAPHICS ? \
596 (leveldir)->graphics_set : \
597 (type) == ARTWORK_TYPE_SOUNDS ? \
598 (leveldir)->sounds_set : \
599 (leveldir)->music_set)
601 #define LEVELDIR_ARTWORK_PATH_PTR(leveldir, type) \
602 ((type) == ARTWORK_TYPE_GRAPHICS ? \
603 &(leveldir)->graphics_path : \
604 (type) == ARTWORK_TYPE_SOUNDS ? \
605 &(leveldir)->sounds_path : \
606 &(leveldir)->music_path)
608 #define LEVELDIR_ARTWORK_PATH(leveldir, type) \
609 ((type) == ARTWORK_TYPE_GRAPHICS ? \
610 (leveldir)->graphics_path : \
611 (type) == ARTWORK_TYPE_SOUNDS ? \
612 (leveldir)->sounds_path : \
613 (leveldir)->music_path)
615 #define SETUP_ARTWORK_SET(setup, type) \
616 ((type) == ARTWORK_TYPE_GRAPHICS ? \
617 (setup).graphics_set : \
618 (type) == ARTWORK_TYPE_SOUNDS ? \
619 (setup).sounds_set : \
622 #define SETUP_OVERRIDE_ARTWORK(setup, type) \
623 ((type) == ARTWORK_TYPE_GRAPHICS ? \
624 (setup).override_level_graphics : \
625 (type) == ARTWORK_TYPE_SOUNDS ? \
626 (setup).override_level_sounds : \
627 (setup).override_level_music)
629 #define GFX_OVERRIDE_ARTWORK(type) \
630 ((type) == ARTWORK_TYPE_GRAPHICS ? \
631 gfx.override_level_graphics : \
632 (type) == ARTWORK_TYPE_SOUNDS ? \
633 gfx.override_level_sounds : \
634 gfx.override_level_music)
636 #define ARTWORK_FIRST_NODE(artwork, type) \
637 ((type) == ARTWORK_TYPE_GRAPHICS ? \
638 (artwork).gfx_first : \
639 (type) == ARTWORK_TYPE_SOUNDS ? \
640 (artwork).snd_first : \
643 #define ARTWORK_CURRENT_IDENTIFIER_PTR(artwork, type) \
644 ((type) == ARTWORK_TYPE_GRAPHICS ? \
645 &(artwork).gfx_current_identifier : \
646 (type) == ARTWORK_TYPE_SOUNDS ? \
647 &(artwork).snd_current_identifier : \
648 &(artwork).mus_current_identifier)
650 #define ARTWORK_CURRENT_IDENTIFIER(artwork, type) \
651 ((type) == ARTWORK_TYPE_GRAPHICS ? \
652 (artwork).gfx_current_identifier : \
653 (type) == ARTWORK_TYPE_SOUNDS ? \
654 (artwork).snd_current_identifier : \
655 (artwork).mus_current_identifier)
657 #define ARTWORKINFO_FILENAME(type) \
658 ((type) == ARTWORK_TYPE_GRAPHICS ? \
659 GRAPHICSINFO_FILENAME : \
660 (type) == ARTWORK_TYPE_SOUNDS ? \
661 SOUNDSINFO_FILENAME : \
662 (type) == ARTWORK_TYPE_MUSIC ? \
663 MUSICINFO_FILENAME : "")
665 #define ARTWORK_DIRECTORY(type) \
666 ((type) == ARTWORK_TYPE_GRAPHICS ? \
667 GRAPHICS_DIRECTORY : \
668 (type) == ARTWORK_TYPE_SOUNDS ? \
670 (type) == ARTWORK_TYPE_MUSIC ? \
671 MUSIC_DIRECTORY : "")
673 #define OPTIONS_ARTWORK_DIRECTORY(type) \
674 ((type) == ARTWORK_TYPE_GRAPHICS ? \
675 options.graphics_directory : \
676 (type) == ARTWORK_TYPE_SOUNDS ? \
677 options.sounds_directory : \
678 (type) == ARTWORK_TYPE_MUSIC ? \
679 options.music_directory : "")
681 #define UPDATE_BUSY_STATE() \
683 if (gfx.draw_busy_anim_function != NULL) \
684 gfx.draw_busy_anim_function(); \
688 /* type definitions */
689 #if defined(TARGET_SDL2)
690 typedef int (*EventFilter)(void *, Event *);
692 typedef int (*EventFilter)(const Event *);
696 /* structure definitions */
700 char *command_basepath; /* path to the program binary */
701 char *command_basename; /* base filename of the program binary */
703 char *config_filename; /* optional global program config filename */
705 char *maindata_path; /* main game data (installation) directory */
707 char *userdata_subdir; /* personal user game data directory */
708 char *userdata_path; /* resulting full path to game data directory */
718 char *log_filename[NUM_LOGS]; /* log filenames for out/err messages */
719 FILE *log_file[NUM_LOGS]; /* log file handles for out/err files */
720 FILE *log_file_default[NUM_LOGS]; /* default log file handles (out/err) */
728 char *(*window_title_function)(void);
729 void (*exit_message_function)(char *, va_list);
730 void (*exit_function)(int);
738 char *ro_base_directory;
739 char *rw_base_directory;
740 char *level_directory;
741 char *graphics_directory;
742 char *sounds_directory;
743 char *music_directory;
744 char *docs_directory;
746 char *execute_command;
756 struct VideoSystemInfo
759 int width, height, depth;
760 int window_width, window_height;
762 boolean fullscreen_available;
763 boolean fullscreen_enabled;
764 boolean fullscreen_initial;
766 boolean window_scaling_available;
767 int window_scaling_percent;
768 char *window_scaling_quality;
769 int screen_rendering_mode;
771 unsigned int frame_delay;
772 unsigned int frame_delay_value;
777 struct AudioSystemInfo
779 boolean sound_available;
780 boolean loops_available;
781 boolean music_available;
783 boolean sound_enabled;
784 boolean sound_deactivated; /* for temporarily disabling sound */
793 int first_sound_channel;
796 struct FontBitmapInfo
800 int src_x, src_y; /* start position of animation frames */
801 int width, height; /* width/height of each animation frame */
803 int draw_xoffset; /* offset for drawing font characters */
804 int draw_yoffset; /* offset for drawing font characters */
807 int num_chars_per_line;
814 int real_sx, real_sy;
815 int full_sxsize, full_sysize;
816 int scrollbuffer_width, scrollbuffer_height;
818 int game_tile_size, standard_tile_size;
829 int win_xsize, win_ysize;
831 int draw_deactivation_mask;
832 int draw_background_mask;
834 Bitmap *field_save_buffer;
836 Bitmap *background_bitmap;
837 int background_bitmap_mask;
839 Bitmap *fade_bitmap_source;
840 Bitmap *fade_bitmap_target;
841 Bitmap *fade_bitmap_black;
843 int fade_border_source_status;
844 int fade_border_target_status;
845 Bitmap *masked_border_bitmap_ptr;
847 Bitmap *final_screen_bitmap;
849 boolean clipping_enabled;
851 int clip_width, clip_height;
853 boolean override_level_graphics;
854 boolean override_level_sounds;
855 boolean override_level_music;
857 boolean draw_init_text;
860 struct FontBitmapInfo *font_bitmap_info;
861 int (*select_font_function)(int);
862 int (*get_font_from_token_function)(char *);
864 int anim_random_frame;
866 void (*draw_busy_anim_function)(void);
867 void (*draw_global_anim_function)(int);
868 void (*draw_global_border_function)(int);
876 int fd[MAX_PLAYERS]; /* file descriptor of player's joystick */
879 struct SetupJoystickInfo
881 char *device_name; /* device name of player's joystick */
883 int xleft, xmiddle, xright;
884 int yupper, ymiddle, ylower;
888 struct SetupKeyboardInfo
890 Key left, right, up, down;
894 struct SetupTouchInfo
901 struct SetupInputInfo
903 boolean use_joystick;
904 struct SetupJoystickInfo joy;
905 struct SetupKeyboardInfo key;
908 struct SetupEditorInfo
910 boolean el_boulderdash;
911 boolean el_emerald_mine;
912 boolean el_emerald_mine_club;
916 boolean el_diamond_caves;
917 boolean el_dx_boulderdash;
919 boolean el_steel_chars;
921 boolean el_user_defined;
924 boolean el_headlines;
929 boolean show_element_token;
932 struct SetupEditorCascadeInfo
943 boolean el_steel_chars;
951 struct SetupShortcutInfo
957 Key focus_player[MAX_PLAYERS];
958 Key focus_player_all;
977 struct SetupSystemInfo
979 char *sdl_videodriver;
980 char *sdl_audiodriver;
981 int audio_fragment_size;
984 struct SetupInternalInfo
987 char *program_author;
989 char *program_website;
990 char *program_copyright;
991 char *program_company;
993 char *program_icon_file;
995 char *default_graphics_set;
996 char *default_sounds_set;
997 char *default_music_set;
999 char *fallback_graphics_file;
1000 char *fallback_sounds_file;
1001 char *fallback_music_file;
1003 char *default_level_series;
1005 int default_window_width;
1006 int default_window_height;
1008 boolean choose_from_top_leveldir;
1016 boolean sound_loops;
1017 boolean sound_music;
1018 boolean sound_simple;
1020 boolean scroll_delay;
1021 boolean scroll_delay_value;
1022 char *engine_snapshot_mode;
1023 boolean fade_screens;
1025 boolean show_titlescreen;
1026 boolean quick_doors;
1029 boolean skip_levels;
1032 int window_scaling_percent;
1033 char *window_scaling_quality;
1034 char *screen_rendering_mode;
1035 boolean ask_on_escape;
1036 boolean ask_on_escape_editor;
1037 boolean quick_switch;
1038 boolean input_on_focus;
1039 boolean prefer_aga_graphics;
1040 int game_frame_delay;
1041 boolean sp_show_border_elements;
1042 boolean small_game_graphics;
1043 boolean show_snapshot_buttons;
1048 int override_level_graphics; /* not boolean -- can also be "AUTO" */
1049 int override_level_sounds; /* not boolean -- can also be "AUTO" */
1050 int override_level_music; /* not boolean -- can also be "AUTO" */
1056 struct SetupEditorInfo editor;
1057 struct SetupEditorCascadeInfo editor_cascade;
1058 struct SetupShortcutInfo shortcut;
1059 struct SetupInputInfo input[MAX_PLAYERS];
1060 struct SetupTouchInfo touch;
1061 struct SetupSystemInfo system;
1062 struct SetupInternalInfo internal;
1063 struct OptionInfo options;
1068 struct TreeInfo **node_top; /* topmost node in tree */
1069 struct TreeInfo *node_parent; /* parent level directory info */
1070 struct TreeInfo *node_group; /* level group sub-directory info */
1071 struct TreeInfo *next; /* next level series structure node */
1073 int cl_first; /* internal control field for setup screen */
1074 int cl_cursor; /* internal control field for setup screen */
1076 int type; /* type of tree content */
1078 /* fields for "type == TREE_TYPE_LEVEL_DIR" */
1080 char *subdir; /* tree info sub-directory basename (may be ".") */
1081 char *fullpath; /* complete path relative to tree base directory */
1082 char *basepath; /* absolute base path of tree base directory */
1083 char *identifier; /* identifier string for configuration files */
1084 char *name; /* tree info name, as displayed in selection menues */
1085 char *name_sorting; /* optional sorting name for correct name sorting */
1086 char *author; /* level or artwork author name */
1087 char *year; /* optional year of creation for levels or artwork */
1088 char *imported_from; /* optional comment for imported levels or artwork */
1089 char *imported_by; /* optional comment for imported levels or artwork */
1090 char *tested_by; /* optional comment to name people who tested a set */
1092 char *graphics_set_ecs; /* special EMC custom graphics set (ECS graphics) */
1093 char *graphics_set_aga; /* special EMC custom graphics set (AGA graphics) */
1094 char *graphics_set; /* optional custom graphics set (level tree only) */
1095 char *sounds_set; /* optional custom sounds set (level tree only) */
1096 char *music_set; /* optional custom music set (level tree only) */
1097 char *graphics_path; /* path to optional custom graphics set (level only) */
1098 char *sounds_path; /* path to optional custom sounds set (level only) */
1099 char *music_path; /* path to optional custom music set (level only) */
1101 char *level_filename; /* filename of level file (for packed level file) */
1102 char *level_filetype; /* type of levels in level directory or level file */
1104 char *special_flags; /* flags for special actions performed on level file */
1106 int levels; /* number of levels in level series */
1107 int first_level; /* first level number (to allow start with 0 or 1) */
1108 int last_level; /* last level number (automatically calculated) */
1109 int sort_priority; /* sort levels by 'sort_priority' and then by name */
1111 boolean latest_engine;/* force level set to use the latest game engine */
1113 boolean level_group; /* directory contains more level series directories */
1114 boolean parent_link; /* entry links back to parent directory */
1115 boolean in_user_dir; /* user defined levels are stored in home directory */
1116 boolean user_defined; /* levels in user directory and marked as "private" */
1117 boolean readonly; /* readonly levels can not be changed with editor */
1118 boolean handicap; /* level set has no handicap when set to "false" */
1119 boolean skip_levels; /* levels can be skipped when set to "true" */
1121 int color; /* color to use on selection screen for this level */
1122 char *class_desc; /* description of level series class */
1123 int handicap_level; /* number of the lowest unsolved level */
1125 char *infotext; /* optional text to describe the tree type (headline) */
1128 typedef struct TreeInfo TreeInfo;
1129 typedef struct TreeInfo LevelDirTree;
1130 typedef struct TreeInfo ArtworkDirTree;
1131 typedef struct TreeInfo GraphicsDirTree;
1132 typedef struct TreeInfo SoundsDirTree;
1133 typedef struct TreeInfo MusicDirTree;
1137 GraphicsDirTree *gfx_first;
1138 GraphicsDirTree *gfx_current;
1139 SoundsDirTree *snd_first;
1140 SoundsDirTree *snd_current;
1141 MusicDirTree *mus_first;
1142 MusicDirTree *mus_current;
1144 char *gfx_current_identifier;
1145 char *snd_current_identifier;
1146 char *mus_current_identifier;
1149 struct ValueTextInfo
1161 struct ConfigTypeInfo
1168 struct TokenIntPtrInfo
1178 char *default_filename;
1181 char **default_parameter; /* array of file parameters */
1182 char **parameter; /* array of file parameters */
1185 boolean fallback_to_default;
1186 boolean default_is_cloned;
1189 struct SetupFileList
1194 struct SetupFileList *next;
1199 char *source_filename; /* primary key for node list */
1203 struct PropertyMapping
1213 struct ArtworkListInfo
1215 int type; /* type of artwork */
1217 int num_file_list_entries;
1218 int num_dynamic_file_list_entries;
1219 struct FileInfo *file_list; /* static artwork file array */
1220 struct FileInfo *dynamic_file_list; /* dynamic artwrk file array */
1222 int num_suffix_list_entries;
1223 struct ConfigTypeInfo *suffix_list; /* parameter suffixes array */
1225 int num_base_prefixes;
1226 int num_ext1_suffixes;
1227 int num_ext2_suffixes;
1228 int num_ext3_suffixes;
1229 char **base_prefixes; /* base token prefixes array */
1230 char **ext1_suffixes; /* property suffixes array 1 */
1231 char **ext2_suffixes; /* property suffixes array 2 */
1232 char **ext3_suffixes; /* property suffixes array 3 */
1234 int num_ignore_tokens;
1235 char **ignore_tokens; /* file tokens to be ignored */
1237 int num_property_mapping_entries;
1238 struct PropertyMapping *property_mapping; /* mapping token -> artwork */
1240 int sizeof_artwork_list_entry;
1242 struct ListNodeInfo **artwork_list; /* static artwork node array */
1243 struct ListNodeInfo **dynamic_artwork_list; /* dynamic artwrk node array */
1244 struct ListNode *content_list; /* dynamic artwork node list */
1246 void *(*load_artwork)(char *); /* constructor function */
1247 void (*free_artwork)(void *); /* destructor function */
1261 struct RectWithBorder
1275 struct DoorPartPosInfo
1282 int start_step_opening;
1283 int start_step_closing;
1284 boolean draw_masked;
1291 int xoffset; /* special case for tape date and time */
1292 int xoffset2; /* special case for tape date */
1295 int size; /* also used for suffix ".digits" */
1297 boolean draw_masked;
1298 boolean draw_player; /* special case for network player buttons */
1299 int sort_priority; /* also used for suffix ".draw_order" */
1310 /* ========================================================================= */
1311 /* exported variables */
1312 /* ========================================================================= */
1314 extern struct ProgramInfo program;
1315 extern struct OptionInfo options;
1316 extern struct VideoSystemInfo video;
1317 extern struct AudioSystemInfo audio;
1318 extern struct GfxInfo gfx;
1319 extern struct AnimInfo anim;
1320 extern struct ArtworkInfo artwork;
1321 extern struct JoystickInfo joystick;
1322 extern struct SetupInfo setup;
1324 extern LevelDirTree *leveldir_first_all;
1325 extern LevelDirTree *leveldir_first;
1326 extern LevelDirTree *leveldir_current;
1327 extern int level_nr;
1329 extern struct LevelStats level_stats[];
1331 extern DrawWindow *window;
1332 extern DrawBuffer *backbuffer;
1333 extern DrawBuffer *drawto;
1335 extern int button_status;
1336 extern boolean motion_status;
1337 #if defined(TARGET_SDL2)
1338 extern boolean keyrepeat_status;
1341 extern int redraw_mask;
1343 extern int FrameCounter;
1346 /* function definitions */
1348 void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *,
1351 void SetWindowTitle();
1353 void InitWindowTitleFunction(char *(*window_title_function)(void));
1354 void InitExitMessageFunction(void (*exit_message_function)(char *, va_list));
1355 void InitExitFunction(void (*exit_function)(int));
1356 void InitPlatformDependentStuff(void);
1357 void ClosePlatformDependentStuff(void);
1359 void InitGfxFieldInfo(int, int, int, int, int, int, int, int, Bitmap *);
1360 void InitGfxTileSizeInfo(int, int);
1361 void InitGfxDoor1Info(int, int, int, int);
1362 void InitGfxDoor2Info(int, int, int, int);
1363 void InitGfxDoor3Info(int, int, int, int);
1364 void InitGfxWindowInfo(int, int);
1365 void InitGfxScrollbufferInfo(int, int);
1366 void InitGfxClipRegion(boolean, int, int, int, int);
1367 void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(void));
1368 void InitGfxDrawGlobalAnimFunction(void (*draw_global_anim_function)(int));
1369 void InitGfxDrawGlobalBorderFunction(void (*draw_global_border_function)(int));
1370 void InitGfxCustomArtworkInfo();
1371 void InitGfxOtherSettings();
1372 void SetDrawDeactivationMask(int);
1373 void SetDrawBackgroundMask(int);
1374 void SetWindowBackgroundBitmap(Bitmap *);
1375 void SetMainBackgroundBitmap(Bitmap *);
1376 void SetDoorBackgroundBitmap(Bitmap *);
1377 void SetRedrawMaskFromArea(int, int, int, int);
1379 void LimitScreenUpdates(boolean);
1381 void InitVideoDisplay(void);
1382 void CloseVideoDisplay(void);
1383 void InitVideoBuffer(int, int, int, boolean);
1384 Bitmap *CreateBitmapStruct(void);
1385 Bitmap *CreateBitmap(int, int, int);
1386 void ReCreateBitmap(Bitmap **, int, int, int);
1387 void FreeBitmap(Bitmap *);
1388 void BlitBitmap(Bitmap *, Bitmap *, int, int, int, int, int, int);
1389 void BlitBitmapTiled(Bitmap *, Bitmap *, int, int, int, int, int, int, int,int);
1390 void FadeRectangle(Bitmap *bitmap, int, int, int, int, int, int, int,
1391 void (*draw_border_function)(void));
1392 void FillRectangle(Bitmap *, int, int, int, int, Pixel);
1393 void ClearRectangle(Bitmap *, int, int, int, int);
1394 void ClearRectangleOnBackground(Bitmap *, int, int, int, int);
1395 void BlitBitmapMasked(Bitmap *, Bitmap *, int, int, int, int, int, int);
1396 boolean DrawingOnBackground(int, int);
1397 boolean DrawingAreaChanged();
1398 void BlitBitmapOnBackground(Bitmap *, Bitmap *, int, int, int, int, int, int);
1399 void BlitTexture(Bitmap *, int, int, int, int, int, int);
1400 void BlitTextureMasked(Bitmap *, int, int, int, int, int, int);
1401 void BlitToScreen(Bitmap *, int, int, int, int, int, int);
1402 void BlitToScreenMasked(Bitmap *, int, int, int, int, int, int);
1403 void DrawSimpleBlackLine(Bitmap *, int, int, int, int);
1404 void DrawSimpleWhiteLine(Bitmap *, int, int, int, int);
1405 void DrawLines(Bitmap *, struct XY *, int, Pixel);
1406 Pixel GetPixel(Bitmap *, int, int);
1407 Pixel GetPixelFromRGB(Bitmap *, unsigned int,unsigned int,unsigned int);
1408 Pixel GetPixelFromRGBcompact(Bitmap *, unsigned int);
1410 void KeyboardAutoRepeatOn(void);
1411 void KeyboardAutoRepeatOff(void);
1412 boolean SetVideoMode(boolean);
1413 void SetVideoFrameDelay(unsigned int);
1414 unsigned int GetVideoFrameDelay();
1415 boolean ChangeVideoModeIfNeeded(boolean);
1417 Bitmap *LoadImage(char *);
1418 Bitmap *LoadCustomImage(char *);
1419 void ReloadCustomImage(Bitmap *, char *);
1421 Bitmap *ZoomBitmap(Bitmap *, int, int);
1422 void ReCreateGameTileSizeBitmap(Bitmap **);
1423 void CreateBitmapWithSmallBitmaps(Bitmap **, int, int);
1424 void CreateBitmapTextures(Bitmap **);
1425 void FreeBitmapTextures(Bitmap **);
1426 void ScaleBitmap(Bitmap **, int);
1428 void SetMouseCursor(int);
1430 void OpenAudio(void);
1431 void CloseAudio(void);
1432 void SetAudioMode(boolean);
1434 void InitEventFilter(EventFilter);
1435 boolean PendingEvent(void);
1436 void NextEvent(Event *event);
1437 void PeekEvent(Event *event);
1438 Key GetEventKey(KeyEvent *, boolean);
1439 KeyMod HandleKeyModState(Key, int);
1440 KeyMod GetKeyModState();
1441 KeyMod GetKeyModStateFromEvents();
1442 boolean CheckCloseWindowEvent(ClientMessageEvent *);
1444 void InitJoysticks();
1445 boolean ReadJoystick(int, int *, int *, boolean *, boolean *);
1447 #endif /* SYSTEM_H */