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