[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48328] branches/soc-2012-swiss_cheese/ source: Fixed up some changes that were missed after the last merge.

Jason Wilkins Jason.A.Wilkins at gmail.com
Wed Jun 27 07:38:53 CEST 2012


Revision: 48328
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48328
Author:   jwilkins
Date:     2012-06-27 05:38:52 +0000 (Wed, 27 Jun 2012)
Log Message:
-----------
Fixed up some changes that were missed after the last merge.  Several new uses of deprecated functions were introduced.

Modified Paths:
--------------
    branches/soc-2012-swiss_cheese/source/blender/editors/mask/CMakeLists.txt
    branches/soc-2012-swiss_cheese/source/blender/editors/mask/mask_draw.c
    branches/soc-2012-swiss_cheese/source/blender/editors/space_clip/clip_draw.c
    branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_extensions.h
    branches/soc-2012-swiss_cheese/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp

Modified: branches/soc-2012-swiss_cheese/source/blender/editors/mask/CMakeLists.txt
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/editors/mask/CMakeLists.txt	2012-06-27 05:36:56 UTC (rev 48327)
+++ branches/soc-2012-swiss_cheese/source/blender/editors/mask/CMakeLists.txt	2012-06-27 05:38:52 UTC (rev 48328)
@@ -26,6 +26,7 @@
 	../../blenkernel
 	../../blenloader
 	../../blenlib
+	../../gpu
 	../../makesdna
 	../../makesrna
 	../../windowmanager

Modified: branches/soc-2012-swiss_cheese/source/blender/editors/mask/mask_draw.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/editors/mask/mask_draw.c	2012-06-27 05:36:56 UTC (rev 48327)
+++ branches/soc-2012-swiss_cheese/source/blender/editors/mask/mask_draw.c	2012-06-27 05:38:52 UTC (rev 48328)
@@ -40,8 +40,9 @@
 #include "DNA_object_types.h"   /* SELECT */
 
 #include "ED_mask.h"  /* own include */
-#include "BIF_gl.h"
 
+#include "GPU_compatibility.h"
+
 #include "UI_resources.h"
 
 #include "mask_intern.h"  /* own include */
@@ -90,26 +91,26 @@
 	if (!spline->tot_point)
 		return;
 
-	glColor3ub(0, 0, 0);
+	gpuCurrentColor3ub(0, 0, 0);
 	glEnable(GL_LINE_STIPPLE);
 	glLineStipple(1, 0xAAAA);
 
-	glBegin(GL_LINES);
+	gpuBegin(GL_LINES);
 
 	for (i = 0; i < spline->tot_point; i++) {
 		MaskSplinePoint *point = &points_array[i];
 		BezTriple *bezt = &point->bezt;
 
 		if (point->parent.id) {
-			glVertex2f(bezt->vec[1][0],
+			gpuVertex2f(bezt->vec[1][0],
 			           bezt->vec[1][1]);
 
-			glVertex2f(bezt->vec[1][0] - point->parent.offset[0],
+			gpuVertex2f(bezt->vec[1][0] - point->parent.offset[0],
 			           bezt->vec[1][1] - point->parent.offset[1]);
 		}
 	}
 
-	glEnd();
+	gpuEnd();
 
 	glDisable(GL_LINE_STIPPLE);
 }
@@ -136,7 +137,12 @@
 	mask_spline_color_get(masklay, spline, is_spline_sel, rgb_spline);
 
 	/* feather points */
+
 	feather_points = fp = BKE_mask_spline_feather_points(spline, &tot_feather_point);
+
+	gpuImmediateFormat_C4_V3();
+	gpuBegin(GL_POINTS);
+
 	for (i = 0; i < spline->tot_point; i++) {
 
 		/* watch it! this is intentionally not the deform array, only check for sel */
@@ -156,21 +162,22 @@
 
 			if (sel) {
 				if (point == masklay->act_point)
-					glColor3f(1.0f, 1.0f, 1.0f);
+					gpuColor3f(1.0f, 1.0f, 1.0f);
 				else
-					glColor3f(1.0f, 1.0f, 0.0f);
+					gpuColor3f(1.0f, 1.0f, 0.0f);
 			}
 			else {
-				glColor3f(0.5f, 0.5f, 0.0f);
+				gpuColor3f(0.5f, 0.5f, 0.0f);
 			}
 
-			glBegin(GL_POINTS);
-			glVertex2fv(*fp);
-			glEnd();
+			gpuVertex2fv(*fp);
 
 			fp++;
 		}
 	}
+
+	gpuEnd();
+
 	MEM_freeN(feather_points);
 
 	/* control points */
