i965/vec4: Fix confusion between SWIZZLE and BRW_SWIZZLE macros.
[mesa.git] / src / mesa / vbo / vbo_rebase.c
index 9a98ef7d44975cbd7cf015b775120ffde91790b8..c700621cef201bdcef9aa636720a84fa3414b128 100644 (file)
@@ -1,7 +1,6 @@
 
 /*
  * Mesa 3-D graphics library
- * Version:  6.5
  *
  * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
  *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
  *
  * Authors:
- *    Keith Whitwell <keith@tungstengraphics.com>
+ *    Keith Whitwell <keithw@vmware.com>
  */
 
 /* Helper for drivers which find themselves rendering a range of
@@ -146,7 +146,7 @@ void vbo_rebase_prims( struct gl_context *ctx,
       /* If we can just tell the hardware or the TNL to interpret our
        * indices with a different base, do so.
        */
-      tmp_prims = (struct _mesa_prim *)malloc(sizeof(*prim) * nr_prims);
+      tmp_prims = malloc(sizeof(*prim) * nr_prims);
 
       for (i = 0; i < nr_prims; i++) {
         tmp_prims[i] = prim[i];
@@ -195,7 +195,7 @@ void vbo_rebase_prims( struct gl_context *ctx,
    else {
       /* Otherwise the primitives need adjustment.
        */
-      tmp_prims = (struct _mesa_prim *)malloc(sizeof(*prim) * nr_prims);
+      tmp_prims = malloc(sizeof(*prim) * nr_prims);
 
       for (i = 0; i < nr_prims; i++) {
         /* If this fails, it could indicate an application error:
@@ -228,6 +228,7 @@ void vbo_rebase_prims( struct gl_context *ctx,
    /* Re-issue the draw call.
     */
    ctx->Array._DrawArrays = tmp_array_pointers;
+   ctx->NewDriverState |= ctx->DriverFlags.NewArray;
 
    draw( ctx, 
         prim,
@@ -236,15 +237,14 @@ void vbo_rebase_prims( struct gl_context *ctx,
         GL_TRUE,
         0, 
         max_index - min_index,
-        NULL );
+        NULL, NULL );
 
    ctx->Array._DrawArrays = saved_arrays;
+   ctx->NewDriverState |= ctx->DriverFlags.NewArray;
    
-   if (tmp_indices)
-      free(tmp_indices);
+   free(tmp_indices);
    
-   if (tmp_prims)
-      free(tmp_prims);
+   free(tmp_prims);
 }