1 /***********************************************************
2 * Artsoft Retro-Game Library *
3 *----------------------------------------------------------*
4 * (c) 1994-2002 Artsoft Entertainment *
6 * Detmolder Strasse 189 *
9 * e-mail: info@artsoft.org *
10 *----------------------------------------------------------*
12 ***********************************************************/
21 #if defined(PLATFORM_MACOSX)
23 #elif defined(PLATFORM_WIN32)
25 #elif defined(PLATFORM_MSDOS)
29 #if defined(TARGET_SDL)
31 #elif defined(TARGET_X11)
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"
41 #define DEFAULT_DEPTH 0
45 #define BLIT_INVERSE 2
46 #define BLIT_ON_BACKGROUND 3
48 #define FULLSCREEN_NOT_AVAILABLE FALSE
49 #define FULLSCREEN_AVAILABLE TRUE
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_DROP KSYM_KP_Enter
60 #define DEFAULT_KEY_SNAP KSYM_Control_L
61 #define DEFAULT_KEY_DROP KSYM_Control_R
63 #define DEFAULT_KEY_OKAY KSYM_Return
64 #define DEFAULT_KEY_CANCEL KSYM_Escape
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
71 /* values for key_status */
72 #define KEY_NOT_PRESSED FALSE
73 #define KEY_RELEASED FALSE
74 #define KEY_PRESSED TRUE
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
90 /* values for move directions */
92 #define MV_BIT_RIGHT 1
96 #define NUM_DIRECTIONS 4
98 /* values for special "button" bitmasks */
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)
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)
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)
120 /* values for animation mode (frame order and direction) */
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)
129 /* values for special (non game element) animation modes */
130 #define ANIM_HORIZONTAL (1 << 6)
131 #define ANIM_VERTICAL (1 << 7)
133 #define ANIM_DEFAULT ANIM_LOOP
135 /* values for redraw_mask */
136 #define REDRAW_NONE (0)
137 #define REDRAW_ALL (1 << 0)
138 #define REDRAW_FIELD (1 << 1)
139 #define REDRAW_TILES (1 << 2)
140 #define REDRAW_DOOR_1 (1 << 3)
141 #define REDRAW_VIDEO_1 (1 << 4)
142 #define REDRAW_VIDEO_2 (1 << 5)
143 #define REDRAW_VIDEO_3 (1 << 6)
144 #define REDRAW_MICROLEVEL (1 << 7)
145 #define REDRAW_MICROLABEL (1 << 8)
146 #define REDRAW_FROM_BACKBUFFER (1 << 9)
147 #define REDRAW_DOOR_2 (REDRAW_VIDEO_1 | \
150 #define REDRAW_DOOR_3 (1 << 10)
151 #define REDRAW_DOORS (REDRAW_DOOR_1 | \
154 #define REDRAW_MAIN (REDRAW_FIELD | \
157 #define REDRAW_FPS (1 << 11)
158 #define REDRAWTILES_THRESHOLD (SCR_FIELDX * SCR_FIELDY / 2)
160 #define IN_GFX_SCREEN(x, y) (x >= gfx.sx && x < gfx.sx + gfx.sxsize && \
161 y >= gfx.sy && y < gfx.sy + gfx.sysize)
162 #define IN_GFX_DOOR(x, y) (x >= gfx.dx && x < gfx.dx + gfx.dxsize && \
163 y >= gfx.dy && y < gfx.dy + gfx.dysize)
164 #define IN_GFX_VIDEO(x, y) (x >= gfx.vx && x < gfx.vx + gfx.vxsize && \
165 y >= gfx.vy && y < gfx.vy + gfx.vysize)
167 /* values for mouse cursor */
168 #define CURSOR_DEFAULT 0
169 #define CURSOR_PLAYFIELD 1
172 /* maximum number of parallel players supported by libgame functions */
173 #define MAX_PLAYERS 4
175 /* maximum allowed length of player name */
176 #define MAX_PLAYER_NAME_LEN 10
178 /* default name for empty highscore entry */
179 #define EMPTY_PLAYER_NAME "no name"
181 /* default name for unknown player names */
182 #define ANONYMOUS_NAME "anonymous"
184 /* default for other unknown names */
185 #define UNKNOWN_NAME "unknown"
187 /* default name for new levels */
188 #define NAMELESS_LEVEL_NAME "nameless level"
190 /* default text for non-existant artwork */
191 #define NOT_AVAILABLE "(not available)"
193 /* default value for undefined filename */
194 #define UNDEFINED_FILENAME "[NONE]"
196 /* default value for undefined parameter */
197 #define ARG_DEFAULT "[DEFAULT]"
199 /* default values for undefined configuration file parameters */
200 #define ARG_UNDEFINED "-1000000"
201 #define ARG_UNDEFINED_VALUE (atoi(ARG_UNDEFINED))
203 /* definitions for game sub-directories */
205 #define RO_GAME_DIR "."
209 #define RW_GAME_DIR "."
212 #define RO_BASE_PATH RO_GAME_DIR
213 #define RW_BASE_PATH RW_GAME_DIR
215 /* directory names */
216 #define GRAPHICS_DIRECTORY "graphics"
217 #define SOUNDS_DIRECTORY "sounds"
218 #define MUSIC_DIRECTORY "music"
219 #define LEVELS_DIRECTORY "levels"
220 #define TAPES_DIRECTORY "tapes"
221 #define SCORES_DIRECTORY "scores"
222 #define DOCS_DIRECTORY "docs"
224 #if !defined(PLATFORM_MSDOS)
225 #define GFX_CLASSIC_SUBDIR "gfx_classic"
226 #define SND_CLASSIC_SUBDIR "snd_classic"
227 #define MUS_CLASSIC_SUBDIR "mus_classic"
229 #define GFX_CLASSIC_SUBDIR "gfx_orig"
230 #define SND_CLASSIC_SUBDIR "snd_orig"
231 #define MUS_CLASSIC_SUBDIR "mus_orig"
234 /* file names and filename extensions */
235 #if !defined(PLATFORM_MSDOS)
236 #define LEVELSETUP_DIRECTORY "levelsetup"
237 #define SETUP_FILENAME "setup.conf"
238 #define LEVELSETUP_FILENAME "levelsetup.conf"
239 #define EDITORSETUP_FILENAME "editorsetup.conf"
240 #define HELPANIM_FILENAME "helpanim.conf"
241 #define HELPTEXT_FILENAME "helptext.conf"
242 #define LEVELINFO_FILENAME "levelinfo.conf"
243 #define GRAPHICSINFO_FILENAME "graphicsinfo.conf"
244 #define SOUNDSINFO_FILENAME "soundsinfo.conf"
245 #define MUSICINFO_FILENAME "musicinfo.conf"
246 #define LEVELFILE_EXTENSION "level"
247 #define TAPEFILE_EXTENSION "tape"
248 #define SCOREFILE_EXTENSION "score"
250 #define LEVELSETUP_DIRECTORY "lvlsetup"
251 #define SETUP_FILENAME "setup.cnf"
252 #define LEVELSETUP_FILENAME "lvlsetup.cnf"
253 #define EDITORSETUP_FILENAME "edsetup.cnf"
254 #define HELPANIM_FILENAME "helpanim.conf"
255 #define HELPTEXT_FILENAME "helptext.conf"
256 #define LEVELINFO_FILENAME "lvlinfo.cnf"
257 #define GRAPHICSINFO_FILENAME "gfxinfo.cnf"
258 #define SOUNDSINFO_FILENAME "sndinfo.cnf"
259 #define MUSICINFO_FILENAME "musinfo.cnf"
260 #define LEVELFILE_EXTENSION "lvl"
261 #define TAPEFILE_EXTENSION "tap"
262 #define SCOREFILE_EXTENSION "sco"
266 /* areas in bitmap PIX_DOOR */
267 /* meaning in PIX_DB_DOOR: (3 PAGEs)
268 PAGEX1: 1. buffer for DOOR_1
269 PAGEX2: 2. buffer for DOOR_1
270 PAGEX3: buffer for animations
273 #define DOOR_GFX_PAGESIZE (gfx.dxsize)
274 #define DOOR_GFX_PAGEX1 (0 * DOOR_GFX_PAGESIZE)
275 #define DOOR_GFX_PAGEX2 (1 * DOOR_GFX_PAGESIZE)
276 #define DOOR_GFX_PAGEX3 (2 * DOOR_GFX_PAGESIZE)
277 #define DOOR_GFX_PAGEX4 (3 * DOOR_GFX_PAGESIZE)
278 #define DOOR_GFX_PAGEX5 (4 * DOOR_GFX_PAGESIZE)
279 #define DOOR_GFX_PAGEX6 (5 * DOOR_GFX_PAGESIZE)
280 #define DOOR_GFX_PAGEX7 (6 * DOOR_GFX_PAGESIZE)
281 #define DOOR_GFX_PAGEX8 (7 * DOOR_GFX_PAGESIZE)
282 #define DOOR_GFX_PAGEY1 (0)
283 #define DOOR_GFX_PAGEY2 (gfx.dysize)
286 /* macros for version handling */
287 #define VERSION_MAJOR(x) ((x) / 1000000)
288 #define VERSION_MINOR(x) (((x) % 1000000) / 10000)
289 #define VERSION_PATCH(x) (((x) % 10000) / 100)
290 #define VERSION_BUILD(x) ((x) % 100)
291 #define VERSION_IDENT(a,b,c,d) ((a) * 1000000 + (b) * 10000 + (c) * 100 + (d))
294 /* macros for parent/child process identification */
295 #if defined(PLATFORM_UNIX)
296 #define IS_PARENT_PROCESS() (audio.mixer_pid != getpid())
297 #define IS_CHILD_PROCESS() (audio.mixer_pid == getpid())
298 #define HAS_CHILD_PROCESS() (audio.mixer_pid > 0)
300 #define IS_PARENT_PROCESS() TRUE
301 #define IS_CHILD_PROCESS() FALSE
302 #define HAS_CHILD_PROCESS() FALSE
306 /* values for artwork type */
307 #define ARTWORK_TYPE_GRAPHICS 0
308 #define ARTWORK_TYPE_SOUNDS 1
309 #define ARTWORK_TYPE_MUSIC 2
311 #define NUM_ARTWORK_TYPES 3
314 /* values for tree type (chosen to match artwork type) */
315 #define TREE_TYPE_UNDEFINED -1
316 #define TREE_TYPE_GRAPHICS_DIR ARTWORK_TYPE_GRAPHICS
317 #define TREE_TYPE_SOUNDS_DIR ARTWORK_TYPE_SOUNDS
318 #define TREE_TYPE_MUSIC_DIR ARTWORK_TYPE_MUSIC
319 #define TREE_TYPE_LEVEL_DIR 3
321 #define NUM_TREE_TYPES 4
324 /* values for artwork handling */
325 #define LEVELDIR_ARTWORK_SET(leveldir, type) \
326 ((type) == ARTWORK_TYPE_GRAPHICS ? \
327 (leveldir)->graphics_set : \
328 (type) == ARTWORK_TYPE_SOUNDS ? \
329 (leveldir)->sounds_set : \
330 (leveldir)->music_set)
332 #define LEVELDIR_ARTWORK_PATH(leveldir, type) \
333 ((type) == ARTWORK_TYPE_GRAPHICS ? \
334 (leveldir)->graphics_path : \
335 (type) == ARTWORK_TYPE_SOUNDS ? \
336 (leveldir)->sounds_path : \
337 (leveldir)->music_path)
339 #define SETUP_ARTWORK_SET(setup, type) \
340 ((type) == ARTWORK_TYPE_GRAPHICS ? \
341 (setup).graphics_set : \
342 (type) == ARTWORK_TYPE_SOUNDS ? \
343 (setup).sounds_set : \
346 #define SETUP_OVERRIDE_ARTWORK(setup, type) \
347 ((type) == ARTWORK_TYPE_GRAPHICS ? \
348 (setup).override_level_graphics : \
349 (type) == ARTWORK_TYPE_SOUNDS ? \
350 (setup).override_level_sounds : \
351 (setup).override_level_music)
353 #define ARTWORK_FIRST_NODE(artwork, type) \
354 ((type) == ARTWORK_TYPE_GRAPHICS ? \
355 (artwork).gfx_first : \
356 (type) == ARTWORK_TYPE_SOUNDS ? \
357 (artwork).snd_first : \
360 #define ARTWORK_CURRENT_IDENTIFIER(artwork, type) \
361 ((type) == ARTWORK_TYPE_GRAPHICS ? \
362 (artwork).gfx_current_identifier : \
363 (type) == ARTWORK_TYPE_SOUNDS ? \
364 (artwork).snd_current_identifier : \
365 (artwork).mus_current_identifier)
367 #define ARTWORKINFO_FILENAME(type) \
368 ((type) == ARTWORK_TYPE_GRAPHICS ? \
369 GRAPHICSINFO_FILENAME : \
370 (type) == ARTWORK_TYPE_SOUNDS ? \
371 SOUNDSINFO_FILENAME : \
372 (type) == ARTWORK_TYPE_MUSIC ? \
373 MUSICINFO_FILENAME : "")
375 #define ARTWORK_DIRECTORY(type) \
376 ((type) == ARTWORK_TYPE_GRAPHICS ? \
377 GRAPHICS_DIRECTORY : \
378 (type) == ARTWORK_TYPE_SOUNDS ? \
380 (type) == ARTWORK_TYPE_MUSIC ? \
381 MUSIC_DIRECTORY : "")
383 #define OPTIONS_ARTWORK_DIRECTORY(type) \
384 ((type) == ARTWORK_TYPE_GRAPHICS ? \
385 options.graphics_directory : \
386 (type) == ARTWORK_TYPE_SOUNDS ? \
387 options.sounds_directory : \
388 (type) == ARTWORK_TYPE_MUSIC ? \
389 options.music_directory : "")
392 /* type definitions */
393 typedef int (*EventFilter)(const Event *);
396 /* structure definitions */
400 char *command_basename;
401 char *userdata_directory;
407 char *x11_icon_filename;
408 char *x11_iconmask_filename;
409 char *msdos_cursor_filename;
412 char *filename_prefix; /* prefix to cut off from DOS filenames */
418 void (*exit_function)(int);
427 char *ro_base_directory;
428 char *rw_base_directory;
429 char *level_directory;
430 char *graphics_directory;
431 char *sounds_directory;
432 char *music_directory;
433 char *docs_directory;
434 char *execute_command;
442 struct VideoSystemInfo
445 int width, height, depth;
446 boolean fullscreen_available;
447 boolean fullscreen_enabled;
450 struct AudioSystemInfo
452 boolean sound_available;
453 boolean loops_available;
454 boolean music_available;
456 boolean sound_enabled;
457 boolean sound_deactivated; /* for temporarily disabling sound */
466 int first_sound_channel;
469 struct FontBitmapInfo
472 int src_x, src_y; /* start position of animation frames */
473 int width, height; /* width/height of each animation frame */
474 int draw_x, draw_y; /* offset for drawing font characters */
476 int num_chars_per_line;
478 #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
479 Pixmap *clip_mask; /* single-char-only clip mask array for X11 */
487 int real_sx, real_sy;
488 int full_sxsize, full_sysize;
489 int scrollbuffer_width, scrollbuffer_height;
497 int draw_deactivation_mask;
498 int draw_background_mask;
500 Bitmap *field_save_buffer;
502 Bitmap *background_bitmap;
503 int background_bitmap_mask;
506 struct FontBitmapInfo *font_bitmap_info;
507 int (*select_font_function)(int);
509 int anim_random_frame;
515 int fd[MAX_PLAYERS]; /* file descriptor of player's joystick */
518 struct SetupJoystickInfo
520 char *device_name; /* device name of player's joystick */
522 int xleft, xmiddle, xright;
523 int yupper, ymiddle, ylower;
527 struct SetupKeyboardInfo
529 Key left, right, up, down;
533 struct SetupInputInfo
535 boolean use_joystick;
536 struct SetupJoystickInfo joy;
537 struct SetupKeyboardInfo key;
540 struct SetupEditorInfo
542 boolean el_boulderdash;
543 boolean el_emerald_mine;
547 boolean el_diamond_caves;
548 boolean el_dx_boulderdash;
551 boolean el_custom_more;
552 boolean el_user_defined;
554 boolean el_headlines;
557 struct SetupShortcutInfo
564 struct SetupSystemInfo
566 char *sdl_audiodriver;
567 int audio_fragment_size;
577 boolean sound_simple;
579 boolean double_buffering;
580 boolean direct_draw; /* !double_buffering (redundant!) */
581 boolean scroll_delay;
582 boolean soft_scrolling;
590 boolean ask_on_escape;
595 boolean override_level_graphics;
596 boolean override_level_sounds;
597 boolean override_level_music;
599 struct SetupEditorInfo editor;
600 struct SetupShortcutInfo shortcut;
601 struct SetupInputInfo input[MAX_PLAYERS];
602 struct SetupSystemInfo system;
603 struct OptionInfo options;
608 struct TreeInfo **node_top; /* topmost node in tree */
609 struct TreeInfo *node_parent; /* parent level directory info */
610 struct TreeInfo *node_group; /* level group sub-directory info */
611 struct TreeInfo *next; /* next level series structure node */
613 int cl_first; /* internal control field for setup screen */
614 int cl_cursor; /* internal control field for setup screen */
616 int type; /* type of tree content */
618 /* fields for "type == TREE_TYPE_LEVEL_DIR" */
620 char *filename; /* tree info sub-directory basename (may be ".") */
621 char *fullpath; /* complete path relative to tree base directory */
622 char *basepath; /* absolute base path of tree base directory */
623 char *identifier; /* identifier string for configuration files */
624 char *name; /* tree info name, as displayed in selection menues */
625 char *name_sorting; /* optional sorting name for correct name sorting */
626 char *author; /* level or artwork author name */
627 char *imported_from; /* optional comment for imported levels or artwork */
629 char *graphics_set; /* optional custom graphics set (level tree only) */
630 char *sounds_set; /* optional custom sounds set (level tree only) */
631 char *music_set; /* optional custom music set (level tree only) */
632 char *graphics_path; /* path to optional custom graphics set (level only) */
633 char *sounds_path; /* path to optional custom sounds set (level only) */
634 char *music_path; /* path to optional custom music set (level only) */
636 int levels; /* number of levels in level series */
637 int first_level; /* first level number (to allow start with 0 or 1) */
638 int last_level; /* last level number (automatically calculated) */
639 int sort_priority; /* sort levels by 'sort_priority' and then by name */
641 boolean latest_engine;/* force level set to use the latest game engine */
643 boolean level_group; /* directory contains more level series directories */
644 boolean parent_link; /* entry links back to parent directory */
645 boolean user_defined; /* user defined levels are stored in home directory */
646 boolean readonly; /* readonly levels can not be changed with editor */
648 int color; /* color to use on selection screen for this level */
649 char *class_desc; /* description of level series class */
650 int handicap_level; /* number of the lowest unsolved level */
653 typedef struct TreeInfo TreeInfo;
654 typedef struct TreeInfo LevelDirTree;
655 typedef struct TreeInfo ArtworkDirTree;
656 typedef struct TreeInfo GraphicsDirTree;
657 typedef struct TreeInfo SoundsDirTree;
658 typedef struct TreeInfo MusicDirTree;
662 GraphicsDirTree *gfx_first;
663 GraphicsDirTree *gfx_current;
664 SoundsDirTree *snd_first;
665 SoundsDirTree *snd_current;
666 MusicDirTree *mus_first;
667 MusicDirTree *mus_current;
669 char *gfx_current_identifier;
670 char *snd_current_identifier;
671 char *mus_current_identifier;
687 struct TokenIntPtrInfo
697 char *default_filename;
700 char **default_parameter; /* array of file parameters */
701 char **parameter; /* array of file parameters */
711 struct SetupFileList *next;
716 char *source_filename; /* primary key for node list */
720 struct PropertyMapping
730 struct ArtworkListInfo
732 int type; /* type of artwork */
734 int num_file_list_entries;
735 int num_dynamic_file_list_entries;
736 struct FileInfo *file_list; /* static artwork file array */
737 struct FileInfo *dynamic_file_list; /* dynamic artwrk file array */
739 int num_suffix_list_entries;
740 struct ConfigInfo *suffix_list; /* parameter suffixes array */
742 int num_base_prefixes;
743 int num_ext1_suffixes;
744 int num_ext2_suffixes;
745 int num_ext3_suffixes;
746 char **base_prefixes; /* base token prefixes array */
747 char **ext1_suffixes; /* property suffixes array 1 */
748 char **ext2_suffixes; /* property suffixes array 2 */
749 char **ext3_suffixes; /* property suffixes array 3 */
751 int num_ignore_tokens;
752 char **ignore_tokens; /* file tokens to be ignored */
754 int num_property_mapping_entries;
755 struct PropertyMapping *property_mapping; /* mapping token -> artwork */
757 int sizeof_artwork_list_entry;
759 struct ListNodeInfo **artwork_list; /* static artwork node array */
760 struct ListNodeInfo **dynamic_artwork_list; /* dynamic artwrk node array */
761 struct ListNode *content_list; /* dynamic artwork node list */
763 void *(*load_artwork)(char *); /* constructor function */
764 void (*free_artwork)(void *); /* destructor function */
768 /* ========================================================================= */
769 /* exported variables */
770 /* ========================================================================= */
772 extern struct ProgramInfo program;
773 extern struct OptionInfo options;
774 extern struct VideoSystemInfo video;
775 extern struct AudioSystemInfo audio;
776 extern struct GfxInfo gfx;
777 extern struct AnimInfo anim;
778 extern struct ArtworkInfo artwork;
779 extern struct JoystickInfo joystick;
780 extern struct SetupInfo setup;
782 extern LevelDirTree *leveldir_first;
783 extern LevelDirTree *leveldir_current;
786 extern Display *display;
787 extern Visual *visual;
789 extern Colormap cmap;
791 extern DrawWindow *window;
792 extern DrawBuffer *backbuffer;
793 extern DrawBuffer *drawto;
795 extern int button_status;
796 extern boolean motion_status;
798 extern int redraw_mask;
799 extern int redraw_tiles;
801 extern int FrameCounter;
804 /* function definitions */
806 void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *,
807 char *, char *, char *, int);
809 void InitExitFunction(void (*exit_function)(int));
810 void InitPlatformDependentStuff(void);
811 void ClosePlatformDependentStuff(void);
813 void InitGfxFieldInfo(int, int, int, int, int, int, int, int, Bitmap *);
814 void InitGfxDoor1Info(int, int, int, int);
815 void InitGfxDoor2Info(int, int, int, int);
816 void InitGfxScrollbufferInfo(int, int);
817 void SetDrawDeactivationMask(int);
818 void SetDrawBackgroundMask(int);
819 void SetMainBackgroundBitmap(Bitmap *);
820 void SetDoorBackgroundBitmap(Bitmap *);
822 inline void InitVideoDisplay(void);
823 inline void CloseVideoDisplay(void);
824 inline void InitVideoBuffer(DrawBuffer **,DrawWindow **, int,int,int, boolean);
825 inline Bitmap *CreateBitmapStruct(void);
826 inline Bitmap *CreateBitmap(int, int, int);
827 inline void FreeBitmap(Bitmap *);
828 inline void BlitBitmap(Bitmap *, Bitmap *, int, int, int, int, int, int);
829 inline void FillRectangle(Bitmap *, int, int, int, int, Pixel);
830 inline void ClearRectangle(Bitmap *, int, int, int, int);
831 inline void ClearRectangleOnBackground(Bitmap *, int, int, int, int);
832 inline void SetClipMask(Bitmap *, GC, Pixmap);
833 inline void SetClipOrigin(Bitmap *, GC, int, int);
834 inline void BlitBitmapMasked(Bitmap *, Bitmap *, int, int, int, int, int, int);
835 inline boolean DrawingOnBackground(int, int);
836 inline void BlitBitmapOnBackground(Bitmap *, Bitmap *, int, int, int, int, int,
838 inline void DrawSimpleWhiteLine(Bitmap *, int, int, int, int);
839 inline void DrawLines(Bitmap *, struct XY *, int, Pixel);
840 inline Pixel GetPixel(Bitmap *, int, int);
841 inline Pixel GetPixelFromRGB(Bitmap *, unsigned int,unsigned int,unsigned int);
842 inline Pixel GetPixelFromRGBcompact(Bitmap *, unsigned int);
844 inline void FlushDisplay(void);
845 inline void SyncDisplay(void);
846 inline void KeyboardAutoRepeatOn(void);
847 inline void KeyboardAutoRepeatOff(void);
848 inline boolean PointerInWindow(DrawWindow *);
849 inline boolean SetVideoMode(boolean);
850 inline boolean ChangeVideoModeIfNeeded(boolean);
852 Bitmap *LoadImage(char *);
853 Bitmap *LoadCustomImage(char *);
854 void ReloadCustomImage(Bitmap *, char *);
856 Bitmap *ZoomBitmap(Bitmap *, int, int);
857 void CreateBitmapWithSmallBitmaps(Bitmap *);
859 void SetMouseCursor(int);
861 inline void OpenAudio(void);
862 inline void CloseAudio(void);
863 inline void SetAudioMode(boolean);
865 inline void InitEventFilter(EventFilter);
866 inline boolean PendingEvent(void);
867 inline void NextEvent(Event *event);
868 inline Key GetEventKey(KeyEvent *, boolean);
869 inline KeyMod HandleKeyModState(Key, int);
870 inline KeyMod GetKeyModState();
871 inline boolean CheckCloseWindowEvent(ClientMessageEvent *);
873 inline void InitJoysticks();
874 inline boolean ReadJoystick(int, int *, int *, boolean *, boolean *);
876 #endif /* SYSTEM_H */