rnd-20030405-1-src
[rocksndiamonds.git] / src / libgame / sdl.h
index e6543a9e80dbd25c51592dda6a0834dc0d136f64..fcf19341a81fd08372a5edd2c67881b012147611 100644 (file)
@@ -1,7 +1,7 @@
 /***********************************************************
 * Artsoft Retro-Game Library                               *
 *----------------------------------------------------------*
-* (c) 1994-2000 Artsoft Entertainment                      *
+* (c) 1994-2002 Artsoft Entertainment                      *
 *               Holger Schemel                             *
 *               Detmolder Strasse 189                      *
 *               33604 Bielefeld                            *
 
 #define SURFACE_FLAGS          (SDL_SWSURFACE)
 
-#define SDLCOPYAREA_OPAQUE     0
-#define SDLCOPYAREA_MASKED     1
-
 /* system dependent definitions */
 
 #define TARGET_STRING          "SDL"
 #define FULLSCREEN_STATUS      FULLSCREEN_AVAILABLE
 
+#define CURSOR_MAX_WIDTH       32
+#define CURSOR_MAX_HEIGHT      32
+
 
 /* SDL type definitions */
 
@@ -38,6 +38,7 @@ typedef struct SDLSurfaceInfo Bitmap;
 typedef struct SDLSurfaceInfo  DrawBuffer;
 typedef struct SDLSurfaceInfo  DrawWindow;
 typedef Uint32                 Pixel;
+typedef SDL_Cursor            *Cursor;
 
 typedef SDLKey                 Key;
 
@@ -60,12 +61,24 @@ typedef int                 Colormap;
 
 struct SDLSurfaceInfo
 {
+  char *source_filename;
+
+  int width, height;
   SDL_Surface *surface;
   SDL_Surface *surface_masked;
   GC gc;
   GC stored_clip_gc;
 };
 
+struct MouseCursorInfo
+{
+  int width, height;
+  int hot_x, hot_y;
+
+  char data[CURSOR_MAX_WIDTH * CURSOR_MAX_HEIGHT / 8];
+  char mask[CURSOR_MAX_WIDTH * CURSOR_MAX_HEIGHT / 8];
+};
+
 struct XY
 {
   short x, y;
@@ -76,6 +89,9 @@ struct XY
 
 #define None                   0L
 
+#define BLACK_PIXEL            0x000000
+#define WHITE_PIXEL            0xffffff
+
 #define EVENT_BUTTONPRESS      SDL_MOUSEBUTTONDOWN
 #define EVENT_BUTTONRELEASE    SDL_MOUSEBUTTONUP
 #define EVENT_MOTIONNOTIFY     SDL_MOUSEMOTION
@@ -311,22 +327,39 @@ struct XY
 #define KSYM_F23               KSYM_UNDEFINED
 #define KSYM_F24               KSYM_UNDEFINED
 
+#define KSYM_FKEY_FIRST                KSYM_F1
+#define KSYM_FKEY_LAST         KSYM_F15
+#define KSYM_NUM_FKEYS         (KSYM_FKEY_LAST - KSYM_FKEY_FIRST + 1)
+
 
 /* SDL function definitions */
 
 inline void SDLInitVideoDisplay(void);
 inline void SDLInitVideoBuffer(DrawBuffer **, DrawWindow **, boolean);
 inline boolean SDLSetVideoMode(DrawBuffer **, boolean);
+inline void SDLCreateBitmapContent(Bitmap *, int, int, int);
+inline void SDLFreeBitmapPointers(Bitmap *);
 inline void SDLCopyArea(Bitmap *, Bitmap *, int, int, int, int, int, int, int);
-inline void SDLFillRectangle(Bitmap *, int, int, int, int, unsigned int);
-inline void SDLDrawSimpleLine(SDL_Surface *, int, int, int, int, unsigned int);
-inline void SDLDrawLine(SDL_Surface *, int, int, int, int, Uint32);
-/* functions from SGE library */
-void sge_Line(SDL_Surface *, Sint16, Sint16, Sint16, Sint16, Uint32);
+inline void SDLFillRectangle(Bitmap *, int, int, int, int, Uint32);
+inline void SDLDrawSimpleLine(Bitmap *, int, int, int, int, Uint32);
+inline void SDLDrawLine(Bitmap *, int, int, int, int, Uint32);
+inline Pixel SDLGetPixel(Bitmap *, int, int);
+
+inline void SDLInvertArea(Bitmap *, int, int, int, int, Uint32);
+
+void SDLZoomBitmap(Bitmap *, Bitmap *);
 
 Bitmap *SDLLoadImage(char *);
 
-inline boolean SDLOpenAudio(void);
+void SDLSetMouseCursor(struct MouseCursorInfo *);
+
+inline void SDLOpenAudio(void);
 inline void SDLCloseAudio(void);
 
+inline void SDLNextEvent(Event *);
+
+void HandleJoystickEvent(Event *);
+void SDLInitJoysticks(void);
+boolean SDLReadJoystick(int, int *, int *, boolean *, boolean *);
+
 #endif /* SDL_H */