Improve consistency in editmesh tmp unions.
authorMartin Poirier <theeth@yahoo.com>
Thu, 27 Sep 2007 17:45:53 +0000 (17:45 +0000)
committerMartin Poirier <theeth@yahoo.com>
Thu, 27 Sep 2007 17:45:53 +0000 (17:45 +0000)
EditVert had "float *fp" while the others had "float p".
changed to "float p" and made all code using the float pointer use the already existing tmp.p (void*) instead.

source/blender/blenlib/BLI_editVert.h
source/blender/src/editmesh_mods.c
source/blender/src/transform_conversions.c

index fd217e479edacdc1e7bf5c5423d4f2b6753783c5..795f67818941e743dfd20701f68c6aa67461443e 100644 (file)
@@ -55,9 +55,9 @@ typedef struct EditVert
                struct EditVert *v;
                struct EditEdge *e;
                struct EditFace *f;
-               float           *fp;
                void            *p;
                long             l;
+               float            fp;
        } tmp;
        float no[3]; /*vertex normal */
        float co[3]; /*vertex location */
index 2a86c674f662c5f6a79b0d6d82e246e2b6e9f093..5cfeab03c0aa080ae594c0325207c88cb6d9d8e9 100644 (file)
@@ -3894,7 +3894,7 @@ void vertexsmooth(void)
        eve= em->verts.first;
        while(eve) {
                if(eve->f & SELECT) {
-                       eve->tmp.fp = adr;
+                       eve->tmp.p = (void*)adr;
                        eve->f1= 0;
                        eve->f2= 0;
                        adr+= 3;
@@ -3942,11 +3942,11 @@ void vertexsmooth(void)
                        
                        if((eed->v1->f & SELECT) && eed->v1->f1<255) {
                                eed->v1->f1++;
-                               VecAddf(eed->v1->tmp.fp, eed->v1->tmp.fp, fvec);
+                               VecAddf(eed->v1->tmp.p, eed->v1->tmp.p, fvec);
                        }
                        if((eed->v2->f & SELECT) && eed->v2->f1<255) {
                                eed->v2->f1++;
-                               VecAddf(eed->v2->tmp.fp, eed->v2->tmp.fp, fvec);
+                               VecAddf(eed->v2->tmp.p, eed->v2->tmp.p, fvec);
                        }
                }
                eed= eed->next;
@@ -3956,7 +3956,7 @@ void vertexsmooth(void)
        while(eve) {
                if(eve->f & SELECT) {
                        if(eve->f1) {
-                               adr = eve->tmp.fp;
+                               adr = eve->tmp.p;
                                fac= 0.5/(float)eve->f1;
                                
                                eve->co[0]= 0.5*eve->co[0]+fac*adr[0];
@@ -3976,7 +3976,7 @@ void vertexsmooth(void)
                                        }
                                }
                        }
-                       eve->tmp.fp= 0;
+                       eve->tmp.p= NULL;
                }
                eve= eve->next;
        }
index 058461806ce9bac4ddb70a9edcf4910217070591..d7bd3154ba19ac338221fb6666b8a9aca309a546 100644 (file)
@@ -1580,7 +1580,7 @@ static void set_crazyspace_quats(float *origcos, float *mappedcos, float *quats)
        
        /* two abused locations in vertices */
        for(eve= em->verts.first; eve; eve= eve->next, index++) {
-               eve->tmp.fp = NULL;
+               eve->tmp.p = NULL;
                eve->prev= (EditVert *)index;
        }
        
@@ -1596,9 +1596,9 @@ static void set_crazyspace_quats(float *origcos, float *mappedcos, float *quats)
                co2= (origcos)? origcos + 3*(long)(efa->v2->prev): efa->v2->co;
                co3= (origcos)? origcos + 3*(long)(efa->v3->prev): efa->v3->co;
 
-               if(efa->v2->tmp.fp==NULL && efa->v2->f1) {
+               if(efa->v2->tmp.p==NULL && efa->v2->f1) {
                        set_crazy_vertex_quat(quats, co2, co3, co1, v2, v3, v1);
-                       efa->v2->tmp.fp= quats;
+                       efa->v2->tmp.p= (void*)quats;
                        quats+= 4;
                }
                
@@ -1606,31 +1606,31 @@ static void set_crazyspace_quats(float *origcos, float *mappedcos, float *quats)
                        v4= mappedcos + 3*(long)(efa->v4->prev);
                        co4= (origcos)? origcos + 3*(long)(efa->v4->prev): efa->v4->co;
 
-                       if(efa->v1->tmp.fp==NULL && efa->v1->f1) {
+                       if(efa->v1->tmp.p==NULL && efa->v1->f1) {
                                set_crazy_vertex_quat(quats, co1, co2, co4, v1, v2, v4);
-                               efa->v1->tmp.fp= quats;
+                               efa->v1->tmp.p= (void*)quats;
                                quats+= 4;
                        }
-                       if(efa->v3->tmp.fp==NULL && efa->v3->f1) {
+                       if(efa->v3->tmp.p==NULL && efa->v3->f1) {
                                set_crazy_vertex_quat(quats, co3, co4, co2, v3, v4, v2);
-                               efa->v3->tmp.fp= quats;
+                               efa->v3->tmp.p= (void*)quats;
                                quats+= 4;
                        }
-                       if(efa->v4->tmp.fp==NULL && efa->v4->f1) {
+                       if(efa->v4->tmp.p==NULL && efa->v4->f1) {
                                set_crazy_vertex_quat(quats, co4, co1, co3, v4, v1, v3);
-                               efa->v4->tmp.fp= quats;
+                               efa->v4->tmp.p= (void*)quats;
                                quats+= 4;
                        }
                }
                else {
-                       if(efa->v1->tmp.fp==NULL && efa->v1->f1) {
+                       if(efa->v1->tmp.p==NULL && efa->v1->f1) {
                                set_crazy_vertex_quat(quats, co1, co2, co3, v1, v2, v3);
-                               efa->v1->tmp.fp= quats;
+                               efa->v1->tmp.p= (void*)quats;
                                quats+= 4;
                        }
-                       if(efa->v3->tmp.fp==NULL && efa->v3->f1) {
+                       if(efa->v3->tmp.p==NULL && efa->v3->f1) {
                                set_crazy_vertex_quat(quats, co3, co1, co2, v3, v1, v2);
-                               efa->v3->tmp.fp= quats;
+                               efa->v3->tmp.p= (void*)quats;
                                quats+= 4;
                        }
                }
@@ -1764,12 +1764,12 @@ static void createTransEditVerts(TransInfo *t)
                                }
                                
                                /* CrazySpace */
-                               if(defmats || (quats && eve->tmp.fp)) {
+                               if(defmats || (quats && eve->tmp.p)) {
                                        float mat[3][3], imat[3][3], qmat[3][3];
                                        
                                        /* use both or either quat and defmat correction */
                                        if(quats && eve->tmp.f) {
-                                               QuatToMat3(eve->tmp.fp, qmat);
+                                               QuatToMat3(eve->tmp.p, qmat);
 
                                                if(defmats)
                                                        Mat3MulSerie(mat, mtx, qmat, defmats[a],