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