72dbb28d46de2766ff0b1bf8360c3a8b88ec9630
[rocksndiamonds.git] / src / libgame / system.h
1 /***********************************************************
2 * Artsoft Retro-Game Library                               *
3 *----------------------------------------------------------*
4 * (c) 1994-2002 Artsoft Entertainment                      *
5 *               Holger Schemel                             *
6 *               Detmolder Strasse 189                      *
7 *               33604 Bielefeld                            *
8 *               Germany                                    *
9 *               e-mail: info@artsoft.org                   *
10 *----------------------------------------------------------*
11 * system.h                                                 *
12 ***********************************************************/
13
14 #ifndef SYSTEM_H
15 #define SYSTEM_H
16
17 #include "platform.h"
18 #include "types.h"
19
20 #if defined(PLATFORM_MSDOS)
21 #include "msdos.h"
22 #endif
23
24 #if defined(TARGET_SDL)
25 #include "sdl.h"
26 #elif defined(TARGET_X11)
27 #include "x11.h"
28 #endif
29
30 #if defined(PLATFORM_MACOSX)
31 /* some symbols are already defined on Mac OS X */
32 #define Delay Delay_internal
33 #define DrawLine DrawLine_internal
34 #define DrawText DrawText_internal
35 #define GetPixel GetPixel_internal
36 #endif
37
38
39 /* the additional 'b' is needed for Win32 to open files in binary mode */
40 #define MODE_READ               "rb"
41 #define MODE_WRITE              "wb"
42 #define MODE_APPEND             "ab"
43
44 #define DEFAULT_DEPTH           0
45
46 #define FULLSCREEN_NOT_AVAILABLE FALSE
47 #define FULLSCREEN_AVAILABLE     TRUE
48
49 /* default input keys */
50 #define DEFAULT_KEY_LEFT        KSYM_Left
51 #define DEFAULT_KEY_RIGHT       KSYM_Right
52 #define DEFAULT_KEY_UP          KSYM_Up
53 #define DEFAULT_KEY_DOWN        KSYM_Down
54 #if defined(PLATFORM_MACOSX)
55 #define DEFAULT_KEY_SNAP        KSYM_Control_L
56 #define DEFAULT_KEY_BOMB        KSYM_KP_Enter
57 #else
58 #define DEFAULT_KEY_SNAP        KSYM_Shift_L
59 #define DEFAULT_KEY_BOMB        KSYM_Shift_R
60 #endif
61 #define DEFAULT_KEY_OKAY        KSYM_Return
62 #define DEFAULT_KEY_CANCEL      KSYM_Escape
63
64 /* default shortcut keys */
65 #define DEFAULT_KEY_SAVE_GAME   KSYM_F1
66 #define DEFAULT_KEY_LOAD_GAME   KSYM_F2
67 #define DEFAULT_KEY_TOGGLE_PAUSE KSYM_space
68
69 /* values for move directions and special "button" keys */
70 #define MV_BIT_LEFT             0
71 #define MV_BIT_RIGHT            1
72 #define MV_BIT_UP               2
73 #define MV_BIT_DOWN             3
74 #define NUM_DIRECTIONS          4
75
76 #define MV_NO_MOVING            0
77 #define MV_LEFT                 (1 << MV_BIT_LEFT)
78 #define MV_RIGHT                (1 << MV_BIT_RIGHT)
79 #define MV_UP                   (1 << MV_BIT_UP)
80 #define MV_DOWN                 (1 << MV_BIT_DOWN)
81 #define KEY_BUTTON_1            (1 << 4)
82 #define KEY_BUTTON_2            (1 << 5)
83 #define KEY_MOTION              (MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN)
84 #define KEY_BUTTON              (KEY_BUTTON_1 | KEY_BUTTON_2)
85 #define KEY_ACTION              (KEY_MOTION | KEY_BUTTON)
86
87 #define MV_DIR_BIT(x)           ((x) == MV_LEFT  ? MV_BIT_LEFT  :       \
88                                  (x) == MV_RIGHT ? MV_BIT_RIGHT :       \
89                                  (x) == MV_UP    ? MV_BIT_UP    : MV_BIT_DOWN)
90
91 /* values for button status */
92 #define MB_NOT_PRESSED          FALSE
93 #define MB_NOT_RELEASED         TRUE
94 #define MB_RELEASED             FALSE
95 #define MB_PRESSED              TRUE
96 #define MB_MENU_CHOICE          FALSE
97 #define MB_MENU_MARK            TRUE
98 #define MB_MENU_INITIALIZE      (-1)
99 #define MB_MENU_LEAVE           (-2)
100 #define MB_LEFTBUTTON           1
101 #define MB_MIDDLEBUTTON         2
102 #define MB_RIGHTBUTTON          3
103
104 /* values for redraw_mask */
105 #define REDRAW_NONE             (0)
106 #define REDRAW_ALL              (1 << 0)
107 #define REDRAW_FIELD            (1 << 1)
108 #define REDRAW_TILES            (1 << 2)
109 #define REDRAW_DOOR_1           (1 << 3)
110 #define REDRAW_VIDEO_1          (1 << 4)
111 #define REDRAW_VIDEO_2          (1 << 5)
112 #define REDRAW_VIDEO_3          (1 << 6)
113 #define REDRAW_MICROLEVEL       (1 << 7)
114 #define REDRAW_MICROLABEL       (1 << 8)
115 #define REDRAW_FROM_BACKBUFFER  (1 << 9)
116 #define REDRAW_DOOR_2           (REDRAW_VIDEO_1 | \
117                                  REDRAW_VIDEO_2 | \
118                                  REDRAW_VIDEO_3)
119 #define REDRAW_DOOR_3           (1 << 10)
120 #define REDRAW_DOORS            (REDRAW_DOOR_1 | \
121                                  REDRAW_DOOR_2 | \
122                                  REDRAW_DOOR_3)
123 #define REDRAW_MAIN             (REDRAW_FIELD | \
124                                  REDRAW_TILES | \
125                                  REDRAW_MICROLEVEL)
126 #define REDRAW_FPS              (1 << 11)
127 #define REDRAWTILES_THRESHOLD   (SCR_FIELDX * SCR_FIELDY / 2)
128
129 /* maximum number of parallel players supported by libgame functions */
130 #define MAX_PLAYERS             4
131
132 /* maximum allowed length of player name */
133 #define MAX_PLAYER_NAME_LEN     10
134
135 /* default name for empty highscore entry */
136 #define EMPTY_PLAYER_NAME       "no name"
137
138 /* default name for unknown player names */
139 #define ANONYMOUS_NAME          "anonymous"
140
141 /* default name for new levels */
142 #define NAMELESS_LEVEL_NAME     "nameless level"
143
144 /* default text for non-existant artwork */
145 #define NOT_AVAILABLE           "(not available)"
146
147 /* default value for undefined filename */
148 #define UNDEFINED_FILENAME      "[NONE]"
149
150 /* default values for undefined configuration file parameters */
151 #define ARG_UNDEFINED           "-1000000"
152 #define ARG_UNDEFINED_VALUE     (atoi(ARG_UNDEFINED))
153
154 /* definitions for game sub-directories */
155 #ifndef RO_GAME_DIR
156 #define RO_GAME_DIR             "."
157 #endif
158
159 #ifndef RW_GAME_DIR
160 #define RW_GAME_DIR             "."
161 #endif
162
163 #define RO_BASE_PATH            RO_GAME_DIR
164 #define RW_BASE_PATH            RW_GAME_DIR
165
166 #define GRAPHICS_DIRECTORY      "graphics"
167 #define SOUNDS_DIRECTORY        "sounds"
168 #define MUSIC_DIRECTORY         "music"
169 #define LEVELS_DIRECTORY        "levels"
170 #define TAPES_DIRECTORY         "tapes"
171 #define SCORES_DIRECTORY        "scores"
172
173 #if !defined(PLATFORM_MSDOS)
174 #define GRAPHICS_SUBDIR         "gfx_classic"
175 #define SOUNDS_SUBDIR           "snd_classic"
176 #define MUSIC_SUBDIR            "mus_classic"
177 #else
178 #define GRAPHICS_SUBDIR         "gfx_orig"
179 #define SOUNDS_SUBDIR           "snd_orig"
180 #define MUSIC_SUBDIR            "mus_orig"
181 #endif
182
183 /* areas in bitmap PIX_DOOR */
184 /* meaning in PIX_DB_DOOR: (3 PAGEs)
185    PAGEX1: 1. buffer for DOOR_1
186    PAGEX2: 2. buffer for DOOR_1
187    PAGEX3: buffer for animations
188 */
189
190 #define DOOR_GFX_PAGESIZE       (gfx.dxsize)
191 #define DOOR_GFX_PAGEX1         (0 * DOOR_GFX_PAGESIZE)
192 #define DOOR_GFX_PAGEX2         (1 * DOOR_GFX_PAGESIZE)
193 #define DOOR_GFX_PAGEX3         (2 * DOOR_GFX_PAGESIZE)
194 #define DOOR_GFX_PAGEX4         (3 * DOOR_GFX_PAGESIZE)
195 #define DOOR_GFX_PAGEX5         (4 * DOOR_GFX_PAGESIZE)
196 #define DOOR_GFX_PAGEX6         (5 * DOOR_GFX_PAGESIZE)
197 #define DOOR_GFX_PAGEX7         (6 * DOOR_GFX_PAGESIZE)
198 #define DOOR_GFX_PAGEX8         (7 * DOOR_GFX_PAGESIZE)
199 #define DOOR_GFX_PAGEY1         (0)
200 #define DOOR_GFX_PAGEY2         (gfx.dysize)
201
202 /* functions for version handling */
203 #define VERSION_IDENT(x,y,z)    ((x) * 10000 + (y) * 100 + (z))
204 #define VERSION_MAJOR(x)        ((x) / 10000)
205 #define VERSION_MINOR(x)        (((x) % 10000) / 100)
206 #define VERSION_PATCH(x)        ((x) % 100)
207
208 /* functions for parent/child process identification */
209 #if defined(PLATFORM_UNIX)
210 #define IS_PARENT_PROCESS()     (audio.mixer_pid != getpid())
211 #define IS_CHILD_PROCESS()      (audio.mixer_pid == getpid())
212 #else
213 #define IS_PARENT_PROCESS()     TRUE
214 #define IS_CHILD_PROCESS()      FALSE
215 #endif
216
217 /* type definitions */
218 typedef int (*EventFilter)(const Event *);
219
220
221 /* structure definitions */
222
223 struct ProgramInfo
224 {
225   char *command_basename;
226   char *userdata_directory;
227
228   char *program_title;
229   char *window_title;
230   char *icon_title;
231
232   char *x11_icon_filename;
233   char *x11_iconmask_filename;
234   char *msdos_pointer_filename;
235
236   char *cookie_prefix;
237   char *filename_prefix;        /* prefix to cut off from DOS filenames */
238
239   int version_major;
240   int version_minor;
241   int version_patch;
242
243   void (*exit_function)(int);
244 };
245
246 struct OptionInfo
247 {
248   char *display_name;
249   char *server_host;
250   int server_port;
251
252   char *ro_base_directory;
253   char *rw_base_directory;
254   char *level_directory;
255   char *graphics_directory;
256   char *sounds_directory;
257   char *music_directory;
258   char *execute_command;
259
260   boolean serveronly;
261   boolean network;
262   boolean verbose;
263   boolean debug;
264 };
265
266 struct VideoSystemInfo
267 {
268   int default_depth;
269   int width, height, depth;
270   boolean fullscreen_available;
271   boolean fullscreen_enabled;
272 };
273
274 struct AudioSystemInfo
275 {
276   boolean sound_available;
277   boolean loops_available;
278   boolean music_available;
279
280   boolean sound_enabled;
281   boolean sound_deactivated;    /* for temporarily disabling sound */
282
283   int mixer_pipe[2];
284   int mixer_pid;
285   char *device_name;
286   int device_fd;
287
288   int num_channels;
289   int music_channel;
290   int first_sound_channel;
291 };
292
293 struct FontInfo
294 {
295   Bitmap *bitmap;
296   int src_x, src_y;             /* start position of animation frames */
297   int width, height;            /* width/height of each animation frame */
298   int draw_x, draw_y;           /* offset for drawing font characters */
299
300 #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
301   Pixmap *clip_mask;            /* single-char-only clip mask array for X11 */
302 #endif
303 };
304
305 struct GfxInfo
306 {
307   int sx, sy;
308   int sxsize, sysize;
309   int real_sx, real_sy;
310   int full_sxsize, full_sysize;
311   int scrollbuffer_width, scrollbuffer_height;
312
313   int dx, dy;
314   int dxsize, dysize;
315
316   int vx, vy;
317   int vxsize, vysize;
318
319   int draw_deactivation_mask;
320   int draw_background_mask;
321
322   Bitmap *background_bitmap;
323   int background_bitmap_mask;
324
325   boolean menu_main_hide_static_text;
326
327   int num_fonts;
328   struct FontInfo *font;
329 };
330
331 struct AnimInfo
332 {
333   int random_frame;
334 };
335
336 struct JoystickInfo
337 {
338   int status;
339   int fd[MAX_PLAYERS];          /* file descriptor of player's joystick */
340 };
341
342 struct SetupJoystickInfo
343 {
344   char *device_name;            /* device name of player's joystick */
345
346   int xleft, xmiddle, xright;
347   int yupper, ymiddle, ylower;
348   int snap;
349   int bomb;
350 };
351
352 struct SetupKeyboardInfo
353 {
354   Key left;
355   Key right;
356   Key up;
357   Key down;
358   Key snap;
359   Key bomb;
360 };
361
362 struct SetupInputInfo
363 {
364   boolean use_joystick;
365   struct SetupJoystickInfo joy;
366   struct SetupKeyboardInfo key;
367 };
368
369 struct SetupEditorInfo
370 {
371   boolean el_boulderdash;
372   boolean el_emerald_mine;
373   boolean el_more;
374   boolean el_sokoban;
375   boolean el_supaplex;
376   boolean el_diamond_caves;
377   boolean el_dx_boulderdash;
378   boolean el_chars;
379   boolean el_custom;
380 };
381
382 struct SetupShortcutInfo
383 {
384   Key save_game;
385   Key load_game;
386   Key toggle_pause;
387 };
388
389 struct SetupInfo
390 {
391   char *player_name;
392
393   boolean sound;
394   boolean sound_loops;
395   boolean sound_music;
396   boolean sound_simple;
397   boolean toons;
398   boolean double_buffering;
399   boolean direct_draw;          /* !double_buffering (redundant!) */
400   boolean scroll_delay;
401   boolean soft_scrolling;
402   boolean fading;
403   boolean autorecord;
404   boolean quick_doors;
405   boolean team_mode;
406   boolean handicap;
407   boolean time_limit;
408   boolean fullscreen;
409   boolean ask_on_escape;
410
411   char *graphics_set;
412   char *sounds_set;
413   char *music_set;
414   boolean override_level_graphics;
415   boolean override_level_sounds;
416   boolean override_level_music;
417
418   struct SetupEditorInfo editor;
419   struct SetupShortcutInfo shortcut;
420   struct SetupInputInfo input[MAX_PLAYERS];
421 };
422
423 #define TREE_TYPE_GENERIC               0
424 #define TREE_TYPE_GRAPHICS_DIR          1
425 #define TREE_TYPE_SOUNDS_DIR            2
426 #define TREE_TYPE_MUSIC_DIR             3
427 #define TREE_TYPE_LEVEL_DIR             4
428
429 #define ARTWORK_TYPE_GRAPHICS           TREE_TYPE_GRAPHICS_DIR
430 #define ARTWORK_TYPE_SOUNDS             TREE_TYPE_SOUNDS_DIR
431 #define ARTWORK_TYPE_MUSIC              TREE_TYPE_MUSIC_DIR
432
433 struct TreeInfo
434 {
435   struct TreeInfo **node_top;           /* topmost node in tree */
436   struct TreeInfo *node_parent;         /* parent level directory info */
437   struct TreeInfo *node_group;          /* level group sub-directory info */
438   struct TreeInfo *next;                /* next level series structure node */
439
440   int cl_first;         /* internal control field for setup screen */
441   int cl_cursor;        /* internal control field for setup screen */
442
443   int type;             /* type of tree content */
444
445   /* fields for "type == TREE_TYPE_LEVEL_DIR" */
446
447   char *filename;       /* tree info sub-directory basename (may be ".") */
448   char *fullpath;       /* complete path relative to tree base directory */
449   char *basepath;       /* absolute base path of tree base directory */
450   char *identifier;     /* identifier string for configuration files */
451   char *name;           /* tree info name, as displayed in selection menues */
452   char *name_sorting;   /* optional sorting name for correct name sorting */
453   char *author;         /* level or artwork author name */
454   char *imported_from;  /* optional comment for imported levels or artwork */
455
456   char *graphics_set;   /* optional custom graphics set (level tree only) */
457   char *sounds_set;     /* optional custom sounds set (level tree only) */
458   char *music_set;      /* optional custom music set (level tree only) */
459   char *graphics_path;  /* path to optional custom graphics set (level only) */
460   char *sounds_path;    /* path to optional custom sounds set (level only) */
461   char *music_path;     /* path to optional custom music set (level only) */
462
463   int levels;           /* number of levels in level series */
464   int first_level;      /* first level number (to allow start with 0 or 1) */
465   int last_level;       /* last level number (automatically calculated) */
466   int sort_priority;    /* sort levels by 'sort_priority' and then by name */
467
468   boolean level_group;  /* directory contains more level series directories */
469   boolean parent_link;  /* entry links back to parent directory */
470   boolean user_defined; /* user defined levels are stored in home directory */
471   boolean readonly;     /* readonly levels can not be changed with editor */
472
473   int color;            /* color to use on selection screen for this level */
474   char *class_desc;     /* description of level series class */
475   int handicap_level;   /* number of the lowest unsolved level */
476 };
477
478 typedef struct TreeInfo TreeInfo;
479 typedef struct TreeInfo LevelDirTree;
480 typedef struct TreeInfo ArtworkDirTree;
481 typedef struct TreeInfo GraphicsDirTree;
482 typedef struct TreeInfo SoundsDirTree;
483 typedef struct TreeInfo MusicDirTree;
484
485 struct ArtworkInfo
486 {
487   GraphicsDirTree *gfx_first;
488   GraphicsDirTree *gfx_current;
489   SoundsDirTree *snd_first;
490   SoundsDirTree *snd_current;
491   MusicDirTree *mus_first;
492   MusicDirTree *mus_current;
493
494   char *gfx_current_identifier;
495   char *snd_current_identifier;
496   char *mus_current_identifier;
497 };
498
499 struct ConfigInfo
500 {
501   char *token;
502   char *value;
503   int type;
504 };
505
506 struct FileInfo
507 {
508   char *token;
509
510   char *default_filename;
511   char *filename;
512
513   char **default_parameter;                     /* array of file parameters */
514   char **parameter;                             /* array of file parameters */
515
516   boolean redefined;
517 };
518
519 struct SetupFileList
520 {
521   char *token;
522   char *value;
523
524   struct SetupFileList *next;
525 };
526
527 struct ListNodeInfo
528 {
529   char *source_filename;                        /* primary key for node list */
530   int num_references;
531 };
532
533 struct PropertyMapping
534 {
535   int base_index;
536   int ext1_index;
537   int ext2_index;
538   int ext3_index;
539
540   int artwork_index;
541 };
542
543 struct ArtworkListInfo
544 {
545   int type;                                     /* type of artwork */
546
547   int num_file_list_entries;
548   int num_dynamic_file_list_entries;
549   struct FileInfo *file_list;                   /* static artwork file array */
550   struct FileInfo *dynamic_file_list;           /* dynamic artwrk file array */
551
552   int num_suffix_list_entries;
553   struct ConfigInfo *suffix_list;               /* parameter suffixes array */
554
555   int num_base_prefixes;
556   int num_ext1_suffixes;
557   int num_ext2_suffixes;
558   int num_ext3_suffixes;
559   char **base_prefixes;                         /* base token prefixes array */
560   char **ext1_suffixes;                         /* property suffixes array 1 */
561   char **ext2_suffixes;                         /* property suffixes array 2 */
562   char **ext3_suffixes;                         /* property suffixes array 3 */
563
564   int num_ignore_tokens;
565   char **ignore_tokens;                         /* file tokens to be ignored */
566
567   int num_property_mapping_entries;
568   struct PropertyMapping *property_mapping;     /* mapping token -> artwork */
569
570   int sizeof_artwork_list_entry;
571
572   struct ListNodeInfo **artwork_list;           /* static artwork node array */
573   struct ListNodeInfo **dynamic_artwork_list;   /* dynamic artwrk node array */
574   struct ListNode *content_list;                /* dynamic artwork node list */
575
576   void *(*load_artwork)(char *);                /* constructor function */
577   void (*free_artwork)(void *);                 /* destructor function */
578 };
579
580
581 /* ========================================================================= */
582 /* exported variables                                                        */
583 /* ========================================================================= */
584
585 extern struct ProgramInfo       program;
586 extern struct OptionInfo        options;
587 extern struct VideoSystemInfo   video;
588 extern struct AudioSystemInfo   audio;
589 extern struct GfxInfo           gfx;
590 extern struct AnimInfo          anim;
591 extern struct ArtworkInfo       artwork;
592 extern struct JoystickInfo      joystick;
593 extern struct SetupInfo         setup;
594
595 extern LevelDirTree            *leveldir_first;
596 extern LevelDirTree            *leveldir_current;
597 extern int                      level_nr;
598
599 extern Display                 *display;
600 extern Visual                  *visual;
601 extern int                      screen;
602 extern Colormap                 cmap;
603
604 extern DrawWindow              *window;
605 extern DrawBuffer              *backbuffer;
606 extern DrawBuffer              *drawto;
607
608 extern int                      button_status;
609 extern boolean                  motion_status;
610
611 extern int                      redraw_mask;
612 extern int                      redraw_tiles;
613
614 extern int                      FrameCounter;
615
616
617 /* function definitions */
618
619 void InitCommandName(char *);
620 void InitExitFunction(void (*exit_function)(int));
621 void InitPlatformDependantStuff(void);
622 void ClosePlatformDependantStuff(void);
623
624 void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *,
625                      char *, char *, int);
626
627 void InitGfxFieldInfo(int, int, int, int, int, int, int, int);
628 void InitGfxDoor1Info(int, int, int, int);
629 void InitGfxDoor2Info(int, int, int, int);
630 void InitGfxScrollbufferInfo(int, int);
631 void SetDrawDeactivationMask(int);
632 void SetDrawBackgroundMask(int);
633 void SetMainBackgroundBitmap(Bitmap *);
634 void SetDoorBackgroundBitmap(Bitmap *);
635
636 inline void InitVideoDisplay(void);
637 inline void CloseVideoDisplay(void);
638 inline void InitVideoBuffer(DrawBuffer **,DrawWindow **, int,int,int, boolean);
639 inline Bitmap *CreateBitmapStruct(void);
640 inline Bitmap *CreateBitmap(int, int, int);
641 inline void FreeBitmap(Bitmap *);
642 inline void BlitBitmap(Bitmap *, Bitmap *, int, int, int, int, int, int);
643 inline void ClearRectangle(Bitmap *, int, int, int, int);
644 inline void ClearRectangleOnBackground(Bitmap *, int, int, int, int);
645 inline void SetClipMask(Bitmap *, GC, Pixmap);
646 inline void SetClipOrigin(Bitmap *, GC, int, int);
647 inline void BlitBitmapMasked(Bitmap *, Bitmap *, int, int, int, int, int, int);
648 inline boolean DrawingOnBackground(int, int);
649 inline void BlitBitmapOnBackground(Bitmap *, Bitmap *, int, int, int, int, int,
650                                    int);
651 inline void DrawSimpleWhiteLine(Bitmap *, int, int, int, int);
652 inline void DrawLines(Bitmap *, struct XY *, int, Pixel);
653 inline Pixel GetPixel(Bitmap *, int, int);
654 inline Pixel GetPixelFromRGB(Bitmap *, unsigned int,unsigned int,unsigned int);
655 inline Pixel GetPixelFromRGBcompact(Bitmap *, unsigned int);
656
657 inline void FlushDisplay(void);
658 inline void SyncDisplay(void);
659 inline void KeyboardAutoRepeatOn(void);
660 inline void KeyboardAutoRepeatOff(void);
661 inline boolean PointerInWindow(DrawWindow *);
662 inline boolean SetVideoMode(boolean);
663 inline boolean ChangeVideoModeIfNeeded(boolean);
664
665 Bitmap *LoadImage(char *);
666 Bitmap *LoadCustomImage(char *);
667 void ReloadCustomImage(Bitmap *, char *);
668
669 Bitmap *ZoomBitmap(Bitmap *, int, int);
670 void CreateBitmapWithSmallBitmaps(Bitmap *);
671
672 inline void OpenAudio(void);
673 inline void CloseAudio(void);
674 inline void SetAudioMode(boolean);
675
676 inline void InitEventFilter(EventFilter);
677 inline boolean PendingEvent(void);
678 inline void NextEvent(Event *event);
679 inline Key GetEventKey(KeyEvent *, boolean);
680 inline boolean CheckCloseWindowEvent(ClientMessageEvent *);
681
682 inline void InitJoysticks();
683 inline boolean ReadJoystick(int, int *, int *, boolean *, boolean *);
684
685 #endif /* SYSTEM_H */