Revision: 17987
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17987
Author:   aligorith
Date:     2008-12-21 11:52:57 +0100 (Sun, 21 Dec 2008)

Log Message:
-----------
2.5 - Ported new-style 'sphere' drawtype for empties from animsys2. This draws 
in a much simpler/cleaner way, with only 3 disks, which should help distinguish 
it from standard geometry.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/space_view3d/drawobject.c

Modified: 
branches/blender2.5/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- 
branches/blender2.5/blender/source/blender/editors/space_view3d/drawobject.c    
    2008-12-21 10:36:29 UTC (rev 17986)
+++ 
branches/blender2.5/blender/source/blender/editors/space_view3d/drawobject.c    
    2008-12-21 10:52:57 UTC (rev 17987)
@@ -3964,18 +3964,35 @@
 /* draw a sphere for use as an empty drawtype */
 static void draw_empty_sphere (float size)
 {
-       float cent=0;
-       GLUquadricObj *qobj = gluNewQuadric(); 
-       gluQuadricDrawStyle(qobj, GLU_SILHOUETTE); 
+       static GLuint displist=0;
+       
+       if (displist == 0) {
+               GLUquadricObj   *qobj;
                
-       glPushMatrix();
-       glTranslatef(cent, cent, cent);
-       glScalef(size, size, size);
-       gluSphere(qobj, 1.0, 8, 5);
+               displist= glGenLists(1);
+               glNewList(displist, GL_COMPILE_AND_EXECUTE);
                
-       glPopMatrix();
+               glPushMatrix();
+               
+               qobj    = gluNewQuadric(); 
+               gluQuadricDrawStyle(qobj, GLU_SILHOUETTE); 
+               gluDisk(qobj, 0.0,  1, 16, 1);
+               
+               glRotatef(90, 0, 1, 0);
+               gluDisk(qobj, 0.0,  1, 16, 1);
+               
+               glRotatef(90, 1, 0, 0);
+               gluDisk(qobj, 0.0,  1, 16, 1);
+               
+               gluDeleteQuadric(qobj);  
+               
+               glPopMatrix();
+               glEndList();
+       }
        
-       gluDeleteQuadric(qobj); 
+       glScalef(size, size, size);
+               glCallList(displist);
+       glScalef(1/size, 1/size, 1/size);
 }
 
 /* draw a cone for use as an empty drawtype */


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to