Small changes.

This commit is contained in:
aap 2015-01-17 00:29:50 +01:00
parent 8e181bcae3
commit f8f7efab40
2 changed files with 32 additions and 21 deletions

View File

@ -22,6 +22,8 @@ namespace Rw {
// Node Name // Node Name
int32 NodeNameOffset;
static void* static void*
createNodeName(void *object, int32 offset, int32) createNodeName(void *object, int32 offset, int32)
{ {
@ -35,7 +37,7 @@ copyNodeName(void *dst, void *src, int32 offset, int32)
{ {
char *dstname = PLUGINOFFSET(char, dst, offset); char *dstname = PLUGINOFFSET(char, dst, offset);
char *srcname = PLUGINOFFSET(char, src, offset); char *srcname = PLUGINOFFSET(char, src, offset);
strncpy(dstname, srcname, 17); strncpy(dstname, srcname, 23);
return dst; return dst;
} }
@ -61,7 +63,7 @@ writeNodeName(Stream *stream, int32 len, void *object, int32 offset, int32)
} }
static int32 static int32
getSizeNodeName(void *object, int32 offset) getSizeNodeName(void *object, int32 offset, int32)
{ {
char *name = PLUGINOFFSET(char, object, offset); char *name = PLUGINOFFSET(char, object, offset);
int32 len = strlen(name); int32 len = strlen(name);
@ -72,13 +74,14 @@ getSizeNodeName(void *object, int32 offset)
void void
RegisterNodeNamePlugin(void) RegisterNodeNamePlugin(void)
{ {
Frame::registerPlugin(18, ID_NODENAME, NodeNameOffset = Frame::registerPlugin(24, ID_NODENAME,
(Constructor)createNodeName, createNodeName,
(Destructor)destroyNodeName, destroyNodeName,
(CopyConstructor)copyNodeName); copyNodeName);
Frame::registerPluginStream(0x253f2fe, (StreamRead)readNodeName, Frame::registerPluginStream(ID_NODENAME,
(StreamWrite)writeNodeName, readNodeName,
(StreamGetSize)getSizeNodeName); writeNodeName,
getSizeNodeName);
} }
// //
@ -87,6 +90,8 @@ RegisterNodeNamePlugin(void)
// Breakable Model // Breakable Model
int32 BreakableOffset;
static void* static void*
createBreakableModel(void *object, int32 offset, int32) createBreakableModel(void *object, int32 offset, int32)
{ {
@ -175,17 +180,19 @@ getSizeBreakableModel(void *object, int32 offset, int32)
void void
RegisterBreakableModelPlugin(void) RegisterBreakableModelPlugin(void)
{ {
Geometry::registerPlugin(sizeof(Breakable*), ID_BREAKABLE, BreakableOffset = Geometry::registerPlugin(sizeof(Breakable*),
createBreakableModel, ID_BREAKABLE,
destroyBreakableModel, NULL); createBreakableModel,
destroyBreakableModel, NULL);
Geometry::registerPluginStream(ID_BREAKABLE, Geometry::registerPluginStream(ID_BREAKABLE,
(StreamRead)readBreakableModel, readBreakableModel,
(StreamWrite)writeBreakableModel, writeBreakableModel,
(StreamGetSize)getSizeBreakableModel); getSizeBreakableModel);
} }
// Extra colors // Extra colors
int32 ExtraVertColorOffset;
static void* static void*
createExtraVertColors(void *object, int32 offset, int32) createExtraVertColors(void *object, int32 offset, int32)
@ -253,13 +260,14 @@ getSizeExtraVertColors(void *object, int32 offset, int32)
void void
RegisterExtraVertColorPlugin(void) RegisterExtraVertColorPlugin(void)
{ {
Geometry::registerPlugin(sizeof(ExtraVertColors), ID_EXTRAVERTCOLORS, ExtraVertColorOffset = Geometry::registerPlugin(sizeof(ExtraVertColors),
createExtraVertColors, ID_EXTRAVERTCOLORS,
destroyExtraVertColors, NULL); createExtraVertColors,
destroyExtraVertColors, NULL);
Geometry::registerPluginStream(ID_EXTRAVERTCOLORS, Geometry::registerPluginStream(ID_EXTRAVERTCOLORS,
(StreamRead)readExtraVertColors, readExtraVertColors,
(StreamWrite)writeExtraVertColors, writeExtraVertColors,
(StreamGetSize)getSizeExtraVertColors); getSizeExtraVertColors);
} }
} }

View File

@ -7,6 +7,7 @@ enum
ID_NODENAME = 0x253f2fe ID_NODENAME = 0x253f2fe
}; };
extern int32 NodeNameOffset;
void RegisterNodeNamePlugin(void); void RegisterNodeNamePlugin(void);
struct Breakable struct Breakable
@ -26,6 +27,7 @@ struct Breakable
float32 (*surfaceProps)[3]; float32 (*surfaceProps)[3];
}; };
extern int32 BreakableOffset;
void RegisterBreakableModelPlugin(void); void RegisterBreakableModelPlugin(void);
struct ExtraVertColors struct ExtraVertColors
@ -35,6 +37,7 @@ struct ExtraVertColors
float balance; float balance;
}; };
extern int32 ExtraVertColorOffset;
void RegisterExtraVertColorPlugin(void); void RegisterExtraVertColorPlugin(void);
} }