2019-05-31 17:02:26 +00:00
|
|
|
#ifndef SKELETON_H
|
|
|
|
#define SKELETON_H
|
|
|
|
|
|
|
|
#include "rwcore.h"
|
|
|
|
|
|
|
|
/* Default arena size depending on platform. */
|
|
|
|
#define rsRESOURCESDEFAULTARENASIZE (1 << 20)
|
|
|
|
|
|
|
|
#if (!defined(RsSprintf))
|
|
|
|
#define RsSprintf rwsprintf
|
|
|
|
#endif /* (!defined(RsSprintf)) */
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
#if (!defined(RSASSERT))
|
|
|
|
#define RSASSERT(_condition) /* No-op */
|
|
|
|
#endif /* (!defined(RSASSERT)) */
|
|
|
|
|
|
|
|
#define RSASSERTISTYPE(_f, _t) \
|
|
|
|
RSASSERT( (!(_f)) || ((((const RwObject *)(_f))->type)==(_t)) )
|
|
|
|
|
|
|
|
enum RsInputDeviceType
|
|
|
|
{
|
2019-06-02 03:00:38 +00:00
|
|
|
rsKEYBOARD,
|
|
|
|
rsMOUSE,
|
|
|
|
rsPAD
|
2019-05-31 17:02:26 +00:00
|
|
|
};
|
|
|
|
typedef enum RsInputDeviceType RsInputDeviceType;
|
|
|
|
|
|
|
|
enum RsEventStatus
|
|
|
|
{
|
2019-06-02 03:00:38 +00:00
|
|
|
rsEVENTERROR,
|
|
|
|
rsEVENTPROCESSED,
|
|
|
|
rsEVENTNOTPROCESSED
|
2019-05-31 17:02:26 +00:00
|
|
|
};
|
|
|
|
typedef enum RsEventStatus RsEventStatus;
|
|
|
|
|
|
|
|
enum RsEvent
|
|
|
|
{
|
|
|
|
rsCAMERASIZE,
|
|
|
|
rsCOMMANDLINE,
|
|
|
|
rsFILELOAD,
|
|
|
|
rsINITDEBUG,
|
|
|
|
rsINPUTDEVICEATTACH,
|
|
|
|
rsLEFTBUTTONDOWN,
|
|
|
|
rsLEFTBUTTONUP,
|
|
|
|
rsMOUSEMOVE,
|
|
|
|
rsMOUSEWHEELMOVE,
|
|
|
|
rsPLUGINATTACH,
|
|
|
|
rsREGISTERIMAGELOADER,
|
|
|
|
rsRIGHTBUTTONDOWN,
|
|
|
|
rsRIGHTBUTTONUP,
|
|
|
|
_rs_13,
|
|
|
|
_rs_14,
|
|
|
|
_rs_15,
|
|
|
|
_rs_16,
|
|
|
|
_rs_17,
|
|
|
|
_rs_18,
|
|
|
|
_rs_19,
|
|
|
|
_rs_20,
|
2020-05-23 09:34:40 +00:00
|
|
|
rsRWINITIALIZE,
|
2019-05-31 17:02:26 +00:00
|
|
|
rsRWTERMINATE,
|
|
|
|
rsSELECTDEVICE,
|
2020-05-23 09:34:40 +00:00
|
|
|
rsINITIALIZE,
|
2019-05-31 17:02:26 +00:00
|
|
|
rsTERMINATE,
|
|
|
|
rsIDLE,
|
|
|
|
rsFRONTENDIDLE,
|
|
|
|
rsKEYDOWN,
|
|
|
|
rsKEYUP,
|
|
|
|
rsQUITAPP,
|
|
|
|
rsPADBUTTONDOWN,
|
|
|
|
rsPADBUTTONUP,
|
|
|
|
rsPADANALOGUELEFT,
|
|
|
|
rsPADANALOGUELEFTRESET,
|
|
|
|
rsPADANALOGUERIGHT,
|
|
|
|
rsPADANALOGUERIGHTRESET,
|
|
|
|
rsPREINITCOMMANDLINE,
|
|
|
|
rsACTIVATE,
|
2019-08-15 14:51:39 +00:00
|
|
|
rsANIMVIEWER,
|
2019-05-31 17:02:26 +00:00
|
|
|
};
|
|
|
|
|
2019-08-15 14:51:39 +00:00
|
|
|
extern bool TurnOnAnimViewer;
|
|
|
|
|
2019-05-31 17:02:26 +00:00
|
|
|
typedef enum RsEvent RsEvent;
|
|
|
|
|
|
|
|
typedef RsEventStatus (*RsInputEventHandler)(RsEvent event, void *param);
|
|
|
|
|
|
|
|
typedef struct RsInputDevice RsInputDevice;
|
|
|
|
struct RsInputDevice
|
|
|
|
{
|
2019-06-02 03:00:38 +00:00
|
|
|
RsInputDeviceType inputDeviceType;
|
|
|
|
RwBool used;
|
|
|
|
RsInputEventHandler inputEventHandler;
|
2019-05-31 17:02:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct RsGlobalType RsGlobalType;
|
|
|
|
struct RsGlobalType
|
|
|
|
{
|
2019-06-02 03:00:38 +00:00
|
|
|
const RwChar *appName;
|
|
|
|
RwInt32 width;
|
|
|
|
RwInt32 height;
|
|
|
|
RwInt32 maximumWidth;
|
|
|
|
RwInt32 maximumHeight;
|
2019-05-31 17:02:26 +00:00
|
|
|
RwInt32 maxFPS;
|
2019-06-02 03:00:38 +00:00
|
|
|
RwBool quit;
|
2019-05-31 17:02:26 +00:00
|
|
|
|
2019-06-02 03:00:38 +00:00
|
|
|
void *ps; /* platform specific data */
|
2019-05-31 17:02:26 +00:00
|
|
|
|
2019-06-02 03:00:38 +00:00
|
|
|
RsInputDevice keyboard;
|
|
|
|
RsInputDevice mouse;
|
|
|
|
RsInputDevice pad;
|
2019-05-31 17:02:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum RsKeyCodes
|
|
|
|
{
|
|
|
|
rsESC = 1000,
|
|
|
|
|
|
|
|
rsF1 = 1001,
|
|
|
|
rsF2 = 1002,
|
|
|
|
rsF3 = 1003,
|
|
|
|
rsF4 = 1004,
|
|
|
|
rsF5 = 1005,
|
|
|
|
rsF6 = 1006,
|
|
|
|
rsF7 = 1007,
|
|
|
|
rsF8 = 1008,
|
|
|
|
rsF9 = 1009,
|
|
|
|
rsF10 = 1010,
|
|
|
|
rsF11 = 1011,
|
|
|
|
rsF12 = 1012,
|
|
|
|
|
|
|
|
rsINS = 1013,
|
|
|
|
rsDEL = 1014,
|
|
|
|
rsHOME = 1015,
|
|
|
|
rsEND = 1016,
|
|
|
|
rsPGUP = 1017,
|
|
|
|
rsPGDN = 1018,
|
|
|
|
|
|
|
|
rsUP = 1019,
|
|
|
|
rsDOWN = 1020,
|
|
|
|
rsLEFT = 1021,
|
|
|
|
rsRIGHT = 1022,
|
|
|
|
|
|
|
|
rsDIVIDE = 1023,
|
|
|
|
rsTIMES = 1024,
|
|
|
|
rsPLUS = 1025,
|
|
|
|
rsMINUS = 1026,
|
|
|
|
rsPADDEL = 1027,
|
|
|
|
rsPADEND = 1028,
|
|
|
|
rsPADDOWN = 1029,
|
|
|
|
rsPADPGDN = 1030,
|
|
|
|
rsPADLEFT = 1031,
|
|
|
|
rsPAD5 = 1032,
|
|
|
|
rsNUMLOCK = 1033,
|
|
|
|
rsPADRIGHT = 1034,
|
|
|
|
rsPADHOME = 1035,
|
|
|
|
rsPADUP = 1036,
|
|
|
|
rsPADPGUP = 1037,
|
|
|
|
rsPADINS = 1038,
|
|
|
|
rsPADENTER = 1039,
|
|
|
|
|
|
|
|
rsSCROLL = 1040,
|
|
|
|
rsPAUSE = 1041,
|
|
|
|
|
|
|
|
rsBACKSP = 1042,
|
|
|
|
rsTAB = 1043,
|
|
|
|
rsCAPSLK = 1044,
|
|
|
|
rsENTER = 1045,
|
|
|
|
rsLSHIFT = 1046,
|
|
|
|
rsRSHIFT = 1047,
|
|
|
|
rsSHIFT = 1048,
|
|
|
|
rsLCTRL = 1049,
|
|
|
|
rsRCTRL = 1050,
|
|
|
|
rsLALT = 1051,
|
|
|
|
rsRALT = 1052,
|
|
|
|
rsLWIN = 1053,
|
|
|
|
rsRWIN = 1054,
|
|
|
|
rsAPPS = 1055,
|
|
|
|
|
|
|
|
rsNULL = 1056,
|
2019-10-27 03:17:30 +00:00
|
|
|
|
|
|
|
rsMOUSELEFTBUTTON = 1,
|
|
|
|
rsMOUSMIDDLEBUTTON = 2,
|
|
|
|
rsMOUSERIGHTBUTTON = 3,
|
|
|
|
rsMOUSEWHEELUPBUTTON = 4,
|
|
|
|
rsMOUSEWHEELDOWNBUTTON = 5,
|
|
|
|
rsMOUSEX1BUTTON = 6,
|
|
|
|
rsMOUSEX2BUTTON = 7,
|
2019-05-31 17:02:26 +00:00
|
|
|
};
|
|
|
|
typedef enum RsKeyCodes RsKeyCodes;
|
|
|
|
|
|
|
|
typedef struct RsKeyStatus RsKeyStatus;
|
|
|
|
struct RsKeyStatus
|
|
|
|
{
|
2019-06-02 03:00:38 +00:00
|
|
|
RwInt32 keyCharCode;
|
2019-05-31 17:02:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct RsPadButtonStatus RsPadButtonStatus;
|
|
|
|
struct RsPadButtonStatus
|
|
|
|
{
|
2019-06-02 03:00:38 +00:00
|
|
|
RwInt32 padID;
|
2019-05-31 17:02:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum RsPadButtons
|
|
|
|
{
|
|
|
|
rsPADNULL = 0,
|
|
|
|
|
|
|
|
rsPADBUTTON1 = 1,
|
|
|
|
rsPADBUTTON2 = 2,
|
|
|
|
rsPADBUTTON3 = 3,
|
|
|
|
rsPADBUTTON4 = 4,
|
|
|
|
|
|
|
|
rsPADBUTTON5 = 5,
|
2019-06-02 03:00:38 +00:00
|
|
|
rsPADBUTTON6 = 6,
|
|
|
|
rsPADBUTTON7 = 7,
|
|
|
|
rsPADBUTTON8 = 8,
|
2019-05-31 17:02:26 +00:00
|
|
|
|
|
|
|
rsPADSELECT = 9,
|
|
|
|
|
|
|
|
rsPADBUTTONA1 = 10,
|
2019-06-02 03:00:38 +00:00
|
|
|
rsPADBUTTONA2 = 11,
|
2019-05-31 17:02:26 +00:00
|
|
|
|
|
|
|
rsPADSTART = 12,
|
|
|
|
|
|
|
|
rsPADDPADUP = 13,
|
|
|
|
rsPADDPADRIGHT = 14,
|
|
|
|
rsPADDPADDOWN = 15,
|
|
|
|
rsPADDPADLEFT = 16,
|
|
|
|
};
|
|
|
|
typedef enum RsPadButtons RsPadButtons;
|
|
|
|
|
|
|
|
|
2020-04-17 05:54:14 +00:00
|
|
|
extern RsGlobalType RsGlobal;
|
2019-05-31 17:02:26 +00:00
|
|
|
|
|
|
|
extern RsEventStatus AppEventHandler(RsEvent event, void *param);
|
|
|
|
extern RwBool AttachInputDevices(void);
|
|
|
|
|
|
|
|
extern RsEventStatus RsEventHandler(RsEvent event, void *param);
|
|
|
|
extern RsEventStatus RsKeyboardEventHandler(RsEvent event, void *param);
|
|
|
|
extern RsEventStatus RsPadEventHandler(RsEvent event, void *param);
|
|
|
|
|
2020-05-23 09:34:40 +00:00
|
|
|
extern RwBool
|
|
|
|
RsInitialize(void);
|
2019-05-31 17:02:26 +00:00
|
|
|
|
2020-05-23 09:34:40 +00:00
|
|
|
extern RwBool
|
2019-05-31 17:02:26 +00:00
|
|
|
RsRegisterImageLoader(void);
|
|
|
|
|
2020-05-23 09:34:40 +00:00
|
|
|
extern RwBool
|
|
|
|
RsRwInitialize(void *param);
|
2019-05-31 17:02:26 +00:00
|
|
|
|
2020-05-23 09:34:40 +00:00
|
|
|
extern RwBool
|
2019-05-31 17:02:26 +00:00
|
|
|
RsSelectDevice(void);
|
|
|
|
|
2020-05-23 09:34:40 +00:00
|
|
|
extern RwBool
|
2019-05-31 17:02:26 +00:00
|
|
|
RsInputDeviceAttach(RsInputDeviceType inputDevice,
|
2019-06-02 03:00:38 +00:00
|
|
|
RsInputEventHandler inputEventHandler);
|
2019-05-31 17:02:26 +00:00
|
|
|
|
2020-05-11 02:55:57 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
extern RwUInt32
|
|
|
|
#else
|
|
|
|
extern double
|
|
|
|
#endif
|
2019-05-31 17:02:26 +00:00
|
|
|
RsTimer(void);
|
|
|
|
|
|
|
|
extern void
|
|
|
|
RsCameraShowRaster(RwCamera *camera);
|
|
|
|
|
|
|
|
extern RwBool
|
|
|
|
RsCameraBeginUpdate(RwCamera *camera);
|
|
|
|
|
|
|
|
//TODO
|
|
|
|
//extern void
|
|
|
|
//RsMouseSetVisibility(RwBool visible);
|
|
|
|
|
2020-08-14 15:57:23 +00:00
|
|
|
extern RwImage*
|
|
|
|
RsGrabScreen(RwCamera *camera);
|
|
|
|
|
2019-05-31 17:02:26 +00:00
|
|
|
extern void
|
|
|
|
RsMouseSetPos(RwV2d *pos);
|
|
|
|
|
|
|
|
extern void
|
|
|
|
RsRwTerminate(void);
|
|
|
|
|
|
|
|
extern void
|
|
|
|
RsTerminate(void);
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif /* __cplusplus */
|
|
|
|
|
|
|
|
#endif /* SKELETON_H */
|