@@ -194,54 +201,57 @@
 			if (draw_type == MASK_DT_OUTLINE) {
 				const unsigned char rgb_grey[4] = {0x60, 0x60, 0x60, 0xff};
 				glLineWidth(3);
-				glColor4ubv(rgb_grey);
-				glBegin(GL_LINES);
-				glVertex3fv(vert);
-				glVertex3fv(handle);
-				glEnd();
+				gpuCurrentColor4ubv(rgb_grey);
+				gpuBegin(GL_LINES);
+				gpuVertex3fv(vert);
+				gpuVertex3fv(handle);
+				gpuEnd();
 				glLineWidth(1);
 			}
 
-			glColor3ubv(rgb_spline);
-			glBegin(GL_LINES);
-			glVertex3fv(vert);
-			glVertex3fv(handle);
-			glEnd();
+			gpuCurrentColor3ubv(rgb_spline);
+			gpuBegin(GL_LINES);
+			gpuVertex3fv(vert);
+			gpuVertex3fv(handle);
+			gpuEnd();
 		}
 
+		gpuBegin(GL_POINTS);
+
 		/* draw CV point */
 		if (MASKPOINT_ISSEL_KNOT(point)) {
 			if (point == masklay->act_point)
-				glColor3f(1.0f, 1.0f, 1.0f);
+				gpuColor3f(1.0f, 1.0f, 1.0f);
 			else
-				glColor3f(1.0f, 1.0f, 0.0f);
+				gpuColor3f(1.0f, 1.0f, 0.0f);
 		}
-		else
-			glColor3f(0.5f, 0.5f, 0.0f);
+		else {
+			gpuColor3f(0.5f, 0.5f, 0.0f);
+		}
 
-		glBegin(GL_POINTS);
-		glVertex3fv(vert);
-		glEnd();
+		gpuVertex3fv(vert);
 
 		/* draw handle points */
 		if (has_handle) {
 			if (MASKPOINT_ISSEL_HANDLE(point)) {
 				if (point == masklay->act_point)
-					glColor3f(1.0f, 1.0f, 1.0f);
+					gpuColor3f(1.0f, 1.0f, 1.0f);
 				else
-					glColor3f(1.0f, 1.0f, 0.0f);
+					gpuColor3f(1.0f, 1.0f, 0.0f);
 			}
 			else {
-				glColor3f(0.5f, 0.5f, 0.0f);
+				gpuColor3f(0.5f, 0.5f, 0.0f);
 			}
 
-			glBegin(GL_POINTS);
-			glVertex3fv(handle);
-			glEnd();
+			gpuVertex3fv(handle);
 		}
+
+		gpuEnd();
 	}
 
 	glPointSize(1.0f);
+
+	gpuImmediateUnformat();
 }
 
 /* #define USE_XOR */
@@ -267,25 +277,25 @@
 	const unsigned char rgb_black[4] = {0x00, 0x00, 0x00, 0xff};
 //	const unsigned char rgb_white[4] = {0xff, 0xff, 0xff, 0xff};
 	unsigned char rgb_tmp[4];
+	GPUarrays arrays = GPU_ARRAYS_V3F;
 
-	glEnableClientState(GL_VERTEX_ARRAY);
-	glVertexPointer(2, GL_FLOAT, 0, points);
+	arrays.vertexPointer = points;
 
