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:
authorCampbell Barton <ideasman42@gmail.com>2011-12-02 05:01:07 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-12-02 05:01:07 +0400
commit15ad39e6848ea54da8a3f36b867f8b09a7b8b163 (patch)
tree53e4f1c2f37d0e2f3679e284a8f7c0f3f66f6d5c /source/blender/blenkernel/intern
parentce6487291349b00a85f265d2b8cfb682e2bb8086 (diff)
parent1936b31cd0f7741ec39f638cc57286e5b379134c (diff)
svn merge ^/trunk/blender -r42303:42329
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c7
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c106
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c26
-rw-r--r--source/blender/blenkernel/intern/editderivedbmesh.c28
-rw-r--r--source/blender/blenkernel/intern/mesh.c2
-rw-r--r--source/blender/blenkernel/intern/mesh_validate.c30
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c31
7 files changed, 145 insertions, 85 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index ad154a44980..acec42ee761 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -2389,9 +2389,14 @@ static void navmesh_drawColored(DerivedMesh *dm)
glEnable(GL_LIGHTING);
}
-static void navmesh_DM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr))
+static void navmesh_DM_drawFacesTex(DerivedMesh *dm,
+ int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr),
+ int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ void *userData)
{
(void) setDrawOptions;
+ (void) compareDrawOptions;
+ (void) userData;
navmesh_drawColored(dm);
}
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 2379bc41e8f..bf2e12e1533 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -683,6 +683,7 @@ static void cdDM_drawFacesColored(DerivedMesh *dm, int useTwoSided, unsigned cha
static void cdDM_drawFacesTex_common(DerivedMesh *dm,
int (*drawParams)(MTFace *tface, int has_mcol, int matnr),
int (*drawParamsMapped)(void *userData, int index),
+ int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
void *userData)
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
@@ -807,24 +808,18 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
}
if( !GPU_buffer_legacy(dm) ) {
- /* warning!, this logic is incorrect, see bug [#27175]
- * firstly, there are no checks for changes in context, such as texface image.
- * secondly, drawParams() sets the GL context, so checking if there is a change
- * from lastFlag is too late once glDrawArrays() runs, since drawing the arrays
- * will use the modified, OpenGL settings.
- *
- * However its tricky to fix this without duplicating the internal logic
- * of drawParams(), perhaps we need an argument like...
- * drawParams(..., keep_gl_state_but_return_when_changed) ?.
- *
- * We could also just disable VBO's here, since texface may be deprecated - campbell.
- */
-
+ int tottri = dm->drawObject->tot_triangle_point/3;
+ int next_actualFace= dm->drawObject->triangle_to_mface[0];
+
glShadeModel( GL_SMOOTH );
lastFlag = 0;
- for(i = 0; i < dm->drawObject->tot_triangle_point/3; i++) {
- int actualFace = dm->drawObject->triangle_to_mface[i];
+ for(i = 0; i < tottri; i++) {
+ int actualFace = next_actualFace;
int flag = 1;
+ int flush = 0;
+
+ if(i != tottri-1)
+ next_actualFace= dm->drawObject->triangle_to_mface[i+1];
if(drawParams) {
flag = drawParams(tf? &tf[actualFace]: NULL, (mcol != NULL), mf[actualFace].mat_nr);
@@ -840,27 +835,30 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
if(drawParamsMapped)
flag = drawParamsMapped(userData, actualFace);
}
- if( flag != lastFlag ) {
- if( startFace < i ) {
- if( lastFlag != 0 ) { /* if the flag is 0 it means the face is hidden or invisible */
- if (lastFlag==1 && col)
- GPU_color_switch(1);
- else
- GPU_color_switch(0);
- glDrawArrays(GL_TRIANGLES,startFace*3,(i-startFace)*3);
- }
- }
- lastFlag = flag;
- startFace = i;
+
+ /* flush buffer if current triangle isn't drawable or it's last triangle */
+ flush= !flag || i == tottri - 1;
+
+ if(!flush && compareDrawOptions) {
+ /* also compare draw options and flush buffer if they're different
+ need for face selection highlight in edit mode */
+ flush|= compareDrawOptions(userData, actualFace, next_actualFace) == 0;
}
- }
- if( startFace < dm->drawObject->tot_triangle_point/3 ) {
- if( lastFlag != 0 ) { /* if the flag is 0 it means the face is hidden or invisible */
- if (lastFlag==1 && col)
- GPU_color_switch(1);
- else
- GPU_color_switch(0);
- glDrawArrays(GL_TRIANGLES, startFace*3, dm->drawObject->tot_triangle_point - startFace*3);
+
+ if(flush) {
+ int first= startFace*3;
+ int count= (i-startFace+(flag ? 1 : 0))*3; /* Add one to the length if we're drawing at the end of the array */
+
+ if(count) {
+ if (col)
+ GPU_color_switch(1);
+ else
+ GPU_color_switch(0);
+
+ glDrawArrays(GL_TRIANGLES, first, count);
+ }
+
+ startFace = i + 1;
}
}
}
@@ -870,13 +868,19 @@ static void cdDM_drawFacesTex_common(DerivedMesh *dm,
}
}
-static void cdDM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr))
+static void cdDM_drawFacesTex(DerivedMesh *dm,
+ int (*setDrawOptions)(MTFace *tface, int has_mcol, int matnr),
+ int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ void *userData)
{
- cdDM_drawFacesTex_common(dm, setDrawOptions, NULL, NULL);
+ cdDM_drawFacesTex_common(dm, setDrawOptions, NULL, compareDrawOptions, userData);
}
-static void cdDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), void *userData, int useColors, int (*setMaterial)(int, void *attribs),
- int (*compareDrawOptions)(void *userData, int cur_index, int next_index))
+static void cdDM_drawMappedFaces(DerivedMesh *dm,
+ int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r),
+ int (*setMaterial)(int, void *attribs),
+ int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ void *userData, int useColors)
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
MVert *mv = cddm->mvert;
@@ -1018,15 +1022,7 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
flush|= mf[actualFace].mat_nr != mf[next_actualFace].mat_nr;
if(!flush && compareDrawOptions) {
- int next_orig= (index==NULL) ? next_actualFace : index[next_actualFace];
-
- if(orig==ORIGINDEX_NONE || next_orig==ORIGINDEX_NONE) {
- flush= 1;
- } else {
- /* also compare draw options and flush buffer if they're different
- need for face selection highlight in edit mode */
- flush|= compareDrawOptions(userData, orig, next_orig) == 0;
- }
+ flush|= compareDrawOptions(userData, actualFace, next_actualFace) == 0;
}
if(flush) {
@@ -1047,9 +1043,12 @@ static void cdDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *us
}
}
-static void cdDM_drawMappedFacesTex(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index), void *userData)
+static void cdDM_drawMappedFacesTex(DerivedMesh *dm,
+ int (*setDrawOptions)(void *userData, int index),
+ int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ void *userData)
{
- cdDM_drawFacesTex_common(dm, NULL, setDrawOptions, userData);
+ cdDM_drawFacesTex_common(dm, NULL, setDrawOptions, compareDrawOptions, userData);
}
static void cddm_draw_attrib_vertex(DMVertexAttribs *attribs, MVert *mvert, int a, int index, int vert, int smoothnormal)
@@ -1096,7 +1095,10 @@ static void cddm_draw_attrib_vertex(DMVertexAttribs *attribs, MVert *mvert, int
glVertex3fv(mvert[index].co);
}
-static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, void *attribs), int (*setDrawOptions)(void *userData, int index), void *userData)
+static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm,
+ int (*setMaterial)(int, void *attribs),
+ int (*setDrawOptions)(void *userData, int index),
+ void *userData)
{
CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
GPUVertexAttribs gattribs;
@@ -1386,7 +1388,7 @@ static void cdDM_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, vo
glShadeModel(GL_FLAT);
}
-static void cdDM_drawFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, void *attribs))
+static void cdDM_drawFacesGLSL(DerivedMesh *dm,int (*setMaterial)(int, void *attribs))
{
dm->drawMappedFacesGLSL(dm, setMaterial, NULL, NULL);
}
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index 5fbb69f32fb..229f2125364 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -3566,7 +3566,7 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface,
float radius = 0.0f;
float strength = 0.0f;
float velocity_val = 0.0f;
- int part_index;
+ int part_index= -1;
/*
* With predefined radius, there is no variation between particles.
@@ -3638,10 +3638,12 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface,
part_index = nearest[n].index;
/* If inside solid range and no disp depth required, no need to seek further */
- if (s_range < 0.0f)
- if (surface->type != MOD_DPAINT_SURFACE_T_DISPLACE &&
- surface->type != MOD_DPAINT_SURFACE_T_WAVE)
+ if ( (s_range < 0.0f) &&
+ (surface->type != MOD_DPAINT_SURFACE_T_DISPLACE) &&
+ (surface->type != MOD_DPAINT_SURFACE_T_WAVE))
+ {
break;
+ }
}
if (nearest) MEM_freeN(nearest);
@@ -3669,7 +3671,7 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface,
float depth = 0.0f;
/* apply velocity */
- if (brush->flags & MOD_DPAINT_USES_VELOCITY) {
+ if ((brush->flags & MOD_DPAINT_USES_VELOCITY) && (part_index != -1)) {
float velocity[3];
ParticleData *pa = psys->particles + part_index;
mul_v3_v3fl(velocity, pa->state.vel, particle_timestep);
@@ -3681,8 +3683,9 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface,
velocity_val = len_v3(velocity);
/* store brush velocity for smudge */
- if (surface->type == MOD_DPAINT_SURFACE_T_PAINT &&
- brush->flags & MOD_DPAINT_DO_SMUDGE && bData->brush_velocity) {
+ if ( (surface->type == MOD_DPAINT_SURFACE_T_PAINT) &&
+ (brush->flags & MOD_DPAINT_DO_SMUDGE && bData->brush_velocity))
+ {
copy_v3_v3(&bData->brush_velocity[index*4], velocity);
mul_v3_fl(&bData->brush_velocity[index*4], 1.0f/velocity_val);
bData->brush_velocity[index*4+3] = velocity_val;
@@ -3690,12 +3693,11 @@ static int dynamicPaint_paintParticles(DynamicPaintSurface *surface,
}
if (surface->type == MOD_DPAINT_SURFACE_T_PAINT) {
- paintColor[0] = brush->r;
- paintColor[1] = brush->g;
- paintColor[2] = brush->b;
+ copy_v3_v3(paintColor, &brush->r);
}
- else if (surface->type == MOD_DPAINT_SURFACE_T_DISPLACE ||
- surface->type == MOD_DPAINT_SURFACE_T_WAVE) {
+ else if ( (surface->type == MOD_DPAINT_SURFACE_T_DISPLACE) ||
+ (surface->type == MOD_DPAINT_SURFACE_T_WAVE))
+ {
/* get displace depth */
disp_intersect = (1.0f - sqrtf(disp_intersect / radius)) * radius;
depth = (radius - disp_intersect) / bData->bNormal[index].normal_scale;
diff --git a/source/blender/blenkernel/intern/editderivedbmesh.c b/source/blender/blenkernel/intern/editderivedbmesh.c
index df28ab99bec..888ebb801d7 100644
--- a/source/blender/blenkernel/intern/editderivedbmesh.c
+++ b/source/blender/blenkernel/intern/editderivedbmesh.c
@@ -613,9 +613,9 @@ static void bmDM_foreachMappedFaceCenter(DerivedMesh *dm, void (*func)(void *use
static void bmDM_drawMappedFaces(DerivedMesh *dm,
int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r),
- void *userData, int UNUSED(useColors),
int (*setMaterial)(int, void *attribs),
- int (*compareDrawOptions)(void *userData, int cur_index, int next_index))
+ int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ void *userData, int UNUSED(useColors))
{
EditDerivedBMesh *bmdm= (EditDerivedBMesh*) dm;
BMFace *efa;
@@ -795,7 +795,8 @@ static void bmdm_get_tri_tex(BMesh *bm, BMLoop **ls, MLoopUV *luv[3], MLoopCol *
static void bmDM_drawFacesTex_common(DerivedMesh *dm,
int (*drawParams)(MTFace *tface, int has_vcol, int matnr),
int (*drawParamsMapped)(void *userData, int index),
- void *userData)
+ int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ void *userData)
{
EditDerivedBMesh *bmdm= (EditDerivedBMesh*) dm;
BMEditMesh *em = bmdm->tc;
@@ -808,6 +809,8 @@ static void bmDM_drawFacesTex_common(DerivedMesh *dm,
int i, has_vcol = CustomData_has_layer(&bm->ldata, CD_MLOOPCOL);
int has_uv = CustomData_has_layer(&bm->pdata, CD_MTEXPOLY);
+ (void) compareDrawOptions;
+
luv[0] = luv[1] = luv[2] = &dummyluv;
lcol[0] = lcol[1] = lcol[2] = &dummylcol;
@@ -987,19 +990,26 @@ static void bmDM_drawFacesTex_common(DerivedMesh *dm,
}
}
-static void bmDM_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, int has_vcol, int matnr))
+static void bmDM_drawFacesTex(DerivedMesh *dm,
+ int (*setDrawOptions)(MTFace *tface, int has_vcol, int matnr),
+ int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ void *userData)
{
- bmDM_drawFacesTex_common(dm, setDrawOptions, NULL, NULL);
+ bmDM_drawFacesTex_common(dm, setDrawOptions, NULL, compareDrawOptions, userData);
}
-static void bmDM_drawMappedFacesTex(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index), void *userData)
+static void bmDM_drawMappedFacesTex(DerivedMesh *dm,
+ int (*setDrawOptions)(void *userData, int index),
+ int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ void *userData)
{
- bmDM_drawFacesTex_common(dm, NULL, setDrawOptions, userData);
+ bmDM_drawFacesTex_common(dm, NULL, setDrawOptions, compareDrawOptions, userData);
}
static void bmDM_drawMappedFacesGLSL(DerivedMesh *dm,
- int (*setMaterial)(int, void *attribs),
- int (*setDrawOptions)(void *userData, int index), void *userData)
+ int (*setMaterial)(int, void *attribs),
+ int (*setDrawOptions)(void *userData, int index),
+ void *userData)
{
EditDerivedBMesh *bmdm= (EditDerivedBMesh*) dm;
BMesh *bm= bmdm->tc->bm;
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 12097e9b502..e281d6405eb 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -333,8 +333,6 @@ static void mesh_ensure_tesselation_customdata(Mesh *me)
mloopcol and mcol) have the same relative active/render/clone/mask indices.*/
static void mesh_update_linked_customdata(Mesh *me)
{
- int act;
-
if (me->edit_btmesh)
BMEdit_UpdateLinkedCustomData(me->edit_btmesh);
diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c
index d8e91a140f7..509cc821c65 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -38,6 +38,7 @@
#include "BLI_utildefines.h"
#include "BLI_edgehash.h"
+#include "BLI_math_base.h"
#include "BKE_DerivedMesh.h"
@@ -117,7 +118,7 @@ static int search_face_cmp(const void *v1, const void *v2)
#define PRINT if(do_verbose) printf
-int BKE_mesh_validate_arrays(Mesh *me, MVert *UNUSED(mverts), unsigned int totvert, MEdge *medges, unsigned int totedge, MFace *mfaces, unsigned int totface, const short do_verbose, const short do_fixes)
+int BKE_mesh_validate_arrays(Mesh *me, MVert *mverts, unsigned int totvert, MEdge *medges, unsigned int totedge, MFace *mfaces, unsigned int totface, const short do_verbose, const short do_fixes)
{
# define REMOVE_EDGE_TAG(_med) { _med->v2= _med->v1; do_edge_free= 1; }
# define REMOVE_FACE_TAG(_mf) { _mf->v3=0; do_face_free= 1; }
@@ -126,10 +127,12 @@ int BKE_mesh_validate_arrays(Mesh *me, MVert *UNUSED(mverts), unsigned int totve
MEdge *med;
MFace *mf;
MFace *mf_prev;
+ MVert *mvert= mverts;
unsigned int i;
int do_face_free= FALSE;
int do_edge_free= FALSE;
+ int verts_fixed= FALSE;
int do_edge_recalc= FALSE;
@@ -149,6 +152,29 @@ int BKE_mesh_validate_arrays(Mesh *me, MVert *UNUSED(mverts), unsigned int totve
do_edge_recalc= TRUE;
}
+ for(i=1; i<totvert; i++, mvert++) {
+ int j;
+ int fix_normal= TRUE;
+
+ for(j=0; j<3; j++) {
+ if(isnan(mvert->co[j]) || !finite(mvert->co[j])) {
+ PRINT(" vertex %u: has invalid coordinate\n", i);
+ zero_v3(mvert->co);
+
+ verts_fixed= TRUE;
+ }
+
+ if(mvert->no[j]!=0)
+ fix_normal= FALSE;
+ }
+
+ if(fix_normal) {
+ PRINT(" vertex %u: has zero normal, assuming Z-up normal\n", i);
+ mvert->no[2]= SHRT_MAX;
+ verts_fixed= TRUE;
+ }
+ }
+
for(i=0, med= medges; i<totedge; i++, med++) {
int remove= FALSE;
if(med->v1 == med->v2) {
@@ -300,7 +326,7 @@ int BKE_mesh_validate_arrays(Mesh *me, MVert *UNUSED(mverts), unsigned int totve
}
}
- return (do_face_free || do_edge_free || do_edge_recalc);
+ return (verts_fixed || do_face_free || do_edge_free || do_edge_recalc);
}
static int mesh_validate_customdata(CustomData *data, short do_verbose, const short do_fixes)
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 74664963988..af987a774e3 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -1613,7 +1613,11 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes)
}
/* Only used by non-editmesh types */
-static void cgdm_drawMappedFacesGLSL(DerivedMesh *dm, int (*setMaterial)(int, void *attribs), int (*setDrawOptions)(void *userData, int index), void *userData) {
+static void cgdm_drawMappedFacesGLSL(DerivedMesh *dm,
+ int (*setMaterial)(int, void *attribs),
+ int (*setDrawOptions)(void *userData, int index),
+ void *userData)
+{
CCGDerivedMesh *cgdm = (CCGDerivedMesh*) dm;
CCGSubSurf *ss = cgdm->ss;
GPUVertexAttribs gattribs;
@@ -1970,6 +1974,7 @@ static void cgdm_drawFacesColored(DerivedMesh *dm, int UNUSED(useTwoSided), unsi
static void cgdm_drawFacesTex_common(DerivedMesh *dm,
int (*drawParams)(MTFace *tface, int has_mcol, int matnr),
int (*drawParamsMapped)(void *userData, int index),
+ int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
void *userData)
{
CCGDerivedMesh *cgdm = (CCGDerivedMesh*) dm;
@@ -1980,6 +1985,8 @@ static void cgdm_drawFacesTex_common(DerivedMesh *dm,
int i, totface, flag, gridSize = ccgSubSurf_getGridSize(ss);
int gridFaces = gridSize - 1;
+ (void) compareDrawOptions;
+
ccgdm_pbvh_update(cgdm);
if(!mcol)
@@ -2110,14 +2117,20 @@ static void cgdm_drawFacesTex_common(DerivedMesh *dm,
}
}
-static void cgdm_drawFacesTex(DerivedMesh *dm, int (*setDrawOptions)(MTFace *tface, int has_vcol, int matnr))
+static void cgdm_drawFacesTex(DerivedMesh *dm,
+ int (*setDrawOptions)(MTFace *tface, int has_vcol, int matnr),
+ int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ void *userData)
{
- cgdm_drawFacesTex_common(dm, setDrawOptions, NULL, NULL);
+ cgdm_drawFacesTex_common(dm, setDrawOptions, NULL, compareDrawOptions, userData);
}
-static void cgdm_drawMappedFacesTex(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index), void *userData)
+static void cgdm_drawMappedFacesTex(DerivedMesh *dm,
+ int (*setDrawOptions)(void *userData, int index),
+ int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ void *userData)
{
- cgdm_drawFacesTex_common(dm, NULL, setDrawOptions, userData);
+ cgdm_drawFacesTex_common(dm, NULL, setDrawOptions, compareDrawOptions, userData);
}
static void cgdm_drawUVEdges(DerivedMesh *dm)
@@ -2153,8 +2166,12 @@ static void cgdm_drawUVEdges(DerivedMesh *dm)
}
}
-static void ccgDM_drawMappedFaces(DerivedMesh *dm, int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r), void *userData, int useColors, int (*setMaterial)(int, void *attribs),
- int (*compareDrawOptions)(void *userData, int cur_index, int next_index)) {
+static void ccgDM_drawMappedFaces(DerivedMesh *dm,
+ int (*setDrawOptions)(void *userData, int index, int *drawSmooth_r),
+ int (*setMaterial)(int, void *attribs),
+ int (*compareDrawOptions)(void *userData, int cur_index, int next_index),
+ void *userData, int useColors)
+{
CCGDerivedMesh *cgdm = (CCGDerivedMesh*) dm;
CCGSubSurf *ss = cgdm->ss;
MCol *mcol= NULL;