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