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
path: root/source
diff options
context:
space:
mode:
authorNicholas Bishop <nicholasbishop@gmail.com>2012-03-06 01:27:28 +0400
committerNicholas Bishop <nicholasbishop@gmail.com>2012-03-06 01:27:28 +0400
commite2003f9a6c0ad1f2b03821f2c8aaa91565c51c40 (patch)
treee08672eb63a8e31d977b79a88f8d6d48624533ab /source
parentbd83487dab6e4be5facf9fefb476a4273c64e1df (diff)
Code cleanup: remove unused drawFacesColored from DerivedMesh.
This function pointer isn't called anymore, so removing it and the cddm/ccgdm/gpu code associated with it.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_DerivedMesh.h8
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c88
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c70
-rw-r--r--source/blender/gpu/GPU_buffers.h2
-rw-r--r--source/blender/gpu/intern/gpu_buffers.c12
5 files changed, 0 insertions, 180 deletions
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h
index 116b3e05a8e..b9e2fddb895 100644
--- a/source/blender/blenkernel/BKE_DerivedMesh.h
+++ b/source/blender/blenkernel/BKE_DerivedMesh.h
@@ -302,14 +302,6 @@ struct DerivedMesh {
void (*drawFacesSolid)(DerivedMesh *dm, float (*partial_redraw_planes)[4],
int fast, int (*setMaterial)(int, void *attribs));
- /* Draw all faces
- * o If useTwoSided, draw front and back using col arrays
- * o col1,col2 are arrays of length numFace*4 of 4 component colors
- * in ABGR format, and should be passed as per-face vertex color.
- */
- void (*drawFacesColored)(DerivedMesh *dm, int useTwoSided,
- unsigned char *col1, unsigned char *col2);
-
/* Draw all faces using MTFace
* o Drawing options too complicated to enumerate, look at code.
*/
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index 50d0f2daab9..04d438ebf0c 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -604,93 +604,6 @@ static void cdDM_drawFacesSolid(DerivedMesh *dm,
glShadeModel(GL_FLAT);
}
-static void cdDM_drawFacesColored(DerivedMesh *dm, int useTwoSided, unsigned char *col1, unsigned char *col2)
-{
- CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
- int a, glmode;
- unsigned char *cp1, *cp2;
- MVert *mvert = cddm->mvert;
- MFace *mface = cddm->mface;
-
- cp1 = col1;
- if(col2) {
- cp2 = col2;
- } else {
- cp2 = NULL;
- useTwoSided = 0;
- }
-
- /* there's a conflict here... twosided colors versus culling...? */
- /* defined by history, only texture faces have culling option */
- /* we need that as mesh option builtin, next to double sided lighting */
- if(col2) {
- glEnable(GL_CULL_FACE);
- }
-
- cdDM_update_normals_from_pbvh(dm);
-
- if( GPU_buffer_legacy(dm) ) {
- DEBUG_VBO( "Using legacy code. cdDM_drawFacesColored\n" );
- glShadeModel(GL_SMOOTH);
- glBegin(glmode = GL_QUADS);
- for(a = 0; a < dm->numTessFaceData; a++, mface++, cp1 += 16) {
- int new_glmode = mface->v4?GL_QUADS:GL_TRIANGLES;
-
- if(new_glmode != glmode) {
- glEnd();
- glBegin(glmode = new_glmode);
- }
-
- glColor3ubv(cp1+0);
- glVertex3fv(mvert[mface->v1].co);
- glColor3ubv(cp1+4);
- glVertex3fv(mvert[mface->v2].co);
- glColor3ubv(cp1+8);
- glVertex3fv(mvert[mface->v3].co);
- if(mface->v4) {
- glColor3ubv(cp1+12);
- glVertex3fv(mvert[mface->v4].co);
- }
-
- if(useTwoSided) {
- glColor3ubv(cp2+8);
- glVertex3fv(mvert[mface->v3].co );
- glColor3ubv(cp2+4);
- glVertex3fv(mvert[mface->v2].co );
- glColor3ubv(cp2+0);
- glVertex3fv(mvert[mface->v1].co );
- if(mface->v4) {
- glColor3ubv(cp2+12);
- glVertex3fv(mvert[mface->v4].co );
- }
- }
- if(col2) cp2 += 16;
- }
- glEnd();
- }
- else { /* use OpenGL VBOs or Vertex Arrays instead for better, faster rendering */
- GPU_color4_upload(dm,cp1);
- GPU_vertex_setup(dm);
- GPU_color_setup(dm);
- if( !GPU_buffer_legacy(dm) ) {
- glShadeModel(GL_SMOOTH);
- glDrawArrays(GL_TRIANGLES, 0, dm->drawObject->tot_triangle_point);
-
- if( useTwoSided ) {
- GPU_color4_upload(dm,cp2);
- GPU_color_setup(dm);
- glCullFace(GL_FRONT);
- glDrawArrays(GL_TRIANGLES, 0, dm->drawObject->tot_triangle_point);
- glCullFace(GL_BACK);
- }
- }
- GPU_buffer_unbind();
- }
-
- glShadeModel(GL_FLAT);
- glDisable(GL_CULL_FACE);
-}
-
static void cdDM_drawFacesTex_common(DerivedMesh *dm,
int (*drawParams)(MTFace *tface, int has_mcol, int matnr),
int (*drawParamsMapped)(void *userData, int index),
@@ -1691,7 +1604,6 @@ static CDDerivedMesh *cdDM_create(const char *desc)
dm->drawMappedEdges = cdDM_drawMappedEdges;
dm->drawFacesSolid = cdDM_drawFacesSolid;
- dm->drawFacesColored = cdDM_drawFacesColored;
dm->drawFacesTex = cdDM_drawFacesTex;
dm->drawFacesGLSL = cdDM_drawFacesGLSL;
dm->drawMappedFaces = cdDM_drawMappedFaces;
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 8d381299ab3..944602b66d0 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -1920,75 +1920,6 @@ static void ccgDM_drawMappedFacesMat(DerivedMesh *dm, void (*setMaterial)(void *
#undef PASSATTRIB
}
-
-static void ccgDM_drawFacesColored(DerivedMesh *dm, int UNUSED(useTwoSided), unsigned char *col1, unsigned char *col2)
-{
- CCGDerivedMesh *ccgdm = (CCGDerivedMesh*) dm;
- CCGSubSurf *ss = ccgdm->ss;
- int gridSize = ccgSubSurf_getGridSize(ss);
- unsigned char *cp1, *cp2;
- int useTwoSide=1, i, totface;
-
- ccgdm_pbvh_update(ccgdm);
-
- cp1= col1;
- if(col2) {
- cp2= col2;
- } else {
- cp2= NULL;
- useTwoSide= 0;
- }
-
- glShadeModel(GL_SMOOTH);
-
- if(col2) {
- glEnable(GL_CULL_FACE);
- }
-
- glBegin(GL_QUADS);
- totface = ccgSubSurf_getNumFaces(ss);
- for(i = 0; i < totface; i++) {
- CCGFace *f = ccgdm->faceMap[i].face;
- int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f);
-
- for (S=0; S<numVerts; S++) {
- DMGridData *faceGridData = ccgSubSurf_getFaceGridDataArray(ss, f, S);
- for (y=0; y<gridSize-1; y++) {
- for (x=0; x<gridSize-1; x++) {
- float *a = faceGridData[(y+0)*gridSize + x].co;
- float *b = faceGridData[(y+0)*gridSize + x + 1].co;
- float *c = faceGridData[(y+1)*gridSize + x + 1].co;
- float *d = faceGridData[(y+1)*gridSize + x].co;
-
- glColor3ub(cp1[3], cp1[2], cp1[1]);
- glVertex3fv(d);
- glColor3ub(cp1[7], cp1[6], cp1[5]);
- glVertex3fv(c);
- glColor3ub(cp1[11], cp1[10], cp1[9]);
- glVertex3fv(b);
- glColor3ub(cp1[15], cp1[14], cp1[13]);
- glVertex3fv(a);
-
- if (useTwoSide) {
- glColor3ub(cp2[15], cp2[14], cp2[13]);
- glVertex3fv(a);
- glColor3ub(cp2[11], cp2[10], cp2[9]);
- glVertex3fv(b);
- glColor3ub(cp2[7], cp2[6], cp2[5]);
- glVertex3fv(c);
- glColor3ub(cp2[3], cp2[2], cp2[1]);
- glVertex3fv(d);
- }
-
- if (cp2) cp2+=16;
- cp1+=16;
- }
- }
- }
- }
- glEnd();
-}
-
static void ccgDM_drawFacesTex_common(DerivedMesh *dm,
int (*drawParams)(MTFace *tface, int has_mcol, int matnr),
int (*drawParamsMapped)(void *userData, int index),
@@ -2978,7 +2909,6 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
ccgdm->dm.drawEdges = ccgDM_drawEdges;
ccgdm->dm.drawLooseEdges = ccgDM_drawLooseEdges;
ccgdm->dm.drawFacesSolid = ccgDM_drawFacesSolid;
- ccgdm->dm.drawFacesColored = ccgDM_drawFacesColored;
ccgdm->dm.drawFacesTex = ccgDM_drawFacesTex;
ccgdm->dm.drawFacesGLSL = ccgDM_drawFacesGLSL;
ccgdm->dm.drawMappedFaces = ccgDM_drawMappedFaces;
diff --git a/source/blender/gpu/GPU_buffers.h b/source/blender/gpu/GPU_buffers.h
index b3a317364a9..b89219c2d56 100644
--- a/source/blender/gpu/GPU_buffers.h
+++ b/source/blender/gpu/GPU_buffers.h
@@ -142,8 +142,6 @@ void GPU_buffer_unlock( GPUBuffer *buffer );
/* upload three unsigned chars, representing RGB colors, for each vertex. Resets dm->drawObject->colType to -1 */
void GPU_color3_upload( struct DerivedMesh *dm, unsigned char *data );
-/* upload four unsigned chars, representing RGBA colors, for each vertex. Resets dm->drawObject->colType to -1 */
-void GPU_color4_upload( struct DerivedMesh *dm, unsigned char *data );
/* switch color rendering on=1/off=0 */
void GPU_color_switch( int mode );
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index 00e34b41faf..6e7ec98e65b 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -1170,18 +1170,6 @@ void GPU_color3_upload(DerivedMesh *dm, unsigned char *data)
GL_ARRAY_BUFFER_ARB, data, GPU_buffer_copy_color3);
}
-/* this is used only in cdDM_drawFacesColored, which I think is no
- longer used, so can probably remove this --nicholas */
-void GPU_color4_upload(DerivedMesh *UNUSED(dm), unsigned char *UNUSED(data))
-{
- /*if(dm->drawObject == 0)
- dm->drawObject = GPU_drawobject_new(dm);
- GPU_buffer_free(dm->drawObject->colors);
- dm->drawObject->colors = gpu_buffer_setup(dm, dm->drawObject, 3,
- sizeof(char)*3*dm->drawObject->tot_triangle_point,
- GL_ARRAY_BUFFER_ARB, data, GPU_buffer_copy_color4);*/
-}
-
void GPU_color_switch(int mode)
{
if(mode) {