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