2015-09-06 13:31:42 +02:00
|
|
|
namespace rw {
|
|
|
|
namespace d3d9 {
|
|
|
|
|
|
|
|
struct VertexElement
|
|
|
|
{
|
|
|
|
uint16 stream;
|
|
|
|
uint16 offset;
|
|
|
|
uint8 type;
|
|
|
|
uint8 method;
|
|
|
|
uint8 usage;
|
|
|
|
uint8 usageIndex;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct VertexStream
|
|
|
|
{
|
|
|
|
void *vertexBuffer;
|
|
|
|
uint32 offset;
|
|
|
|
uint32 stride;
|
|
|
|
uint16 geometryFlags;
|
|
|
|
uint8 managed;
|
|
|
|
uint8 dynamicLock;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct InstanceData
|
|
|
|
{
|
|
|
|
uint32 numIndex;
|
|
|
|
uint32 minVert;
|
|
|
|
Material *material;
|
|
|
|
bool32 vertexAlpha;
|
|
|
|
void *vertexShader;
|
|
|
|
uint32 baseIndex;
|
|
|
|
uint32 numVertices;
|
|
|
|
uint32 startIndex;
|
|
|
|
uint32 numPrimitives;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct InstanceDataHeader : rw::InstanceDataHeader
|
|
|
|
{
|
|
|
|
uint32 serialNumber;
|
|
|
|
uint32 numMeshes;
|
|
|
|
void *indexBuffer;
|
|
|
|
uint32 primType;
|
|
|
|
VertexStream vertexStream[2];
|
|
|
|
bool32 useOffsets;
|
|
|
|
void *vertexDeclaration;
|
|
|
|
uint32 totalNumIndex;
|
|
|
|
uint32 totalNumVertex;
|
|
|
|
|
|
|
|
InstanceData *inst;
|
|
|
|
};
|
|
|
|
|
|
|
|
void *createVertexDeclaration(VertexElement *elements);
|
|
|
|
uint32 getDeclaration(void *declaration, VertexElement *elements);
|
|
|
|
|
|
|
|
void *destroyNativeData(void *object, int32, int32);
|
|
|
|
void readNativeData(Stream *stream, int32 len, void *object, int32, int32);
|
|
|
|
void writeNativeData(Stream *stream, int32 len, void *object, int32, int32);
|
|
|
|
int32 getSizeNativeData(void *object, int32, int32);
|
|
|
|
void registerNativeDataPlugin(void);
|
|
|
|
|
|
|
|
class ObjPipeline : public rw::ObjPipeline
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void (*instanceCB)(Geometry *geo, InstanceDataHeader *header);
|
|
|
|
void (*uninstanceCB)(Geometry *geo, InstanceDataHeader *header);
|
2016-02-14 12:28:03 +01:00
|
|
|
void (*renderCB)(Atomic *atomic, InstanceDataHeader *header);
|
2015-09-06 13:31:42 +02:00
|
|
|
|
|
|
|
ObjPipeline(uint32 platform);
|
|
|
|
};
|
|
|
|
|
2016-02-14 12:28:03 +01:00
|
|
|
void defaultInstanceCB(Geometry *geo, InstanceDataHeader *header);
|
|
|
|
void defaultUninstanceCB(Geometry *geo, InstanceDataHeader *header);
|
|
|
|
void defaultRenderCB(Atomic *atomic, InstanceDataHeader *header);
|
|
|
|
|
2015-09-06 13:31:42 +02:00
|
|
|
ObjPipeline *makeDefaultPipeline(void);
|
|
|
|
|
|
|
|
ObjPipeline *makeSkinPipeline(void);
|
|
|
|
|
|
|
|
ObjPipeline *makeMatFXPipeline(void);
|
|
|
|
|
2016-02-07 01:25:52 +01:00
|
|
|
// Native Texture and Raster
|
|
|
|
|
|
|
|
Texture *readNativeTexture(Stream *stream);
|
|
|
|
void writeNativeTexture(Texture *tex, Stream *stream);
|
|
|
|
uint32 getSizeNativeTexture(Texture *tex);
|
|
|
|
|
2015-09-06 13:31:42 +02:00
|
|
|
}
|
|
|
|
}
|