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>2008-03-27 14:52:58 +0300
committerCampbell Barton <ideasman42@gmail.com>2008-03-27 14:52:58 +0300
commit08bc0efecba8141da70cc560bf0d759ad35dc494 (patch)
tree0433b636b2886c6ea057c4b02fb3bb68433107eb /source/blender/blenkernel
parentc2ae2b51cffaa5344722bae23d6b8917742ffb73 (diff)
made editmode only force smooth shading when vcols are present (as joe suggested)
pythons api's image.unpack() was broken
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 63fa59ccbfe..273575883b8 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -757,12 +757,16 @@ static void emDM_drawFacesTex_common(DerivedMesh *dm,
flag= 1;
if(flag != 0) { /* flag 0 == the face is hidden or invisible */
- if (flag==1 && mcol)
- cp= (unsigned char*)mcol;
-
+
/* we always want smooth here since otherwise vertex colors dont interpolate */
- /* glShadeModel(drawSmooth?GL_SMOOTH:GL_FLAT); */
-
+ if (mcol) {
+ if (flag==1) {
+ cp= (unsigned char*)mcol;
+ }
+ } else {
+ glShadeModel(drawSmooth?GL_SMOOTH:GL_FLAT);
+ }
+
glBegin(efa->v4?GL_QUADS:GL_TRIANGLES);
if (!drawSmooth) {
glNormal3fv(emdm->faceNos[i]);
@@ -826,11 +830,14 @@ static void emDM_drawFacesTex_common(DerivedMesh *dm,
flag= 1;
if(flag != 0) { /* flag 0 == the face is hidden or invisible */
- if (flag==1 && mcol)
- cp= (unsigned char*)mcol;
-
/* we always want smooth here since otherwise vertex colors dont interpolate */
- /*glShadeModel(drawSmooth?GL_SMOOTH:GL_FLAT);*/
+ if (mcol) {
+ if (flag==1) {
+ cp= (unsigned char*)mcol;
+ }
+ } else {
+ glShadeModel(drawSmooth?GL_SMOOTH:GL_FLAT);
+ }
glBegin(efa->v4?GL_QUADS:GL_TRIANGLES);
if (!drawSmooth) {