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:
Diffstat (limited to 'source/blender/editors/space_view3d/drawobject.c')
-rw-r--r--source/blender/editors/space_view3d/drawobject.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index f272cb61c26..fd1eb7852c1 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -622,7 +622,7 @@ static void draw_empty_image(Object *ob, const short dflag, const unsigned char
BKE_image_release_ibuf(ima, ibuf, NULL);
}
-static void circball_array_fill(float verts[CIRCLE_RESOL][3], const float cent[3], float rad, float tmat[][4])
+static void circball_array_fill(float verts[CIRCLE_RESOL][3], const float cent[3], float rad, float tmat[4][4])
{
float vx[3], vy[3];
float *viter = (float *)verts;
@@ -638,7 +638,7 @@ static void circball_array_fill(float verts[CIRCLE_RESOL][3], const float cent[3
}
}
-void drawcircball(int mode, const float cent[3], float rad, float tmat[][4])
+void drawcircball(int mode, const float cent[3], float rad, float tmat[4][4])
{
float verts[CIRCLE_RESOL][3];
@@ -739,7 +739,7 @@ void view3d_cached_text_draw_add(const float co[3],
memcpy(++vos, str, alloc_len);
}
-void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, float mat[][4])
+void view3d_cached_text_draw_end(View3D *v3d, ARegion *ar, int depth_write, float mat[4][4])
{
RegionView3D *rv3d = ar->regiondata;
ListBase *strings = &CachedText[CachedTextLevel - 1];
@@ -929,7 +929,7 @@ static void drawcube_size(const float size[3])
}
#endif
-static void drawshadbuflimits(Lamp *la, float mat[][4])
+static void drawshadbuflimits(Lamp *la, float mat[4][4])
{
float sta[3], end[3], lavec[3];
@@ -2854,7 +2854,7 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d,
}
}
- EDBM_index_arrays_init(em, 1, 1, 1);
+ EDBM_index_arrays_ensure(em, BM_VERT | BM_EDGE | BM_FACE);
if (dt > OB_WIRE) {
if (check_object_draw_texture(scene, v3d, dt)) {
@@ -3019,8 +3019,6 @@ static void draw_em_fancy(Scene *scene, View3D *v3d, RegionView3D *rv3d,
bglPolygonOffset(rv3d->dist, 0.0);
GPU_disable_material();
}
-
- EDBM_index_arrays_free(em);
}
/* Mesh drawing routines */
@@ -4689,9 +4687,11 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, PTCacheEdit *edit)
if (!(point->flag & PEP_HIDE))
totkeys += point->totkey;
- if (edit->points && !(edit->points->keys->flag & PEK_USE_WCO))
- pd = pdata = MEM_callocN(totkeys * 3 * sizeof(float), "particle edit point data");
- cd = cdata = MEM_callocN(totkeys * (timed ? 4 : 3) * sizeof(float), "particle edit color data");
+ if (totkeys) {
+ if (edit->points && !(edit->points->keys->flag & PEK_USE_WCO))
+ pd = pdata = MEM_callocN(totkeys * 3 * sizeof(float), "particle edit point data");
+ cd = cdata = MEM_callocN(totkeys * (timed ? 4 : 3) * sizeof(float), "particle edit color data");
+ }
for (i = 0, point = edit->points; i < totpoint; i++, point++) {
if (point->flag & PEP_HIDE)
@@ -5462,10 +5462,10 @@ static void curve_draw_speed(Scene *scene, Object *ob)
#endif /* XXX old animation system stuff */
-static void draw_textcurs(float textcurs[4][2])
+static void draw_textcurs(RegionView3D *rv3d, float textcurs[4][2])
{
cpack(0);
-
+ bglPolygonOffset(rv3d->dist, -1.0);
set_inverted_drawing(1);
glBegin(GL_QUADS);
glVertex2fv(textcurs[0]);
@@ -5474,9 +5474,10 @@ static void draw_textcurs(float textcurs[4][2])
glVertex2fv(textcurs[3]);
glEnd();
set_inverted_drawing(0);
+ bglPolygonOffset(rv3d->dist, 0.0);
}
-static void drawspiral(const float cent[3], float rad, float tmat[][4], int start)
+static void drawspiral(const float cent[3], float rad, float tmat[4][4], int start)
{
float vec[3], vx[3], vy[3];
const float tot_inv = (1.0f / (float)CIRCLE_RESOL);
@@ -5565,7 +5566,7 @@ static void drawcircle_size(float size)
}
/* needs fixing if non-identity matrice used */
-static void drawtube(const float vec[3], float radius, float height, float tmat[][4])
+static void drawtube(const float vec[3], float radius, float height, float tmat[4][4])
{
float cur[3];
drawcircball(GL_LINE_LOOP, vec, radius, tmat);
@@ -5587,7 +5588,7 @@ static void drawtube(const float vec[3], float radius, float height, float tmat[
glEnd();
}
/* needs fixing if non-identity matrice used */
-static void drawcone(const float vec[3], float radius, float height, float tmat[][4])
+static void drawcone(const float vec[3], float radius, float height, float tmat[4][4])
{
float cur[3];
@@ -6394,7 +6395,7 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, const short
case OB_FONT:
cu = ob->data;
if (cu->editfont) {
- draw_textcurs(cu->editfont->textcurs);
+ draw_textcurs(rv3d, cu->editfont->textcurs);
if (cu->flag & CU_FAST) {
cpack(0xFFFFFF);
@@ -7153,7 +7154,7 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
DerivedMesh *dm = editbmesh_get_derived_cage(scene, ob, em, CD_MASK_BAREMESH);
- EDBM_index_arrays_init(em, 1, 1, 1);
+ EDBM_index_arrays_ensure(em, BM_VERT | BM_EDGE | BM_FACE);
bbs_mesh_solid_EM(em, scene, v3d, ob, dm, ts->selectmode & SCE_SELECT_FACE);
if (ts->selectmode & SCE_SELECT_FACE)
@@ -7179,8 +7180,6 @@ void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Objec
bglPolygonOffset(rv3d->dist, 0.0);
dm->release(dm);
-
- EDBM_index_arrays_free(em);
}
else {
Mesh *me = ob->data;