X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fsystem.h;h=f7cb3984c02194f2306faf003be643ee2780c6de;hb=69c2342c24b734fcbcd7c5ab2acfb2b3837f5c5a;hp=35351e32a614f8083b4f34afd7d617692f17ad65;hpb=36357e8399d0a42ac45a1cd096aee24a9008b5f5;p=rocksndiamonds.git diff --git a/src/system.h b/src/system.h index 35351e32..f7cb3984 100644 --- a/src/system.h +++ b/src/system.h @@ -15,89 +15,63 @@ #ifndef SYSTEM_H #define SYSTEM_H -#ifndef MSDOS -#include -#include -#include -#include -#include -#include +#if defined(MSDOS) +#define PLATFORM_MSDOS +#elif defined(WIN32) +#define PLATFORM_WIN32 +#else +#define PLATFORM_UNIX #endif -#ifdef USE_SDL_LIBRARY -#include "sdl.h" +#if defined(MSDOS) +#include "msdos.h" #endif -#ifdef USE_SDL_LIBRARY -typedef SDL_Surface *Bitmap; -typedef SDL_Surface *DrawWindow; -typedef SDL_Surface *DrawBuffer; -#else -typedef Pixmap Bitmap; -typedef Window DrawWindow; -typedef Drawable DrawBuffer; +#if defined(TARGET_SDL) +#include "sdl.h" +#elif defined(TARGET_X11) +#include "x11.h" #endif -#ifdef USE_SDL_LIBRARY - -typedef SDL_Event Event; -typedef SDL_MouseButtonEvent ButtonEvent; -typedef SDL_MouseMotionEvent MotionEvent; -typedef XKeyEvent KeyEvent; -typedef XExposeEvent ExposeEvent; -typedef XFocusChangeEvent FocusChangeEvent; -typedef XClientMessageEvent ClientMessageEvent; - -#define EVENT_BUTTONPRESS SDL_MOUSEBUTTONDOWN -#define EVENT_BUTTONRELEASE SDL_MOUSEBUTTONUP -#define EVENT_MOTIONNOTIFY SDL_MOUSEMOTION -#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 -#else +/* system-wide contant definitions */ -typedef XEvent Event; -typedef XButtonEvent ButtonEvent; -typedef XMotionEvent MotionEvent; -typedef XKeyEvent KeyEvent; -typedef XExposeEvent ExposeEvent; -typedef XFocusChangeEvent FocusChangeEvent; -typedef XClientMessageEvent ClientMessageEvent; - -#define EVENT_BUTTONPRESS ButtonPress -#define EVENT_BUTTONRELEASE ButtonRelease -#define EVENT_MOTIONNOTIFY MotionNotify -#define EVENT_KEYPRESS KeyPress -#define EVENT_KEYRELEASE KeyRelease -#define EVENT_EXPOSE Expose -#define EVENT_FOCUSIN FocusIn -#define EVENT_FOCUSOUT FocusOut -#define EVENT_CLIENTMESSAGE ClientMessage -#define EVENT_MAPNOTIFY MapNotify -#define EVENT_UNMAPNOTIFY UnmapNotify +#define DEFAULT_DEPTH 0 -#endif +#define FULLSCREEN_NOT_AVAILABLE FALSE +#define FULLSCREEN_AVAILABLE TRUE + + +/* system-wide type definitions */ + +typedef int (*EventFilter)(const Event *); + + +/* system-wide function definitions */ +inline void InitBufferedDisplay(DrawBuffer *, DrawWindow *); +inline int GetDisplayDepth(void); +inline Bitmap CreateBitmap(int, int, int); +inline void FreeBitmap(Bitmap); inline void ClearRectangle(Bitmap, int, int, int, int); inline void BlitBitmap(Bitmap, Bitmap, int, int, int, int, int, int); inline void SetClipMask(GC, Pixmap); inline void SetClipOrigin(GC, int, int); inline void BlitBitmapMasked(Bitmap, Bitmap, int, int, int, int, int, int); inline void DrawSimpleWhiteLine(Bitmap, int, int, int, int); +inline void FlushDisplay(void); +inline void SyncDisplay(void); +inline void KeyboardAutoRepeatOn(void); +inline void KeyboardAutoRepeatOff(void); +inline boolean PointerInWindow(DrawWindow); +inline boolean SetVideoMode(void); +inline void ChangeVideoModeIfNeeded(void); -inline void FlushDisplay(); -inline void SyncDisplay(); -inline void KeyboardAutoRepeatOn(); -inline void KeyboardAutoRepeatOff(); -inline boolean QueryPointer(DrawWindow, int *, int *); +inline boolean InitAudio(void); -inline boolean PendingEvent(); +inline void InitEventFilter(EventFilter); +inline boolean PendingEvent(void); inline void NextEvent(Event *event); +inline Key GetEventKey(KeyEvent *, boolean); #endif /* SYSTEM_H */