diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/armature/reeb.c | 1 | ||||
-rw-r--r-- | source/blender/editors/gpencil/drawgpencil.c | 5 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_draw.c | 4 | ||||
-rw-r--r-- | source/blender/editors/mask/mask_draw.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_loopcut.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_clip/clip_draw.c | 14 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_draw.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawanimviz.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawarmature.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 37 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawsimdebug.c | 2 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_manipulator.c | 3 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_draw.c | 10 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_smart_stitch.c | 7 |
14 files changed, 35 insertions, 75 deletions
diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index a1c1f4f115e..2d58689c8be 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -3432,7 +3432,6 @@ void REEB_draw() glEnable(GL_DEPTH_TEST); glLineWidth(1.0); - glPointSize(1.0); } #endif diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index f207c71474c..d5c7c523ca8 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -105,9 +105,9 @@ static void gp_draw_stroke_buffer(tGPspoint *points, int totpoints, short thickn if (dflag & (GP_DRAWDATA_ONLY3D | GP_DRAWDATA_ONLYV2D)) return; - /* if drawing a single point, draw it larger */ if (totpoints == 1) { - /* draw point */ + /* if drawing a single point, draw it larger */ + glPointSize((float)(thickness + 2) * points->pressure); glBegin(GL_POINTS); glVertex2iv(&points->x); glEnd(); @@ -1123,7 +1123,6 @@ static void gp_draw_data(bGPdata *gpd, int offsx, int offsy, int winx, int winy, /* restore initial gl conditions */ glLineWidth(1.0); - glPointSize(1.0); glColor4f(0, 0, 0, 1); } diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index e7f5f1b49de..749fa2253f0 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -728,6 +728,8 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), /* LUMA (1 channel) */ glBlendFunc(GL_ONE, GL_ONE); glColor3f(alpha, alpha, alpha); + glPointSize(1.0); + if (scopes->wavefrm_mode == SCOPES_WAVEFRM_LUMA) { glBlendFunc(GL_ONE, GL_ONE); @@ -944,6 +946,7 @@ void ui_draw_but_VECTORSCOPE(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wco glScalef(diam, diam, 0.f); glVertexPointer(2, GL_FLOAT, 0, scopes->vecscope); + glPointSize(1.0); glDrawArrays(GL_POINTS, 0, scopes->waveform_tot); glDisableClientState(GL_VERTEX_ARRAY); @@ -1517,7 +1520,6 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, uiWidgetColors *wcol, const rcti glVertex2fv(fac); } glEnd(); - glPointSize(1.0f); /* restore scissortest */ glScissor(scissor[0], scissor[1], scissor[2], scissor[3]); diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c index 727c2d8adc8..74af0aaffce 100644 --- a/source/blender/editors/mask/mask_draw.c +++ b/source/blender/editors/mask/mask_draw.c @@ -387,8 +387,6 @@ static void draw_spline_points(const bContext *C, MaskLayer *masklay, MaskSpline draw_circle(x, y, 6.0f, false, xscale, yscale); } - glPointSize(1.0f); - if (is_smooth) { glDisable(GL_LINE_SMOOTH); glDisable(GL_BLEND); diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c index 7236b41577c..c35a36069a7 100644 --- a/source/blender/editors/mesh/editmesh_loopcut.c +++ b/source/blender/editors/mesh/editmesh_loopcut.c @@ -117,8 +117,6 @@ static void ringsel_draw(const bContext *C, ARegion *UNUSED(ar), void *arg) glVertexPointer(3, GL_FLOAT, 0, lcd->points); glDrawArrays(GL_POINTS, 0, lcd->totpoint); glDisableClientState(GL_VERTEX_ARRAY); - - glPointSize(1.0f); } glPopMatrix(); diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index e00ebc14ee0..77934bb4099 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -467,7 +467,6 @@ static void draw_track_path(SpaceClip *sc, MovieClip *UNUSED(clip), MovieTrackin glVertex2f(path[i][0], path[i][1]); } glEnd(); - glPointSize(1.0f); } static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieTrackingMarker *marker, @@ -495,12 +494,10 @@ static void draw_marker_outline(SpaceClip *sc, MovieTrackingTrack *track, MovieT if (isect_point_quad_v2(p, marker->pattern_corners[0], marker->pattern_corners[1], marker->pattern_corners[2], marker->pattern_corners[3])) { - if (tiny) glPointSize(3.0f); - else glPointSize(4.0f); + glPointSize(tiny ? 3.0f : 4.0f); glBegin(GL_POINTS); glVertex2f(pos[0], pos[1]); glEnd(); - glPointSize(1.0f); } else { if (!tiny) glLineWidth(3.0f); @@ -612,15 +609,10 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra if (isect_point_quad_v2(p, marker->pattern_corners[0], marker->pattern_corners[1], marker->pattern_corners[2], marker->pattern_corners[3])) { - if (!tiny) - glPointSize(2.0f); - + glPointSize(tiny ? 1.0f : 2.0f); glBegin(GL_POINTS); glVertex2f(pos[0], pos[1]); glEnd(); - - if (!tiny) - glPointSize(1.0f); } else { glBegin(GL_LINES); @@ -1451,7 +1443,6 @@ static void draw_tracking_tracks(SpaceClip *sc, Scene *scene, ARegion *ar, Movie track = track->next; } - glPointSize(1.0f); glDisable(GL_POINT_SMOOTH); } @@ -1677,7 +1668,6 @@ static void draw_distortion(SpaceClip *sc, ARegion *ar, MovieClip *clip, } glLineWidth(1.0f); - glPointSize(1.0f); } glPopMatrix(); diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 5e1747692e1..b5b308f1b83 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -112,9 +112,7 @@ static void draw_fcurve_modifier_controls_envelope(FModifier *fcm, View2D *v2d) glVertex2f(fed->time, fed->max); } } - glEnd(); /* GL_POINTS */ - - glPointSize(1.0f); + glEnd(); } /* *************************** */ @@ -152,7 +150,7 @@ static void draw_fcurve_vertices_keyframes(FCurve *fcu, SpaceIpo *UNUSED(sipo), } } - glEnd(); /* GL_POINTS */ + glEnd(); } @@ -288,8 +286,6 @@ static void draw_fcurve_vertices(SpaceIpo *sipo, ARegion *ar, FCurve *fcu, short set_fcurve_vertex_color(fcu, 1); draw_fcurve_vertices_keyframes(fcu, sipo, v2d, !(fcu->flag & FCURVE_PROTECTED), 1); - - glPointSize(1.0f); } /* Handles ---------------- */ @@ -915,8 +911,6 @@ static void graph_draw_driver_debug(bAnimContext *ac, ID *id, FCurve *fcu) glBegin(GL_POINTS); glVertex2f(x, y); glEnd(); - - glPointSize(1.0f); } } } diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c index d753ad68fcc..9872b05da63 100644 --- a/source/blender/editors/space_view3d/drawanimviz.c +++ b/source/blender/editors/space_view3d/drawanimviz.c @@ -220,7 +220,6 @@ void draw_motion_path_instance(Scene *scene, glVertex3fv(mpv->co); glEnd(); - glPointSize(1.0f); UI_ThemeColor(TH_TEXT_HI); } @@ -305,8 +304,6 @@ void draw_motion_path_instance(Scene *scene, } glEnd(); - glPointSize(1.0f); - /* Draw frame numbers of keyframes */ if (avs->path_viewflag & MOTIONPATH_VIEW_KFNOS) { float co[3]; diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index e35c70048e7..6a3e8f242be 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -1000,6 +1000,12 @@ static void draw_line_bone(int armflag, int boneflag, short constflag, unsigned /* this chunk not in object mode */ if (armflag & (ARM_EDITMODE | ARM_POSEMODE)) { glLineWidth(4.0f); + if (G.f & G_PICKSEL) { + /* no bitmap in selection mode, crashes 3d cards... + * instead draw a solid point the same size */ + glPointSize(8.0f); + } + if (armflag & ARM_POSEMODE) set_pchan_glColor(PCHAN_COLOR_NORMAL, boneflag, constflag); else if (armflag & ARM_EDITMODE) { @@ -1008,7 +1014,7 @@ static void draw_line_bone(int armflag, int boneflag, short constflag, unsigned /* Draw root point if we are not connected */ if ((boneflag & BONE_CONNECTED) == 0) { - if (G.f & G_PICKSEL) { /* no bitmap in selection mode, crashes 3d cards... */ + if (G.f & G_PICKSEL) { GPU_select_load_id(id | BONESEL_ROOT); glBegin(GL_POINTS); glVertex3f(0.0f, 0.0f, 0.0f); @@ -2587,7 +2593,7 @@ static void draw_ghost_poses(Scene *scene, View3D *v3d, ARegion *ar, Base *base) /* ********************************** Armature Drawing - Main ************************* */ -/* called from drawobject.c, return 1 if nothing was drawn +/* called from drawobject.c, return true if nothing was drawn * (ob_wire_col == NULL) when drawing ghost */ bool draw_armature(Scene *scene, View3D *v3d, ARegion *ar, Base *base, const short dt, const short dflag, const unsigned char ob_wire_col[4], diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index de79468d144..5b95c047036 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -135,7 +135,6 @@ typedef struct drawDMVerts_userData { unsigned char th_vertex_select[4]; unsigned char th_vertex[4]; unsigned char th_skin_root[4]; - float th_vertex_size; /* for skin node drawing */ int cd_vskin_offset; @@ -972,7 +971,6 @@ static void drawshadbuflimits(Lamp *la, float mat[4][4]) glVertex3fv(sta); glVertex3fv(end); glEnd(); - glPointSize(1.0); } static void spotvolume(float lvec[3], float vvec[3], const float inp) @@ -1501,7 +1499,6 @@ static void drawlamp(View3D *v3d, RegionView3D *rv3d, Base *base, glBegin(GL_POINTS); glVertex3fv(vec); glEnd(); - glPointSize(1.0); glDisable(GL_BLEND); @@ -1529,7 +1526,6 @@ static void draw_limit_line(float sta, float end, const short dflag, const unsig glVertex3f(0.0, 0.0, -sta); glVertex3f(0.0, 0.0, -end); glEnd(); - glPointSize(1.0); } } @@ -2234,7 +2230,6 @@ static void lattice_draw_verts(Lattice *lt, DispList *dl, BPoint *actbp, short s } glEnd(); - glPointSize(1.0); } static void drawlattice__point(Lattice *lt, DispList *dl, int u, int v, int w, int actdef_wcol) @@ -2567,20 +2562,13 @@ static void draw_dm_verts__mapFunc(void *userData, int index, const float co[3], } } - /* draw active larger - need to stop/start point drawing for this :/ */ + /* draw active in a different color - no need to stop/start point drawing for this :D */ if (eve == data->eve_act) { glColor4ubv(data->th_editmesh_active); - - glEnd(); - - glPointSize(data->th_vertex_size); - glBegin(GL_POINTS); glVertex3fv(co); - glEnd(); + /* back to regular vertex color */ glColor4ubv(data->sel ? data->th_vertex_select : data->th_vertex); - glPointSize(data->th_vertex_size); - glBegin(GL_POINTS); } else { glVertex3fv(co); @@ -2601,7 +2589,6 @@ static void draw_dm_verts(BMEditMesh *em, DerivedMesh *dm, const char sel, BMVer UI_GetThemeColor4ubv(TH_VERTEX_SELECT, data.th_vertex_select); UI_GetThemeColor4ubv(TH_VERTEX, data.th_vertex); UI_GetThemeColor4ubv(TH_SKIN_ROOT, data.th_skin_root); - data.th_vertex_size = UI_GetThemeValuef(TH_VERTEX_SIZE); /* For skin root drawing */ data.cd_vskin_offset = CustomData_get_offset(&em->bm->vdata, CD_MVERT_SKIN); @@ -2609,6 +2596,7 @@ static void draw_dm_verts(BMEditMesh *em, DerivedMesh *dm, const char sel, BMVer mul_m4_m4m4(data.imat, rv3d->viewmat, em->ob->obmat); invert_m4(data.imat); + glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE)); glBegin(GL_POINTS); dm->foreachMappedVert(dm, draw_dm_verts__mapFunc, &data, DM_FOREACH_NOP); glEnd(); @@ -3182,7 +3170,6 @@ static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit, } if (v3d->zbuf) glDepthMask(1); - glPointSize(1.0); } static void draw_em_fancy_edges(BMEditMesh *em, Scene *scene, View3D *v3d, @@ -3995,7 +3982,6 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D { glPointSize(1.5); dm->drawVerts(dm); - glPointSize(1.0); } else if ((dt == OB_WIRE) || no_faces) { draw_wire = OBDRAW_WIRE_ON; /* draw wire only, no depth buffer stuff */ @@ -4196,8 +4182,6 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D drawSelectedVertices(dm, ob->data); if (!use_depth) glEnable(GL_DEPTH_TEST); else ED_view3d_polygon_offset(rv3d, 0.0); - - glPointSize(1.0f); } dm->release(dm); } @@ -5846,7 +5830,6 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit) glShadeModel(GL_FLAT); if (v3d->zbuf) glEnable(GL_DEPTH_TEST); glLineWidth(1.0f); - glPointSize(1.0f); } static void ob_draw_RE_motion(float com[3], float rotscale[3][3], float itw, float ith, float drw_size) @@ -6161,7 +6144,6 @@ static void drawvertsN(Nurb *nu, const char sel, const bool hide_handles, const } glEnd(); - glPointSize(1.0); } static void editnurb_draw_active_poly(Nurb *nu) @@ -7268,7 +7250,6 @@ static void draw_hooks(Object *ob) glBegin(GL_POINTS); glVertex3fv(vec); glEnd(); - glPointSize(1.0); } } } @@ -7859,7 +7840,6 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short } glEnd(); - glPointSize(1.0); glMultMatrixf(ob->obmat); glDisable(GL_BLEND); @@ -8047,9 +8027,12 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short if (do_draw_center != -1) { if (dflag & DRAW_PICKING) { /* draw a single point for opengl selection */ - glBegin(GL_POINTS); - glVertex3fv(ob->obmat[3]); - glEnd(); + if (U.obcenter_dia > 0) { + glPointSize(U.obcenter_dia); + glBegin(GL_POINTS); + glVertex3fv(ob->obmat[3]); + glEnd(); + } } else if ((dflag & DRAW_CONSTCOLOR) == 0) { /* we don't draw centers for duplicators and sets */ @@ -8200,7 +8183,6 @@ static void bbs_obmode_mesh_verts(Object *ob, DerivedMesh *dm, int offset) glBegin(GL_POINTS); dm->foreachMappedVert(dm, bbs_obmode_mesh_verts__mapFunc, &data, DM_FOREACH_NOP); glEnd(); - glPointSize(1.0); } static void bbs_mesh_verts__mapFunc(void *userData, int index, const float co[3], @@ -8221,7 +8203,6 @@ static void bbs_mesh_verts(BMEditMesh *em, DerivedMesh *dm, int offset) glBegin(GL_POINTS); dm->foreachMappedVert(dm, bbs_mesh_verts__mapFunc, &data, DM_FOREACH_NOP); glEnd(); - glPointSize(1.0); } static DMDrawOption bbs_mesh_wire__setDrawOptions(void *userData, int index) diff --git a/source/blender/editors/space_view3d/drawsimdebug.c b/source/blender/editors/space_view3d/drawsimdebug.c index 46320ba6763..91adc905816 100644 --- a/source/blender/editors/space_view3d/drawsimdebug.c +++ b/source/blender/editors/space_view3d/drawsimdebug.c @@ -62,7 +62,6 @@ static void draw_sim_debug_elements(SimDebugData *debug_data, float imat[4][4]) glVertex3f(elem->v1[0], elem->v1[1], elem->v1[2]); } glEnd(); - glPointSize(1.0f); /**** circles ****/ @@ -123,7 +122,6 @@ static void draw_sim_debug_elements(SimDebugData *debug_data, float imat[4][4]) glVertex3f(elem->v1[0], elem->v1[1], elem->v1[2]); } glEnd(); - glPointSize(1.0f); glBegin(GL_LINES); for (BLI_ghashIterator_init(&iter, debug_data->gh); !BLI_ghashIterator_done(&iter); BLI_ghashIterator_step(&iter)) { diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 3ce0de5a6a1..0f2af58e0ce 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -1326,6 +1326,7 @@ static void draw_manipulator_scale( } } +#if 0 // XXX /* if shiftkey, center point as last, for selectbuffer order */ if (is_picksel) { int shift = 0; // XXX @@ -1333,11 +1334,13 @@ static void draw_manipulator_scale( if (shift) { glTranslatef(0.0, -dz, 0.0); GPU_select_load_id(MAN_SCALE_C); + /* TODO: set glPointSize before drawing center point */ glBegin(GL_POINTS); glVertex3f(0.0, 0.0, 0.0); glEnd(); } } +#endif /* restore */ glLoadMatrixf(rv3d->viewmat); diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 9f9a42e9b80..988f60a36f9 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -856,12 +856,13 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) float cent[2]; pointsize = UI_GetThemeValuef(TH_FACEDOT_SIZE); - glPointSize(pointsize); // TODO - drawobject.c changes this value after - Investigate! + glPointSize(pointsize); + glBegin(GL_POINTS); + /* unselected faces */ UI_ThemeColor(TH_WIRE); - glBegin(GL_POINTS); BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) { if (!BM_elem_flag_test(efa, BM_ELEM_TAG)) continue; @@ -871,12 +872,10 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) glVertex2fv(cent); } } - glEnd(); /* selected faces */ UI_ThemeColor(TH_FACE_DOT); - glBegin(GL_POINTS); BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) { if (!BM_elem_flag_test(efa, BM_ELEM_TAG)) continue; @@ -886,6 +885,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) glVertex2fv(cent); } } + glEnd(); } @@ -947,8 +947,6 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit) } glEnd(); } - - glPointSize(1.0); } diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index 828537fd585..c9f4d274b8e 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -1506,15 +1506,12 @@ static void stitch_calculate_edge_normal(BMEditMesh *em, UvEdge *edge, float *no static void stitch_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *arg) { int i, index = 0; - float pointsize = UI_GetThemeValuef(TH_VERTEX_SIZE); StitchState *state = (StitchState *)arg; StitchPreviewer *stitch_preview = state->stitch_preview; glPushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT); glEnableClientState(GL_VERTEX_ARRAY); - glPointSize(pointsize * 2.0f); - glEnable(GL_BLEND); UI_ThemeColor4(TH_STITCH_PREVIEW_ACTIVE); @@ -1542,6 +1539,8 @@ static void stitch_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *ar /* draw vert preview */ if (state->mode == STITCH_VERT) { + glPointSize(UI_GetThemeValuef(TH_VERTEX_SIZE) * 2.0f); + UI_ThemeColor4(TH_STITCH_PREVIEW_STITCHABLE); glVertexPointer(2, GL_FLOAT, 0, stitch_preview->preview_stitchable); glDrawArrays(GL_POINTS, 0, stitch_preview->num_stitchable); @@ -1562,8 +1561,6 @@ static void stitch_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *ar glPopClientAttrib(); glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - - glPointSize(1.0); } static UvEdge *uv_edge_get(BMLoop *l, StitchState *state) |