2016-06-24 15:24:58 +02:00
|
|
|
|
|
|
|
namespace rw {
|
|
|
|
namespace wdgl {
|
|
|
|
|
|
|
|
// NOTE: This is not really RW OpenGL! It's specific to WarDrum's GTA ports
|
|
|
|
|
|
|
|
void initializePlatform(void);
|
|
|
|
|
|
|
|
struct AttribDesc
|
|
|
|
{
|
|
|
|
// arguments to glVertexAttribPointer (should use OpenGL types here)
|
|
|
|
// Vertex = 0, TexCoord, Normal, Color, Weight, Bone Index, Extra Color
|
|
|
|
uint32 index;
|
|
|
|
// float = 0, byte, ubyte, short, ushort
|
|
|
|
int32 type;
|
|
|
|
bool32 normalized;
|
|
|
|
int32 size;
|
|
|
|
uint32 stride;
|
|
|
|
uint32 offset;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct InstanceDataHeader : rw::InstanceDataHeader
|
|
|
|
{
|
|
|
|
int32 numAttribs;
|
|
|
|
AttribDesc *attribs;
|
|
|
|
uint32 dataSize;
|
|
|
|
uint8 *data;
|
|
|
|
|
|
|
|
// needed for rendering
|
|
|
|
uint32 vbo;
|
|
|
|
uint32 ibo;
|
|
|
|
};
|
|
|
|
|
|
|
|
// only RW_OPENGL
|
|
|
|
void uploadGeo(Geometry *geo);
|
|
|
|
void setAttribPointers(InstanceDataHeader *inst);
|
|
|
|
|
|
|
|
void packattrib(uint8 *dst, float32 *src, AttribDesc *a, float32 scale);
|
|
|
|
void unpackattrib(float *dst, uint8 *src, AttribDesc *a, float32 scale);
|
|
|
|
|
|
|
|
void *destroyNativeData(void *object, int32, int32);
|
|
|
|
Stream *readNativeData(Stream *stream, int32 len, void *object, int32, int32);
|
|
|
|
Stream *writeNativeData(Stream *stream, int32 len, void *object, int32, int32);
|
|
|
|
int32 getSizeNativeData(void *object, int32, int32);
|
|
|
|
void registerNativeDataPlugin(void);
|
|
|
|
|
|
|
|
void printPipeinfo(Atomic *a);
|
|
|
|
|
|
|
|
class ObjPipeline : public rw::ObjPipeline
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
uint32 numCustomAttribs;
|
|
|
|
uint32 (*instanceCB)(Geometry *g, int32 i, uint32 offset);
|
|
|
|
void (*uninstanceCB)(Geometry *g);
|
|
|
|
|
|
|
|
ObjPipeline(uint32 platform);
|
|
|
|
};
|
|
|
|
|
|
|
|
ObjPipeline *makeDefaultPipeline(void);
|
|
|
|
|
|
|
|
// Skin plugin
|
|
|
|
|
2016-06-27 21:59:35 +02:00
|
|
|
void initSkin(void);
|
2016-06-24 15:24:58 +02:00
|
|
|
Stream *readNativeSkin(Stream *stream, int32, void *object, int32 offset);
|
|
|
|
Stream *writeNativeSkin(Stream *stream, int32 len, void *object, int32 offset);
|
|
|
|
int32 getSizeNativeSkin(void *object, int32 offset);
|
|
|
|
|
|
|
|
ObjPipeline *makeSkinPipeline(void);
|
|
|
|
|
2016-06-27 21:59:35 +02:00
|
|
|
// MatFX plugin
|
|
|
|
|
|
|
|
void initMatFX(void);
|
2016-06-24 15:24:58 +02:00
|
|
|
ObjPipeline *makeMatFXPipeline(void);
|
|
|
|
|
|
|
|
// Raster
|
|
|
|
|
|
|
|
struct Texture : rw::Texture
|
|
|
|
{
|
|
|
|
void upload(void);
|
|
|
|
void bind(int n);
|
|
|
|
};
|
|
|
|
|
|
|
|
extern int32 nativeRasterOffset;
|
|
|
|
void registerNativeRaster(void);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|