Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_draw.c
| Context not available. | |||||
| /* ********* end custom clipping *********** */ | /* ********* end custom clipping *********** */ | ||||
| void ED_view3d_color_overlay(View3D *v3d) | |||||
| { | |||||
| if (V3D_IS_WIRECOLOR(v3d)) { | |||||
| cpack(0xffffff); | |||||
| } | |||||
| else { | |||||
| UI_ThemeColor(TH_VIEW_OVERLAY); | |||||
| } | |||||
| } | |||||
| static void drawgrid_draw(ARegion *ar, double wx, double wy, double x, double y, double dx) | static void drawgrid_draw(ARegion *ar, double wx, double wy, double x, double y, double dx) | ||||
| { | { | ||||
| Context not available. | |||||
| circ((float)co[0], (float)co[1], f10); | circ((float)co[0], (float)co[1], f10); | ||||
| setlinestyle(0); | setlinestyle(0); | ||||
| UI_ThemeColor(TH_VIEW_OVERLAY); | ED_view3d_color_overlay(v3d); | ||||
| sdrawline(co[0] - f20, co[1], co[0] - f5, co[1]); | sdrawline(co[0] - f20, co[1], co[0] - f5, co[1]); | ||||
| sdrawline(co[0] + f5, co[1], co[0] + f20, co[1]); | sdrawline(co[0] + f5, co[1], co[0] + f20, co[1]); | ||||
| sdrawline(co[0], co[1] - f20, co[0], co[1] - f5); | sdrawline(co[0], co[1] - f20, co[0], co[1] - f5); | ||||
| Context not available. | |||||
| glRectf(x1i - 1, y1i - 1, x2i + 1, y2i + 1); | glRectf(x1i - 1, y1i - 1, x2i + 1, y2i + 1); | ||||
| } | } | ||||
| UI_ThemeColor(TH_VIEW_OVERLAY); | ED_view3d_color_overlay(v3d); | ||||
| glRectf(x1i, y1i, x2i, y2i); | glRectf(x1i, y1i, x2i, y2i); | ||||
| /* border */ | /* border */ | ||||
| Context not available. | |||||
| static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int color) | static void draw_dupli_objects_color(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int color) | ||||
| { | { | ||||
| const bool is_wire_color = V3D_IS_WIRECOLOR(v3d); | |||||
| RegionView3D *rv3d = ar->regiondata; | RegionView3D *rv3d = ar->regiondata; | ||||
| ListBase *lb; | ListBase *lb; | ||||
| LodLevel *savedlod; | LodLevel *savedlod; | ||||
| Context not available. | |||||
| else | else | ||||
| tbase.object->transflag &= ~OB_NEG_SCALE; | tbase.object->transflag &= ~OB_NEG_SCALE; | ||||
| UI_ThemeColorBlend(color, TH_BACK, 0.5); | if (is_wire_color) { | ||||
| glColor3fv(base->object->col); | |||||
| } | |||||
| else { | |||||
| UI_ThemeColorBlend(color, TH_BACK, 0.5); | |||||
| } | |||||
| /* generate displist, test for new object */ | /* generate displist, test for new object */ | ||||
| if (dob_prev && dob_prev->ob != dob->ob) { | if (dob_prev && dob_prev->ob != dob->ob) { | ||||
| Context not available. | |||||
| displist = glGenLists(1); | displist = glGenLists(1); | ||||
| glNewList(displist, GL_COMPILE); | glNewList(displist, GL_COMPILE); | ||||
| draw_object(scene, ar, v3d, &tbase, DRAW_CONSTCOLOR); | draw_object(scene, ar, v3d, &tbase, DRAW_CONSTCOLOR | (base->flag & SELECT)); | ||||
| glEndList(); | glEndList(); | ||||
| use_displist = true; | use_displist = true; | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| draw_object(scene, ar, v3d, &tbase, DRAW_CONSTCOLOR); | draw_object(scene, ar, v3d, &tbase, DRAW_CONSTCOLOR | (base->flag & SELECT)); | ||||
| } | } | ||||
| tbase.object->dt = dt; | tbase.object->dt = dt; | ||||
| Context not available. | |||||
| void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar, int winx, int winy, | void ED_view3d_draw_offscreen(Scene *scene, View3D *v3d, ARegion *ar, int winx, int winy, | ||||
| float viewmat[4][4], float winmat[4][4], bool do_bgpic, bool do_sky) | float viewmat[4][4], float winmat[4][4], bool do_bgpic, bool do_sky) | ||||
| { | { | ||||
| const bool is_wire_color = V3D_IS_WIRECOLOR(v3d); | |||||
| RegionView3D *rv3d = ar->regiondata; | RegionView3D *rv3d = ar->regiondata; | ||||
| Base *base; | Base *base; | ||||
| int bwinx, bwiny; | int bwinx, bwiny; | ||||
| Context not available. | |||||
| Scene *sce_iter; | Scene *sce_iter; | ||||
| for (SETLOOPER(scene->set, sce_iter, base)) { | for (SETLOOPER(scene->set, sce_iter, base)) { | ||||
| if (v3d->lay & base->lay) { | if (v3d->lay & base->lay) { | ||||
| UI_ThemeColorBlend(TH_WIRE, TH_BACK, 0.6f); | if (is_wire_color) { | ||||
| glColor3fv(base->object->col); | |||||
| } | |||||
| else { | |||||
| UI_ThemeColorBlend(TH_WIRE, TH_BACK, 0.6f); | |||||
| } | |||||
| draw_object(scene, ar, v3d, base, DRAW_CONSTCOLOR | DRAW_SCENESET); | draw_object(scene, ar, v3d, base, DRAW_CONSTCOLOR | DRAW_SCENESET); | ||||
| if (base->object->transflag & OB_DUPLI) | if (base->object->transflag & OB_DUPLI) | ||||
| Context not available. | |||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| if (UI_GetThemeValue(TH_SHOW_BACK_GRAD)) { | if (V3D_IS_WIRECOLOR(v3d)) { | ||||
| glClearColor(0.0, 0.0, 0.0, 0.0); | |||||
| glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); | |||||
| } | |||||
| else if (UI_GetThemeValue(TH_SHOW_BACK_GRAD)) { | |||||
| glMatrixMode(GL_PROJECTION); | glMatrixMode(GL_PROJECTION); | ||||
| glPushMatrix(); | glPushMatrix(); | ||||
| glLoadIdentity(); | glLoadIdentity(); | ||||
| Context not available. | |||||
| for (base = scene->base.first; base; base = base->next) { | for (base = scene->base.first; base; base = base->next) { | ||||
| if (v3d->lay & base->lay) { | if (v3d->lay & base->lay) { | ||||
| if (base->object == scene->obedit || (base->flag & SELECT)) { | if (base->object == scene->obedit || (base->flag & SELECT)) { | ||||
| draw_object(scene, ar, v3d, base, 0); | draw_object(scene, ar, v3d, base, (base->flag & SELECT)); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||