X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsystem.h;h=55201a9f2fe8d81f9c6ea2c9b3880fa283128518;hb=c4e1a476135ce36417cdd797481feeaaff4301af;hp=e4126a7d6676237789491ff03b760f9563998dec;hpb=ff56a43aa3799aa3357f4deca4d6482fc25a6a41;p=rocksndiamonds.git diff --git a/src/libgame/system.h b/src/libgame/system.h index e4126a7d..55201a9f 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -30,10 +30,15 @@ /* 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 @@ -56,18 +61,19 @@ #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) @@ -93,6 +99,7 @@ #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" @@ -165,12 +172,19 @@ struct VideoSystemInfo 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 @@ -236,9 +250,9 @@ extern Visual *visual; 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; @@ -254,6 +268,7 @@ extern int FrameCounter; void InitCommandName(char *); void InitExitFunction(void (*exit_function)(int)); void InitPlatformDependantStuff(void); +void ClosePlatformDependantStuff(void); void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *); @@ -263,26 +278,33 @@ void InitGfxDoor2Info(int, int, int, int); 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);