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 50
51 #define STD_WINDOW_SCALING_PERCENT 100
52 #define MAX_WINDOW_SCALING_PERCENT 300
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 touch control */
63 #define TOUCH_CONTROL_VIRTUAL_BUTTONS "virtual_buttons"
64 #define TOUCH_CONTROL_WIPE_GESTURES "wipe_gestures"
66 #define TOUCH_CONTROL_DEFAULT TOUCH_CONTROL_VIRTUAL_BUTTONS
68 #define TOUCH_MOVE_DISTANCE_DEFAULT 2
69 #define TOUCH_DROP_DISTANCE_DEFAULT 5
72 /* default input keys */
73 #define DEFAULT_KEY_LEFT KSYM_Left
74 #define DEFAULT_KEY_RIGHT KSYM_Right
75 #define DEFAULT_KEY_UP KSYM_Up
76 #define DEFAULT_KEY_DOWN KSYM_Down
77 #if defined(PLATFORM_MACOSX)
78 #define DEFAULT_KEY_SNAP KSYM_Control_L
79 #define DEFAULT_KEY_DROP KSYM_KP_Enter
81 #define DEFAULT_KEY_SNAP KSYM_Control_L
82 #define DEFAULT_KEY_DROP KSYM_Control_R
84 #define DEFAULT_KEY_OKAY KSYM_Return
85 #define DEFAULT_KEY_CANCEL KSYM_Escape
87 /* default shortcut keys */
88 #define DEFAULT_KEY_SAVE_GAME KSYM_F1
89 #define DEFAULT_KEY_LOAD_GAME KSYM_F2
90 #define DEFAULT_KEY_TOGGLE_PAUSE KSYM_space
91 #define DEFAULT_KEY_FOCUS_PLAYER_1 KSYM_F5
92 #define DEFAULT_KEY_FOCUS_PLAYER_2 KSYM_F6
93 #define DEFAULT_KEY_FOCUS_PLAYER_3 KSYM_F7
94 #define DEFAULT_KEY_FOCUS_PLAYER_4 KSYM_F8
95 #define DEFAULT_KEY_FOCUS_PLAYER_ALL KSYM_F9
96 #define DEFAULT_KEY_TAPE_EJECT KSYM_UNDEFINED
97 #define DEFAULT_KEY_TAPE_EXTRA KSYM_UNDEFINED
98 #define DEFAULT_KEY_TAPE_STOP KSYM_UNDEFINED
99 #define DEFAULT_KEY_TAPE_PAUSE KSYM_UNDEFINED
100 #define DEFAULT_KEY_TAPE_RECORD KSYM_UNDEFINED
101 #define DEFAULT_KEY_TAPE_PLAY KSYM_UNDEFINED
102 #define DEFAULT_KEY_SOUND_SIMPLE KSYM_UNDEFINED
103 #define DEFAULT_KEY_SOUND_LOOPS KSYM_UNDEFINED
104 #define DEFAULT_KEY_SOUND_MUSIC KSYM_UNDEFINED
105 #define DEFAULT_KEY_SNAP_LEFT KSYM_UNDEFINED
106 #define DEFAULT_KEY_SNAP_RIGHT KSYM_UNDEFINED
107 #define DEFAULT_KEY_SNAP_UP KSYM_UNDEFINED
108 #define DEFAULT_KEY_SNAP_DOWN KSYM_UNDEFINED
110 /* values for key_status */
111 #define KEY_NOT_PRESSED FALSE
112 #define KEY_RELEASED FALSE
113 #define KEY_PRESSED TRUE
115 /* values for button status */
116 #define MB_NOT_PRESSED FALSE
117 #define MB_NOT_RELEASED TRUE
118 #define MB_RELEASED FALSE
119 #define MB_PRESSED TRUE
120 #define MB_MENU_CHOICE FALSE
121 #define MB_MENU_MARK TRUE
122 #define MB_MENU_INITIALIZE (-1)
123 #define MB_MENU_LEAVE (-2)
124 #define MB_LEFTBUTTON 1
125 #define MB_MIDDLEBUTTON 2
126 #define MB_RIGHTBUTTON 3
127 #define MB_WHEEL_UP 4
128 #define MB_WHEEL_DOWN 5
129 #define MB_WHEEL_LEFT 6
130 #define MB_WHEEL_RIGHT 7
131 #define IS_WHEEL_BUTTON_VERTICAL(b) ((b) >= MB_WHEEL_UP && \
132 (b) <= MB_WHEEL_DOWN)
133 #define IS_WHEEL_BUTTON_HORIZONTAL(b) ((b) >= MB_WHEEL_LEFT && \
134 (b) <= MB_WHEEL_RIGHT)
135 #define IS_WHEEL_BUTTON(b) ((b) >= MB_WHEEL_UP && \
136 (b) <= MB_WHEEL_DOWN)
137 #define DEFAULT_WHEEL_STEPS 3
139 #define BUTTON_STEPSIZE(b) ((b) == MB_LEFTBUTTON ? 1 : \
140 (b) == MB_MIDDLEBUTTON ? 5 : \
141 (b) == MB_RIGHTBUTTON ? 10 : 1)
143 /* values for move directions */
144 #define MV_BIT_LEFT 0
145 #define MV_BIT_RIGHT 1
147 #define MV_BIT_DOWN 3
149 #define NUM_DIRECTIONS 4
151 /* diagonal movement directions are used in a different contect than buttons */
152 #define MV_BIT_UPLEFT 4
153 #define MV_BIT_UPRIGHT 5
154 #define MV_BIT_DOWNLEFT 6
155 #define MV_BIT_DOWNRIGHT 7
157 #define NUM_DIRECTIONS_FULL 8
159 /* values for special "button" bitmasks */
163 #define NUM_PLAYER_ACTIONS 6
165 /* values for special "focus player" bitmasks */
166 #define BIT_SET_FOCUS 6
168 /* values for drawing stages for global animations */
169 #define DRAW_GLOBAL_ANIM_STAGE_1 1
170 #define DRAW_GLOBAL_ANIM_STAGE_2 2
172 /* values for move directions and special "button" key bitmasks */
174 #define MV_LEFT (1 << MV_BIT_LEFT)
175 #define MV_RIGHT (1 << MV_BIT_RIGHT)
176 #define MV_UP (1 << MV_BIT_UP)
177 #define MV_DOWN (1 << MV_BIT_DOWN)
179 #define MV_UPLEFT (MV_UP | MV_LEFT)
180 #define MV_UPRIGHT (MV_UP | MV_RIGHT)
181 #define MV_DOWNLEFT (MV_DOWN | MV_LEFT)
182 #define MV_DOWNRIGHT (MV_DOWN | MV_RIGHT)
184 #define MV_HORIZONTAL (MV_LEFT | MV_RIGHT)
185 #define MV_VERTICAL (MV_UP | MV_DOWN)
186 #define MV_ALL_DIRECTIONS (MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN)
187 #define MV_ANY_DIRECTION (MV_ALL_DIRECTIONS)
188 #define MV_NO_DIRECTION (MV_NONE)
190 #define KEY_BUTTON_1 (1 << BUTTON_1)
191 #define KEY_BUTTON_2 (1 << BUTTON_2)
192 #define KEY_BUTTON_SNAP KEY_BUTTON_1
193 #define KEY_BUTTON_DROP KEY_BUTTON_2
194 #define KEY_MOTION (MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN)
195 #define KEY_BUTTON (KEY_BUTTON_1 | KEY_BUTTON_2)
196 #define KEY_ACTION (KEY_MOTION | KEY_BUTTON)
198 #define KEY_SET_FOCUS (1 << BIT_SET_FOCUS)
200 #define MV_DIR_FROM_BIT(x) ((x) < NUM_DIRECTIONS ? 1 << (x) : \
201 (x) == MV_BIT_UPLEFT ? MV_UPLEFT : \
202 (x) == MV_BIT_UPRIGHT ? MV_UPRIGHT : \
203 (x) == MV_BIT_DOWNLEFT ? MV_DOWNLEFT : \
204 (x) == MV_BIT_DOWNRIGHT ? MV_DOWNRIGHT : \
207 #define MV_DIR_TO_BIT(x) ((x) == MV_LEFT ? MV_BIT_LEFT : \
208 (x) == MV_RIGHT ? MV_BIT_RIGHT : \
209 (x) == MV_UP ? MV_BIT_UP : \
210 (x) == MV_DOWN ? MV_BIT_DOWN : \
211 (x) == MV_UPLEFT ? MV_BIT_UPLEFT : \
212 (x) == MV_UPRIGHT ? MV_BIT_UPRIGHT : \
213 (x) == MV_DOWNLEFT ? MV_BIT_DOWNLEFT : \
214 (x) == MV_DOWNRIGHT ? MV_BIT_DOWNRIGHT : \
217 #define MV_DIR_OPPOSITE(x) ((x) == MV_LEFT ? MV_RIGHT : \
218 (x) == MV_RIGHT ? MV_LEFT : \
219 (x) == MV_UP ? MV_DOWN : \
220 (x) == MV_DOWN ? MV_UP : \
221 (x) == MV_UPLEFT ? MV_DOWNRIGHT : \
222 (x) == MV_UPRIGHT ? MV_DOWNLEFT : \
223 (x) == MV_DOWNLEFT ? MV_UPRIGHT : \
224 (x) == MV_DOWNRIGHT ? MV_UPLEFT : \
227 /* values for animation mode (frame order and direction) */
229 #define ANIM_LOOP (1 << 0)
230 #define ANIM_LINEAR (1 << 1)
231 #define ANIM_PINGPONG (1 << 2)
232 #define ANIM_PINGPONG2 (1 << 3)
233 #define ANIM_RANDOM (1 << 4)
234 #define ANIM_CE_VALUE (1 << 5)
235 #define ANIM_CE_SCORE (1 << 6)
236 #define ANIM_CE_DELAY (1 << 7)
237 #define ANIM_REVERSE (1 << 8)
238 #define ANIM_OPAQUE_PLAYER (1 << 9)
240 /* values for special (non game element) animation modes */
241 #define ANIM_HORIZONTAL (1 << 10)
242 #define ANIM_VERTICAL (1 << 11)
243 #define ANIM_CENTERED (1 << 12)
244 #define ANIM_STATIC_PANEL (1 << 13)
245 #define ANIM_ALL (1 << 14)
247 #define ANIM_DEFAULT ANIM_LOOP
249 /* values for special drawing styles (currently only for crumbled graphics) */
251 #define STYLE_ACCURATE_BORDERS (1 << 0)
252 #define STYLE_INNER_CORNERS (1 << 1)
254 #define STYLE_DEFAULT STYLE_NONE
256 /* values for fade mode */
257 #define FADE_TYPE_NONE 0
258 #define FADE_TYPE_FADE_IN (1 << 0)
259 #define FADE_TYPE_FADE_OUT (1 << 1)
260 #define FADE_TYPE_TRANSFORM (1 << 2)
261 #define FADE_TYPE_CROSSFADE (1 << 3)
262 #define FADE_TYPE_MELT (1 << 4)
263 #define FADE_TYPE_CURTAIN (1 << 5)
264 #define FADE_TYPE_SKIP (1 << 6)
266 #define FADE_MODE_NONE (FADE_TYPE_NONE)
267 #define FADE_MODE_FADE_IN (FADE_TYPE_FADE_IN)
268 #define FADE_MODE_FADE_OUT (FADE_TYPE_FADE_OUT)
269 #define FADE_MODE_FADE (FADE_TYPE_FADE_IN | FADE_TYPE_FADE_OUT)
270 #define FADE_MODE_TRANSFORM (FADE_TYPE_TRANSFORM | FADE_TYPE_FADE_IN)
271 #define FADE_MODE_CROSSFADE (FADE_MODE_TRANSFORM | FADE_TYPE_CROSSFADE)
272 #define FADE_MODE_MELT (FADE_MODE_TRANSFORM | FADE_TYPE_MELT)
273 #define FADE_MODE_CURTAIN (FADE_MODE_TRANSFORM | FADE_TYPE_CURTAIN)
274 #define FADE_MODE_SKIP_FADE_IN (FADE_TYPE_SKIP | FADE_TYPE_FADE_IN)
275 #define FADE_MODE_SKIP_FADE_OUT (FADE_TYPE_SKIP | FADE_TYPE_FADE_OUT)
277 #define FADE_MODE_DEFAULT FADE_MODE_FADE
279 /* values for toon positions */
280 #define POS_UNDEFINED -1
290 /* values for text alignment */
291 #define ALIGN_LEFT (1 << 0)
292 #define ALIGN_RIGHT (1 << 1)
293 #define ALIGN_CENTER (1 << 2)
294 #define ALIGN_DEFAULT ALIGN_LEFT
296 #define VALIGN_TOP (1 << 0)
297 #define VALIGN_BOTTOM (1 << 1)
298 #define VALIGN_MIDDLE (1 << 2)
299 #define VALIGN_DEFAULT VALIGN_TOP
301 #define ALIGNED_XPOS(x,w,a) ((a) == ALIGN_CENTER ? (x) - (w) / 2 : \
302 (a) == ALIGN_RIGHT ? (x) - (w) : (x))
303 #define ALIGNED_YPOS(y,h,v) ((v) == VALIGN_MIDDLE ? (y) - (h) / 2 : \
304 (v) == VALIGN_BOTTOM ? (y) - (h) : (y))
305 #define ALIGNED_TEXT_XPOS(p) ALIGNED_XPOS((p)->x, (p)->width, (p)->align)
306 #define ALIGNED_TEXT_YPOS(p) ALIGNED_YPOS((p)->y, (p)->height, (p)->valign)
308 /* values for redraw_mask */
309 #define REDRAW_NONE (0)
310 #define REDRAW_ALL (1 << 0)
311 #define REDRAW_FIELD (1 << 1)
312 #define REDRAW_DOOR_1 (1 << 2)
313 #define REDRAW_DOOR_2 (1 << 3)
314 #define REDRAW_DOOR_3 (1 << 4)
315 #define REDRAW_FPS (1 << 5)
317 #define REDRAW_DOORS (REDRAW_DOOR_1 | \
321 #define IN_GFX_FIELD_PLAY(x, y) (x >= gfx.sx && x < gfx.sx + gfx.sxsize && \
322 y >= gfx.sy && y < gfx.sy + gfx.sysize)
323 #define IN_GFX_FIELD_FULL(x, y) (x >= gfx.real_sx && \
324 x < gfx.real_sx + gfx.full_sxsize && \
325 y >= gfx.real_sy && \
326 y < gfx.real_sy + gfx.full_sysize)
327 #define IN_GFX_DOOR_1(x, y) (x >= gfx.dx && x < gfx.dx + gfx.dxsize && \
328 y >= gfx.dy && y < gfx.dy + gfx.dysize)
329 #define IN_GFX_DOOR_2(x, y) (x >= gfx.vx && x < gfx.vx + gfx.vxsize && \
330 y >= gfx.vy && y < gfx.vy + gfx.vysize)
331 #define IN_GFX_DOOR_3(x, y) (x >= gfx.ex && x < gfx.ex + gfx.exsize && \
332 y >= gfx.ey && y < gfx.ey + gfx.eysize)
334 /* values for mouse cursor */
335 #define CURSOR_DEFAULT 0
336 #define CURSOR_NONE 1
337 #define CURSOR_PLAYFIELD 2
339 /* fundamental game speed values */
340 #define ONE_SECOND_DELAY 1000 /* delay value for one second */
341 #define GAME_FRAME_DELAY 20 /* frame delay in milliseconds */
342 #define FFWD_FRAME_DELAY 10 /* 200% speed for fast forward */
343 #define FRAMES_PER_SECOND (ONE_SECOND_DELAY / GAME_FRAME_DELAY)
344 #define FRAMES_PER_SECOND_SP 35
346 /* maximum playfield size supported by libgame functions */
347 #define MAX_PLAYFIELD_WIDTH 128
348 #define MAX_PLAYFIELD_HEIGHT 128
350 /* maximum number of parallel players supported by libgame functions */
351 #define MAX_PLAYERS 4
353 /* maximum allowed length of player name */
354 #define MAX_PLAYER_NAME_LEN 10
356 /* maximum number of levels in a level set */
357 #define MAX_LEVELS 1000
359 /* default name for empty highscore entry */
360 #define EMPTY_PLAYER_NAME "no name"
362 /* default name for unknown player names */
363 #define ANONYMOUS_NAME "anonymous"
365 /* default for other unknown names */
366 #define UNKNOWN_NAME "unknown"
368 /* default name for new levels */
369 #define NAMELESS_LEVEL_NAME "nameless level"
371 /* default text for non-existant artwork */
372 #define NOT_AVAILABLE "(not available)"
374 /* default value for undefined filename */
375 #define UNDEFINED_FILENAME "[NONE]"
377 /* default value for undefined levelset */
378 #define UNDEFINED_LEVELSET "[NONE]"
380 /* default value for undefined parameter */
381 #define ARG_DEFAULT "[DEFAULT]"
383 /* default values for undefined configuration file parameters */
384 #define ARG_UNDEFINED "-1000000"
385 #define ARG_UNDEFINED_VALUE (-1000000)
387 /* default value for off-screen positions */
388 #define POS_OFFSCREEN (-1000000)
390 /* definitions for game sub-directories */
392 #define RO_GAME_DIR "."
396 #define RW_GAME_DIR "."
399 #define RO_BASE_PATH RO_GAME_DIR
400 #define RW_BASE_PATH RW_GAME_DIR
402 /* directory names */
403 #define GRAPHICS_DIRECTORY "graphics"
404 #define SOUNDS_DIRECTORY "sounds"
405 #define MUSIC_DIRECTORY "music"
406 #define LEVELS_DIRECTORY "levels"
407 #define TAPES_DIRECTORY "tapes"
408 #define SCORES_DIRECTORY "scores"
409 #define DOCS_DIRECTORY "docs"
410 #define CACHE_DIRECTORY "cache"
412 #define GFX_CLASSIC_SUBDIR "gfx_classic"
413 #define SND_CLASSIC_SUBDIR "snd_classic"
414 #define MUS_CLASSIC_SUBDIR "mus_classic"
416 #define GFX_DEFAULT_SUBDIR (setup.internal.default_graphics_set)
417 #define SND_DEFAULT_SUBDIR (setup.internal.default_sounds_set)
418 #define MUS_DEFAULT_SUBDIR (setup.internal.default_music_set)
420 #define GFX_FALLBACK_FILENAME (setup.internal.fallback_graphics_file)
421 #define SND_FALLBACK_FILENAME (setup.internal.fallback_sounds_file)
422 #define MUS_FALLBACK_FILENAME (setup.internal.fallback_music_file)
424 #define DEFAULT_LEVELSET (setup.internal.default_level_series)
426 /* file names and filename extensions */
427 #define LEVELSETUP_DIRECTORY "levelsetup"
428 #define SETUP_FILENAME "setup.conf"
429 #define LEVELSETUP_FILENAME "levelsetup.conf"
430 #define EDITORSETUP_FILENAME "editorsetup.conf"
431 #define EDITORCASCADE_FILENAME "editorcascade.conf"
432 #define HELPANIM_FILENAME "helpanim.conf"
433 #define HELPTEXT_FILENAME "helptext.conf"
434 #define LEVELINFO_FILENAME "levelinfo.conf"
435 #define GRAPHICSINFO_FILENAME "graphicsinfo.conf"
436 #define SOUNDSINFO_FILENAME "soundsinfo.conf"
437 #define MUSICINFO_FILENAME "musicinfo.conf"
438 #define ARTWORKINFO_CACHE_FILE "artworkinfo.cache"
439 #define LEVELFILE_EXTENSION "level"
440 #define TAPEFILE_EXTENSION "tape"
441 #define SCOREFILE_EXTENSION "score"
443 #define LOG_OUT_BASENAME "stdout.txt"
444 #define LOG_ERR_BASENAME "stderr.txt"
450 #define STRING_PARENT_DIRECTORY ".."
451 #define STRING_TOP_DIRECTORY "/"
453 #define CHAR_PATH_SEPARATOR_UNIX '/'
454 #define CHAR_PATH_SEPARATOR_DOS '\\'
456 #define STRING_PATH_SEPARATOR_UNIX "/"
457 #define STRING_PATH_SEPARATOR_DOS "\\"
459 #define STRING_NEWLINE_UNIX "\n"
460 #define STRING_NEWLINE_DOS "\r\n"
462 #if defined(PLATFORM_WIN32)
463 #define CHAR_PATH_SEPARATOR CHAR_PATH_SEPARATOR_DOS
464 #define STRING_PATH_SEPARATOR STRING_PATH_SEPARATOR_DOS
465 #define STRING_NEWLINE STRING_NEWLINE_DOS
467 #define CHAR_PATH_SEPARATOR CHAR_PATH_SEPARATOR_UNIX
468 #define STRING_PATH_SEPARATOR STRING_PATH_SEPARATOR_UNIX
469 #define STRING_NEWLINE STRING_NEWLINE_UNIX
473 /* areas in bitmap PIX_DOOR */
474 /* meaning in PIX_DB_DOOR: (3 PAGEs)
475 PAGEX1: 1. buffer for DOOR_1
476 PAGEX2: 2. buffer for DOOR_1
477 PAGEX3: buffer for animations
480 /* these values are hard-coded to be able to use them in initialization */
481 #define DOOR_GFX_PAGE_WIDTH 100 /* should be set to "gfx.dxsize" */
482 #define DOOR_GFX_PAGE_HEIGHT 280 /* should be set to "gfx.dysize" */
484 #define DOOR_GFX_PAGESIZE (DOOR_GFX_PAGE_WIDTH)
485 #define DOOR_GFX_PAGEX1 (0 * DOOR_GFX_PAGESIZE)
486 #define DOOR_GFX_PAGEX2 (1 * DOOR_GFX_PAGESIZE)
487 #define DOOR_GFX_PAGEX3 (2 * DOOR_GFX_PAGESIZE)
488 #define DOOR_GFX_PAGEX4 (3 * DOOR_GFX_PAGESIZE)
489 #define DOOR_GFX_PAGEX5 (4 * DOOR_GFX_PAGESIZE)
490 #define DOOR_GFX_PAGEX6 (5 * DOOR_GFX_PAGESIZE)
491 #define DOOR_GFX_PAGEX7 (6 * DOOR_GFX_PAGESIZE)
492 #define DOOR_GFX_PAGEX8 (7 * DOOR_GFX_PAGESIZE)
493 #define DOOR_GFX_PAGEY1 (0)
494 #define DOOR_GFX_PAGEY2 (DOOR_GFX_PAGE_HEIGHT)
497 /* macros for version handling */
498 #define VERSION_MAJOR(x) ((x) / 1000000)
499 #define VERSION_MINOR(x) (((x) % 1000000) / 10000)
500 #define VERSION_PATCH(x) (((x) % 10000) / 100)
501 #define VERSION_BUILD(x) ((x) % 100)
502 #define VERSION_IDENT(a,b,c,d) ((a) * 1000000 + (b) * 10000 + (c) * 100 + (d))
505 /* macros for parent/child process identification */
506 #if defined(PLATFORM_UNIX)
507 #define IS_PARENT_PROCESS() (audio.mixer_pid != getpid())
508 #define IS_CHILD_PROCESS() (audio.mixer_pid == getpid())
509 #define HAS_CHILD_PROCESS() (audio.mixer_pid > 0)
511 #define IS_PARENT_PROCESS() TRUE
512 #define IS_CHILD_PROCESS() FALSE
513 #define HAS_CHILD_PROCESS() FALSE
517 /* values for artwork type */
518 #define ARTWORK_TYPE_GRAPHICS 0
519 #define ARTWORK_TYPE_SOUNDS 1
520 #define ARTWORK_TYPE_MUSIC 2
522 #define NUM_ARTWORK_TYPES 3
525 /* values for tree type (chosen to match artwork type) */
526 #define TREE_TYPE_UNDEFINED -1
527 #define TREE_TYPE_GRAPHICS_DIR ARTWORK_TYPE_GRAPHICS
528 #define TREE_TYPE_SOUNDS_DIR ARTWORK_TYPE_SOUNDS
529 #define TREE_TYPE_MUSIC_DIR ARTWORK_TYPE_MUSIC
530 #define TREE_TYPE_LEVEL_DIR 3
531 #define TREE_TYPE_LEVEL_NR 4
533 #define NUM_TREE_TYPES 5
535 #define INFOTEXT_UNDEFINED ""
536 #define INFOTEXT_GRAPHICS_DIR "Custom Graphics"
537 #define INFOTEXT_SOUNDS_DIR "Custom Sounds"
538 #define INFOTEXT_MUSIC_DIR "Custom Music"
539 #define INFOTEXT_LEVEL_DIR "Level Sets"
540 #define INFOTEXT_LEVEL_NR "Levels"
542 #define TREE_INFOTEXT(t) ((t) == TREE_TYPE_LEVEL_NR ? \
543 INFOTEXT_LEVEL_NR : \
544 (t) == TREE_TYPE_LEVEL_DIR ? \
545 INFOTEXT_LEVEL_DIR : \
546 (t) == TREE_TYPE_GRAPHICS_DIR ? \
547 INFOTEXT_GRAPHICS_DIR : \
548 (t) == TREE_TYPE_SOUNDS_DIR ? \
549 INFOTEXT_SOUNDS_DIR : \
550 (t) == TREE_TYPE_MUSIC_DIR ? \
551 INFOTEXT_MUSIC_DIR : \
554 /* values for artwork handling */
555 #define LEVELDIR_ARTWORK_SET_PTR(leveldir, type) \
556 ((type) == ARTWORK_TYPE_GRAPHICS ? \
557 &(leveldir)->graphics_set : \
558 (type) == ARTWORK_TYPE_SOUNDS ? \
559 &(leveldir)->sounds_set : \
560 &(leveldir)->music_set)
562 #define LEVELDIR_ARTWORK_SET(leveldir, type) \
563 ((type) == ARTWORK_TYPE_GRAPHICS ? \
564 (leveldir)->graphics_set : \
565 (type) == ARTWORK_TYPE_SOUNDS ? \
566 (leveldir)->sounds_set : \
567 (leveldir)->music_set)
569 #define LEVELDIR_ARTWORK_PATH_PTR(leveldir, type) \
570 ((type) == ARTWORK_TYPE_GRAPHICS ? \
571 &(leveldir)->graphics_path : \
572 (type) == ARTWORK_TYPE_SOUNDS ? \
573 &(leveldir)->sounds_path : \
574 &(leveldir)->music_path)
576 #define LEVELDIR_ARTWORK_PATH(leveldir, type) \
577 ((type) == ARTWORK_TYPE_GRAPHICS ? \
578 (leveldir)->graphics_path : \
579 (type) == ARTWORK_TYPE_SOUNDS ? \
580 (leveldir)->sounds_path : \
581 (leveldir)->music_path)
583 #define SETUP_ARTWORK_SET(setup, type) \
584 ((type) == ARTWORK_TYPE_GRAPHICS ? \
585 (setup).graphics_set : \
586 (type) == ARTWORK_TYPE_SOUNDS ? \
587 (setup).sounds_set : \
590 #define SETUP_OVERRIDE_ARTWORK(setup, type) \
591 ((type) == ARTWORK_TYPE_GRAPHICS ? \
592 (setup).override_level_graphics : \
593 (type) == ARTWORK_TYPE_SOUNDS ? \
594 (setup).override_level_sounds : \
595 (setup).override_level_music)
597 #define GFX_OVERRIDE_ARTWORK(type) \
598 ((type) == ARTWORK_TYPE_GRAPHICS ? \
599 gfx.override_level_graphics : \
600 (type) == ARTWORK_TYPE_SOUNDS ? \
601 gfx.override_level_sounds : \
602 gfx.override_level_music)
604 #define ARTWORK_FIRST_NODE(artwork, type) \
605 ((type) == ARTWORK_TYPE_GRAPHICS ? \
606 (artwork).gfx_first : \
607 (type) == ARTWORK_TYPE_SOUNDS ? \
608 (artwork).snd_first : \
611 #define ARTWORK_CURRENT_IDENTIFIER_PTR(artwork, type) \
612 ((type) == ARTWORK_TYPE_GRAPHICS ? \
613 &(artwork).gfx_current_identifier : \
614 (type) == ARTWORK_TYPE_SOUNDS ? \
615 &(artwork).snd_current_identifier : \
616 &(artwork).mus_current_identifier)
618 #define ARTWORK_CURRENT_IDENTIFIER(artwork, type) \
619 ((type) == ARTWORK_TYPE_GRAPHICS ? \
620 (artwork).gfx_current_identifier : \
621 (type) == ARTWORK_TYPE_SOUNDS ? \
622 (artwork).snd_current_identifier : \
623 (artwork).mus_current_identifier)
625 #define ARTWORKINFO_FILENAME(type) \
626 ((type) == ARTWORK_TYPE_GRAPHICS ? \
627 GRAPHICSINFO_FILENAME : \
628 (type) == ARTWORK_TYPE_SOUNDS ? \
629 SOUNDSINFO_FILENAME : \
630 (type) == ARTWORK_TYPE_MUSIC ? \
631 MUSICINFO_FILENAME : "")
633 #define ARTWORK_DIRECTORY(type) \
634 ((type) == ARTWORK_TYPE_GRAPHICS ? \
635 GRAPHICS_DIRECTORY : \
636 (type) == ARTWORK_TYPE_SOUNDS ? \
638 (type) == ARTWORK_TYPE_MUSIC ? \
639 MUSIC_DIRECTORY : "")
641 #define OPTIONS_ARTWORK_DIRECTORY(type) \
642 ((type) == ARTWORK_TYPE_GRAPHICS ? \
643 options.graphics_directory : \
644 (type) == ARTWORK_TYPE_SOUNDS ? \
645 options.sounds_directory : \
646 (type) == ARTWORK_TYPE_MUSIC ? \
647 options.music_directory : "")
649 #define UPDATE_BUSY_STATE() \
651 if (gfx.draw_busy_anim_function != NULL) \
652 gfx.draw_busy_anim_function(); \
656 /* type definitions */
657 #if defined(TARGET_SDL2)
658 typedef int (*EventFilter)(void *, Event *);
660 typedef int (*EventFilter)(const Event *);
664 /* structure definitions */
668 char *command_basepath; /* path to the program binary */
669 char *command_basename; /* base filename of the program binary */
671 char *config_filename; /* optional global program config filename */
673 char *maindata_path; /* main game data (installation) directory */
675 char *userdata_subdir; /* personal user game data directory */
676 char *userdata_path; /* resulting full path to game data directory */
686 char *log_filename[NUM_LOGS]; /* log filenames for out/err messages */
687 FILE *log_file[NUM_LOGS]; /* log file handles for out/err files */
688 FILE *log_file_default[NUM_LOGS]; /* default log file handles (out/err) */
696 char *(*window_title_function)(void);
697 void (*exit_message_function)(char *, va_list);
698 void (*exit_function)(int);
707 char *ro_base_directory;
708 char *rw_base_directory;
709 char *level_directory;
710 char *graphics_directory;
711 char *sounds_directory;
712 char *music_directory;
713 char *docs_directory;
715 char *execute_command;
725 struct ScreenModeInfo
730 struct VideoSystemInfo
733 int width, height, depth;
734 int window_width, window_height;
736 boolean fullscreen_available;
737 boolean fullscreen_enabled;
738 boolean fullscreen_initial;
739 struct ScreenModeInfo *fullscreen_modes;
740 char *fullscreen_mode_current;
742 boolean window_scaling_available;
743 int window_scaling_percent;
744 char *window_scaling_quality;
749 struct AudioSystemInfo
751 boolean sound_available;
752 boolean loops_available;
753 boolean music_available;
755 boolean sound_enabled;
756 boolean sound_deactivated; /* for temporarily disabling sound */
765 int first_sound_channel;
768 struct FontBitmapInfo
772 int src_x, src_y; /* start position of animation frames */
773 int width, height; /* width/height of each animation frame */
775 int draw_xoffset; /* offset for drawing font characters */
776 int draw_yoffset; /* offset for drawing font characters */
779 int num_chars_per_line;
786 int real_sx, real_sy;
787 int full_sxsize, full_sysize;
788 int scrollbuffer_width, scrollbuffer_height;
790 int game_tile_size, standard_tile_size;
801 int win_xsize, win_ysize;
803 int draw_deactivation_mask;
804 int draw_background_mask;
806 Bitmap *field_save_buffer;
808 Bitmap *background_bitmap;
809 int background_bitmap_mask;
811 #if USE_FINAL_SCREEN_BITMAP
812 Bitmap *final_screen_bitmap;
815 boolean clipping_enabled;
817 int clip_width, clip_height;
819 boolean override_level_graphics;
820 boolean override_level_sounds;
821 boolean override_level_music;
823 boolean draw_init_text;
826 struct FontBitmapInfo *font_bitmap_info;
827 int (*select_font_function)(int);
828 int (*get_font_from_token_function)(char *);
830 int anim_random_frame;
832 void (*draw_busy_anim_function)(void);
833 void (*draw_global_anim_function)(int);
834 void (*draw_global_border_function)(int);
842 int fd[MAX_PLAYERS]; /* file descriptor of player's joystick */
845 struct SetupJoystickInfo
847 char *device_name; /* device name of player's joystick */
849 int xleft, xmiddle, xright;
850 int yupper, ymiddle, ylower;
854 struct SetupKeyboardInfo
856 Key left, right, up, down;
860 struct SetupTouchInfo
867 struct SetupInputInfo
869 boolean use_joystick;
870 struct SetupJoystickInfo joy;
871 struct SetupKeyboardInfo key;
874 struct SetupEditorInfo
876 boolean el_boulderdash;
877 boolean el_emerald_mine;
878 boolean el_emerald_mine_club;
882 boolean el_diamond_caves;
883 boolean el_dx_boulderdash;
885 boolean el_steel_chars;
887 boolean el_user_defined;
890 boolean el_headlines;
895 boolean show_element_token;
898 struct SetupEditorCascadeInfo
909 boolean el_steel_chars;
917 struct SetupShortcutInfo
923 Key focus_player[MAX_PLAYERS];
924 Key focus_player_all;
943 struct SetupSystemInfo
945 char *sdl_videodriver;
946 char *sdl_audiodriver;
947 int audio_fragment_size;
950 struct SetupInternalInfo
953 char *program_author;
955 char *program_website;
956 char *program_copyright;
957 char *program_company;
959 char *program_icon_file;
961 char *default_graphics_set;
962 char *default_sounds_set;
963 char *default_music_set;
965 char *fallback_graphics_file;
966 char *fallback_sounds_file;
967 char *fallback_music_file;
969 char *default_level_series;
971 int default_window_width;
972 int default_window_height;
974 boolean choose_from_top_leveldir;
984 boolean sound_simple;
986 boolean scroll_delay;
987 boolean scroll_delay_value;
988 char *engine_snapshot_mode;
989 boolean fade_screens;
991 boolean show_titlescreen;
998 char *fullscreen_mode;
999 int window_scaling_percent;
1000 char *window_scaling_quality;
1001 boolean ask_on_escape;
1002 boolean ask_on_escape_editor;
1003 boolean quick_switch;
1004 boolean input_on_focus;
1005 boolean prefer_aga_graphics;
1006 int game_frame_delay;
1007 boolean sp_show_border_elements;
1008 boolean small_game_graphics;
1009 boolean show_snapshot_buttons;
1014 int override_level_graphics; /* not boolean -- can also be "AUTO" */
1015 int override_level_sounds; /* not boolean -- can also be "AUTO" */
1016 int override_level_music; /* not boolean -- can also be "AUTO" */
1022 struct SetupEditorInfo editor;
1023 struct SetupEditorCascadeInfo editor_cascade;
1024 struct SetupShortcutInfo shortcut;
1025 struct SetupInputInfo input[MAX_PLAYERS];
1026 struct SetupTouchInfo touch;
1027 struct SetupSystemInfo system;
1028 struct SetupInternalInfo internal;
1029 struct OptionInfo options;
1034 struct TreeInfo **node_top; /* topmost node in tree */
1035 struct TreeInfo *node_parent; /* parent level directory info */
1036 struct TreeInfo *node_group; /* level group sub-directory info */
1037 struct TreeInfo *next; /* next level series structure node */
1039 int cl_first; /* internal control field for setup screen */
1040 int cl_cursor; /* internal control field for setup screen */
1042 int type; /* type of tree content */
1044 /* fields for "type == TREE_TYPE_LEVEL_DIR" */
1046 char *subdir; /* tree info sub-directory basename (may be ".") */
1047 char *fullpath; /* complete path relative to tree base directory */
1048 char *basepath; /* absolute base path of tree base directory */
1049 char *identifier; /* identifier string for configuration files */
1050 char *name; /* tree info name, as displayed in selection menues */
1051 char *name_sorting; /* optional sorting name for correct name sorting */
1052 char *author; /* level or artwork author name */
1053 char *year; /* optional year of creation for levels or artwork */
1054 char *imported_from; /* optional comment for imported levels or artwork */
1055 char *imported_by; /* optional comment for imported levels or artwork */
1056 char *tested_by; /* optional comment to name people who tested a set */
1058 char *graphics_set_ecs; /* special EMC custom graphics set (ECS graphics) */
1059 char *graphics_set_aga; /* special EMC custom graphics set (AGA graphics) */
1060 char *graphics_set; /* optional custom graphics set (level tree only) */
1061 char *sounds_set; /* optional custom sounds set (level tree only) */
1062 char *music_set; /* optional custom music set (level tree only) */
1063 char *graphics_path; /* path to optional custom graphics set (level only) */
1064 char *sounds_path; /* path to optional custom sounds set (level only) */
1065 char *music_path; /* path to optional custom music set (level only) */
1067 char *level_filename; /* filename of level file (for packed level file) */
1068 char *level_filetype; /* type of levels in level directory or level file */
1070 char *special_flags; /* flags for special actions performed on level file */
1072 int levels; /* number of levels in level series */
1073 int first_level; /* first level number (to allow start with 0 or 1) */
1074 int last_level; /* last level number (automatically calculated) */
1075 int sort_priority; /* sort levels by 'sort_priority' and then by name */
1077 boolean latest_engine;/* force level set to use the latest game engine */
1079 boolean level_group; /* directory contains more level series directories */
1080 boolean parent_link; /* entry links back to parent directory */
1081 boolean in_user_dir; /* user defined levels are stored in home directory */
1082 boolean user_defined; /* levels in user directory and marked as "private" */
1083 boolean readonly; /* readonly levels can not be changed with editor */
1084 boolean handicap; /* level set has no handicap when set to "false" */
1085 boolean skip_levels; /* levels can be skipped when set to "true" */
1087 int color; /* color to use on selection screen for this level */
1088 char *class_desc; /* description of level series class */
1089 int handicap_level; /* number of the lowest unsolved level */
1091 char *infotext; /* optional text to describe the tree type (headline) */
1094 typedef struct TreeInfo TreeInfo;
1095 typedef struct TreeInfo LevelDirTree;
1096 typedef struct TreeInfo ArtworkDirTree;
1097 typedef struct TreeInfo GraphicsDirTree;
1098 typedef struct TreeInfo SoundsDirTree;
1099 typedef struct TreeInfo MusicDirTree;
1103 GraphicsDirTree *gfx_first;
1104 GraphicsDirTree *gfx_current;
1105 SoundsDirTree *snd_first;
1106 SoundsDirTree *snd_current;
1107 MusicDirTree *mus_first;
1108 MusicDirTree *mus_current;
1110 char *gfx_current_identifier;
1111 char *snd_current_identifier;
1112 char *mus_current_identifier;
1115 struct ValueTextInfo
1127 struct ConfigTypeInfo
1134 struct TokenIntPtrInfo
1144 char *default_filename;
1147 char **default_parameter; /* array of file parameters */
1148 char **parameter; /* array of file parameters */
1151 boolean fallback_to_default;
1152 boolean default_is_cloned;
1155 struct SetupFileList
1160 struct SetupFileList *next;
1165 char *source_filename; /* primary key for node list */
1169 struct PropertyMapping
1179 struct ArtworkListInfo
1181 int type; /* type of artwork */
1183 int num_file_list_entries;
1184 int num_dynamic_file_list_entries;
1185 struct FileInfo *file_list; /* static artwork file array */
1186 struct FileInfo *dynamic_file_list; /* dynamic artwrk file array */
1188 int num_suffix_list_entries;
1189 struct ConfigTypeInfo *suffix_list; /* parameter suffixes array */
1191 int num_base_prefixes;
1192 int num_ext1_suffixes;
1193 int num_ext2_suffixes;
1194 int num_ext3_suffixes;
1195 char **base_prefixes; /* base token prefixes array */
1196 char **ext1_suffixes; /* property suffixes array 1 */
1197 char **ext2_suffixes; /* property suffixes array 2 */
1198 char **ext3_suffixes; /* property suffixes array 3 */
1200 int num_ignore_tokens;
1201 char **ignore_tokens; /* file tokens to be ignored */
1203 int num_property_mapping_entries;
1204 struct PropertyMapping *property_mapping; /* mapping token -> artwork */
1206 int sizeof_artwork_list_entry;
1208 struct ListNodeInfo **artwork_list; /* static artwork node array */
1209 struct ListNodeInfo **dynamic_artwork_list; /* dynamic artwrk node array */
1210 struct ListNode *content_list; /* dynamic artwork node list */
1212 void *(*load_artwork)(char *); /* constructor function */
1213 void (*free_artwork)(void *); /* destructor function */
1227 struct RectWithBorder
1241 struct DoorPartPosInfo
1248 int start_step_opening;
1249 int start_step_closing;
1250 boolean draw_masked;
1257 int xoffset; /* special case for tape date and time */
1258 int xoffset2; /* special case for tape date */
1261 int size; /* also used for suffix ".digits" */
1263 boolean draw_masked;
1264 boolean draw_player; /* special case for network player buttons */
1265 int sort_priority; /* also used for suffix ".draw_order" */
1276 /* ========================================================================= */
1277 /* exported variables */
1278 /* ========================================================================= */
1280 extern struct ProgramInfo program;
1281 extern struct OptionInfo options;
1282 extern struct VideoSystemInfo video;
1283 extern struct AudioSystemInfo audio;
1284 extern struct GfxInfo gfx;
1285 extern struct AnimInfo anim;
1286 extern struct ArtworkInfo artwork;
1287 extern struct JoystickInfo joystick;
1288 extern struct SetupInfo setup;
1290 extern LevelDirTree *leveldir_first_all;
1291 extern LevelDirTree *leveldir_first;
1292 extern LevelDirTree *leveldir_current;
1293 extern int level_nr;
1295 extern struct LevelStats level_stats[];
1297 extern DrawWindow *window;
1298 extern DrawBuffer *backbuffer;
1299 extern DrawBuffer *drawto;
1301 extern int button_status;
1302 extern boolean motion_status;
1303 #if defined(TARGET_SDL2)
1304 extern boolean keyrepeat_status;
1307 extern int redraw_mask;
1309 extern int FrameCounter;
1312 /* function definitions */
1314 void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *,
1317 void SetWindowTitle();
1319 void InitWindowTitleFunction(char *(*window_title_function)(void));
1320 void InitExitMessageFunction(void (*exit_message_function)(char *, va_list));
1321 void InitExitFunction(void (*exit_function)(int));
1322 void InitPlatformDependentStuff(void);
1323 void ClosePlatformDependentStuff(void);
1325 void InitGfxFieldInfo(int, int, int, int, int, int, int, int, Bitmap *);
1326 void InitGfxTileSizeInfo(int, int);
1327 void InitGfxDoor1Info(int, int, int, int);
1328 void InitGfxDoor2Info(int, int, int, int);
1329 void InitGfxDoor3Info(int, int, int, int);
1330 void InitGfxWindowInfo(int, int);
1331 void InitGfxScrollbufferInfo(int, int);
1332 void InitGfxClipRegion(boolean, int, int, int, int);
1333 void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(void));
1334 void InitGfxDrawGlobalAnimFunction(void (*draw_global_anim_function)(int));
1335 void InitGfxDrawGlobalBorderFunction(void (*draw_global_border_function)(int));
1336 void InitGfxCustomArtworkInfo();
1337 void InitGfxOtherSettings();
1338 void SetDrawDeactivationMask(int);
1339 void SetDrawBackgroundMask(int);
1340 void SetWindowBackgroundBitmap(Bitmap *);
1341 void SetMainBackgroundBitmap(Bitmap *);
1342 void SetDoorBackgroundBitmap(Bitmap *);
1343 void SetRedrawMaskFromArea(int, int, int, int);
1345 void LimitScreenUpdates(boolean);
1347 void InitVideoDisplay(void);
1348 void CloseVideoDisplay(void);
1349 void InitVideoBuffer(int, int, int, boolean);
1350 Bitmap *CreateBitmapStruct(void);
1351 Bitmap *CreateBitmap(int, int, int);
1352 void ReCreateBitmap(Bitmap **, int, int, int);
1353 void FreeBitmap(Bitmap *);
1354 void BlitBitmap(Bitmap *, Bitmap *, int, int, int, int, int, int);
1355 void BlitBitmapTiled(Bitmap *, Bitmap *, int, int, int, int, int, int, int,int);
1356 void FadeRectangle(Bitmap *bitmap, int, int, int, int, int, int, int,
1357 void (*draw_border_function)(void));
1358 void FillRectangle(Bitmap *, int, int, int, int, Pixel);
1359 void ClearRectangle(Bitmap *, int, int, int, int);
1360 void ClearRectangleOnBackground(Bitmap *, int, int, int, int);
1361 void BlitBitmapMasked(Bitmap *, Bitmap *, int, int, int, int, int, int);
1362 boolean DrawingOnBackground(int, int);
1363 boolean DrawingAreaChanged();
1364 void BlitBitmapOnBackground(Bitmap *, Bitmap *, int, int, int, int, int, int);
1365 void BlitTexture(Bitmap *, int, int, int, int, int, int);
1366 void BlitTextureMasked(Bitmap *, int, int, int, int, int, int);
1367 void BlitToScreen(Bitmap *, int, int, int, int, int, int);
1368 void BlitToScreenMasked(Bitmap *, int, int, int, int, int, int);
1369 void DrawSimpleBlackLine(Bitmap *, int, int, int, int);
1370 void DrawSimpleWhiteLine(Bitmap *, int, int, int, int);
1371 void DrawLines(Bitmap *, struct XY *, int, Pixel);
1372 Pixel GetPixel(Bitmap *, int, int);
1373 Pixel GetPixelFromRGB(Bitmap *, unsigned int,unsigned int,unsigned int);
1374 Pixel GetPixelFromRGBcompact(Bitmap *, unsigned int);
1376 void KeyboardAutoRepeatOn(void);
1377 void KeyboardAutoRepeatOff(void);
1378 boolean SetVideoMode(boolean);
1379 boolean ChangeVideoModeIfNeeded(boolean);
1381 Bitmap *LoadImage(char *);
1382 Bitmap *LoadCustomImage(char *);
1383 void ReloadCustomImage(Bitmap *, char *);
1385 Bitmap *ZoomBitmap(Bitmap *, int, int);
1386 void ReCreateGameTileSizeBitmap(Bitmap **);
1387 void CreateBitmapWithSmallBitmaps(Bitmap **, int, int);
1388 void CreateBitmapTextures(Bitmap **);
1389 void FreeBitmapTextures(Bitmap **);
1390 void ScaleBitmap(Bitmap **, int);
1392 void SetMouseCursor(int);
1394 void OpenAudio(void);
1395 void CloseAudio(void);
1396 void SetAudioMode(boolean);
1398 void InitEventFilter(EventFilter);
1399 boolean PendingEvent(void);
1400 void NextEvent(Event *event);
1401 void PeekEvent(Event *event);
1402 Key GetEventKey(KeyEvent *, boolean);
1403 KeyMod HandleKeyModState(Key, int);
1404 KeyMod GetKeyModState();
1405 KeyMod GetKeyModStateFromEvents();
1406 boolean CheckCloseWindowEvent(ClientMessageEvent *);
1408 void InitJoysticks();
1409 boolean ReadJoystick(int, int *, int *, boolean *, boolean *);
1411 #endif /* SYSTEM_H */