[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48417] branches/soc-2012-swiss_cheese/ source/blender: fixed user prefs crash

Jason Wilkins Jason.A.Wilkins at gmail.com
Sat Jun 30 00:31:42 CEST 2012


Revision: 48417
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48417
Author:   jwilkins
Date:     2012-06-29 22:31:28 +0000 (Fri, 29 Jun 2012)
Log Message:
-----------
fixed user prefs crash

Modified Paths:
--------------
    branches/soc-2012-swiss_cheese/source/blender/editors/interface/interface_draw.c
    branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate.h

Modified: branches/soc-2012-swiss_cheese/source/blender/editors/interface/interface_draw.c
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/editors/interface/interface_draw.c	2012-06-29 20:34:10 UTC (rev 48416)
+++ branches/soc-2012-swiss_cheese/source/blender/editors/interface/interface_draw.c	2012-06-29 22:31:28 UTC (rev 48417)
@@ -1265,6 +1265,8 @@
 void ui_draw_but_NORMAL(uiBut *but, uiWidgetColors *wcol, rcti *rect)
 {
 	static GPUimmediate *displist = NULL;
+	static GPUindex *index = NULL;
+
 	int a, old[8];
 	GLfloat diff[4], diffn[4] = {1.0f, 1.0f, 1.0f, 1.0f};
 	float vec0[4] = {0.0f, 0.0f, 0.0f, 0.0f};
@@ -1314,15 +1316,24 @@
 	
 	glShadeModel(GL_SMOOTH);
 
-	if (displist == 0) {
+	if (!displist) {
 		GPUprim3 prim = GPU_PRIM_HIFI_SOLID;
+		prim.usegs = 32;
+		prim.vsegs = 24;
+
 		gpuPushImmediate();
+		gpuImmediateMaxVertexCount(800);
+		
+		index = gpuNewIndex();
+		gpuImmediateIndex(index);
+		gpuImmediateMaxIndexCount(4608);
+
 		gpuSingleSphere(&prim, 100);
-		//GLU gluSphere(qobj, 100.0, 32, 24);
+
 		displist = gpuPopImmediate();
 	}
 	else {
-		gpuImmediateSingleRepeat(displist);
+		gpuImmediateSingleRepeatElements(displist);
 	}
 
 	glShadeModel(GL_FLAT);

Modified: branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate.h
===================================================================
--- branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate.h	2012-06-29 20:34:10 UTC (rev 48416)
+++ branches/soc-2012-swiss_cheese/source/blender/gpu/intern/gpu_immediate.h	2012-06-29 22:31:28 UTC (rev 48417)
@@ -32,10 +32,10 @@
 #ifndef __GPU_IMMEDIATE_H__
 #define __GPU_IMMEDIATE_H__
 
-#ifdef GLES
-#include <GLES2/gl2.h>
-#else
-#include <GL/glew.h>
+#ifdef GLES
+#include <GLES2/gl2.h>
+#else
+#include <GL/glew.h>
 #endif
 
 #include <stdlib.h>




More information about the Bf-blender-cvs mailing list