diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_writeframeserver.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/CCGSubSurf.c | 92 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/CCGSubSurf.h | 28 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/DerivedMesh.c | 28 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/cdderivedmesh.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/customdata.c | 7 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/idprop.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/modifier.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle_system.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/softbody.c | 44 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 204 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/writeframeserver.c | 2 |
15 files changed, 211 insertions, 217 deletions
diff --git a/source/blender/blenkernel/BKE_writeframeserver.h b/source/blender/blenkernel/BKE_writeframeserver.h index a6ece63bc56..4774906a2fa 100644 --- a/source/blender/blenkernel/BKE_writeframeserver.h +++ b/source/blender/blenkernel/BKE_writeframeserver.h @@ -37,7 +37,7 @@ struct RenderData; extern void start_frameserver(struct RenderData *rd, int rectx, int recty); extern void end_frameserver(void); extern void append_frameserver(int frame, int *pixels, int rectx, int recty); -extern int frameserver_loop(); +extern int frameserver_loop(void); #ifdef __cplusplus } diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c index 1652b24e1e5..ce4458b4307 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.c +++ b/source/blender/blenkernel/intern/CCGSubSurf.c @@ -201,21 +201,21 @@ static CCGAllocatorIFC *_getStandardAllocatorIFC(void) { static int VertDataEqual(float *a, float *b) { return a[0]==b[0] && a[1]==b[1] && a[2]==b[2]; } -#define VertDataZero(av) { float *a = (float*) av; a[0] = a[1] = a[2] = 0.0f; } -#define VertDataCopy(av, bv) { float *a = (float*) av, *b = (float*) bv; a[0] =b[0]; a[1] =b[1]; a[2] =b[2]; } -#define VertDataAdd(av, bv) { float *a = (float*) av, *b = (float*) bv; a[0]+=b[0]; a[1]+=b[1]; a[2]+=b[2]; } -#define VertDataSub(av, bv) { float *a = (float*) av, *b = (float*) bv; a[0]-=b[0]; a[1]-=b[1]; a[2]-=b[2]; } -#define VertDataMulN(av, n) { float *a = (float*) av; a[0]*=n; a[1]*=n; a[2]*=n; } +#define VertDataZero(av) { float *_a = (float*) av; _a[0] = _a[1] = _a[2] = 0.0f; } +#define VertDataCopy(av, bv) { float *_a = (float*) av, *_b = (float*) bv; _a[0] =_b[0]; _a[1] =_b[1]; _a[2] =_b[2]; } +#define VertDataAdd(av, bv) { float *_a = (float*) av, *_b = (float*) bv; _a[0]+=_b[0]; _a[1]+=_b[1]; _a[2]+=_b[2]; } +#define VertDataSub(av, bv) { float *_a = (float*) av, *_b = (float*) bv; _a[0]-=_b[0]; _a[1]-=_b[1]; _a[2]-=_b[2]; } +#define VertDataMulN(av, n) { float *_a = (float*) av; _a[0]*=n; _a[1]*=n; _a[2]*=n; } #define VertDataAvg4(tv, av, bv, cv, dv) \ { \ - float *t = (float*) tv, *a = (float*) av, *b = (float*) bv, *c = (float*) cv, *d = (float*) dv; \ - t[0] = (a[0]+b[0]+c[0]+d[0])*.25; \ - t[1] = (a[1]+b[1]+c[1]+d[1])*.25; \ - t[2] = (a[2]+b[2]+c[2]+d[2])*.25; \ + float *_t = (float*) tv, *_a = (float*) av, *_b = (float*) bv, *_c = (float*) cv, *_d = (float*) dv; \ + _t[0] = (_a[0]+_b[0]+_c[0]+_d[0])*.25; \ + _t[1] = (_a[1]+_b[1]+_c[1]+_d[1])*.25; \ + _t[2] = (_a[2]+_b[2]+_c[2]+_d[2])*.25; \ } -#define NormZero(av) { float *a = (float*) av; a[0] = a[1] = a[2] = 0.0f; } -#define NormCopy(av, bv) { float *a = (float*) av, *b = (float*) bv; a[0] =b[0]; a[1] =b[1]; a[2] =b[2]; } -#define NormAdd(av, bv) { float *a = (float*) av, *b = (float*) bv; a[0]+=b[0]; a[1]+=b[1]; a[2]+=b[2]; } +#define NormZero(av) { float *_a = (float*) av; _a[0] = _a[1] = _a[2] = 0.0f; } +#define NormCopy(av, bv) { float *_a = (float*) av, *_b = (float*) bv; _a[0] =_b[0]; _a[1] =_b[1]; _a[2] =_b[2]; } +#define NormAdd(av, bv) { float *_a = (float*) av, *_b = (float*) bv; _a[0]+=_b[0]; _a[1]+=_b[1]; _a[2]+=_b[2]; } static int _edge_isBoundary(CCGEdge *e); @@ -330,7 +330,7 @@ struct _CCGSubSurf { /***/ -static CCGVert *_vert_new(CCGVertHDL vHDL, int levels, int dataSize, CCGSubSurf *ss) { +static CCGVert *_vert_new(CCGVertHDL vHDL, CCGSubSurf *ss) { CCGVert *v = CCGSUBSURF_alloc(ss, sizeof(CCGVert) + ss->meshIFC.vertDataSize * (ss->subdivLevels+1) + ss->meshIFC.vertUserSize); byte *userData; @@ -346,7 +346,7 @@ static CCGVert *_vert_new(CCGVertHDL vHDL, int levels, int dataSize, CCGSubSurf return v; } -static void _vert_remEdge(CCGVert *v, CCGEdge *e, CCGSubSurf *ss) { +static void _vert_remEdge(CCGVert *v, CCGEdge *e) { int i; for (i=0; i<v->numEdges; i++) { if (v->edges[i]==e) { @@ -355,7 +355,7 @@ static void _vert_remEdge(CCGVert *v, CCGEdge *e, CCGSubSurf *ss) { } } } -static void _vert_remFace(CCGVert *v, CCGFace *f, CCGSubSurf *ss) { +static void _vert_remFace(CCGVert *v, CCGFace *f) { int i; for (i=0; i<v->numFaces; i++) { if (v->faces[i]==f) { @@ -403,13 +403,13 @@ static void _vert_free(CCGVert *v, CCGSubSurf *ss) { CCGSUBSURF_free(ss, v); } -static int VERT_seam(CCGVert *v, CCGSubSurf *ss) { +static int VERT_seam(CCGVert *v) { return ((v->flags & Vert_eSeam) != 0); } /***/ -static CCGEdge *_edge_new(CCGEdgeHDL eHDL, CCGVert *v0, CCGVert *v1, float crease, int levels, int dataSize, CCGSubSurf *ss) { +static CCGEdge *_edge_new(CCGEdgeHDL eHDL, CCGVert *v0, CCGVert *v1, float crease, CCGSubSurf *ss) { CCGEdge *e = CCGSUBSURF_alloc(ss, sizeof(CCGEdge) + ss->meshIFC.vertDataSize *((ss->subdivLevels+1) + (1<<(ss->subdivLevels+1))-1) + ss->meshIFC.edgeUserSize); byte *userData; @@ -429,7 +429,7 @@ static CCGEdge *_edge_new(CCGEdgeHDL eHDL, CCGVert *v0, CCGVert *v1, float creas return e; } -static void _edge_remFace(CCGEdge *e, CCGFace *f, CCGSubSurf *ss) { +static void _edge_remFace(CCGEdge *e, CCGFace *f) { int i; for (i=0; i<e->numFaces; i++) { if (e->faces[i]==f) { @@ -478,8 +478,8 @@ static void _edge_free(CCGEdge *e, CCGSubSurf *ss) { CCGSUBSURF_free(ss, e); } static void _edge_unlinkMarkAndFree(CCGEdge *e, CCGSubSurf *ss) { - _vert_remEdge(e->v0, e, ss); - _vert_remEdge(e->v1, e, ss); + _vert_remEdge(e->v0, e); + _vert_remEdge(e->v1, e); e->v0->flags |= Vert_eEffected; e->v1->flags |= Vert_eEffected; _edge_free(e, ss); @@ -496,7 +496,7 @@ static float EDGE_getSharpness(CCGEdge *e, int lvl) { return e->crease - lvl; } -static CCGFace *_face_new(CCGFaceHDL fHDL, CCGVert **verts, CCGEdge **edges, int numVerts, int levels, int dataSize, CCGSubSurf *ss) { +static CCGFace *_face_new(CCGFaceHDL fHDL, CCGVert **verts, CCGEdge **edges, int numVerts, CCGSubSurf *ss) { int maxGridSize = 1 + (1<<(ss->subdivLevels-1)); CCGFace *f = CCGSUBSURF_alloc(ss, sizeof(CCGFace) + sizeof(CCGVert*)*numVerts + sizeof(CCGEdge*)*numVerts + ss->meshIFC.vertDataSize *(1 + numVerts*maxGridSize + numVerts*maxGridSize*maxGridSize) + ss->meshIFC.faceUserSize); byte *userData; @@ -610,8 +610,8 @@ static void _face_free(CCGFace *f, CCGSubSurf *ss) { static void _face_unlinkMarkAndFree(CCGFace *f, CCGSubSurf *ss) { int j; for (j=0; j<f->numVerts; j++) { - _vert_remFace(FACE_getVerts(f)[j], f, ss); - _edge_remFace(FACE_getEdges(f)[j], f, ss); + _vert_remFace(FACE_getVerts(f)[j], f); + _edge_remFace(FACE_getEdges(f)[j], f); FACE_getVerts(f)[j]->flags |= Vert_eEffected; } _face_free(f, ss); @@ -884,7 +884,7 @@ CCGError ccgSubSurf_syncVert(CCGSubSurf *ss, CCGVertHDL vHDL, void *vertData, in if (ss->syncState==eSyncState_Partial) { v = _ehash_lookupWithPrev(ss->vMap, vHDL, &prevp); if (!v) { - v = _vert_new(vHDL, ss->subdivLevels, ss->meshIFC.vertDataSize, ss); + v = _vert_new(vHDL, ss); VertDataCopy(_vert_getCo(v,0,ss->meshIFC.vertDataSize), vertData); _ehash_insert(ss->vMap, (EHEntry*) v); v->flags = Vert_eEffected|seamflag; @@ -913,7 +913,7 @@ CCGError ccgSubSurf_syncVert(CCGSubSurf *ss, CCGVertHDL vHDL, void *vertData, in v = _ehash_lookupWithPrev(ss->oldVMap, vHDL, &prevp); if (!v) { - v = _vert_new(vHDL, ss->subdivLevels, ss->meshIFC.vertDataSize, ss); + v = _vert_new(vHDL, ss); VertDataCopy(_vert_getCo(v,0,ss->meshIFC.vertDataSize), vertData); _ehash_insert(ss->vMap, (EHEntry*) v); v->flags = Vert_eEffected|seamflag; @@ -943,7 +943,7 @@ CCGError ccgSubSurf_syncEdge(CCGSubSurf *ss, CCGEdgeHDL eHDL, CCGVertHDL e_vHDL0 CCGVert *v0 = _ehash_lookup(ss->vMap, e_vHDL0); CCGVert *v1 = _ehash_lookup(ss->vMap, e_vHDL1); - eNew = _edge_new(eHDL, v0, v1, crease, ss->subdivLevels, ss->meshIFC.vertDataSize, ss); + eNew = _edge_new(eHDL, v0, v1, crease, ss); if (e) { *prevp = eNew; @@ -968,7 +968,7 @@ CCGError ccgSubSurf_syncEdge(CCGSubSurf *ss, CCGEdgeHDL eHDL, CCGVertHDL e_vHDL0 if (!e || e->v0->vHDL!=e_vHDL0 || e->v1->vHDL!=e_vHDL1|| e->crease!=crease) { CCGVert *v0 = _ehash_lookup(ss->vMap, e_vHDL0); CCGVert *v1 = _ehash_lookup(ss->vMap, e_vHDL1); - e = _edge_new(eHDL, v0, v1, crease, ss->subdivLevels, ss->meshIFC.vertDataSize, ss); + e = _edge_new(eHDL, v0, v1, crease, ss); _ehash_insert(ss->eMap, (EHEntry*) e); e->v0->flags |= Vert_eEffected; e->v1->flags |= Vert_eEffected; @@ -1017,7 +1017,7 @@ CCGError ccgSubSurf_syncFace(CCGSubSurf *ss, CCGFaceHDL fHDL, int numVerts, CCGV } if (!f || topologyChanged) { - fNew = _face_new(fHDL, ss->tempVerts, ss->tempEdges, numVerts, ss->subdivLevels, ss->meshIFC.vertDataSize, ss); + fNew = _face_new(fHDL, ss->tempVerts, ss->tempEdges, numVerts, ss); if (f) { ss->numGrids += numVerts - f->numVerts; @@ -1054,7 +1054,7 @@ CCGError ccgSubSurf_syncFace(CCGSubSurf *ss, CCGFaceHDL fHDL, int numVerts, CCGV if (!ss->tempEdges[k]) { if (ss->allowEdgeCreation) { - CCGEdge *e = ss->tempEdges[k] = _edge_new((CCGEdgeHDL) -1, ss->tempVerts[k], ss->tempVerts[(k+1)%numVerts], ss->defaultCreaseValue, ss->subdivLevels, ss->meshIFC.vertDataSize, ss); + CCGEdge *e = ss->tempEdges[k] = _edge_new((CCGEdgeHDL) -1, ss->tempVerts[k], ss->tempVerts[(k+1)%numVerts], ss->defaultCreaseValue, ss); _ehash_insert(ss->eMap, (EHEntry*) e); e->v0->flags |= Vert_eEffected; e->v1->flags |= Vert_eEffected; @@ -1075,7 +1075,7 @@ CCGError ccgSubSurf_syncFace(CCGSubSurf *ss, CCGFaceHDL fHDL, int numVerts, CCGV } if (!f || topologyChanged) { - f = _face_new(fHDL, ss->tempVerts, ss->tempEdges, numVerts, ss->subdivLevels, ss->meshIFC.vertDataSize, ss); + f = _face_new(fHDL, ss->tempVerts, ss->tempEdges, numVerts, ss); _ehash_insert(ss->fMap, (EHEntry*) f); ss->numGrids += numVerts; @@ -1228,7 +1228,7 @@ static void ccgSubSurf__sync(CCGSubSurf *ss) { void *nCo = VERT_getCo(v, nextLvl); int sharpCount = 0, allSharp = 1; float avgSharpness = 0.0; - int seam = VERT_seam(v, ss), seamEdges = 0; + int seam = VERT_seam(v), seamEdges = 0; for (i=0; i<v->numEdges; i++) { CCGEdge *e = v->edges[i]; @@ -1526,7 +1526,7 @@ static void ccgSubSurf__sync(CCGSubSurf *ss) { void *nCo = VERT_getCo(v, nextLvl); int sharpCount = 0, allSharp = 1; float avgSharpness = 0.0; - int seam = VERT_seam(v, ss), seamEdges = 0; + int seam = VERT_seam(v), seamEdges = 0; for (i=0; i<v->numEdges; i++) { CCGEdge *e = v->edges[i]; @@ -2071,7 +2071,7 @@ int ccgSubSurf_getGridLevelSize(CCGSubSurf *ss, int level) { /* Vert accessors */ -CCGVertHDL ccgSubSurf_getVertVertHandle(CCGSubSurf *ss, CCGVert *v) { +CCGVertHDL ccgSubSurf_getVertVertHandle(CCGVert *v) { return v->vHDL; } int ccgSubSurf_getVertAge(CCGSubSurf *ss, CCGVert *v) { @@ -2085,20 +2085,20 @@ int ccgSubSurf_getVertAge(CCGSubSurf *ss, CCGVert *v) { void *ccgSubSurf_getVertUserData(CCGSubSurf *ss, CCGVert *v) { return VERT_getLevelData(v) + ss->meshIFC.vertDataSize*(ss->subdivLevels+1); } -int ccgSubSurf_getVertNumFaces(CCGSubSurf *ss, CCGVert *v) { +int ccgSubSurf_getVertNumFaces(CCGVert *v) { return v->numFaces; } -CCGFace *ccgSubSurf_getVertFace(CCGSubSurf *ss, CCGVert *v, int index) { +CCGFace *ccgSubSurf_getVertFace(CCGVert *v, int index) { if (index<0 || index>=v->numFaces) { return NULL; } else { return v->faces[index]; } } -int ccgSubSurf_getVertNumEdges(CCGSubSurf *ss, CCGVert *v) { +int ccgSubSurf_getVertNumEdges(CCGVert *v) { return v->numEdges; } -CCGEdge *ccgSubSurf_getVertEdge(CCGSubSurf *ss, CCGVert *v, int index) { +CCGEdge *ccgSubSurf_getVertEdge(CCGVert *v, int index) { if (index<0 || index>=v->numEdges) { return NULL; } else { @@ -2118,7 +2118,7 @@ void *ccgSubSurf_getVertLevelData(CCGSubSurf *ss, CCGVert *v, int level) { /* Edge accessors */ -CCGEdgeHDL ccgSubSurf_getEdgeEdgeHandle(CCGSubSurf *ss, CCGEdge *e) { +CCGEdgeHDL ccgSubSurf_getEdgeEdgeHandle(CCGEdge *e) { return e->eHDL; } int ccgSubSurf_getEdgeAge(CCGSubSurf *ss, CCGEdge *e) { @@ -2132,20 +2132,20 @@ int ccgSubSurf_getEdgeAge(CCGSubSurf *ss, CCGEdge *e) { void *ccgSubSurf_getEdgeUserData(CCGSubSurf *ss, CCGEdge *e) { return EDGE_getLevelData(e) + ss->meshIFC.vertDataSize *((ss->subdivLevels+1) + (1<<(ss->subdivLevels+1))-1); } -int ccgSubSurf_getEdgeNumFaces(CCGSubSurf *ss, CCGEdge *e) { +int ccgSubSurf_getEdgeNumFaces(CCGEdge *e) { return e->numFaces; } -CCGFace *ccgSubSurf_getEdgeFace(CCGSubSurf *ss, CCGEdge *e, int index) { +CCGFace *ccgSubSurf_getEdgeFace(CCGEdge *e, int index) { if (index<0 || index>=e->numFaces) { return NULL; } else { return e->faces[index]; } } -CCGVert *ccgSubSurf_getEdgeVert0(CCGSubSurf *ss, CCGEdge *e) { +CCGVert *ccgSubSurf_getEdgeVert0(CCGEdge *e) { return e->v0; } -CCGVert *ccgSubSurf_getEdgeVert1(CCGSubSurf *ss, CCGEdge *e) { +CCGVert *ccgSubSurf_getEdgeVert1(CCGEdge *e) { return e->v1; } void *ccgSubSurf_getEdgeDataArray(CCGSubSurf *ss, CCGEdge *e) { @@ -2161,7 +2161,7 @@ void *ccgSubSurf_getEdgeLevelData(CCGSubSurf *ss, CCGEdge *e, int x, int level) return _edge_getCo(e, level, x, ss->meshIFC.vertDataSize); } } -float ccgSubSurf_getEdgeCrease(CCGSubSurf *ss, CCGEdge *e) { +float ccgSubSurf_getEdgeCrease(CCGEdge *e) { return e->crease; } @@ -2182,7 +2182,7 @@ void *ccgSubSurf_getFaceUserData(CCGSubSurf *ss, CCGFace *f) { int maxGridSize = 1 + (1<<(ss->subdivLevels-1)); return FACE_getCenterData(f) + ss->meshIFC.vertDataSize *(1 + f->numVerts*maxGridSize + f->numVerts*maxGridSize*maxGridSize); } -int ccgSubSurf_getFaceNumVerts(CCGSubSurf *ss, CCGFace *f) { +int ccgSubSurf_getFaceNumVerts(CCGFace *f) { return f->numVerts; } CCGVert *ccgSubSurf_getFaceVert(CCGSubSurf *ss, CCGFace *f, int index) { @@ -2199,7 +2199,7 @@ CCGEdge *ccgSubSurf_getFaceEdge(CCGSubSurf *ss, CCGFace *f, int index) { return FACE_getEdges(f)[index]; } } -int ccgSubSurf_getFaceEdgeIndex(CCGSubSurf *ss, CCGFace *f, CCGEdge *e) { +int ccgSubSurf_getFaceEdgeIndex(CCGFace *f, CCGEdge *e) { int i; for (i=0; i<f->numVerts; i++) @@ -2208,7 +2208,7 @@ int ccgSubSurf_getFaceEdgeIndex(CCGSubSurf *ss, CCGFace *f, CCGEdge *e) { return -1; } -void *ccgSubSurf_getFaceCenterData(CCGSubSurf *ss, CCGFace *f) { +void *ccgSubSurf_getFaceCenterData(CCGFace *f) { return FACE_getCenterData(f); } void *ccgSubSurf_getFaceGridEdgeDataArray(CCGSubSurf *ss, CCGFace *f, int gridIndex) { diff --git a/source/blender/blenkernel/intern/CCGSubSurf.h b/source/blender/blenkernel/intern/CCGSubSurf.h index 91f3ffab43b..fbd0aecc0a5 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.h +++ b/source/blender/blenkernel/intern/CCGSubSurf.h @@ -82,11 +82,11 @@ int ccgSubSurf_getGridSize (CCGSubSurf *ss); int ccgSubSurf_getGridLevelSize (CCGSubSurf *ss, int level); CCGVert* ccgSubSurf_getVert (CCGSubSurf *ss, CCGVertHDL v); -CCGVertHDL ccgSubSurf_getVertVertHandle (CCGSubSurf *ss, CCGVert *v); -int ccgSubSurf_getVertNumFaces (CCGSubSurf *ss, CCGVert *v); -CCGFace* ccgSubSurf_getVertFace (CCGSubSurf *ss, CCGVert *v, int index); -int ccgSubSurf_getVertNumEdges (CCGSubSurf *ss, CCGVert *v); -CCGEdge* ccgSubSurf_getVertEdge (CCGSubSurf *ss, CCGVert *v, int index); +CCGVertHDL ccgSubSurf_getVertVertHandle (CCGVert *v); +int ccgSubSurf_getVertNumFaces (CCGVert *v); +CCGFace* ccgSubSurf_getVertFace (CCGVert *v, int index); +int ccgSubSurf_getVertNumEdges (CCGVert *v); +CCGEdge* ccgSubSurf_getVertEdge (CCGVert *v, int index); int ccgSubSurf_getVertAge (CCGSubSurf *ss, CCGVert *v); void* ccgSubSurf_getVertUserData (CCGSubSurf *ss, CCGVert *v); @@ -94,12 +94,12 @@ void* ccgSubSurf_getVertData (CCGSubSurf *ss, CCGVert *v); void* ccgSubSurf_getVertLevelData (CCGSubSurf *ss, CCGVert *v, int level); CCGEdge* ccgSubSurf_getEdge (CCGSubSurf *ss, CCGEdgeHDL e); -CCGEdgeHDL ccgSubSurf_getEdgeEdgeHandle (CCGSubSurf *ss, CCGEdge *e); -int ccgSubSurf_getEdgeNumFaces (CCGSubSurf *ss, CCGEdge *e); -CCGFace* ccgSubSurf_getEdgeFace (CCGSubSurf *ss, CCGEdge *e, int index); -CCGVert* ccgSubSurf_getEdgeVert0 (CCGSubSurf *ss, CCGEdge *e); -CCGVert* ccgSubSurf_getEdgeVert1 (CCGSubSurf *ss, CCGEdge *e); -float ccgSubSurf_getEdgeCrease (CCGSubSurf *ss, CCGEdge *e); +CCGEdgeHDL ccgSubSurf_getEdgeEdgeHandle (CCGEdge *e); +int ccgSubSurf_getEdgeNumFaces (CCGEdge *e); +CCGFace* ccgSubSurf_getEdgeFace (CCGEdge *e, int index); +CCGVert* ccgSubSurf_getEdgeVert0 (CCGEdge *e); +CCGVert* ccgSubSurf_getEdgeVert1 (CCGEdge *e); +float ccgSubSurf_getEdgeCrease (CCGEdge *e); int ccgSubSurf_getEdgeAge (CCGSubSurf *ss, CCGEdge *e); void* ccgSubSurf_getEdgeUserData (CCGSubSurf *ss, CCGEdge *e); @@ -109,14 +109,14 @@ void* ccgSubSurf_getEdgeLevelData (CCGSubSurf *ss, CCGEdge *e, int x, int lev CCGFace* ccgSubSurf_getFace (CCGSubSurf *ss, CCGFaceHDL f); CCGFaceHDL ccgSubSurf_getFaceFaceHandle (CCGSubSurf *ss, CCGFace *f); -int ccgSubSurf_getFaceNumVerts (CCGSubSurf *ss, CCGFace *f); +int ccgSubSurf_getFaceNumVerts (CCGFace *f); CCGVert* ccgSubSurf_getFaceVert (CCGSubSurf *ss, CCGFace *f, int index); CCGEdge* ccgSubSurf_getFaceEdge (CCGSubSurf *ss, CCGFace *f, int index); -int ccgSubSurf_getFaceEdgeIndex (CCGSubSurf *ss, CCGFace *f, CCGEdge *e); +int ccgSubSurf_getFaceEdgeIndex (CCGFace *f, CCGEdge *e); int ccgSubSurf_getFaceAge (CCGSubSurf *ss, CCGFace *f); void* ccgSubSurf_getFaceUserData (CCGSubSurf *ss, CCGFace *f); -void* ccgSubSurf_getFaceCenterData (CCGSubSurf *ss, CCGFace *f); +void* ccgSubSurf_getFaceCenterData (CCGFace *f); void* ccgSubSurf_getFaceGridEdgeDataArray (CCGSubSurf *ss, CCGFace *f, int gridIndex); void* ccgSubSurf_getFaceGridEdgeData (CCGSubSurf *ss, CCGFace *f, int gridIndex, int x); void* ccgSubSurf_getFaceGridDataArray (CCGSubSurf *ss, CCGFace *f, int gridIndex); diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c index 569229cb8ab..d4b17f97ad9 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.c +++ b/source/blender/blenkernel/intern/DerivedMesh.c @@ -94,7 +94,7 @@ /////////////////////////////////// /////////////////////////////////// -MVert *dm_getVertArray(DerivedMesh *dm) +static MVert *dm_getVertArray(DerivedMesh *dm) { MVert *mvert = CustomData_get_layer(&dm->vertData, CD_MVERT); @@ -108,7 +108,7 @@ MVert *dm_getVertArray(DerivedMesh *dm) return mvert; } -MEdge *dm_getEdgeArray(DerivedMesh *dm) +static MEdge *dm_getEdgeArray(DerivedMesh *dm) { MEdge *medge = CustomData_get_layer(&dm->edgeData, CD_MEDGE); @@ -122,7 +122,7 @@ MEdge *dm_getEdgeArray(DerivedMesh *dm) return medge; } -MFace *dm_getFaceArray(DerivedMesh *dm) +static MFace *dm_getFaceArray(DerivedMesh *dm) { MFace *mface = CustomData_get_layer(&dm->faceData, CD_MFACE); @@ -136,7 +136,7 @@ MFace *dm_getFaceArray(DerivedMesh *dm) return mface; } -MVert *dm_dupVertArray(DerivedMesh *dm) +static MVert *dm_dupVertArray(DerivedMesh *dm) { MVert *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumVerts(dm), "dm_dupVertArray tmp"); @@ -146,7 +146,7 @@ MVert *dm_dupVertArray(DerivedMesh *dm) return tmp; } -MEdge *dm_dupEdgeArray(DerivedMesh *dm) +static MEdge *dm_dupEdgeArray(DerivedMesh *dm) { MEdge *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumEdges(dm), "dm_dupEdgeArray tmp"); @@ -156,7 +156,7 @@ MEdge *dm_dupEdgeArray(DerivedMesh *dm) return tmp; } -MFace *dm_dupFaceArray(DerivedMesh *dm) +static MFace *dm_dupFaceArray(DerivedMesh *dm) { MFace *tmp = MEM_callocN(sizeof(*tmp) * dm->getNumFaces(dm), "dm_dupFaceArray tmp"); @@ -912,8 +912,8 @@ static void emDM_drawMappedFacesGLSL(DerivedMesh *dm, glVertexAttrib3fvARB(attribs.orco.glIndex, orco); \ } \ for(b = 0; b < attribs.tottface; b++) { \ - MTFace *tf = (MTFace*)((char*)efa->data + attribs.tface[b].emOffset); \ - glVertexAttrib2fvARB(attribs.tface[b].glIndex, tf->uv[vert]); \ + MTFace *_tf = (MTFace*)((char*)efa->data + attribs.tface[b].emOffset); \ + glVertexAttrib2fvARB(attribs.tface[b].glIndex, _tf->uv[vert]); \ } \ for(b = 0; b < attribs.totmcol; b++) { \ MCol *cp = (MCol*)((char*)efa->data + attribs.mcol[b].emOffset); \ @@ -1069,7 +1069,7 @@ static int emDM_getNumFaces(DerivedMesh *dm) return BLI_countlist(&emdm->em->faces); } -void emDM_getVert(DerivedMesh *dm, int index, MVert *vert_r) +static void emDM_getVert(DerivedMesh *dm, int index, MVert *vert_r) { EditVert *ev = ((EditMeshDerivedMesh *)dm)->em->verts.first; int i; @@ -1087,7 +1087,7 @@ void emDM_getVert(DerivedMesh *dm, int index, MVert *vert_r) vert_r->bweight = (unsigned char) (ev->bweight*255.0f); } -void emDM_getEdge(DerivedMesh *dm, int index, MEdge *edge_r) +static void emDM_getEdge(DerivedMesh *dm, int index, MEdge *edge_r) { EditMesh *em = ((EditMeshDerivedMesh *)dm)->em; EditEdge *ee = em->edges.first; @@ -1122,7 +1122,7 @@ void emDM_getEdge(DerivedMesh *dm, int index, MEdge *edge_r) } } -void emDM_getFace(DerivedMesh *dm, int index, MFace *face_r) +static void emDM_getFace(DerivedMesh *dm, int index, MFace *face_r) { EditMesh *em = ((EditMeshDerivedMesh *)dm)->em; EditFace *ef = em->faces.first; @@ -1164,7 +1164,7 @@ void emDM_getFace(DerivedMesh *dm, int index, MFace *face_r) test_index_face(face_r, NULL, 0, ef->v4?4:3); } -void emDM_copyVertArray(DerivedMesh *dm, MVert *vert_r) +static void emDM_copyVertArray(DerivedMesh *dm, MVert *vert_r) { EditVert *ev = ((EditMeshDerivedMesh *)dm)->em->verts.first; @@ -1182,7 +1182,7 @@ void emDM_copyVertArray(DerivedMesh *dm, MVert *vert_r) } } -void emDM_copyEdgeArray(DerivedMesh *dm, MEdge *edge_r) +static void emDM_copyEdgeArray(DerivedMesh *dm, MEdge *edge_r) { EditMesh *em = ((EditMeshDerivedMesh *)dm)->em; EditEdge *ee = em->edges.first; @@ -1210,7 +1210,7 @@ void emDM_copyEdgeArray(DerivedMesh *dm, MEdge *edge_r) } } -void emDM_copyFaceArray(DerivedMesh *dm, MFace *face_r) +static void emDM_copyFaceArray(DerivedMesh *dm, MFace *face_r) { EditMesh *em = ((EditMeshDerivedMesh *)dm)->em; EditFace *ef = em->faces.first; diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index c30d86431b1..2c1b5ced614 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -121,7 +121,7 @@ static void cdDM_copyEdgeArray(DerivedMesh *dm, MEdge *edge_r) memcpy(edge_r, cddm->medge, sizeof(*edge_r) * dm->numEdgeData); } -void cdDM_copyFaceArray(DerivedMesh *dm, MFace *face_r) +static void cdDM_copyFaceArray(DerivedMesh *dm, MFace *face_r) { CDDerivedMesh *cddm = (CDDerivedMesh *)dm; memcpy(face_r, cddm->mface, sizeof(*face_r) * dm->numFaceData); diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 2c1f6bb84c1..e93266c85f3 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -265,9 +265,9 @@ static void layerSwap_tface(void *data, int *corner_indices) { MTFace *tf = data; float uv[4][2]; - const static short pin_flags[4] = + static const short pin_flags[4] = { TF_PIN1, TF_PIN2, TF_PIN3, TF_PIN4 }; - const static char sel_flags[4] = + static const char sel_flags[4] = { TF_SEL1, TF_SEL2, TF_SEL3, TF_SEL4 }; short unwrap = tf->unwrap & ~(TF_PIN1 | TF_PIN2 | TF_PIN3 | TF_PIN4); char flag = tf->flag & ~(TF_SEL1 | TF_SEL2 | TF_SEL3 | TF_SEL4); @@ -926,12 +926,9 @@ void *CustomData_add_layer_named(CustomData *data, int type, int alloctype, int CustomData_free_layer(CustomData *data, int type, int totelem, int index) { int i; - CustomDataLayer *layer; if (index < 0) return 0; - layer = &data->layers[index]; - customData_free_layer__internal(&data->layers[index], totelem); for (i=index+1; i < data->totlayer; ++i) diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index f67fcd7a1b7..be24d1d2474 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -1234,7 +1234,7 @@ void curve_calc_modifiers_pre(Object *ob, ListBase *nurb, int forRender, float ( *numVerts_r = numVerts; } -void curve_calc_modifiers_post(Object *ob, ListBase *nurb, ListBase *dispbase, int forRender, float (*originalVerts)[3], float (*deformedVerts)[3]) +static void curve_calc_modifiers_post(Object *ob, ListBase *nurb, ListBase *dispbase, int forRender, float (*originalVerts)[3], float (*deformedVerts)[3]) { int editmode = (!forRender && ob==G.obedit); ModifierData *md = modifiers_getVirtualModifierList(ob); diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index b16f52571f6..0a140ebaba1 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -317,7 +317,7 @@ void IDP_FreeIterBeforeEnd(void *vself) This is because all ID Property freeing functions free only direct data (not the ID Property struct itself), but for Groups the child properties *are* considered direct data.*/ -void IDP_FreeGroup(IDProperty *prop) +static void IDP_FreeGroup(IDProperty *prop) { IDProperty *loop, *next; for (loop=prop->data.group.first; loop; loop=next) diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 27fa00ac239..18570515057 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -585,7 +585,7 @@ void tag_image_time(Image *ima) ima->lastused = (int)PIL_check_seconds_timer(); } -void tag_all_images_time() +static void tag_all_images_time() { Image *ima; int ctime = (int)PIL_check_seconds_timer(); diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 5ef7f985435..0822042f855 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -7063,7 +7063,6 @@ static DerivedMesh * explodeModifier_explodeMesh(ExplodeModifierData *emd, { DerivedMesh *explode, *dm=to_explode; MFace *mf=0; - MVert *dupvert=0; ParticleSettings *part=psmd->psys->part; ParticleData *pa=NULL, *pars=psmd->psys->particles; ParticleKey state; @@ -7118,7 +7117,7 @@ static DerivedMesh * explodeModifier_explodeMesh(ExplodeModifierData *emd, /* the final duplicated vertices */ explode= CDDM_from_template(dm, totdup, 0,totface); - dupvert= CDDM_get_verts(explode); + /*dupvert= CDDM_get_verts(explode);*/ /* getting back to object space */ Mat4Invert(imat,ob->obmat); diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c index f6bfaf14b7e..02c06b94b6c 100644 --- a/source/blender/blenkernel/intern/particle.c +++ b/source/blender/blenkernel/intern/particle.c @@ -1368,7 +1368,7 @@ ParticleSystemModifierData *psys_get_modifier(Object *ob, ParticleSystem *psys) /* Particles on a shape */ /************************************************/ /* ready for future use */ -void psys_particle_on_shape(int distr, int index, float *fuv, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor) +static void psys_particle_on_shape(int distr, int index, float *fuv, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor) { /* TODO */ float zerovec[3]={0.0f,0.0f,0.0f}; @@ -2268,7 +2268,7 @@ void psys_thread_create_path(ParticleThread *thread, struct ChildParticle *cpa, } } -void *exec_child_path_cache(void *data) +static void *exec_child_path_cache(void *data) { ParticleThread *thread= (ParticleThread*)data; ParticleThreadContext *ctx= thread->ctx; diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index ef675c1c791..3aac1b5f4a5 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -864,7 +864,7 @@ void psys_thread_distribute_particle(ParticleThread *thread, ParticleData *pa, C } } -void *exec_distribution(void *data) +static void *exec_distribution(void *data) { ParticleThread *thread= (ParticleThread*)data; ParticleSystem *psys= thread->ctx->psys; @@ -3877,7 +3877,7 @@ static void boid_body(BoidVecFunc *bvf, ParticleData *pa, ParticleSystem *psys, /************************************************/ /* Hair */ /************************************************/ -void save_hair(Object *ob, ParticleSystem *psys, ParticleSystemModifierData *psmd, float cfra){ +static void save_hair(Object *ob, ParticleSystem *psys, ParticleSystemModifierData *psmd, float cfra){ ParticleData *pa; HairKey *key; int totpart; @@ -4643,7 +4643,7 @@ static void system_step(Object *ob, ParticleSystem *psys, ParticleSystemModifier } } -void psys_to_softbody(Object *ob, ParticleSystem *psys) +static void psys_to_softbody(Object *ob, ParticleSystem *psys) { SoftBody *sb; short softflag; diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 508b2233536..5d93f10526a 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -236,7 +236,7 @@ typedef struct ccd_Mesh { -ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm) +static ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm) { ccd_Mesh *pccd_M = NULL; ccdf_minmax *mima =NULL; @@ -333,7 +333,7 @@ ccd_Mesh *ccd_mesh_make(Object *ob, DerivedMesh *dm) } return pccd_M; } -void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm) +static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm) { ccdf_minmax *mima =NULL; MFace *mface=NULL; @@ -472,7 +472,7 @@ void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M, DerivedMesh *dm) return ; } -void ccd_mesh_free(ccd_Mesh *ccdm) +static void ccd_mesh_free(ccd_Mesh *ccdm) { if(ccdm && (ccdm->savety == CCD_SAVETY )){ /*make sure we're not nuking objects we don't know*/ MEM_freeN(ccdm->mface); @@ -484,7 +484,7 @@ void ccd_mesh_free(ccd_Mesh *ccdm) } } -void ccd_build_deflector_hache(Object *vertexowner,GHash *hash) +static void ccd_build_deflector_hache(Object *vertexowner,GHash *hash) { Base *base; Object *ob; @@ -536,7 +536,7 @@ void ccd_build_deflector_hache(Object *vertexowner,GHash *hash) } /* while (base) */ } -void ccd_update_deflector_hache(Object *vertexowner,GHash *hash) +static void ccd_update_deflector_hache(Object *vertexowner,GHash *hash) { Base *base; Object *ob; @@ -991,7 +991,7 @@ static int query_external_colliders(Object *me) /* +++ the aabb "force" section*/ -int sb_detect_aabb_collisionCached( float force[3], unsigned int par_layer,struct Object *vertexowner,float time) +static int sb_detect_aabb_collisionCached( float force[3], unsigned int par_layer,struct Object *vertexowner,float time) { Object *ob; SoftBody *sb=vertexowner->soft; @@ -1055,7 +1055,7 @@ int sb_detect_aabb_collisionCached( float force[3], unsigned int par_layer,struc /* +++ the face external section*/ -int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float face_v3[3],float *damp, +static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float face_v3[3],float *damp, float force[3], unsigned int par_layer,struct Object *vertexowner,float time) { Object *ob; @@ -1153,7 +1153,7 @@ int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float face_v3[3 } -int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],float face_v3[3],float *damp, +static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],float face_v3[3],float *damp, float force[3], unsigned int par_layer,struct Object *vertexowner,float time) { Object *ob; @@ -1291,7 +1291,7 @@ int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],float face_ -void scan_for_ext_face_forces(Object *ob,float timenow) +static void scan_for_ext_face_forces(Object *ob,float timenow) { SoftBody *sb = ob->soft; BodyFace *bf; @@ -1379,7 +1379,7 @@ void scan_for_ext_face_forces(Object *ob,float timenow) /* +++ the spring external section*/ -int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],float *damp, +static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],float *damp, float force[3], unsigned int par_layer,struct Object *vertexowner,float time) { Object *ob; @@ -1530,7 +1530,7 @@ int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],float *damp -void _scan_for_ext_spring_forces(Object *ob,float timenow,int ifirst,int ilast, struct ListBase *do_effector) +static void _scan_for_ext_spring_forces(Object *ob,float timenow,int ifirst,int ilast, struct ListBase *do_effector) { SoftBody *sb = ob->soft; int a; @@ -1601,7 +1601,7 @@ void _scan_for_ext_spring_forces(Object *ob,float timenow,int ifirst,int ilast, } -void scan_for_ext_spring_forces(Object *ob,float timenow) +static void scan_for_ext_spring_forces(Object *ob,float timenow) { SoftBody *sb = ob->soft; ListBase *do_effector= NULL; @@ -1613,14 +1613,14 @@ void scan_for_ext_spring_forces(Object *ob,float timenow) pdEndEffectors(do_effector); } -void *exec_scan_for_ext_spring_forces(void *data) +static void *exec_scan_for_ext_spring_forces(void *data) { SB_thread_context *pctx = (SB_thread_context*)data; _scan_for_ext_spring_forces(pctx->ob,pctx->timenow,pctx->ifirst,pctx->ilast,pctx->do_effector); return 0; } -void sb_sfesf_threads_run(struct Object *ob, float timenow,int totsprings,int *ptr_to_break_func()) +static void sb_sfesf_threads_run(struct Object *ob, float timenow,int totsprings,int *ptr_to_break_func()) { ListBase *do_effector = NULL; ListBase threads; @@ -1682,7 +1682,7 @@ void sb_sfesf_threads_run(struct Object *ob, float timenow,int totsprings,int *p /* --- the spring external section*/ -int choose_winner(float*w, float* pos,float*a,float*b,float*c,float*ca,float*cb,float*cc) +static int choose_winner(float*w, float* pos,float*a,float*b,float*c,float*ca,float*cb,float*cc) { float mindist,cp; int winner =1; @@ -1709,7 +1709,7 @@ int choose_winner(float*w, float* pos,float*a,float*b,float*c,float*ca,float*cb, -int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], float *damp, +static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3], float *damp, float force[3], unsigned int par_layer,struct Object *vertexowner, float time,float vel[3], float *intrusion) { @@ -2119,7 +2119,7 @@ static void sb_spring_force(Object *ob,int bpi,BodySpring *bs,float iks,float fo /* since this is definitely the most CPU consuming task here .. try to spread it */ /* core function _softbody_calc_forces_slice_in_a_thread */ /* result is int to be able to flag user break */ -int _softbody_calc_forces_slice_in_a_thread(Object *ob, float forcetime, float timenow,int ifirst,int ilast,int *ptr_to_break_func(),ListBase *do_effector,int do_deflector,float fieldfactor, float windfactor) +static int _softbody_calc_forces_slice_in_a_thread(Object *ob, float forcetime, float timenow,int ifirst,int ilast,int *ptr_to_break_func(),ListBase *do_effector,int do_deflector,float fieldfactor, float windfactor) { float iks; int bb,do_selfcollision,do_springcollision,do_aero; @@ -2319,14 +2319,14 @@ int _softbody_calc_forces_slice_in_a_thread(Object *ob, float forcetime, float t return 0; /*done fine*/ } -void *exec_softbody_calc_forces(void *data) +static void *exec_softbody_calc_forces(void *data) { SB_thread_context *pctx = (SB_thread_context*)data; _softbody_calc_forces_slice_in_a_thread(pctx->ob,pctx->forcetime,pctx->timenow,pctx->ifirst,pctx->ilast,NULL,pctx->do_effector,pctx->do_deflector,pctx->fieldfactor,pctx->windfactor); return 0; } -void sb_cf_threads_run(struct Object *ob, float forcetime, float timenow,int totpoint,int *ptr_to_break_func(),struct ListBase *do_effector,int do_deflector,float fieldfactor, float windfactor) +static void sb_cf_threads_run(struct Object *ob, float forcetime, float timenow,int totpoint,int *ptr_to_break_func(),struct ListBase *do_effector,int do_deflector,float fieldfactor, float windfactor) { ListBase threads; SB_thread_context *sb_threads; @@ -3067,7 +3067,7 @@ static void softbody_apply_goalsnap(Object *ob) } -void apply_spring_memory(Object *ob) +static void apply_spring_memory(Object *ob) { SoftBody *sb = ob->soft; BodySpring *bs; @@ -3293,7 +3293,7 @@ static void mesh_faces_to_scratch(Object *ob) helper function to get proper spring length when object is rescaled */ -float globallen(float *v1,float *v2,Object *ob) +static float globallen(float *v1,float *v2,Object *ob) { float p1[3],p2[3]; VECCOPY(p1,v1); @@ -3711,7 +3711,7 @@ static int softbody_read_cache(Object *ob, float framenr) } /* +++ ************ maintaining scratch *************** */ -void sb_new_scratch(SoftBody *sb) +static void sb_new_scratch(SoftBody *sb) { if (!sb) return; sb->scratch = MEM_callocN(sizeof(SBScratch), "SBScratch"); diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index e6797186b53..f79009e673d 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -86,9 +86,9 @@ struct CCGDerivedMesh { typedef struct CCGDerivedMesh CCGDerivedMesh; -static int ccgDM_getVertMapIndex(CCGDerivedMesh *ccgdm, CCGSubSurf *ss, CCGVert *v); -static int ccgDM_getEdgeMapIndex(CCGDerivedMesh *ccgdm, CCGSubSurf *ss, CCGEdge *e); -static int ccgDM_getFaceMapIndex(CCGDerivedMesh *ccgdm, CCGSubSurf *ss, CCGFace *f); +static int ccgDM_getVertMapIndex(CCGSubSurf *ss, CCGVert *v); +static int ccgDM_getEdgeMapIndex(CCGSubSurf *ss, CCGEdge *e); +static int ccgDM_getFaceMapIndex(CCGSubSurf *ss, CCGFace *f); /// @@ -161,8 +161,8 @@ static CCGSubSurf *_getSubSurf(CCGSubSurf *prevSS, int subdivLevels, int useAgin } static int getEdgeIndex(CCGSubSurf *ss, CCGEdge *e, int x, int edgeSize) { - CCGVert *v0 = ccgSubSurf_getEdgeVert0(ss, e); - CCGVert *v1 = ccgSubSurf_getEdgeVert1(ss, e); + CCGVert *v0 = ccgSubSurf_getEdgeVert0(e); + CCGVert *v1 = ccgSubSurf_getEdgeVert1(e); int v0idx = *((int*) ccgSubSurf_getVertUserData(ss, v0)); int v1idx = *((int*) ccgSubSurf_getVertUserData(ss, v1)); int edgeBase = *((int*) ccgSubSurf_getEdgeUserData(ss, e)); @@ -177,7 +177,7 @@ static int getEdgeIndex(CCGSubSurf *ss, CCGEdge *e, int x, int edgeSize) { } static int getFaceIndex(CCGSubSurf *ss, CCGFace *f, int S, int x, int y, int edgeSize, int gridSize) { int faceBase = *((int*) ccgSubSurf_getFaceUserData(ss, f)); - int numVerts = ccgSubSurf_getFaceNumVerts(ss, f); + int numVerts = ccgSubSurf_getFaceNumVerts(f); if (x==gridSize-1 && y==gridSize-1) { CCGVert *v = ccgSubSurf_getFaceVert(ss, f, S); @@ -186,7 +186,7 @@ static int getFaceIndex(CCGSubSurf *ss, CCGFace *f, int S, int x, int y, int edg CCGVert *v = ccgSubSurf_getFaceVert(ss, f, S); CCGEdge *e = ccgSubSurf_getFaceEdge(ss, f, S); int edgeBase = *((int*) ccgSubSurf_getEdgeUserData(ss, e)); - if (v==ccgSubSurf_getEdgeVert0(ss, e)) { + if (v==ccgSubSurf_getEdgeVert0(e)) { return edgeBase + (gridSize-1-y)-1; } else { return edgeBase + (edgeSize-2-1)-((gridSize-1-y)-1); @@ -195,7 +195,7 @@ static int getFaceIndex(CCGSubSurf *ss, CCGFace *f, int S, int x, int y, int edg CCGVert *v = ccgSubSurf_getFaceVert(ss, f, S); CCGEdge *e = ccgSubSurf_getFaceEdge(ss, f, (S+numVerts-1)%numVerts); int edgeBase = *((int*) ccgSubSurf_getEdgeUserData(ss, e)); - if (v==ccgSubSurf_getEdgeVert0(ss, e)) { + if (v==ccgSubSurf_getEdgeVert0(e)) { return edgeBase + (gridSize-1-x)-1; } else { return edgeBase + (edgeSize-2-1)-((gridSize-1-x)-1); @@ -300,7 +300,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm, if ((mv0->flag&mv1->flag) & ME_VERT_MERGED) crease = creaseFactor; else - crease = ccgSubSurf_getEdgeCrease(origss, orige); + crease = ccgSubSurf_getEdgeCrease(orige); ccgSubSurf_syncEdge(ss, ehdl, fverts[j], fverts[(j+1)%nverts], crease, &e); BLI_edgehash_insert(ehash, v0, v1, NULL); @@ -368,7 +368,7 @@ static void set_subsurf_uv(CCGSubSurf *ss, DerivedMesh *dm, DerivedMesh *result, for(index = 0; index < totface; index++) { CCGFace *f = faceMap[index]; - int numVerts = ccgSubSurf_getFaceNumVerts(uvss, f); + int numVerts = ccgSubSurf_getFaceNumVerts(f); for (S=0; S<numVerts; S++) { VertData *faceGridData= ccgSubSurf_getFaceGridDataArray(uvss, f, S); @@ -399,12 +399,12 @@ static void set_subsurf_uv(CCGSubSurf *ss, DerivedMesh *dm, DerivedMesh *result, static unsigned int ss_getEdgeFlags(CCGSubSurf *ss, CCGEdge *e, int ssFromEditmesh, DispListMesh *dlm, MEdge *medge, MTFace *tface) { unsigned int flags = 0; - int N = ccgSubSurf_getEdgeNumFaces(ss, e); + int N = ccgSubSurf_getEdgeNumFaces(e); if (!N) flags |= ME_LOOSEEDGE; if (ssFromEditmesh) { - EditEdge *eed = ccgSubSurf_getEdgeEdgeHandle(ss, e); + EditEdge *eed = ccgSubSurf_getEdgeEdgeHandle(e); flags |= ME_EDGEDRAW|ME_EDGERENDER; if (eed->seam) { @@ -470,7 +470,7 @@ static void calc_ss_weights(int gridFaces, } } -DerivedMesh *ss_to_cdderivedmesh(CCGSubSurf *ss, int ssFromEditmesh, +static DerivedMesh *ss_to_cdderivedmesh(CCGSubSurf *ss, int ssFromEditmesh, int drawInteriorEdges, int useSubsurfUv, DerivedMesh *dm) { @@ -480,7 +480,6 @@ DerivedMesh *ss_to_cdderivedmesh(CCGSubSurf *ss, int ssFromEditmesh, int gridFaces = gridSize - 1; int edgeBase, faceBase; int i, j, k, S, x, y, index; - int vertBase = 0; CCGVertIterator *vi; CCGEdgeIterator *ei; CCGFaceIterator *fi; @@ -503,7 +502,7 @@ DerivedMesh *ss_to_cdderivedmesh(CCGSubSurf *ss, int ssFromEditmesh, for(; !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) { CCGVert *v = ccgVertIterator_getCurrent(vi); - vertMap2[GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ss, v))] = v; + vertMap2[GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v))] = v; } ccgVertIterator_free(vi); @@ -513,7 +512,7 @@ DerivedMesh *ss_to_cdderivedmesh(CCGSubSurf *ss, int ssFromEditmesh, for(; !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) { CCGEdge *e = ccgEdgeIterator_getCurrent(ei); - edgeMap2[GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(ss, e))] = e; + edgeMap2[GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e))] = e; } totface = ccgSubSurf_getNumFaces(ss); @@ -543,18 +542,18 @@ DerivedMesh *ss_to_cdderivedmesh(CCGSubSurf *ss, int ssFromEditmesh, for(index = 0; index < totface; index++) { CCGFace *f = faceMap2[index]; - int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(ss, f); + int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f); FaceVertWeight *weight = (numVerts == 4) ? qweight : tweight; int vertIdx[4]; for(S = 0; S < numVerts; S++) { CCGVert *v = ccgSubSurf_getFaceVert(ss, f, S); - vertIdx[S] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ss, v)); + vertIdx[S] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v)); } DM_interp_vert_data(dm, result, vertIdx, weight[0][0], numVerts, i); - VecCopyf(mvert->co, ccgSubSurf_getFaceCenterData(ss, f)); + VecCopyf(mvert->co, ccgSubSurf_getFaceCenterData(f)); *origIndex = ORIGINDEX_NONE; ++mvert; ++origIndex; @@ -613,10 +612,10 @@ DerivedMesh *ss_to_cdderivedmesh(CCGSubSurf *ss, int ssFromEditmesh, int vertIdx[2]; CCGVert *v; - v = ccgSubSurf_getEdgeVert0(ss, e); - vertIdx[0] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ss, v)); - v = ccgSubSurf_getEdgeVert1(ss, e); - vertIdx[1] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ss, v)); + v = ccgSubSurf_getEdgeVert0(e); + vertIdx[0] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v)); + v = ccgSubSurf_getEdgeVert1(e); + vertIdx[1] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v)); for(x = 1; x < edgeSize - 1; x++) { float w[2]; @@ -634,18 +633,17 @@ DerivedMesh *ss_to_cdderivedmesh(CCGSubSurf *ss, int ssFromEditmesh, edgeBase += edgeSize-2; } - vertBase = i; for(index = 0; index < totvert; index++) { CCGVert *v = vertMap2[index]; int vertIdx; - vertIdx = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ss, v)); + vertIdx = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v)); DM_copy_vert_data(dm, result, vertIdx, i, 1); VecCopyf(mvert->co, ccgSubSurf_getVertData(ss, v)); *((int*)ccgSubSurf_getVertUserData(ss, v)) = i; - *origIndex = ccgDM_getVertMapIndex(NULL, ss, v); + *origIndex = ccgDM_getVertMapIndex(ss, v); ++mvert; ++origIndex; i++; @@ -658,7 +656,7 @@ DerivedMesh *ss_to_cdderivedmesh(CCGSubSurf *ss, int ssFromEditmesh, for(index = 0; index < totface; index++) { CCGFace *f = faceMap2[index]; - int numVerts = ccgSubSurf_getFaceNumVerts(ss, f); + int numVerts = ccgSubSurf_getFaceNumVerts(f); for(k = 0; k < numVerts; k++) { for(x = 0; x < gridFaces; x++) { @@ -701,9 +699,9 @@ DerivedMesh *ss_to_cdderivedmesh(CCGSubSurf *ss, int ssFromEditmesh, CCGEdge *e = edgeMap2[index]; unsigned int flags = 0; char bweight = 0; - int edgeIdx = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(ss, e)); + int edgeIdx = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e)); - if(!ccgSubSurf_getEdgeNumFaces(ss, e)) flags |= ME_LOOSEEDGE; + if(!ccgSubSurf_getEdgeNumFaces(e)) flags |= ME_LOOSEEDGE; if(edgeIdx != -1 && dm) { @@ -719,7 +717,7 @@ DerivedMesh *ss_to_cdderivedmesh(CCGSubSurf *ss, int ssFromEditmesh, med->v2 = getEdgeIndex(ss, e, x + 1, edgeSize); med->flag = flags; med->bweight = bweight; - *origIndex = ccgDM_getEdgeMapIndex(NULL, ss, e); + *origIndex = ccgDM_getEdgeMapIndex(ss, e); ++med; ++origIndex; i++; @@ -733,10 +731,10 @@ DerivedMesh *ss_to_cdderivedmesh(CCGSubSurf *ss, int ssFromEditmesh, for(index = 0; index < totface; index++) { CCGFace *f = faceMap2[index]; - int numVerts = ccgSubSurf_getFaceNumVerts(ss, f); + int numVerts = ccgSubSurf_getFaceNumVerts(f); int mat_nr; int flag; - int mapIndex = ccgDM_getFaceMapIndex(NULL, ss, f); + int mapIndex = ccgDM_getFaceMapIndex(ss, f); int faceIdx = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, f)); if(!ssFromEditmesh) { @@ -900,15 +898,15 @@ static void ss_sync_from_derivedmesh(CCGSubSurf *ss, DerivedMesh *dm, /***/ -static int ccgDM_getVertMapIndex(CCGDerivedMesh *ccgdm, CCGSubSurf *ss, CCGVert *v) { +static int ccgDM_getVertMapIndex(CCGSubSurf *ss, CCGVert *v) { return ((int*) ccgSubSurf_getVertUserData(ss, v))[1]; } -static int ccgDM_getEdgeMapIndex(CCGDerivedMesh *ccgdm, CCGSubSurf *ss, CCGEdge *e) { +static int ccgDM_getEdgeMapIndex(CCGSubSurf *ss, CCGEdge *e) { return ((int*) ccgSubSurf_getEdgeUserData(ss, e))[1]; } -static int ccgDM_getFaceMapIndex(CCGDerivedMesh *ccgdm, CCGSubSurf *ss, CCGFace *f) { +static int ccgDM_getFaceMapIndex(CCGSubSurf *ss, CCGFace *f) { return ((int*) ccgSubSurf_getFaceUserData(ss, f))[1]; } @@ -941,7 +939,7 @@ static void ccgDM_getMinMax(DerivedMesh *dm, float min_r[3], float max_r[3]) { for (; !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) { CCGFace *f = ccgFaceIterator_getCurrent(fi); - int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(ss, f); + int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f); for (S=0; S<numVerts; S++) { VertData *faceGridData = ccgSubSurf_getFaceGridDataArray(ss, f, S); @@ -997,7 +995,7 @@ static void ccgDM_getFinalVert(DerivedMesh *dm, int vertNum, MVert *mv) ++i; f = ccgdm->faceMap[i].face; - numVerts = ccgSubSurf_getFaceNumVerts(ss, f); + numVerts = ccgSubSurf_getFaceNumVerts(f); gridSideVerts = gridSize - 2; gridInternalVerts = gridSideVerts * gridSideVerts; @@ -1007,7 +1005,7 @@ static void ccgDM_getFinalVert(DerivedMesh *dm, int vertNum, MVert *mv) offset = vertNum - ccgdm->faceMap[i].startVert; if(offset < 1) { - VecCopyf(mv->co, ccgSubSurf_getFaceCenterData(ss, f)); + VecCopyf(mv->co, ccgSubSurf_getFaceCenterData(f)); } else if(offset < gridSideEnd) { offset -= 1; grid = offset / gridSideVerts; @@ -1069,7 +1067,7 @@ static void ccgDM_getFinalEdge(DerivedMesh *dm, int edgeNum, MEdge *med) ++i; f = ccgdm->faceMap[i].face; - numVerts = ccgSubSurf_getFaceNumVerts(ss, f); + numVerts = ccgSubSurf_getFaceNumVerts(f); gridSideEdges = gridSize - 1; gridInternalEdges = (gridSideEdges - 1) * gridSideEdges * 2; @@ -1105,7 +1103,7 @@ static void ccgDM_getFinalEdge(DerivedMesh *dm, int edgeNum, MEdge *med) e = ccgdm->edgeMap[i].edge; - if(!ccgSubSurf_getEdgeNumFaces(ss, e)) flags |= ME_LOOSEEDGE; + if(!ccgSubSurf_getEdgeNumFaces(e)) flags |= ME_LOOSEEDGE; x = edgeNum - ccgdm->edgeMap[i].startEdge; @@ -1147,7 +1145,7 @@ static void ccgDM_getFinalFace(DerivedMesh *dm, int faceNum, MFace *mf) ++i; f = ccgdm->faceMap[i].face; - numVerts = ccgSubSurf_getFaceNumVerts(ss, f); + numVerts = ccgSubSurf_getFaceNumVerts(f); offset = faceNum - ccgdm->faceMap[i].startFace; grid = offset / gridFaces; @@ -1177,9 +1175,9 @@ static void ccgDM_copyFinalVertArray(DerivedMesh *dm, MVert *mvert) totface = ccgSubSurf_getNumFaces(ss); for(index = 0; index < totface; index++) { CCGFace *f = ccgdm->faceMap[index].face; - int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(ss, f); + int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f); - VecCopyf(mvert[i++].co, ccgSubSurf_getFaceCenterData(ss, f)); + VecCopyf(mvert[i++].co, ccgSubSurf_getFaceCenterData(f)); for(S = 0; S < numVerts; S++) { for(x = 1; x < gridSize - 1; x++) { @@ -1232,7 +1230,7 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge) totface = ccgSubSurf_getNumFaces(ss); for(index = 0; index < totface; index++) { CCGFace *f = ccgdm->faceMap[index].face; - int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(ss, f); + int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f); for(S = 0; S < numVerts; S++) { for(x = 0; x < gridSize - 1; x++) { @@ -1276,9 +1274,9 @@ static void ccgDM_copyFinalEdgeArray(DerivedMesh *dm, MEdge *medge) CCGEdge *e = ccgdm->edgeMap[index].edge; unsigned int flags = 0; int x; - int edgeIdx = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(ss, e)); + int edgeIdx = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e)); - if(!ccgSubSurf_getEdgeNumFaces(ss, e)) flags |= ME_LOOSEEDGE; + if(!ccgSubSurf_getEdgeNumFaces(e)) flags |= ME_LOOSEEDGE; if(edgeFlags) { if(edgeIdx != -1) { @@ -1313,7 +1311,7 @@ static void ccgDM_copyFinalFaceArray(DerivedMesh *dm, MFace *mface) totface = ccgSubSurf_getNumFaces(ss); for(index = 0; index < totface; index++) { CCGFace *f = ccgdm->faceMap[index].face; - int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(ss, f); + int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f); int mat_nr = 0; int flag = ME_SMOOTH; /* assume face is smooth by default */ @@ -1360,7 +1358,7 @@ static void ccgdm_getVertCos(DerivedMesh *dm, float (*cos)[3]) { for (; !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) { CCGVert *v = ccgVertIterator_getCurrent(vi); - vertMap2[GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ss, v))] = v; + vertMap2[GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v))] = v; } ccgVertIterator_free(vi); @@ -1370,7 +1368,7 @@ static void ccgdm_getVertCos(DerivedMesh *dm, float (*cos)[3]) { for (i=0; !ccgEdgeIterator_isStopped(ei); i++,ccgEdgeIterator_next(ei)) { CCGEdge *e = ccgEdgeIterator_getCurrent(ei); - edgeMap2[GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(ss, e))] = e; + edgeMap2[GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e))] = e; } totface = ccgSubSurf_getNumFaces(ss); @@ -1386,9 +1384,9 @@ static void ccgdm_getVertCos(DerivedMesh *dm, float (*cos)[3]) { i = 0; for (index=0; index<totface; index++) { CCGFace *f = faceMap2[index]; - int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(ss, f); + int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f); - VecCopyf(cos[i++], ccgSubSurf_getFaceCenterData(ss, f)); + VecCopyf(cos[i++], ccgSubSurf_getFaceCenterData(f)); for (S=0; S<numVerts; S++) { for (x=1; x<gridSize-1; x++) { @@ -1430,7 +1428,7 @@ static void ccgDM_foreachMappedVert(DerivedMesh *dm, void (*func)(void *userData for (; !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) { CCGVert *v = ccgVertIterator_getCurrent(vi); VertData *vd = ccgSubSurf_getVertData(ccgdm->ss, v); - int index = ccgDM_getVertMapIndex(ccgdm, ccgdm->ss, v); + int index = ccgDM_getVertMapIndex(ccgdm->ss, v); if (index!=-1) func(userData, index, vd->co, vd->no, NULL); @@ -1447,7 +1445,7 @@ static void ccgDM_foreachMappedEdge(DerivedMesh *dm, void (*func)(void *userData for (; !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) { CCGEdge *e = ccgEdgeIterator_getCurrent(ei); VertData *edgeData = ccgSubSurf_getEdgeDataArray(ss, e); - int index = ccgDM_getEdgeMapIndex(ccgdm, ss, e); + int index = ccgDM_getEdgeMapIndex(ss, e); if (index!=-1) { for (i=0; i<edgeSize-1; i++) @@ -1488,9 +1486,9 @@ static void ccgDM_drawVerts(DerivedMesh *dm) { fi = ccgSubSurf_getFaceIterator(ss); for (; !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) { CCGFace *f = ccgFaceIterator_getCurrent(fi); - int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(ss, f); + int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f); - glVertex3fv(ccgSubSurf_getFaceCenterData(ss, f)); + glVertex3fv(ccgSubSurf_getFaceCenterData(f)); for (S=0; S<numVerts; S++) for (x=1; x<gridSize-1; x++) glVertex3fv(ccgSubSurf_getFaceGridEdgeData(ss, f, S, x)); @@ -1517,7 +1515,7 @@ static void ccgDM_drawEdges(DerivedMesh *dm, int drawLooseEdges) { CCGEdge *e = ccgEdgeIterator_getCurrent(ei); VertData *edgeData = ccgSubSurf_getEdgeDataArray(ss, e); - if (!drawLooseEdges && !ccgSubSurf_getEdgeNumFaces(ss, e)) + if (!drawLooseEdges && !ccgSubSurf_getEdgeNumFaces(e)) continue; if (useAging && !(G.f&G_BACKBUFSEL)) { @@ -1540,7 +1538,7 @@ static void ccgDM_drawEdges(DerivedMesh *dm, int drawLooseEdges) { if (ccgdm->drawInteriorEdges) { for (; !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) { CCGFace *f = ccgFaceIterator_getCurrent(fi); - int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(ss, f); + int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f); for (S=0; S<numVerts; S++) { VertData *faceGridData = ccgSubSurf_getFaceGridDataArray(ss, f, S); @@ -1578,7 +1576,7 @@ static void ccgDM_drawLooseEdges(DerivedMesh *dm) { CCGEdge *e = ccgEdgeIterator_getCurrent(ei); VertData *edgeData = ccgSubSurf_getEdgeDataArray(ss, e); - if (!ccgSubSurf_getEdgeNumFaces(ss, e)) { + if (!ccgSubSurf_getEdgeNumFaces(e)) { glBegin(GL_LINE_STRIP); for (i=0; i<edgeSize-1; i++) { glVertex3fv(edgeData[i].co); @@ -1615,7 +1613,7 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, int (*setMaterial)(int, void * for (; !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) { CCGFace *f = ccgFaceIterator_getCurrent(fi); - int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(ss, f); + int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f); int index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, f)); int drawSmooth, mat_nr; @@ -1723,9 +1721,9 @@ static void ccgDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, v CCGFace *f = ccgdm->faceMap[i].face; int S, x, y, drawSmooth; int index = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, f)); - int origIndex = ccgDM_getFaceMapIndex(ccgdm, ss, f); + int origIndex = ccgDM_getFaceMapIndex(ss, f); - numVerts = ccgSubSurf_getFaceNumVerts(ss, f); + numVerts = ccgSubSurf_getFaceNumVerts(f); if(faceFlags) { drawSmooth = (faceFlags[index*4] & ME_SMOOTH); @@ -1858,7 +1856,7 @@ static void ccgDM_drawFacesColored(DerivedMesh *dm, int useTwoSided, unsigned ch glBegin(GL_QUADS); for (; !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) { CCGFace *f = ccgFaceIterator_getCurrent(fi); - int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(ss, f); + int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f); for (S=0; S<numVerts; S++) { VertData *faceGridData = ccgSubSurf_getFaceGridDataArray(ss, f, S); @@ -1916,8 +1914,8 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm, totface = ccgSubSurf_getNumFaces(ss); for(i = 0; i < totface; i++) { CCGFace *f = ccgdm->faceMap[i].face; - int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(ss, f); - int drawSmooth, index = ccgDM_getFaceMapIndex(ccgdm, ss, f); + int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f); + int drawSmooth, index = ccgDM_getFaceMapIndex(ss, f); int origIndex = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, f)); unsigned char *cp= NULL; int mat_nr; @@ -1999,28 +1997,28 @@ static void ccgDM_drawFacesTex_common(DerivedMesh *dm, glBegin(GL_QUADS); for (y=0; y<gridFaces; y++) { for (x=0; x<gridFaces; x++) { - float *a = faceGridData[(y+0)*gridSize + x].co; - float *b = faceGridData[(y+0)*gridSize + x + 1].co; - float *c = faceGridData[(y+1)*gridSize + x + 1].co; - float *d = faceGridData[(y+1)*gridSize + x].co; + float *a_co = faceGridData[(y+0)*gridSize + x].co; + float *b_co = faceGridData[(y+0)*gridSize + x + 1].co; + float *c_co = faceGridData[(y+1)*gridSize + x + 1].co; + float *d_co = faceGridData[(y+1)*gridSize + x].co; - ccgDM_glNormalFast(a, b, c, d); + ccgDM_glNormalFast(a_co, b_co, c_co, d_co); if(tf) glTexCoord2fv(tf->uv[1]); if(cp) glColor3ub(cp[7], cp[6], cp[5]); - glVertex3fv(d); + glVertex3fv(d_co); if(tf) glTexCoord2fv(tf->uv[2]); if(cp) glColor3ub(cp[11], cp[10], cp[9]); - glVertex3fv(c); + glVertex3fv(c_co); if(tf) glTexCoord2fv(tf->uv[3]); if(cp) glColor3ub(cp[15], cp[14], cp[13]); - glVertex3fv(b); + glVertex3fv(b_co); if(tf) glTexCoord2fv(tf->uv[0]); if(cp) glColor3ub(cp[3], cp[2], cp[1]); - glVertex3fv(a); + glVertex3fv(a_co); if(tf) tf++; if(cp) cp += 16; @@ -2084,8 +2082,8 @@ static void ccgDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *u for (i=0; !ccgFaceIterator_isStopped(fi); i++,ccgFaceIterator_next(fi)) { CCGFace *f = ccgFaceIterator_getCurrent(fi); - int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(ss, f); - int drawSmooth, index = ccgDM_getFaceMapIndex(ccgdm, ss, f); + int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f); + int drawSmooth, index = ccgDM_getFaceMapIndex(ss, f); int origIndex; origIndex = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, f)); @@ -2166,7 +2164,7 @@ static void ccgDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *u for (; !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) { CCGEdge *e = ccgEdgeIterator_getCurrent(ei); VertData *edgeData = ccgSubSurf_getEdgeDataArray(ss, e); - int index = ccgDM_getEdgeMapIndex(ccgdm, ss, e); + int index = ccgDM_getEdgeMapIndex(ss, e); glBegin(GL_LINE_STRIP); if (index!=-1 && (!setDrawOptions || setDrawOptions(userData, index))) { @@ -2196,7 +2194,7 @@ static void ccgDM_drawMappedEdgesInterp(DerivedMesh *dm, int (*setDrawOptions)(v for (; !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) { CCGEdge *e = ccgEdgeIterator_getCurrent(ei); VertData *edgeData = ccgSubSurf_getEdgeDataArray(ss, e); - int index = ccgDM_getEdgeMapIndex(ccgdm, ss, e); + int index = ccgDM_getEdgeMapIndex(ss, e); glBegin(GL_LINE_STRIP); if (index!=-1 && (!setDrawOptions || setDrawOptions(userData, index))) { @@ -2223,7 +2221,7 @@ static void ccgDM_foreachMappedFaceCenter(DerivedMesh *dm, void (*func)(void *us for (; !ccgFaceIterator_isStopped(fi); ccgFaceIterator_next(fi)) { CCGFace *f = ccgFaceIterator_getCurrent(fi); - int index = ccgDM_getFaceMapIndex(ccgdm, ss, f); + int index = ccgDM_getFaceMapIndex(ss, f); if (index!=-1) { /* Face center data normal isn't updated atm. */ @@ -2259,17 +2257,17 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, int index, totvert, totedge, totface; int i; int vertNum, edgeNum, faceNum; - int *vertOrigIndex, *edgeOrigIndex, *faceOrigIndex; + int *vertOrigIndex, *faceOrigIndex; /* *edgeOrigIndex - as yet, unused */ int *edgeFlags; char *faceFlags; int edgeSize; int gridSize; int gridFaces; int gridSideVerts; - int gridInternalVerts; + /*int gridInternalVerts; - as yet unused */ int gridSideEdges; int gridInternalEdges; - MVert *mvert = NULL; + /* MVert *mvert = NULL; - as yet unused */ MEdge *medge = NULL; MFace *mface = NULL; FaceVertWeight *qweight, *tweight; @@ -2333,7 +2331,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, for(; !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) { CCGVert *v = ccgVertIterator_getCurrent(vi); - ccgdm->vertMap[GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ss, v))].vert = v; + ccgdm->vertMap[GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v))].vert = v; } ccgVertIterator_free(vi); @@ -2343,7 +2341,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, for(; !ccgEdgeIterator_isStopped(ei); ccgEdgeIterator_next(ei)) { CCGEdge *e = ccgEdgeIterator_getCurrent(ei); - ccgdm->edgeMap[GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(ss, e))].edge = e; + ccgdm->edgeMap[GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e))].edge = e; } totface = ccgSubSurf_getNumFaces(ss); @@ -2360,7 +2358,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, gridSize = ccgSubSurf_getGridSize(ss); gridFaces = gridSize - 1; gridSideVerts = gridSize - 2; - gridInternalVerts = gridSideVerts * gridSideVerts; + /*gridInternalVerts = gridSideVerts * gridSideVerts; - as yet, unused */ gridSideEdges = gridSize - 1; gridInternalEdges = (gridSideEdges - 1) * gridSideEdges * 2; @@ -2370,21 +2368,21 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, edgeNum = 0; faceNum = 0; - mvert = dm->getVertArray(dm); + /* mvert = dm->getVertArray(dm); - as yet unused */ medge = dm->getEdgeArray(dm); mface = dm->getFaceArray(dm); vertOrigIndex = DM_get_vert_data_layer(&ccgdm->dm, CD_ORIGINDEX); - edgeOrigIndex = DM_get_edge_data_layer(&ccgdm->dm, CD_ORIGINDEX); + /*edgeOrigIndex = DM_get_edge_data_layer(&ccgdm->dm, CD_ORIGINDEX);*/ faceOrigIndex = DM_get_face_data_layer(&ccgdm->dm, CD_ORIGINDEX); faceFlags = DM_get_face_data_layer(&ccgdm->dm, CD_FLAGS); for(index = 0; index < totface; ++index) { CCGFace *f = ccgdm->faceMap[index].face; - int numVerts = ccgSubSurf_getFaceNumVerts(ss, f); + int numVerts = ccgSubSurf_getFaceNumVerts(f); int numFinalEdges = numVerts * (gridSideEdges + gridInternalEdges); - int mapIndex = ccgDM_getFaceMapIndex(ccgdm, ss, f); + int mapIndex = ccgDM_getFaceMapIndex(ss, f); int origIndex = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(ss, f)); FaceVertWeight *weight = (numVerts == 4) ? qweight : tweight; int S, x, y; @@ -2400,7 +2398,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, for(S = 0; S < numVerts; S++) { CCGVert *v = ccgSubSurf_getFaceVert(ss, f, S); - vertIdx[S] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ss, v)); + vertIdx[S] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v)); } DM_interp_vert_data(dm, &ccgdm->dm, vertIdx, weight[0][0], @@ -2503,16 +2501,16 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, for(index = 0; index < totedge; ++index) { CCGEdge *e = ccgdm->edgeMap[index].edge; int numFinalEdges = edgeSize - 1; - int mapIndex = ccgDM_getEdgeMapIndex(ccgdm, ss, e); + int mapIndex = ccgDM_getEdgeMapIndex(ss, e); int x; int vertIdx[2]; - int edgeIdx = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(ss, e)); + int edgeIdx = GET_INT_FROM_POINTER(ccgSubSurf_getEdgeEdgeHandle(e)); CCGVert *v; - v = ccgSubSurf_getEdgeVert0(ss, e); - vertIdx[0] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ss, v)); - v = ccgSubSurf_getEdgeVert1(ss, e); - vertIdx[1] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ss, v)); + v = ccgSubSurf_getEdgeVert0(e); + vertIdx[0] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v)); + v = ccgSubSurf_getEdgeVert1(e); + vertIdx[1] = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v)); ccgdm->edgeMap[index].startVert = vertNum; ccgdm->edgeMap[index].startEdge = edgeNum; @@ -2543,10 +2541,10 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss, for(index = 0; index < totvert; ++index) { CCGVert *v = ccgdm->vertMap[index].vert; - int mapIndex = ccgDM_getVertMapIndex(ccgdm, ccgdm->ss, v); + int mapIndex = ccgDM_getVertMapIndex(ccgdm->ss, v); int vertIdx; - vertIdx = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ss, v)); + vertIdx = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v)); ccgdm->vertMap[index].startVert = vertNum; @@ -2679,9 +2677,9 @@ void subsurf_calculate_limit_positions(Mesh *me, float (*positions_r)[3]) vi = ccgSubSurf_getVertIterator(ss); for (; !ccgVertIterator_isStopped(vi); ccgVertIterator_next(vi)) { CCGVert *v = ccgVertIterator_getCurrent(vi); - int idx = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(ss, v)); - int N = ccgSubSurf_getVertNumEdges(ss, v); - int numFaces = ccgSubSurf_getVertNumFaces(ss, v); + int idx = GET_INT_FROM_POINTER(ccgSubSurf_getVertVertHandle(v)); + int N = ccgSubSurf_getVertNumEdges(v); + int numFaces = ccgSubSurf_getVertNumFaces(v); float *co; int i; @@ -2689,12 +2687,12 @@ void subsurf_calculate_limit_positions(Mesh *me, float (*positions_r)[3]) face_sum[0]= face_sum[1]= face_sum[2]= 0.0; for (i=0; i<N; i++) { - CCGEdge *e = ccgSubSurf_getVertEdge(ss, v, i); + CCGEdge *e = ccgSubSurf_getVertEdge(v, i); VecAddf(edge_sum, edge_sum, ccgSubSurf_getEdgeData(ss, e, 1)); } for (i=0; i<numFaces; i++) { - CCGFace *f = ccgSubSurf_getVertFace(ss, v, i); - VecAddf(face_sum, face_sum, ccgSubSurf_getFaceCenterData(ss, f)); + CCGFace *f = ccgSubSurf_getVertFace(v, i); + VecAddf(face_sum, face_sum, ccgSubSurf_getFaceCenterData(f)); } /* ad-hoc correction for boundary vertices, to at least avoid them diff --git a/source/blender/blenkernel/intern/writeframeserver.c b/source/blender/blenkernel/intern/writeframeserver.c index 6b38d7deadb..40e1dc1bb03 100644 --- a/source/blender/blenkernel/intern/writeframeserver.c +++ b/source/blender/blenkernel/intern/writeframeserver.c @@ -251,7 +251,7 @@ static int handle_request(char * req) return -1; } -int frameserver_loop() +int frameserver_loop(void) { fd_set readfds; struct timeval tv; |