[Bf-blender-cvs] [aa880bb] master: Cleanup: use ED_view3d_backbuf_* prefix

Campbell Barton noreply at git.blender.org
Mon Apr 20 19:20:20 CEST 2015


Commit: aa880bb815e7707255f7d450f4add1b042f119fa
Author: Campbell Barton
Date:   Tue Apr 21 03:19:27 2015 +1000
Branches: master
https://developer.blender.org/rBaa880bb815e7707255f7d450f4add1b042f119fa

Cleanup: use ED_view3d_backbuf_* prefix

===================================================================

M	source/blender/editors/include/ED_view3d.h
M	source/blender/editors/mesh/editface.c
M	source/blender/editors/mesh/editmesh_select.c
M	source/blender/editors/mesh/meshtools.c
M	source/blender/editors/physics/particle_edit.c
M	source/blender/editors/sculpt_paint/paint_utils.c
M	source/blender/editors/sculpt_paint/paint_vertex.c
M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/editors/space_view3d/view3d_select.c

===================================================================

diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index e5ac8c2..f68b52d 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -267,14 +267,14 @@ float ED_view3d_radius_to_dist(
 void drawcircball(int mode, const float cent[3], float rad, float tmat[4][4]);
 
 /* backbuffer select and draw support */
-void view3d_validate_backbuf(struct ViewContext *vc);
-struct ImBuf *view3d_read_backbuf(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax);
-unsigned int view3d_sample_backbuf_rect(
+void          ED_view3d_backbuf_validate(struct ViewContext *vc);
+struct ImBuf *ED_view3d_backbuf_read(struct ViewContext *vc, short xmin, short ymin, short xmax, short ymax);
+unsigned int  ED_view3d_backbuf_sample_rect(
         struct ViewContext *vc, const int mval[2], int size,
         unsigned int min, unsigned int max, float *dist, const bool is_strict,
         void *handle, bool (*indextest)(void *handle, unsigned int index));
-int          view3d_backbuf_sample_size_clamp(struct ARegion *ar, const float dist);
-unsigned int view3d_sample_backbuf(struct ViewContext *vc, int x, int y);
+int          ED_view3d_backbuf_sample_size_clamp(struct ARegion *ar, const float dist);
+unsigned int ED_view3d_backbuf_sample(struct ViewContext *vc, int x, int y);
 
 /* draws and does a 4x4 sample */
 bool ED_view3d_autodist(struct Scene *scene, struct ARegion *ar, struct View3D *v3d,
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c
index 113f0f7..35fc448 100644
--- a/source/blender/editors/mesh/editface.c
+++ b/source/blender/editors/mesh/editface.c
@@ -446,7 +446,7 @@ int do_paintface_box_select(ViewContext *vc, rcti *rect, bool select, bool exten
 		}
 	}
 
-	view3d_validate_backbuf(vc);
+	ED_view3d_backbuf_validate(vc);
 
 	ibuf = IMB_allocImBuf(sx, sy, 32, IB_rect);
 	rt = ibuf->rect;
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index 244cfe2..a3a61c3 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -200,7 +200,7 @@ bool EDBM_backbuf_border_init(ViewContext *vc, short xmin, short ymin, short xma
 		return false;
 	}
 	
-	buf = view3d_read_backbuf(vc, xmin, ymin, xmax, ymax);
+	buf = ED_view3d_backbuf_read(vc, xmin, ymin, xmax, ymax);
 	if (buf == NULL) return false;
 	if (bm_vertoffs == 0) return false;
 
@@ -275,7 +275,7 @@ bool EDBM_backbuf_border_mask_init(ViewContext *vc, const int mcords[][2], short
 		return false;
 	}
 
-	buf = view3d_read_backbuf(vc, xmin, ymin, xmax, ymax);
+	buf = ED_view3d_backbuf_read(vc, xmin, ymin, xmax, ymax);
 	if (buf == NULL) return false;
 	if (bm_vertoffs == 0) return false;
 
@@ -326,7 +326,7 @@ bool EDBM_backbuf_circle_init(ViewContext *vc, short xs, short ys, short rads)
 
 	xmin = xs - rads; xmax = xs + rads;
 	ymin = ys - rads; ymax = ys + rads;
-	buf = view3d_read_backbuf(vc, xmin, ymin, xmax, ymax);
+	buf = ED_view3d_backbuf_read(vc, xmin, ymin, xmax, ymax);
 	if (bm_vertoffs == 0) return false;
 	if (buf == NULL) return false;
 
@@ -424,18 +424,18 @@ BMVert *EDBM_vert_find_nearest_ex(
 	BMesh *bm = vc->em->bm;
 
 	if (V3D_IS_ZBUF(vc->v3d)) {
-		const int dist_px = view3d_backbuf_sample_size_clamp(vc->ar, *r_dist);
+		const int dist_px = ED_view3d_backbuf_sample_size_clamp(vc->ar, *r_dist);
 		float distance;
 		unsigned int index;
 		BMVert *eve;
 		
 		if (is_strict) {
-			index = view3d_sample_backbuf_rect(
+			index = ED_view3d_backbuf_sample_rect(
 			        vc, vc->mval, dist_px, bm_wireoffs, 0xFFFFFF, &distance,
 			        is_strict, vc->em, findnearestvert__backbufIndextest);
 		}
 		else {
-			index = view3d_sample_backbuf_rect(
+			index = ED_view3d_backbuf_sample_rect(
 			        vc, vc->mval, dist_px, bm_wireoffs, 0xFFFFFF, &distance,
 			        0, NULL, NULL);
 		}
@@ -538,14 +538,14 @@ BMEdge *EDBM_edge_find_nearest(ViewContext *vc, float *r_dist)
 	BMesh *bm = vc->em->bm;
 
 	if (V3D_IS_ZBUF(vc->v3d)) {
-		const int dist_px = view3d_backbuf_sample_size_clamp(vc->ar, *r_dist);
+		const int dist_px = ED_view3d_backbuf_sample_size_clamp(vc->ar, *r_dist);
 		float distance;
 		unsigned int index;
 		BMEdge *eed;
 		
-		view3d_validate_backbuf(vc);
+		ED_view3d_backbuf_validate(vc);
 
-		index = view3d_sample_backbuf_rect(vc, vc->mval, dist_px, bm_solidoffs, bm_wireoffs, &distance, 0, NULL, NULL);
+		index = ED_view3d_backbuf_sample_rect(vc, vc->mval, dist_px, bm_solidoffs, bm_wireoffs, &distance, 0, NULL, NULL);
 		eed = index ? BM_edge_at_index_find_or_table(bm, index - 1) : NULL;
 		
 		if (eed && distance < *r_dist) {
@@ -637,9 +637,9 @@ BMFace *EDBM_face_find_nearest_ex(
 		unsigned int index;
 		BMFace *efa;
 
-		view3d_validate_backbuf(vc);
+		ED_view3d_backbuf_validate(vc);
 
-		index = view3d_sample_backbuf(vc, vc->mval[0], vc->mval[1]);
+		index = ED_view3d_backbuf_sample(vc, vc->mval[0], vc->mval[1]);
 		efa = index ? BM_face_at_index_find_or_table(bm, index - 1) : NULL;
 		
 		if (r_efa_zbuf) {
@@ -726,7 +726,7 @@ static int unified_findnearest(ViewContext *vc, BMVert **r_eve, BMEdge **r_eed,
 	BMFace *efa = NULL;
 	
 	/* no afterqueue (yet), so we check it now, otherwise the em_xxxofs indices are bad */
-	view3d_validate_backbuf(vc);
+	ED_view3d_backbuf_validate(vc);
 
 	if (em->selectmode & SCE_SELECT_VERTEX) {
 		eve = EDBM_vert_find_nearest_ex(vc, &dist, true, false);
@@ -1383,7 +1383,7 @@ static bool mouse_mesh_loop(bContext *C, const int mval[2], bool extend, bool de
 	em = vc.em;
 
 	/* no afterqueue (yet), so we check it now, otherwise the bm_xxxofs indices are bad */
-	view3d_validate_backbuf(&vc);
+	ED_view3d_backbuf_validate(&vc);
 
 	eed = EDBM_edge_find_nearest(&vc, &dist);
 	if (eed == NULL) {
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index 00d79b2..acd7456 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -1082,11 +1082,11 @@ bool ED_mesh_pick_face(bContext *C, Object *ob, const int mval[2], unsigned int
 		 * on an edge in the backbuf, we can still select a face */
 
 		float dummy_dist;
-		*index = view3d_sample_backbuf_rect(&vc, mval, size, 1, me->totpoly + 1, &dummy_dist, 0, NULL, NULL);
+		*index = ED_view3d_backbuf_sample_rect(&vc, mval, size, 1, me->totpoly + 1, &dummy_dist, 0, NULL, NULL);
 	}
 	else {
 		/* sample only on the exact position */
-		*index = view3d_sample_backbuf(&vc, mval[0], mval[1]);
+		*index = ED_view3d_backbuf_sample(&vc, mval[0], mval[1]);
 	}
 
 	if ((*index) == 0 || (*index) > (unsigned int)me->totpoly)
@@ -1248,11 +1248,11 @@ bool ED_mesh_pick_vert(bContext *C, Object *ob, const int mval[2], unsigned int
 			 * on an face in the backbuf, we can still select a vert */
 
 			float dummy_dist;
-			*index = view3d_sample_backbuf_rect(&vc, mval, size, 1, me->totvert + 1, &dummy_dist, 0, NULL, NULL);
+			*index = ED_view3d_backbuf_sample_rect(&vc, mval, size, 1, me->totvert + 1, &dummy_dist, 0, NULL, NULL);
 		}
 		else {
 			/* sample only on the exact position */
-			*index = view3d_sample_backbuf(&vc, mval[0], mval[1]);
+			*index = ED_view3d_backbuf_sample(&vc, mval[0], mval[1]);
 		}
 
 		if ((*index) == 0 || (*index) > (unsigned int)me->totvert)
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 04764aa..7abd6f4 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -405,7 +405,7 @@ static void PE_set_view3d_data(bContext *C, PEData *data)
 			/* needed or else the draw matrix can be incorrect */
 			view3d_operator_needs_opengl(C);
 
-			view3d_validate_backbuf(&data->vc);
+			ED_view3d_backbuf_validate(&data->vc);
 			/* we may need to force an update here by setting the rv3d as dirty
 			 * for now it seems ok, but take care!:
 			 * rv3d->depths->dirty = 1; */
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index b19cced..f1edf8a 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -379,7 +379,7 @@ static int imapaint_pick_face(ViewContext *vc, const int mval[2], unsigned int *
 		return 0;
 
 	/* sample only on the exact position */
-	*r_index = view3d_sample_backbuf(vc, mval[0], mval[1]);
+	*r_index = ED_view3d_backbuf_sample(vc, mval[0], mval[1]);
 
 	if ((*r_index) == 0 || (*r_index) > (unsigned int)totpoly) {
 		return 0;
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 2a7e736..1a31442 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -878,7 +878,7 @@ static int sample_backbuf_area(ViewContext *vc, int *indexar, int totface, int x
 	 * brushes with size > 64, why is this here? */
 	/*if (size > 64.0) size = 64.0;*/
 	
-	ibuf = view3d_read_backbuf(vc, x - size, y - size, x + size, y + size);
+	ibuf = ED_view3d_backbuf_read(vc, x - size, y - size, x + size, y + size);
 	if (ibuf) {
 		unsigned int *rt = ibuf->rect;
 
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 6cfc6ae..678daa6 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1454,7 +1454,7 @@ static void view3d_opengl_read_Z_pixels(ARegion *ar, int x, int y, int w, int h,
 	glReadPixels(ar->winrct.xmin + x, ar->winrct.ymin + y, w, h, format, type, data);
 }
 
-void view3d_validate_backbuf(ViewContext *vc)
+void ED_view3d_backbuf_validate(ViewContext *vc)
 {
 	if (vc->v3d->flag & V3D_INVALID_BACKBUF)
 		backdrawview3d(vc->scene, vc->ar, vc->v3d);
@@ -1464,13 +1464,13 @@ void view3d_validate_backbuf(ViewContext *vc)
  * allow for small values [0.5 - 2.5],
  * and large values, FLT_MAX by clamping by the area size
  */
-int view3d_backbuf_sample_size_clamp(ARegion *ar, const float dist)
+int ED_view3d_backbuf_sample_size_clamp(ARegion *ar, const float d

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list