diff options
author | Ton Roosendaal <ton@blender.org> | 2006-11-21 00:25:02 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-11-21 00:25:02 +0300 |
commit | c57d5bca73ce274f41febace72388e9e198d4d35 (patch) | |
tree | c1372d1a1e49beebbd98af27332824dadc3544bf /source/blender/blenkernel/intern/mball.c | |
parent | 208e69abab9d4a2581e3295f46728ff184fe77b2 (diff) |
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.
Diffstat (limited to 'source/blender/blenkernel/intern/mball.c')
-rw-r--r-- | source/blender/blenkernel/intern/mball.c | 22 |
1 files changed, 6 insertions, 16 deletions
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++; |