/* contant definitions */
-#define DEFAULT_DEPTH 0
+/* the additional 'b' is needed for Win32 to open files in binary mode */
+#define MODE_READ "rb"
+#define MODE_WRITE "wb"
+#define MODE_APPEND "ab"
-#define FULLSCREEN_NOT_AVAILABLE FALSE
-#define FULLSCREEN_AVAILABLE TRUE
+#define DEFAULT_DEPTH 0
+
+#define FULLSCREEN_NOT_AVAILABLE FALSE
+#define FULLSCREEN_AVAILABLE TRUE
/* values for button_status */
#define MB_NOT_PRESSED FALSE
+#define MB_NOT_RELEASED TRUE
#define MB_RELEASED FALSE
#define MB_PRESSED TRUE
#define MB_MENU_CHOICE FALSE
#define REDRAW_VIDEO_2 (1 << 5)
#define REDRAW_VIDEO_3 (1 << 6)
#define REDRAW_MICROLEVEL (1 << 7)
-#define REDRAW_FROM_BACKBUFFER (1 << 8)
+#define REDRAW_MICROLABEL (1 << 8)
+#define REDRAW_FROM_BACKBUFFER (1 << 9)
#define REDRAW_DOOR_2 (REDRAW_VIDEO_1 | \
REDRAW_VIDEO_2 | \
REDRAW_VIDEO_3)
-#define REDRAW_DOOR_3 (1 << 9)
+#define REDRAW_DOOR_3 (1 << 10)
#define REDRAW_DOORS (REDRAW_DOOR_1 | \
REDRAW_DOOR_2 | \
REDRAW_DOOR_3)
#define REDRAW_MAIN (REDRAW_FIELD | \
REDRAW_TILES | \
REDRAW_MICROLEVEL)
-#define REDRAW_FPS (1 << 10)
+#define REDRAW_FPS (1 << 11)
#define REDRAWTILES_THRESHOLD (SCR_FIELDX * SCR_FIELDY / 2)
#define RW_BASE_PATH RW_GAME_DIR
#define GRAPHICS_DIRECTORY "graphics"
+#define MUSIC_DIRECTORY "music"
#define SOUNDS_DIRECTORY "sounds"
#define LEVELS_DIRECTORY "levels"
#define TAPES_DIRECTORY "tapes"
struct AudioSystemInfo
{
boolean sound_available;
+ boolean music_available;
boolean loops_available;
+ boolean mods_available;
boolean sound_enabled;
+
int soundserver_pipe[2];
int soundserver_pid;
char *device_name;
int device_fd;
+
+ int channels;
+ int music_channel;
+ int music_nr;
};
struct GfxInfo
extern int screen;
extern Colormap cmap;
-extern DrawWindow window;
-extern DrawBuffer backbuffer;
-extern DrawBuffer drawto;
+extern DrawWindow *window;
+extern DrawBuffer *backbuffer;
+extern DrawBuffer *drawto;
extern int button_status;
extern boolean motion_status;
void InitCommandName(char *);
void InitExitFunction(void (*exit_function)(int));
void InitPlatformDependantStuff(void);
+void ClosePlatformDependantStuff(void);
void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *);
void InitGfxScrollbufferInfo(int, int);
inline void InitVideoDisplay(void);
-inline void InitVideoBuffer(DrawBuffer *,DrawWindow *, int, int, int, boolean);
-inline Bitmap CreateBitmapStruct(void);
-inline Bitmap CreateBitmap(int, int, int);
-inline void FreeBitmap(Bitmap);
-inline void BlitBitmap(Bitmap, Bitmap, int, int, int, int, int, int);
-inline void ClearRectangle(Bitmap, int, int, int, int);
-inline void SetClipMask(Bitmap, GC, Pixmap);
-inline void SetClipOrigin(Bitmap, GC, int, int);
-inline void BlitBitmapMasked(Bitmap, Bitmap, int, int, int, int, int, int);
-inline void DrawSimpleWhiteLine(Bitmap, int, int, int, int);
+inline void CloseVideoDisplay(void);
+inline void InitVideoBuffer(DrawBuffer **,DrawWindow **, int,int,int, boolean);
+inline Bitmap *CreateBitmapStruct(void);
+inline Bitmap *CreateBitmap(int, int, int);
+inline void FreeBitmap(Bitmap *);
+inline void BlitBitmap(Bitmap *, Bitmap *, int, int, int, int, int, int);
+inline void ClearRectangle(Bitmap *, int, int, int, int);
+inline void SetClipMask(Bitmap *, GC, Pixmap);
+inline void SetClipOrigin(Bitmap *, GC, int, int);
+inline void BlitBitmapMasked(Bitmap *, Bitmap *, int, int, int, int, int, int);
+inline void DrawSimpleWhiteLine(Bitmap *, int, int, int, int);
+inline void DrawLines(Bitmap *, struct XY *, int, Pixel);
+inline Pixel GetPixelFromRGB(Bitmap *, unsigned int,unsigned int,unsigned int);
+inline Pixel GetPixelFromRGBcompact(Bitmap *, unsigned int);
+
inline void FlushDisplay(void);
inline void SyncDisplay(void);
inline void KeyboardAutoRepeatOn(void);
inline void KeyboardAutoRepeatOff(void);
-inline boolean PointerInWindow(DrawWindow);
+inline boolean PointerInWindow(DrawWindow *);
inline boolean SetVideoMode(boolean);
inline boolean ChangeVideoModeIfNeeded(boolean);
-inline boolean OpenAudio(struct AudioSystemInfo *);
-inline void CloseAudio(struct AudioSystemInfo *);
+Bitmap *LoadImage(char *);
+
+inline void OpenAudio(void);
+inline void CloseAudio(void);
inline void SetAudioMode(boolean);
inline void InitEventFilter(EventFilter);