- this routine is going to be my waterloo!
forgot to check null pointer...
This commit is contained in:
@@ -284,6 +284,7 @@ enum {
|
||||
TH_BUT_DRAWTYPE,
|
||||
|
||||
TH_REDALERT,
|
||||
TH_CUSTOM,
|
||||
|
||||
TH_THEMEUI,
|
||||
// common colors among spaces
|
||||
|
||||
@@ -1750,10 +1750,10 @@ static void editing_panel_links(Object *ob)
|
||||
if(ob->totcol) min= 1.0; else min= 0.0;
|
||||
ma= give_current_material(ob, ob->actcol);
|
||||
|
||||
if(ma) {
|
||||
uiDefButF(block, COL, 0, "", 291,123,24,30, &(ma->r), 0, 0, 0, 0, "");
|
||||
uiDefBut(block, LABEL, 0, ma->id.name+2, 318,153, 103, 20, 0, 0, 0, 0, 0, "");
|
||||
}
|
||||
if(ma) uiDefBut(block, LABEL, 0, ma->id.name+2, 318,153, 103, 20, 0, 0, 0, 0, 0, "");
|
||||
|
||||
uiBlockBeginAlign(block);
|
||||
if(ma) uiDefButF(block, COL, 0, "", 291,123,24,30, &(ma->r), 0, 0, 0, 0, "");
|
||||
uiDefButC(block, NUM, B_REDR, str, 318,123,103,30, &ob->actcol, min, (float)(ob->totcol), 0, 0, "Displays total number of material indices and the current index");
|
||||
uiDefBut(block, BUT,B_MATWICH, "?", 423,123,31,30, 0, 0, 0, 0, 0, "In EditMode, sets the active material index from selected faces");
|
||||
|
||||
|
||||
@@ -629,7 +629,8 @@ void mouse_select(void)
|
||||
}
|
||||
|
||||
// for visual speed
|
||||
if(oldbasact != basact && (oldbasact->lay & G.vd->lay)) draw_object_ext(oldbasact);
|
||||
if(oldbasact && oldbasact != basact && (oldbasact->lay & G.vd->lay))
|
||||
draw_object_ext(oldbasact);
|
||||
draw_object_ext(basact);
|
||||
|
||||
if(basact->object->type!=OB_MESH) {
|
||||
|
||||
@@ -1247,7 +1247,6 @@ static void round_button(float x1, float y1, float x2, float y2, float asp, int
|
||||
glEnd();
|
||||
|
||||
BIF_ThemeColorBlendShade(colorid, TH_BACK, 0.5, -70);
|
||||
//BIF_ThemeColorShade(colorid, -70);
|
||||
|
||||
glBegin(GL_LINE_LOOP);
|
||||
gl_round_box(x1, y1, x2, y2, rad);
|
||||
@@ -1261,7 +1260,6 @@ static void round_button_mid(float x1, float y1, float x2, float y2, float asp,
|
||||
{
|
||||
glRectf(x1, y1, x2, y2);
|
||||
|
||||
//BIF_ThemeColorShade(colorid, -70);
|
||||
BIF_ThemeColorBlendShade(colorid, TH_BACK, 0.5, -70);
|
||||
// we draw full outline, its not AA, and it works better button mouse-over hilite
|
||||
|
||||
@@ -1669,11 +1667,21 @@ static void ui_draw_but_COL(uiBut *but)
|
||||
colg= cp[1];
|
||||
colb= cp[2];
|
||||
}
|
||||
glColor3ub(colr, colg, colb);
|
||||
glRectf((but->x1), (but->y1), (but->x2), (but->y2));
|
||||
glColor3ub(0, 0, 0);
|
||||
fdrawbox((but->x1), (but->y1), (but->x2), (but->y2));
|
||||
|
||||
|
||||
/* exception... hrms, but can't simply use the emboss callback for this now. */
|
||||
/* this button type needs review, and nice integration with rest of API here */
|
||||
if(but->embossfunc == ui_draw_round) {
|
||||
char *cp= BIF_ThemeGetColorPtr(U.themes.first, 0, TH_CUSTOM);
|
||||
cp[0]= colr; cp[1]= colg; cp[2]= colb;
|
||||
but->embossfunc(but->type, TH_CUSTOM, but->aspect, but->x1, but->y1, but->x2, but->y2, but->flag);
|
||||
}
|
||||
else {
|
||||
|
||||
glColor3ub(colr, colg, colb);
|
||||
glRectf((but->x1), (but->y1), (but->x2), (but->y2));
|
||||
glColor3ub(0, 0, 0);
|
||||
fdrawbox((but->x1), (but->y1), (but->x2), (but->y2));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -283,6 +283,7 @@ char *BIF_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
|
||||
static char error[4]={240, 0, 240, 255};
|
||||
static char alert[4]={240, 60, 60, 255};
|
||||
static char headerdesel[4]={0,0,0,255};
|
||||
static char custom[4]={0,0,0,255};
|
||||
|
||||
char *cp= error;
|
||||
|
||||
@@ -328,6 +329,8 @@ char *BIF_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
|
||||
|
||||
case TH_REDALERT:
|
||||
cp= alert; break;
|
||||
case TH_CUSTOM:
|
||||
cp= custom; break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user