[Bf-blender-cvs] [1eb5e0b] master: minor cleanup

Mike Erwin noreply at git.blender.org
Mon Jan 4 07:46:04 CET 2016


Commit: 1eb5e0b6608b2c2bbc9813d9155ea379a5bc8ef4
Author: Mike Erwin
Date:   Mon Jan 4 01:37:55 2016 -0500
Branches: master
https://developer.blender.org/rB1eb5e0b6608b2c2bbc9813d9155ea379a5bc8ef4

minor cleanup

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

M	source/blender/editors/screen/glutil.c
M	source/blender/editors/space_view3d/drawobject.c

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

diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c
index 44ccf9a..0b83bf9 100644
--- a/source/blender/editors/screen/glutil.c
+++ b/source/blender/editors/screen/glutil.c
@@ -71,7 +71,7 @@ void fdrawbezier(float vec[4][3])
 	
 	vec[2][0] = vec[3][0] - dist;
 	vec[2][1] = vec[3][1];
-	/* we can reuse the dist variable here to increment the GL curve eval amount*/
+	/* we can reuse the dist variable here to increment the GL curve eval amount */
 	dist = 1.0f / curve_res;
 	
 	cpack(0x0);
@@ -408,7 +408,7 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format,
 		components = 4;
 	else if (format == GL_RGB)
 		components = 3;
-	else if (ELEM(format,  GL_LUMINANCE, GL_ALPHA))
+	else if (ELEM(format, GL_LUMINANCE, GL_ALPHA))
 		components = 1;
 	else {
 		BLI_assert(!"Incompatible format passed to glaDrawPixelsTexScaled");
@@ -427,7 +427,7 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format,
 		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, tex_w, tex_h, 0, format, GL_FLOAT, NULL);
 	}
 	else {
-		/* switch to 8bit RGBA for byte buffer  */
+		/* switch to 8bit RGBA for byte buffer */
 		glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, tex_w, tex_h, 0, format, GL_UNSIGNED_BYTE, NULL);
 	}
 
@@ -444,14 +444,14 @@ void glaDrawPixelsTexScaled(float x, float y, int img_w, int img_h, int format,
 			float rast_x = x + subpart_x * offset_x * xzoom;
 			float rast_y = y + subpart_y * offset_y * yzoom;
 			
-			/* check if we already got these because we always get 2 more when doing seamless*/
+			/* check if we already got these because we always get 2 more when doing seamless */
 			if (subpart_w <= seamless || subpart_h <= seamless)
 				continue;
 			
 			if (type == GL_FLOAT) {
 				glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, subpart_w, subpart_h, format, GL_FLOAT, &f_rect[((size_t)subpart_y) * offset_y * img_w * components + subpart_x * offset_x * components]);
 				
-				/* add an extra border of pixels so linear looks ok at edges of full image. */
+				/* add an extra border of pixels so linear looks ok at edges of full image */
 				if (subpart_w < tex_w)
 					glTexSubImage2D(GL_TEXTURE_2D, 0, subpart_w, 0, 1, subpart_h, format, GL_FLOAT, &f_rect[((size_t)subpart_y) * offset_y * img_w * components + (subpart_x * offset_x + subpart_w - 1) * components]);
 				if (subpart_h < tex_h)
@@ -860,7 +860,7 @@ void bgl_get_mats(bglMats *mats)
  */
 void bglPolygonOffset(float viewdist, float dist)
 {
-	static float winmat[16], offset = 0.0;
+	static float winmat[16], offset = 0.0f;
 	
 	if (dist != 0.0f) {
 		float offs;
@@ -901,7 +901,6 @@ void bglPolygonOffset(float viewdist, float dist)
 		glMatrixMode(GL_MODELVIEW);
 	}
 	else {
-
 		glMatrixMode(GL_PROJECTION);
 		winmat[14] += offset;
 		offset = 0.0;
@@ -1000,8 +999,7 @@ void glaDrawImBuf_glsl(ImBuf *ibuf, float x, float y, int zoomfilter,
 		display_buffer = IMB_display_buffer_acquire(ibuf, view_settings, display_settings, &cache_handle);
 
 		if (display_buffer)
-			glaDrawPixelsAuto(x, y, ibuf->x, ibuf->y, GL_RGBA, GL_UNSIGNED_BYTE,
-			                  zoomfilter, display_buffer);
+			glaDrawPixelsAuto(x, y, ibuf->x, ibuf->y, GL_RGBA, GL_UNSIGNED_BYTE, zoomfilter, display_buffer);
 
 		IMB_display_buffer_release(cache_handle);
 	}
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index f3a3472..7006656 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -648,7 +648,7 @@ static void draw_empty_image(Object *ob, const short dflag, const unsigned char
 
 	if (ibuf && ibuf->rect) {
 		const bool use_clip = (U.glalphaclip != 1.0f);
-		int zoomfilter = (U.gameflags & USER_DISABLE_MIPMAP ) ? GL_NEAREST : GL_LINEAR;
+		int zoomfilter = (U.gameflags & USER_DISABLE_MIPMAP) ? GL_NEAREST : GL_LINEAR;
 		/* Setup GL params */
 		glEnable(GL_BLEND);
 		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -723,8 +723,8 @@ static void drawcentercircle(View3D *v3d, RegionView3D *rv3d, const float co[3],
 	const float size = ED_view3d_pixel_size(rv3d, co) * (float)U.obcenter_dia * 0.5f;
 	float verts[CIRCLE_RESOL][3];
 
-	/* using gldepthfunc guarantees that it does write z values,
-	 * but not checks for it, so centers remain visible independent order of drawing */
+	/* using glDepthFunc guarantees that it does write z values,
+	 * but not checks for it, so centers remain visible independent of draw order */
 	if (v3d->zbuf) glDepthFunc(GL_ALWAYS);
 	/* write to near buffer always */
 	glDepthRange(0.0, 0.0);
@@ -1946,7 +1946,7 @@ static void drawcamera_stereo3d(
 		glPopAttrib();
 	}
 
-	/* draw convergence plane*/
+	/* draw convergence plane */
 	if (is_stereo3d_plane) {
 		float axis_center[3], screen_center[3];
 		float world_plane[4][3];
@@ -1986,7 +1986,7 @@ static void drawcamera_stereo3d(
 		}
 	}
 
-	/* draw convergence plane*/
+	/* draw convergence plane */
 	if (is_stereo3d_volume) {
 		float screen_center[3];
 		float near_plane[4][3], far_plane[4][3];
@@ -2401,7 +2401,7 @@ static void drawlattice(View3D *v3d, Object *ob)
 
 /* ***************** ******************** */
 
-/*  draw callback */
+/* draw callback */
 
 typedef struct drawDMVertSel_userData {
 	MVert *mvert;
@@ -3160,7 +3160,7 @@ static void draw_dm_bweights(BMEditMesh *em, Scene *scene, DerivedMesh *dm)
  * specialized to be split out (like drawing creases or measurements).
  */
 
-/* EditMesh drawing routines*/
+/* EditMesh drawing routines */
 
 static void draw_em_fancy_verts(Scene *scene, View3D *v3d, Object *obedit,
                                 BMEditMesh *em, DerivedMesh *cageDM, BMVert *eve_act,




More information about the Bf-blender-cvs mailing list