X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsdl.h;h=d61e0b26b9f0ec6966a9986b2743edd61dd3fd95;hb=HEAD;hp=676dfab9dbe144e311e6915c42b91a04658f6257;hpb=0f1e162b9ce8b032e3e50d1cfe9dcc157b4814de;p=rocksndiamonds.git diff --git a/src/libgame/sdl.h b/src/libgame/sdl.h index 676dfab9..05f99982 100644 --- a/src/libgame/sdl.h +++ b/src/libgame/sdl.h @@ -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 // ============================================================================ @@ -17,13 +17,13 @@ #include #include #include -#if defined(PLATFORM_WIN32) +#if defined(PLATFORM_WINDOWS) #include #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) @@ -64,9 +64,8 @@ typedef SDL_TextInputEvent TextEvent; typedef SDL_Event PauseResumeEvent; typedef SDL_WindowEvent WindowEvent; typedef SDL_KeyboardEvent KeyEvent; -typedef SDL_Event ExposeEvent; -typedef SDL_Event FocusChangeEvent; -typedef SDL_Event ClientMessageEvent; + +typedef SDL_EventFilter EventFilter; // structure definitions @@ -76,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; @@ -91,6 +94,21 @@ struct MouseCursorInfo byte mask[CURSOR_MAX_WIDTH * CURSOR_MAX_HEIGHT / 8]; }; +struct UserEventInfo +{ + // same as in "struct SDL_UserEvent" + Uint32 type; + Uint32 timestamp; + Uint32 windowID; + Sint32 code; + + // changed to use integer values instead of void pointers + Uint32 value1; + Uint32 value2; +}; + +typedef struct UserEventInfo UserEvent; + // SDL symbol definitions @@ -109,12 +127,8 @@ struct MouseCursorInfo #define EVENT_TEXTINPUT SDL_TEXTINPUT #define EVENT_KEYPRESS SDL_KEYDOWN #define EVENT_KEYRELEASE SDL_KEYUP -#define EVENT_EXPOSE SDL_USEREVENT + 0 -#define EVENT_FOCUSIN SDL_USEREVENT + 1 -#define EVENT_FOCUSOUT SDL_USEREVENT + 2 -#define EVENT_CLIENTMESSAGE SDL_QUIT -#define EVENT_MAPNOTIFY SDL_USEREVENT + 4 -#define EVENT_UNMAPNOTIFY SDL_USEREVENT + 5 +#define EVENT_USER SDL_USEREVENT +#define EVENT_QUIT SDL_QUIT #define KSYM_UNDEFINED SDLK_UNKNOWN @@ -340,6 +354,21 @@ struct MouseCursorInfo #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 @@ -363,8 +392,11 @@ struct MouseCursorInfo #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 *); @@ -390,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); @@ -400,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); @@ -413,6 +445,7 @@ void SDLOpenAudio(void); void SDLCloseAudio(void); void SDLWaitEvent(Event *); +void SDLCorrectRawMousePosition(int *, int *); void HandleJoystickEvent(Event *); void SDLInitJoysticks(void);