[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12160] trunk/blender/source/blender: Improve consistency in editmesh tmp unions.
Martin Poirier
theeth at yahoo.com
Thu Sep 27 19:45:53 CEST 2007
Revision: 12160
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12160
Author: theeth
Date: 2007-09-27 19:45:53 +0200 (Thu, 27 Sep 2007)
Log Message:
-----------
Improve consistency in editmesh tmp unions.
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.
Modified Paths:
--------------
trunk/blender/source/blender/blenlib/BLI_editVert.h
trunk/blender/source/blender/src/editmesh_mods.c
trunk/blender/source/blender/src/transform_conversions.c
Modified: trunk/blender/source/blender/blenlib/BLI_editVert.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_editVert.h 2007-09-27 16:47:08 UTC (rev 12159)
+++ trunk/blender/source/blender/blenlib/BLI_editVert.h 2007-09-27 17:45:53 UTC (rev 12160)
@@ -55,9 +55,9 @@
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 */
Modified: trunk/blender/source/blender/src/editmesh_mods.c
===================================================================
--- trunk/blender/source/blender/src/editmesh_mods.c 2007-09-27 16:47:08 UTC (rev 12159)
+++ trunk/blender/source/blender/src/editmesh_mods.c 2007-09-27 17:45:53 UTC (rev 12160)
@@ -3894,7 +3894,7 @@
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 @@
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 @@
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 @@
}
}
}
- eve->tmp.fp= 0;
+ eve->tmp.p= NULL;
}
eve= eve->next;
}
Modified: trunk/blender/source/blender/src/transform_conversions.c
===================================================================
--- trunk/blender/source/blender/src/transform_conversions.c 2007-09-27 16:47:08 UTC (rev 12159)
+++ trunk/blender/source/blender/src/transform_conversions.c 2007-09-27 17:45:53 UTC (rev 12160)
@@ -1580,7 +1580,7 @@
/* 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 @@
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 @@
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 @@
}
/* 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],
More information about the Bf-blender-cvs
mailing list