diff options
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_displist.h | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/displist.c | 15 |
2 files changed, 10 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_displist.h b/source/blender/blenkernel/BKE_displist.h index febe0a11ae6..9e75e55adf6 100644 --- a/source/blender/blenkernel/BKE_displist.h +++ b/source/blender/blenkernel/BKE_displist.h @@ -99,7 +99,7 @@ extern void shadeMeshMCol(struct Scene *scene, struct Object *ob, struct Mesh *m int surfindex_displist(DispList *dl, int a, int *b, int *p1, int *p2, int *p3, int *p4); void imagestodisplist(void); void reshadeall_displist(struct Scene *scene); -void filldisplist(struct ListBase *dispbase, struct ListBase *to); +void filldisplist(struct ListBase *dispbase, struct ListBase *to, int flipnormal); void fastshade_free_render(void); diff --git a/source/blender/blenkernel/intern/displist.c b/source/blender/blenkernel/intern/displist.c index ae225fd19b7..a958d8c353b 100644 --- a/source/blender/blenkernel/intern/displist.c +++ b/source/blender/blenkernel/intern/displist.c @@ -925,7 +925,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase) } -void filldisplist(ListBase *dispbase, ListBase *to) +void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal) { EditVert *eve, *v1, *vlast; EditFace *efa; @@ -1019,6 +1019,9 @@ void filldisplist(ListBase *dispbase, ListBase *to) index[0]= (intptr_t)efa->v1->tmp.l; index[1]= (intptr_t)efa->v2->tmp.l; index[2]= (intptr_t)efa->v3->tmp.l; + + if(flipnormal) + SWAP(int, index[0], index[2]); index+= 3; efa= efa->next; @@ -1095,13 +1098,13 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase) dl= dl->next; } - filldisplist(&front, dispbase); - filldisplist(&back, dispbase); + filldisplist(&front, dispbase, 1); + filldisplist(&back, dispbase, 0); freedisplist(&front); freedisplist(&back); - filldisplist(dispbase, dispbase); + filldisplist(dispbase, dispbase, 0); } @@ -1113,7 +1116,7 @@ static void curve_to_filledpoly(Curve *cu, ListBase *nurb, ListBase *dispbase) bevels_to_filledpoly(cu, dispbase); } else { - filldisplist(dispbase, dispbase); + filldisplist(dispbase, dispbase, 0); } } @@ -1315,7 +1318,7 @@ static void curve_calc_modifiers_post(Scene *scene, Object *ob, ListBase *dispba ModifierData *preTesselatePoint; Curve *cu= ob->data; ListBase *nurb= cu->editnurb?cu->editnurb:&cu->nurb; - int required_mode, totvert; + int required_mode, totvert = 0; int editmode = (!forRender && cu->editnurb); DerivedMesh *dm= NULL, *ndm; float (*vertCos)[3] = NULL; |