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