#ifdef _WIN32 #include #endif #include #ifndef RW_CORE_H #define RW_CORE_H #include #ifdef __cplusplus extern "C" { #endif #define TRUE 1 #define FALSE 0 enum RwPlatformID { rwID_PCD3D7 = 1, rwID_PCOGL = 2, rwID_MAC = 3, rwID_PS2 = 4, rwID_XBOX = 5, rwID_GAMECUBE = 6, rwID_SOFTRAS = 7, rwID_PCD3D8 = 8, rwID_PCD3D9 = 9 }; typedef enum RwPlatformID RwPlatformID; enum RwStreamAccessType { rwNASTREAMCCESS = 0, rwSTREAMREAD = 1, rwSTREAMWRITE = 2, rwSTREAMAPPEND = 3 }; typedef enum RwStreamAccessType RwStreamAccessType; enum RwStreamType { rwNASTREAM = 0, rwSTREAMFILE = 1, rwSTREAMFILENAME = 2, rwSTREAMMEMORY = 3, rwSTREAMCUSTOM = 4 }; typedef enum RwStreamType RwStreamType; enum RwCorePluginID { rwID_NAOBJECT = 0x0, rwID_STRUCT = 0x1, rwID_STRING = 0x2, rwID_EXTENSION = 0x3, rwID_CAMERA = 0x5, rwID_TEXTURE = 0x6, rwID_MATERIAL = 0x7, rwID_MATLIST = 0x8, rwID_ATOMICSECT = 0x9, rwID_PLANESECT = 0xA, rwID_WORLD = 0xB, rwID_SPLINE = 0xC, rwID_MATRIX = 0xD, rwID_FRAMELIST = 0xE, rwID_GEOMETRY = 0xF, rwID_CLUMP = 0x10, rwID_LIGHT = 0x12, rwID_UNICODESTRING = 0x13, rwID_ATOMIC = 0x14, rwID_TEXTURENATIVE = 0x15, rwID_TEXDICTIONARY = 0x16, rwID_ANIMDATABASE = 0x17, rwID_IMAGE = 0x18, rwID_SKINANIMATION = 0x19, rwID_GEOMETRYLIST = 0x1A, rwID_ANIMANIMATION = 0x1B, rwID_HANIMANIMATION = 0x1B, rwID_TEAM = 0x1C, rwID_CROWD = 0x1D, rwID_RIGHTTORENDER = 0x1F, rwID_MTEFFECTNATIVE = 0x20, rwID_MTEFFECTDICT = 0x21, rwID_TEAMDICTIONARY = 0x22, rwID_PITEXDICTIONARY = 0x23, rwID_TOC = 0x24, rwID_PRTSTDGLOBALDATA = 0x25, rwID_ALTPIPE = 0x26, rwID_PIPEDS = 0x27, rwID_PATCHMESH = 0x28, rwID_CHUNKGROUPSTART = 0x29, rwID_CHUNKGROUPEND = 0x2A, rwID_UVANIMDICT = 0x2B, rwID_COLLTREE = 0x2C, rwID_ENVIRONMENT = 0x2D, rwID_COREPLUGINIDMAX = 0x2E }; typedef enum RwCorePluginID RwCorePluginID; typedef unsigned char RwUInt8; typedef char RwInt8; typedef char RwChar; typedef unsigned short RwUInt16; typedef short RwInt16; typedef unsigned int RwUInt32; typedef int RwInt32; typedef float RwReal; typedef RwUInt32 RwBool; typedef struct RwChunkHeaderInfo RwChunkHeaderInfo; struct RwChunkHeaderInfo { RwUInt32 type; RwUInt32 length; RwUInt32 version; }; typedef struct RwStream RwStream; struct RwStream { FILE *file; }; extern RwStream *RwStreamWriteReal(RwStream *, RwReal *, RwUInt32 numBytes); extern RwStream *RwStreamWriteInt16(RwStream *, RwInt16 *, RwUInt32 numBytes); extern RwStream *RwStreamWriteInt32(RwStream *, RwInt32 *, RwUInt32 numBytes); extern RwStream *RwStreamReadReal(RwStream *, RwReal *, RwUInt32 numBytes); extern RwStream *RwStreamReadInt16(RwStream *, RwInt16 *, RwUInt32 numBytes); extern RwStream *RwStreamReadInt32(RwStream *, RwInt32 *, RwUInt32 numBytes); extern RwUInt32 RwStreamRead(RwStream *, void *buffer, RwUInt32 length); extern RwStream *RwStreamWrite(RwStream *, void *buffer, RwUInt32 length); extern RwStream *RwStreamSkip(RwStream *, RwUInt32 offset); extern RwBool RwStreamClose(RwStream *stream, void *pData); extern RwStream *RwStreamOpen(RwStreamType, RwStreamAccessType, void *pData); extern RwBool RwStreamFindChunk(RwStream *stream, RwUInt32 type, RwUInt32 *lengthOut, RwUInt32 *versionOut); extern RwStream *RwStreamReadChunkHeaderInfo(RwStream *stream, RwChunkHeaderInfo *chunkHeaderInfo); extern RwStream *RwStreamWriteChunkHeader(RwStream *stream, RwInt32 type, RwInt32 size); extern RwUInt32 RwEngineGetVersion(void); /* These functions are non-standard */ extern RwUInt32 RwStreamTell(RwStream *); extern RwUInt32 RwStreamGetLength(RwStream *); extern RwStream *RwStreamSeek(RwStream *, RwInt32); extern RwStream *RwStreamPeekInt32(RwStream *, RwInt32 *, RwUInt32 numBytes); typedef struct RwObject RwObject; struct RwObject { RwUInt8 type; RwUInt8 subType; RwUInt8 flags; RwUInt8 privateFlags; void *parent; }; extern RwUInt32 RwObjectGetType(RwObject *object); typedef struct RwV2d RwV2d; struct RwV2d { RwReal x; RwReal y; }; typedef struct RwV3d RwV3d; struct RwV3d { RwReal x; RwReal y; RwReal z; }; typedef struct RwV4d RwV4d; struct RwV4d { RwReal x; RwReal y; RwReal z; RwReal w; }; typedef struct RwMatrix RwMatrix; struct RwMatrix { RwV3d x; RwV3d y; RwV3d z; RwV3d w; }; typedef struct RwLLLink RwLLLink; struct RwLLLink { RwLLLink *next; RwLLLink *prev; }; typedef struct RwLinkList RwLinkList; struct RwLinkList { RwLLLink link; }; typedef struct RwSphere RwSphere; struct RwSphere { RwV3d position; RwReal radius; }; /* Not original RwTexture */ typedef struct RwTexture RwTexture; struct RwTexture { RwChar Name[32]; RwChar MaskName[32]; RwInt32 FilterFlags; RwInt32 width, height; RwInt32 depth; RwUInt8 *Data; RwUInt8 *Data_a; RwUInt8 *Palette; RwUInt32 PalLength; RwBool HasAlpha; /* PC only */ RwUInt32 RasterFormat; RwUInt32 MipmapCount; RwUInt32 Compression; RwUInt32 *Size; // RwUInt32 size1; /* OpenGL */ int TexID; int reversed; }; /* Not original RwTexDictionary */ typedef struct RwTexDictionary RwTexDictionary; struct RwTexDictionary { RwTexture *texture; RwUInt32 numTextures; /* Not Rw */ RwTexDictionary *Parent; }; extern RwTexDictionary *RwTexDictionaryStreamRead(RwStream *); extern RwTexDictionary *RwTexDictionaryCreate(void); extern void RwTexDictionaryDestroy(RwTexDictionary *); extern RwTexDictionary *RwTexDictionarySetCurrent(RwTexDictionary *); extern RwTexDictionary *RwTexDictionaryGetCurrent(void); extern void RwTextureReadPc(RwStream *, RwTexture *, RwUInt32 end); extern void RwTextureReadPs2(RwStream *, RwTexture *); extern RwTexture *RwTexDictionaryFindNamedTexture(RwTexDictionary *TexDict, const RwChar *Name); const RwChar *RwChunkHeaderInfoGetChunkName(RwUInt32 type); #ifdef __cplusplus } #endif #endif