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