Code cleanup: replace a few macros in CCGSubSurf with inline functions.
This commit is contained in:
@@ -310,7 +310,11 @@ struct CCGVert {
|
||||
// byte *levelData;
|
||||
// byte *userData;
|
||||
};
|
||||
#define VERT_getLevelData(v) ((byte *) &(v)[1])
|
||||
|
||||
static CCG_INLINE byte *VERT_getLevelData(CCGVert *v)
|
||||
{
|
||||
return (byte*)(&(v)[1]);
|
||||
}
|
||||
|
||||
struct CCGEdge {
|
||||
CCGEdge *next; /* EHData.next */
|
||||
@@ -325,7 +329,11 @@ struct CCGEdge {
|
||||
// byte *levelData;
|
||||
// byte *userData;
|
||||
};
|
||||
#define EDGE_getLevelData(e) ((byte *) &(e)[1])
|
||||
|
||||
static CCG_INLINE byte *EDGE_getLevelData(CCGEdge *e)
|
||||
{
|
||||
return (byte*)(&(e)[1]);
|
||||
}
|
||||
|
||||
struct CCGFace {
|
||||
CCGFace *next; /* EHData.next */
|
||||
@@ -339,9 +347,21 @@ struct CCGFace {
|
||||
// byte **gridData;
|
||||
// byte *userData;
|
||||
};
|
||||
#define FACE_getVerts(f) ((CCGVert**) &(f)[1])
|
||||
#define FACE_getEdges(f) ((CCGEdge**) &(FACE_getVerts(f)[(f)->numVerts]))
|
||||
#define FACE_getCenterData(f) ((byte *) &(FACE_getEdges(f)[(f)->numVerts]))
|
||||
|
||||
static CCG_INLINE CCGVert **FACE_getVerts(CCGFace *f)
|
||||
{
|
||||
return (CCGVert**)(&f[1]);
|
||||
}
|
||||
|
||||
static CCG_INLINE CCGEdge **FACE_getEdges(CCGFace *f)
|
||||
{
|
||||
return (CCGEdge**)(&(FACE_getVerts(f)[f->numVerts]));
|
||||
}
|
||||
|
||||
static CCG_INLINE byte *FACE_getCenterData(CCGFace *f)
|
||||
{
|
||||
return (byte*)(&(FACE_getEdges(f)[(f)->numVerts]));
|
||||
}
|
||||
|
||||
typedef enum {
|
||||
eSyncState_None = 0,
|
||||
|
||||
Reference in New Issue
Block a user