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