X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fsdl.h;h=c30afde6218bd2de29aa07980f4d2a3c9ae2b43b;hb=38ea4e57bc9b730abf7a15f8cc235465e6f0ad4c;hp=c2f55ee9e56e645378ae0e8d1851738e7ff25d9c;hpb=de8b3ae622eae10f1caf96872fb1790f7bd9644b;p=rocksndiamonds.git diff --git a/src/libgame/sdl.h b/src/libgame/sdl.h index c2f55ee9..c30afde6 100644 --- a/src/libgame/sdl.h +++ b/src/libgame/sdl.h @@ -14,9 +14,11 @@ #ifndef SDL_H #define SDL_H -#include "SDL.h" -#include "SDL_image.h" -#include "SDL_mixer.h" +#include +#include +#include +#include +#include /* definitions needed for "system.c" */ @@ -28,6 +30,9 @@ #define TARGET_STRING "SDL" #define FULLSCREEN_STATUS FULLSCREEN_AVAILABLE +#define CURSOR_MAX_WIDTH 32 +#define CURSOR_MAX_HEIGHT 32 + /* SDL type definitions */ @@ -38,6 +43,7 @@ typedef Uint32 Pixel; typedef SDL_Cursor *Cursor; typedef SDLKey Key; +typedef unsigned int KeyMod; typedef SDL_Event Event; typedef SDL_MouseButtonEvent ButtonEvent; @@ -67,9 +73,13 @@ struct SDLSurfaceInfo GC stored_clip_gc; }; -struct XY +struct MouseCursorInfo { - short x, y; + 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]; }; @@ -319,32 +329,50 @@ struct XY #define KSYM_FKEY_LAST KSYM_F15 #define KSYM_NUM_FKEYS (KSYM_FKEY_LAST - KSYM_FKEY_FIRST + 1) +#define KMOD_None None +#define KMOD_Shift_L KMOD_LSHIFT +#define KMOD_Shift_R KMOD_RSHIFT +#define KMOD_Control_L KMOD_LCTRL +#define KMOD_Control_R KMOD_RCTRL +#define KMOD_Meta_L KMOD_LMETA +#define KMOD_Meta_R KMOD_RMETA +#define KMOD_Alt_L KMOD_LALT +#define KMOD_Alt_R KMOD_RALT + +#define KMOD_Shift (KMOD_Shift_L | KMOD_Shift_R) +#define KMOD_Control (KMOD_Control_L | KMOD_Control_R) +#define KMOD_Meta (KMOD_Meta_L | KMOD_Meta_R) +#define KMOD_Alt (KMOD_Alt_L | KMOD_Alt_R) -/* 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, 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); +/* SDL function definitions */ -inline void SDLInvertArea(Bitmap *, int, int, int, int, Uint32); +void SDLInitVideoDisplay(void); +void SDLInitVideoBuffer(DrawBuffer **, DrawWindow **, boolean); +boolean SDLSetVideoMode(DrawBuffer **, boolean); +void SDLCreateBitmapContent(Bitmap *, int, int, int); +void SDLFreeBitmapPointers(Bitmap *); +void SDLCopyArea(Bitmap *, Bitmap *, int, int, int, int, int, int, int); +void SDLFillRectangle(Bitmap *, int, int, int, int, Uint32); +void SDLFadeScreen(Bitmap *, int, int, int); +void SDLDrawSimpleLine(Bitmap *, int, int, int, int, Uint32); +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); void SDLZoomBitmap(Bitmap *, Bitmap *); Bitmap *SDLLoadImage(char *); -void SDLSetMouseCursor(const char **); +void SDLSetMouseCursor(struct MouseCursorInfo *); -inline void SDLOpenAudio(void); -inline void SDLCloseAudio(void); +void SDLOpenAudio(void); +void SDLCloseAudio(void); -inline void SDLNextEvent(Event *); +void SDLNextEvent(Event *); void HandleJoystickEvent(Event *); void SDLInitJoysticks(void);