EditMesh was using VBO's even when off in the user preferences causing glMapBufferARB to return an invalid array, however setDrawOptions was (incorrectly) disabling VBO's in almost all cases so it didnt crash except for entering editmode on an object used as a custom bone shape.

Changed to allow setDrawOptions (since it works fine), but only to use VBO's when its enabled in the userprefs.
This commit is contained in:
2009-10-11 11:21:51 +00:00
parent 77bfc417ff
commit 4081f33687

View File

@@ -492,11 +492,12 @@ static void emDM_drawMappedEdges(DerivedMesh *dm, int (*setDrawOptions)(void *us
}
glEnd();
} else {
GPUBuffer *buffer = 0;
GPUBuffer *buffer = NULL;
float *varray;
if( setDrawOptions == 0 ) {
if(GPU_buffer_legacy(dm)==FALSE)
buffer = GPU_buffer_alloc( sizeof(float)*3*2*emdm->em->totedge, 0 );
}
if( buffer != 0 && (varray = GPU_buffer_lock_stream( buffer )) ) {
int prevdraw = 0;
int numedges = 0;