Header file clean-up:
[mesa.git] / src / mesa / main / vtxfmt.c
index b248cb8532703587bcef5592dd090bea1d69224f..54eef4a602873e8fc3bac94cdf8aba3ebfc2a81e 100644 (file)
@@ -1,8 +1,8 @@
-/* $Id: vtxfmt.c,v 1.4 2001/03/11 23:55:19 gareth Exp $ */
+/* $Id: vtxfmt.c,v 1.13 2002/10/24 23:57:21 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
- * Version:  3.5
+ * Version:  4.1
  *
  * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
  *
@@ -23,7 +23,7 @@
  * 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.
  *
- * Author:
+ * Authors:
  *    Keith Whitwell <keithw@valinux.com>
  *    Gareth Hughes <gareth@valinux.com>
  */
@@ -31,7 +31,9 @@
 #include "glheader.h"
 #include "api_loopback.h"
 #include "context.h"
+#include "imports.h"
 #include "mtypes.h"
+#include "state.h"
 #include "vtxfmt.h"
 
 
 {                                                                      \
    GET_CURRENT_CONTEXT(ctx);                                           \
    struct gl_tnl_module *tnl = &(ctx->TnlModule);                      \
-   const GLuint new_state = ctx->NewState;                             \
-                                                                       \
-   if ( new_state )                                                    \
-      _mesa_update_state( ctx );                                       \
-                                                                       \
-   /* Validate the current tnl module.                                 \
-    */                                                                 \
-   if ( new_state & ctx->Driver.NeedValidate )                         \
-      ctx->Driver.ValidateTnlModule( ctx, new_state );                 \
                                                                        \
    ASSERT( tnl->Current );                                             \
    ASSERT( tnl->SwapCount < NUM_VERTEX_FORMAT_ENTRIES );               \
                                                                        \
-   /* Save the swapped function's dispatch entry so it can be          \
-    * restored later.                                                  \
-    */                                                                 \
+   /* Save the swapped function's dispatch entry so it can be */       \
+   /* restored later. */                                               \
    tnl->Swapped[tnl->SwapCount][0] = (void *)&(ctx->Exec->FUNC);       \
    tnl->Swapped[tnl->SwapCount][1] = (void *)TAG(FUNC);                        \
    tnl->SwapCount++;                                                   \
                                                                        \
    if ( 0 )                                                            \
-      fprintf( stderr, "   swapping gl" #FUNC"...\n" );                        \
+      _mesa_debug(ctx, "   swapping gl" #FUNC"...\n" );                        \
                                                                        \
-   /* Install the tnl function pointer.                                        \
-    */                                                                 \
+   /* Install the tnl function pointer.        */                              \
    ctx->Exec->FUNC = tnl->Current->FUNC;                               \
 }
 
@@ -134,26 +125,27 @@ static void install_vtxfmt( struct _glapi_table *tab, GLvertexformat *vfmt )
    tab->Vertex3fv = vfmt->Vertex3fv;
    tab->Vertex4f = vfmt->Vertex4f;
    tab->Vertex4fv = vfmt->Vertex4fv;
+   tab->CallList = vfmt->CallList;
    tab->Begin = vfmt->Begin;
    tab->End = vfmt->End;
-
-/*     tab->NewList = vfmt->NewList; */
-   tab->CallList = vfmt->CallList;
-
+   tab->VertexAttrib4fNV = vfmt->VertexAttrib4fNV;
    tab->Rectf = vfmt->Rectf;
    tab->DrawArrays = vfmt->DrawArrays;
    tab->DrawElements = vfmt->DrawElements;
    tab->DrawRangeElements = vfmt->DrawRangeElements;
    tab->EvalMesh1 = vfmt->EvalMesh1;
    tab->EvalMesh2 = vfmt->EvalMesh2;
+   assert(tab->EvalMesh2);
 }
 
 
 void _mesa_init_exec_vtxfmt( GLcontext *ctx )
 {
    install_vtxfmt( ctx->Exec, &neutral_vtxfmt );
+   ctx->TnlModule.SwapCount = 0;
 }
 
+
 void _mesa_install_exec_vtxfmt( GLcontext *ctx, GLvertexformat *vfmt )
 {
    ctx->TnlModule.Current = vfmt;
@@ -169,6 +161,7 @@ void _mesa_install_save_vtxfmt( GLcontext *ctx, GLvertexformat *vfmt )
       _mesa_loopback_prefer_float( ctx->Save, vfmt->prefer_float_colors );
 }
 
+
 void _mesa_restore_exec_vtxfmt( GLcontext *ctx )
 {
    struct gl_tnl_module *tnl = &(ctx->TnlModule);