+	gpuImmediateFormat_V3();
+
 	switch (draw_type) {
 
 		case MASK_DT_OUTLINE:
 			glLineWidth(3);
 
 			mask_color_active_tint(rgb_tmp, rgb_black, is_active);
-			glColor4ubv(rgb_tmp);
+			gpuCurrentColor4ubv(rgb_tmp);
+			gpuDrawClientArrays(draw_method, &arrays, 0, tot_point);
 
-			glDrawArrays(draw_method, 0, tot_point);
-
 			glLineWidth(1);
 			mask_color_active_tint(rgb_tmp, rgb_spline, is_active);
-			glColor4ubv(rgb_tmp);
-			glDrawArrays(draw_method, 0, tot_point);
-
+			gpuCurrentColor4ubv(rgb_tmp);
+			gpuRepeat();
 			break;
 
 		case MASK_DT_DASH:
@@ -297,19 +307,17 @@
 			glLogicOp(GL_OR);
 #endif
 			mask_color_active_tint(rgb_tmp, rgb_spline, is_active);
-			glColor4ubv(rgb_tmp);
+			gpuCurrentColor4ubv(rgb_tmp);
 			glLineStipple(3, 0xaaaa);
-			glEnableClientState(GL_VERTEX_ARRAY);
-			glVertexPointer(2, GL_FLOAT, 0, points);
-			glDrawArrays(draw_method, 0, tot_point);
+			gpuDrawClientArrays(draw_method, &arrays, 0, tot_point);
 
 #ifdef USE_XOR
 			glDisable(GL_COLOR_LOGIC_OP);
 #endif
 			mask_color_active_tint(rgb_tmp, rgb_black, is_active);
-			glColor4ubv(rgb_tmp);
+			gpuCurrentColor4ubv(rgb_tmp);
 			glLineStipple(3, 0x5555);
-			glDrawArrays(draw_method, 0, tot_point);
+			gpuRepeat();
 
 			glDisable(GL_LINE_STIPPLE);
 			break;
@@ -331,18 +339,14 @@
 
 			if (is_smooth == FALSE && is_feather) {
 				glEnable(GL_BLEND);
-				glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 			}
 
 			mask_color_active_tint(rgb_tmp, rgb_tmp, is_active);
-			glColor4ubv(rgb_tmp);
+			gpuCurrentColor4ubv(rgb_tmp);
 
-			glEnableClientState(GL_VERTEX_ARRAY);
-			glVertexPointer(2, GL_FLOAT, 0, points);
-			glDrawArrays(draw_method, 0, tot_point);
+			gpuDrawClientArrays(draw_method, &arrays, 0, tot_point);
+			gpuRepeat(); // XXX: why twice?
 
-			glDrawArrays(draw_method, 0, tot_point);
-
 			if (is_smooth == FALSE && is_feather) {
 				glDisable(GL_BLEND);
 			}
@@ -350,8 +354,7 @@
 			break;
 	}
 
-	glDisableClientState(GL_VERTEX_ARRAY);
-
+	gpuImmediateUnformat();
 }
 
 static void draw_spline_curve(MaskLayer *masklay, MaskSpline *spline,

Modified: branches/soc-2012-swiss_cheese/source/blender/editors/space_clip/clip_draw.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/editors/space_clip/clip_draw.c	2012-06-27 05:36:56 UTC (rev 48327)
+++ branches/soc-2012-swiss_cheese/source/blender/editors/space_clip/clip_draw.c	2012-06-27 05:38:52 UTC (rev 48328)
@@ -214,7 +214,7 @@
 			{
 				i = masklay_shape->frame;
 
-				/* glRecti((i - sfra) * framelen, 0, (i - sfra + 1) * framelen, 4); */
+				/* gpuDrawFilledRecti((i - sfra) * framelen, 0, (i - sfra + 1) * framelen, 4); */
 
 				/* use a line so we always see the keyframes */
 				gpuVertex2i((i - sfra) * framelen, 0);

Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_extensions.h
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_extensions.h	2012-06-27 05:36:56 UTC (rev 48327)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/GPU_extensions.h	2012-06-27 05:38:52 UTC (rev 48328)
@@ -97,7 +97,7 @@
  *   graphics card capabilities the texture may actually be stored in a
  *   larger texture with power of two dimensions. the actual dimensions
  *   may be queried with GPU_texture_opengl_width/height. GPU_texture_coord_2f
- *   calls glTexCoord2f with the coordinates adjusted for this.
+ *   calls gpuTexCoord2f with the coordinates adjusted for this.
  * - can use reference counting:
  *     - reference counter after GPU_texture_create is 1
  *     - GPU_texture_ref increases by one

Modified: branches/soc-2012-swiss_cheese/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp
===================================================================
--- branches/soc-2012-swiss_cheese/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp	2012-06-27 05:36:56 UTC (rev 48327)
+++ branches/soc-2012-swiss_cheese/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_StorageIM.cpp	2012-06-27 05:38:52 UTC (rev 48328)
@@ -162,7 +162,7 @@
 			return 2;
 		if (current_ms->m_bObjectColor) {
 			MT_Vector4& rgba = current_ms->m_RGBAcolor;
-			glColor4d(rgba[0], rgba[1], rgba[2], rgba[3]);
+			gpuCurrentColor4d(rgba[0], rgba[1], rgba[2], rgba[3]);
 			// don't use mcol
 			return 2;
 		}
@@ -170,7 +170,7 @@
 			// we have to set the color from the material
 			unsigned char rgba[4];
 			current_polymat->GetMaterialRGBAColor(rgba);
-			glColor4ubv((const GLubyte *)rgba);
+			gpuCurrentColor4ubv((const GLubyte *)rgba);
 			return 2;
 		}
 		return 1;




More information about the Bf-blender-cvs mailing list