From c57d5bca73ce274f41febace72388e9e198d4d35 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 20 Nov 2006 21:25:02 +0000 Subject: Step one in migrating to use glArray calls in Blender - Curve/Nurbs/Font/MBall now all draw arrays. - had to flip abgr to rgba in shaded drawing - Mesh drawing can't be easily done; the indices for faces are not in in one chunk. Also need a way to gether trias/quads, per material. Speedup results are mixed. Something between 2-4 times. Especially for text it seems to help. --- source/blender/blenkernel/intern/mball.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'source/blender/blenkernel/intern/mball.c') diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 65a7a3f4f20..3c4b1526c8b 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -571,7 +571,7 @@ float metaball(float x, float y, float z) /* ******************************************** */ -int *indices=0; +int *indices=NULL; int totindex, curindex; @@ -593,25 +593,15 @@ void accum_mballfaces(int i1, int i2, int i3, int i4) cur= indices+4*curindex; - /* prevent zero codes for faces indices */ - if(i3==0) { - if(i4) { - i3= i4; - i4= i1; - i1= i2; - i2= 0; - } - else { - i3= i2; - i2= i1; - i1= 0; - } - } + /* diplists now support array drawing, we treat trias as fake quad */ cur[0]= i1; cur[1]= i2; cur[2]= i3; - cur[3]= i4; + if(i4==0) + cur[3]= i3; + else + cur[3]= i4; curindex++; -- cgit v1.2.3