rnd-20001210-2-src
[rocksndiamonds.git] / src / libgame / system.h
index 26565af0ac320ce16d0f805a12461f24ea93fbfe..55201a9f2fe8d81f9c6ea2c9b3880fa283128518 100644 (file)
@@ -1,15 +1,14 @@
 /***********************************************************
-*  Rocks'n'Diamonds -- McDuffin Strikes Back!              *
+* Artsoft Retro-Game Library                               *
 *----------------------------------------------------------*
-*  ©1995 Artsoft Development                               *
-*        Holger Schemel                                    *
-*        33659 Bielefeld-Senne                             *
-*        Telefon: (0521) 493245                            *
-*        eMail: aeglos@valinor.owl.de                      *
-*               aeglos@uni-paderborn.de                    *
-*               q99492@pbhrzx.uni-paderborn.de             *
+* (c) 1994-2000 Artsoft Entertainment                      *
+*               Holger Schemel                             *
+*               Detmolder Strasse 189                      *
+*               33604 Bielefeld                            *
+*               Germany                                    *
+*               e-mail: info@artsoft.org                   *
 *----------------------------------------------------------*
-*  system.h                                                *
+* system.h                                                 *
 ***********************************************************/
 
 #ifndef SYSTEM_H
 
 /* 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 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)
 
 
@@ -94,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"
@@ -166,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
@@ -237,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;
@@ -255,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 *);
 
@@ -264,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);