Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2014-04-17 18:22:25 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-04-17 20:23:14 +0400
commitf7de9efb7441ec14eb89a3f7ab33b97400911fe9 (patch)
tree702a3e397d784a647d5e265037dfd80f262cf0b0 /source/blender/render
parentdc40a97fc1809aef4ae34c929d26680de4999b28 (diff)
BI: cleanup in autosmooth area.
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/intern/source/convertblender.c47
1 files changed, 22 insertions, 25 deletions
diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c
index 5204799932b..a9e2e1c2daf 100644
--- a/source/blender/render/intern/source/convertblender.c
+++ b/source/blender/render/intern/source/convertblender.c
@@ -500,32 +500,29 @@ static int as_addvert(ASvert *asv, VertRen *v1, VlakRen *vlr)
{
ASface *asf;
int a = -1;
-
- if (v1 == NULL) return a;
-
- if (asv->faces.first==NULL) {
- asf= MEM_callocN(sizeof(ASface), "asface");
- BLI_addtail(&asv->faces, asf);
- }
-
- asf= asv->faces.last;
- for (a=0; a<4; a++) {
- if (asf->vlr[a]==NULL) {
- asf->vlr[a]= vlr;
- asv->totface++;
- break;
+
+ if (v1 == NULL)
+ return a;
+
+ asf = asv->faces.last;
+ if (asf) {
+ for (a = 0; a < 4 && asf->vlr[a]; a++) {
}
}
-
+ else {
+ a = 4;
+ }
+
/* new face struct */
- if (a==4) {
+ if (a == 4) {
a = 0;
- asf= MEM_callocN(sizeof(ASface), "asface");
+ asf = MEM_callocN(sizeof(ASface), "asface");
BLI_addtail(&asv->faces, asf);
- asf->vlr[a]= vlr;
- asv->totface++;
}
+ asf->vlr[a] = vlr;
+ asv->totface++;
+
return a;
}
@@ -628,14 +625,14 @@ static void autosmooth(Render *UNUSED(re), ObjectRen *obr, float mat[4][4], shor
}
/* free */
- for (a=0; a<totvert; a++) {
+ for (a = 0; a < totvert; a++) {
BLI_freelistN(&asverts[a].faces);
}
MEM_freeN(asverts);
/* rotate vertices and calculate normal of faces */
- for (a=0; a<obr->totvert; a++) {
- ver= RE_findOrAddVert(obr, a);
+ for (a = 0; a < obr->totvert; a++) {
+ ver = RE_findOrAddVert(obr, a);
mul_m4_v3(mat, ver->co);
if (lnors) {
mul_mat3_m4_v3(mat, ver->n);
@@ -643,9 +640,9 @@ static void autosmooth(Render *UNUSED(re), ObjectRen *obr, float mat[4][4], shor
normalize_v3(ver->n);
}
}
- for (a=0; a<obr->totvlak; a++) {
- vlr= RE_findOrAddVlak(obr, a);
-
+ for (a = 0; a < obr->totvlak; a++) {
+ vlr = RE_findOrAddVlak(obr, a);
+
/* skip wire faces */
if (vlr->v2 != vlr->v3) {
if (vlr->v4)