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