added optional button to restart game (door, panel and touch variants)
[rocksndiamonds.git] / src / libgame / sdl.h
index ad7dca8c1a95ee9cdf4535838be523469ead2c0f..05f99982809016f1e5e374c3e64809d973ccad98 100644 (file)
@@ -4,7 +4,7 @@
 // (c) 1995-2014 by Artsoft Entertainment
 //                         Holger Schemel
 //                 info@artsoft.org
-//                 http://www.artsoft.org/
+//                 https://www.artsoft.org/
 // ----------------------------------------------------------------------------
 // sdl.h
 // ============================================================================
 #include <SDL_mixer.h>
 #include <SDL_net.h>
 #include <SDL_thread.h>
-#if defined(PLATFORM_WIN32)
+#if defined(PLATFORM_WINDOWS)
 #include <SDL_syswm.h>
 #endif
 
 // definitions needed for "system.c"
 
-#define SURFACE_FLAGS          (0)
+#define SURFACE_FLAGS          (SDL_WINDOW_RESIZABLE)
 
 #define SET_TRANSPARENT_PIXEL  (SDL_TRUE)
 #define UNSET_TRANSPARENT_PIXEL        (SDL_FALSE)
@@ -75,6 +75,10 @@ struct SDLSurfaceInfo
   char *source_filename;
 
   int width, height;
+
+  int alpha[2][2];             // [surface|texture][opaque|masked]
+  int alpha_next_blit;
+
   SDL_Surface *surface;
   SDL_Surface *surface_masked;
   SDL_Texture *texture;
@@ -350,6 +354,21 @@ typedef struct UserEventInfo       UserEvent;
 #define KSYM_FKEY_LAST         KSYM_F12
 #define KSYM_NUM_FKEYS         (KSYM_FKEY_LAST - KSYM_FKEY_FIRST + 1)
 
+#define KSYM_RAW(k)            (((k) >= KSYM_a &&                      \
+                                 (k) <= KSYM_z)        ||              \
+                                ((k) >= KSYM_0 &&                      \
+                                 (k) <= KSYM_9)        ||              \
+                                (k) == KSYM_space)
+
+#define KSYM_PRINTABLE(k)      (((k) >= KSYM_space &&                  \
+                                 (k) <= KSYM_z)        ||              \
+                                (k) == KSYM_Adiaeresis ||              \
+                                (k) == KSYM_Odiaeresis ||              \
+                                (k) == KSYM_Udiaeresis ||              \
+                                (k) == KSYM_adiaeresis ||              \
+                                (k) == KSYM_odiaeresis ||              \
+                                (k) == KSYM_udiaeresis)
+
 #define KMOD_None              KMOD_NONE
 #define KMOD_Shift_L           KMOD_LSHIFT
 #define KMOD_Shift_R           KMOD_RSHIFT
@@ -373,8 +392,11 @@ typedef struct UserEventInfo       UserEvent;
 
 #define KMOD_TextInput         (KMOD_Shift | KMOD_Alt_R)
 
+
 // SDL function definitions
 
+void SDLSetAlpha(SDL_Surface *, boolean, int);
+const char *SDLGetRendererName(void);
 boolean SDLSetNativeSurface(SDL_Surface **);
 SDL_Surface *SDLGetNativeSurface(SDL_Surface *);
 void SDLCreateBitmapTextures(Bitmap *);
@@ -400,6 +422,7 @@ void SDLInitVideoBuffer(boolean);
 boolean SDLSetVideoMode(boolean);
 void SDLCreateBitmapContent(Bitmap *, int, int, int);
 void SDLFreeBitmapPointers(Bitmap *);
+void SDLBlitSurface(SDL_Surface *, SDL_Surface *, int, int, int, int, int, int);
 void SDLCopyArea(Bitmap *, Bitmap *, int, int, int, int, int, int, int);
 void SDLBlitTexture(Bitmap *, int, int, int, int, int, int, int);
 void SDLFillRectangle(Bitmap *, int, int, int, int, Uint32);
@@ -410,7 +433,6 @@ void SDLDrawLine(Bitmap *, int, int, int, int, Uint32);
 Pixel SDLGetPixel(Bitmap *, int, int);
 void SDLPutPixel(Bitmap *, int, int, Pixel);
 
-void SDLInvertArea(Bitmap *, int, int, int, int, Uint32);
 void SDLCopyInverseMasked(Bitmap *, Bitmap *, int, int, int, int, int, int);
 
 Bitmap *SDLZoomBitmap(Bitmap *, int, int);