tnl: use buffer helper functions to improve readbility
authorBrian Paul <brianp@vmware.com>
Tue, 30 Aug 2011 15:44:47 +0000 (09:44 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 30 Aug 2011 16:17:52 +0000 (10:17 -0600)
src/mesa/tnl/t_draw.c

index 86af4b7cfe25232093eca6b5b04abe4891427016..a5225c439b5b9e1054802d3fce46f48ceb5ddd46 100644 (file)
@@ -26,6 +26,7 @@
  */
 
 #include "main/glheader.h"
+#include "main/bufferobj.h"
 #include "main/condrender.h"
 #include "main/context.h"
 #include "main/imports.h"
@@ -346,7 +347,8 @@ static void bind_indices( struct gl_context *ctx,
       return;
    }
 
-   if (ib->obj->Name && !ib->obj->Pointer) {
+   if (_mesa_is_bufferobj(ib->obj) && !_mesa_bufferobj_mapped(ib->obj)) {
+      /* if the buffer object isn't mapped yet, map it now */
       unsigned map_size;
 
       switch (ib->type) {