1 2 #ifndef __SDL_WRAPPER_H__ 3 #define __SDL_WRAPPER_H__ 4 5 /* Map amiga types to SDL types */ 6 typedef SDL_bool BOOL; 7 typedef Uint32 uint32; 8 typedef Sint32 int32; 9 typedef Uint16 uint16; 10 typedef Sint16 int16; 11 typedef Uint8 uint8; 12 typedef Sint8 int8; 13 typedef char TEXT; 14 typedef char * STRPTR; 15 typedef void * APTR; 16 typedef float float32; 17 typedef double float64; 18 typedef Sint32 LONG; 19 20 #define CONST const 21 22 #define TRUE SDL_TRUE 23 #define FALSE SDL_FALSE 24 25 #define ASOT_SEMAPHORE 1 26 #define ASOT_LIST 2 27 #define ASOT_NODE 3 28 29 struct SignalSemaphore 30 { 31 SDL_mutex *mtx; 32 }; 33 34 struct List 35 { 36 struct Node *lh_Head; 37 struct Node *lh_Tail; 38 struct Node *lh_TailPred; 39 }; 40 41 #define NT_USER 0 42 struct Node 43 { 44 struct Node *ln_Succ; 45 struct Node *ln_Pred; 46 STRPTR ln_Name; 47 int8 ln_Pri; 48 uint8 ln_Type; 49 }; 50 51 struct ExecIFace 52 { 53 APTR (*AllocVecTags)(uint32, ...); 54 void (*FreeVec)(void *); 55 APTR (*AllocSysObjectTags)(uint32, ...); 56 void (*FreeSysObject)(uint32, APTR); 57 void (*ObtainSemaphore)(struct SignalSemaphore *); 58 void (*ReleaseSemaphore)(struct SignalSemaphore *); 59 void (*CopyMem)(APTR src, APTR dest, uint32 size); 60 struct Node * (*GetHead)(struct List *); 61 struct Node * (*GetSucc)(struct Node *); 62 void (*AddTail)(struct List *, struct Node *); 63 void (*Remove)(struct Node *); 64 APTR (*AllocPooled)(APTR, uint32); 65 void (*FreePooled)(APTR, APTR, uint32); 66 struct Node *(*RemHead)(struct List *); 67 struct Node *(*GetTail)(struct List *); 68 struct Node *(*RemTail)(struct List *); 69 }; 70 71 72 extern struct ExecIFace *IExec; 73 74 #define SRFTYPE SDL_HWSURFACE 75 //#define SRFTYPE SDL_SWSURFACE 76 77 #define IEQUALIFIER_RBUTTON 1 78 #define IEQUALIFIER_LCOMMAND 2 79 #define IEQUALIFIER_CONTROL 4 80 #define IEQUALIFIER_LSHIFT 8 81 #define IEQUALIFIER_RSHIFT 16 82 #define IEQUALIFIER_LALT 32 83 84 #define SELECTDOWN SDL_BUTTON_LEFT 85 #define SELECTUP SDL_BUTTON_LEFT|0x100 86 #define MENUDOWN SDL_BUTTON_RIGHT 87 #define MENUUP SDL_BUTTON_RIGHT|0x100 88 89 #define IDCMP_MOUSEMOVE 1 90 #define IDCMP_MOUSEBUTTONS 2 91 #define IDCMP_RAWKEY 4 92 #define IDCMP_EXTENDEDMOUSE 8 93 94 #define IMSGCODE_INTUIWHEELDATA 1 95 96 struct IntuiMessage 97 { 98 uint16 Qualifier; 99 uint16 Class; 100 uint16 Code; 101 int32 MouseX; 102 int32 MouseY; 103 void * IAddress; 104 }; 105 106 struct IntuiWheelData 107 { 108 int16 WheelY; 109 }; 110 111 uint16 sdl_keysym_to_amiga_rawkey(SDLKey keysym); 112 113 #define TAG_DONE 0 114 115 #define REQIMAGE_QUESTION 0 116 #define REQIMAGE_WARNING 1 117 #define REQIMAGE_ERROR 2 118 119 #define FR_HVLSAVE 0 120 #define FR_AHXSAVE 1 121 #define FR_INSSAVE 2 122 #define FR_MODLOAD 3 123 #define FR_INSLOAD 4 124 125 char *filerequester( char *title, char *path, char *fname, int type ); 126 BOOL directoryrequester( char *title, char *path ); 127 128 #endif /* __SDL_WRAPPER_H__ */ 129