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:
authorTon Roosendaal <ton@blender.org>2005-12-30 18:56:42 +0300
committerTon Roosendaal <ton@blender.org>2005-12-30 18:56:42 +0300
commit1e864ed482fded9d11b58a65c507eb8ade309526 (patch)
tree7c99c172d74f4bf045dbc50152f4c966f5d7bf79 /source/blender/src/interface_draw.c
parentd921d6be6f3b06cc49923d3546b4105ec9a247f4 (diff)
Bugfixes:
- Deleting bone in editmode did not check for pose layers when clearing pose channels or constraint targets.... - Button 'use nodes' in header of Node editor could only be pressed once - New 'normal' button messed with default material in blender - Theme options for Node window available now in Info window
Diffstat (limited to 'source/blender/src/interface_draw.c')
-rw-r--r--source/blender/src/interface_draw.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/source/blender/src/interface_draw.c b/source/blender/src/interface_draw.c
index 356067882ab..f06717cfe5e 100644
--- a/source/blender/src/interface_draw.c
+++ b/source/blender/src/interface_draw.c
@@ -1972,18 +1972,20 @@ static void ui_draw_but_NORMAL(uiBut *but)
{
static GLuint displist=0;
int a, old[8];
- float vec0[3]={0.0f, 0.0f, 0.0f};
- float vec1[3]={1.0f, 1.0f, 1.0f};
+ GLfloat diff[4], diffn[4]={1.0f, 1.0f, 1.0f, 1.0f};
+ float vec0[4]={0.0f, 0.0f, 0.0f, 0.0f};
float dir[4], size;
+ /* store stuff */
+ glGetMaterialfv(GL_FRONT, GL_DIFFUSE, diff);
+
/* backdrop */
BIF_ThemeColor(TH_BUT_NEUTRAL);
uiSetRoundBox(15);
gl_round_box(GL_POLYGON, but->x1, but->y1, but->x2, but->y2, 5.0f);
/* sphere color */
- glEnable(GL_COLOR_MATERIAL);
- glColor3ub(200, 200, 200);
+ glMaterialfv(GL_FRONT, GL_DIFFUSE, diffn);
glCullFace(GL_BACK); glEnable(GL_CULL_FACE);
/* disable blender light */
@@ -1999,7 +2001,7 @@ static void ui_draw_but_NORMAL(uiBut *but)
VECCOPY(dir, (float *)but->poin);
dir[3]= 0.0f; /* glLight needs 4 args, 0.0 is sun */
glLightfv(GL_LIGHT7, GL_POSITION, dir);
- glLightfv(GL_LIGHT7, GL_DIFFUSE, vec1);
+ glLightfv(GL_LIGHT7, GL_DIFFUSE, diffn);
glLightfv(GL_LIGHT7, GL_SPECULAR, vec0);
glLightf(GL_LIGHT7, GL_CONSTANT_ATTENUATION, 1.0f);
glLightf(GL_LIGHT7, GL_LINEAR_ATTENUATION, 0.0f);
@@ -2016,7 +2018,7 @@ static void ui_draw_but_NORMAL(uiBut *but)
displist= glGenLists(1);
glNewList(displist, GL_COMPILE_AND_EXECUTE);
- qobj = gluNewQuadric();
+ qobj= gluNewQuadric();
gluQuadricDrawStyle(qobj, GLU_FILL);
glShadeModel(GL_SMOOTH);
gluSphere( qobj, 100.0, 32, 24);
@@ -2027,18 +2029,20 @@ static void ui_draw_but_NORMAL(uiBut *but)
}
else glCallList(displist);
+ /* restore */
glPopMatrix();
glDisable(GL_LIGHTING);
- glDisable(GL_COLOR_MATERIAL);
glDisable(GL_CULL_FACE);
+ glMaterialfv(GL_FRONT, GL_DIFFUSE, diff);
+
+ glDisable(GL_LIGHT7);
/* enable blender light */
for(a=0; a<8; a++) {
if(old[a])
glEnable(GL_LIGHT0+a);
}
-
-
+
}
static void ui_draw_roundbox(uiBut *but)