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