OSDN Git Service

more removal of fprintf() calls
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 13 Jun 2002 04:49:17 +0000 (04:49 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 13 Jun 2002 04:49:17 +0000 (04:49 +0000)
14 files changed:
src/mesa/drivers/x11/fakeglx.c
src/mesa/main/context.c
src/mesa/main/context.h
src/mesa/main/polygon.c
src/mesa/main/texobj.c
src/mesa/main/texstate.c
src/mesa/main/varray.c
src/mesa/swrast/s_context.c
src/mesa/swrast_setup/ss_vb.c
src/mesa/tnl/t_imm_api.c
src/mesa/tnl/t_imm_dlist.c
src/mesa/tnl/t_imm_elt.c
src/mesa/tnl/t_imm_eval.c
src/mesa/tnl/t_imm_exec.c

index 7df84b7..6c282a2 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: fakeglx.c,v 1.64 2002/05/27 17:06:59 brianp Exp $ */
+/* $Id: fakeglx.c,v 1.65 2002/06/13 04:49:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -269,8 +269,7 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo,
             ximageFlag = GL_TRUE;
          }
          else {
-            fprintf(stderr, "Mesa: invalid value for MESA_BACK_BUFFER ");
-            fprintf(stderr, "environment variable, using an XImage.\n");
+            _mesa_warning(NULL, "Mesa: invalid value for MESA_BACK_BUFFER environment variable, using an XImage.");
          }
       }
    }
@@ -308,8 +307,8 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo,
 
    /* Create a new visual and add it to the list. */
 
-   if (NumVisuals>=MAX_VISUALS) {
-      fprintf( stderr, "GLX Error: maximum number of visuals exceeded\n");
+   if (NumVisuals >= MAX_VISUALS) {
+      _mesa_problem(NULL, "GLX Error: maximum number of visuals exceeded");
       return NULL;
    }
 
@@ -392,7 +391,7 @@ create_glx_visual( Display *dpy, XVisualInfo *visinfo )
       }
    }
    else {
-      fprintf(stderr,"Mesa: error in glXCreateContext: bad visual\n");
+      _mesa_warning(NULL, "Mesa: error in glXCreateContext: bad visual\n");
       return NULL;
    }
 }
@@ -578,8 +577,13 @@ static XVisualInfo *get_env_visual(Display *dpy, int scr, const char *varname)
       }
    }
 
-   fprintf( stderr, "Mesa: GLX unable to find visual class=%s, depth=%d.\n",
-           type, depth );
+   {
+      char s[1000];
+      sprintf(s, "Mesa: GLX unable to find visual class=%s, depth=%d.\n",
+              type, depth );
+      _mesa_warning(NULL, s);
+   }
+
    return NULL;
 }
 
@@ -1336,7 +1340,7 @@ Fake_glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap )
       XMesaDestroyBuffer(b);
    }
    else if (getenv("MESA_DEBUG")) {
-      fprintf( stderr, "Mesa: glXDestroyGLXPixmap: invalid pixmap\n");
+      _mesa_warning(NULL, "Mesa: glXDestroyGLXPixmap: invalid pixmap\n");
    }
 }
 
@@ -1408,7 +1412,7 @@ Fake_glXSwapBuffers( Display *dpy, GLXDrawable drawable )
       XMesaSwapBuffers(buffer);
    }
    else if (getenv("MESA_DEBUG")) {
-      fprintf(stderr, "Mesa Warning: glXSwapBuffers: invalid drawable\n");
+      _mesa_warning(NULL, "Mesa: glXSwapBuffers: invalid drawable\n");
    }
 }
 
@@ -1425,7 +1429,7 @@ Fake_glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
       XMesaCopySubBuffer(buffer, x, y, width, height);
    }
    else if (getenv("MESA_DEBUG")) {
-      fprintf(stderr, "Mesa Warning: glXCopySubBufferMESA: invalid drawable\n");
+      _mesa_warning(NULL, "Mesa: glXCopySubBufferMESA: invalid drawable\n");
    }
 }
 
@@ -1464,7 +1468,6 @@ Fake_glXGetConfig( Display *dpy, XVisualInfo *visinfo,
            return 0;
         }
         else {
-           /*fprintf( stderr, "Mesa: Error in glXGetConfig: bad visual\n");*/
            return GLX_BAD_VISUAL;
         }
       }
index 15976df..a1975bd 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: context.c,v 1.165 2002/06/13 04:31:09 brianp Exp $ */
+/* $Id: context.c,v 1.166 2002/06/13 04:49:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -2264,16 +2264,16 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *where )
 /*
  * Call this to report debug information.
  */
-#ifdef DEBUG
 void
 _mesa_debug( const char *fmtString, ... )
 {
+#ifdef DEBUG
    va_list args;
    va_start( args, fmtString );  
    (void) vfprintf( stderr, fmtString, args );
    va_end( args );
-}
 #endif
+}
 
 
 void
index ac78b76..23cd7e1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: context.h,v 1.30 2002/06/13 04:31:09 brianp Exp $ */
+/* $Id: context.h,v 1.31 2002/06/13 04:49:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -237,10 +237,10 @@ _mesa_warning( const GLcontext *ctx, const char *s );
 extern void
 _mesa_error( GLcontext *ctx, GLenum error, const char *s );
 
-#ifdef DEBUG
 extern void
 _mesa_debug( const char *fmtString, ... );
-#endif
+
+
 
 extern void
 _mesa_Finish( void );
index 910b8a3..ee9eb3a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: polygon.c,v 1.21 2001/03/22 00:36:27 gareth Exp $ */
+/* $Id: polygon.c,v 1.22 2002/06/13 04:49:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -47,7 +47,7 @@ _mesa_CullFace( GLenum mode )
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    if (MESA_VERBOSE&VERBOSE_API)
-      fprintf(stderr, "glCullFace %s\n", _mesa_lookup_enum_by_nr(mode));
+      _mesa_debug("glCullFace %s\n", _mesa_lookup_enum_by_nr(mode));
 
    if (mode!=GL_FRONT && mode!=GL_BACK && mode!=GL_FRONT_AND_BACK) {
       _mesa_error( ctx, GL_INVALID_ENUM, "glCullFace" );
@@ -73,7 +73,7 @@ _mesa_FrontFace( GLenum mode )
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    if (MESA_VERBOSE&VERBOSE_API)
-      fprintf(stderr, "glFrontFace %s\n", _mesa_lookup_enum_by_nr(mode));
+      _mesa_debug("glFrontFace %s\n", _mesa_lookup_enum_by_nr(mode));
 
    if (mode!=GL_CW && mode!=GL_CCW) {
       _mesa_error( ctx, GL_INVALID_ENUM, "glFrontFace" );
@@ -101,9 +101,9 @@ _mesa_PolygonMode( GLenum face, GLenum mode )
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    if (MESA_VERBOSE&VERBOSE_API)
-      fprintf(stderr, "glPolygonMode %s %s\n",
-             _mesa_lookup_enum_by_nr(face),
-             _mesa_lookup_enum_by_nr(mode));
+      _mesa_debug("glPolygonMode %s %s\n",
+                  _mesa_lookup_enum_by_nr(face),
+                  _mesa_lookup_enum_by_nr(mode));
 
    if (mode!=GL_POINT && mode!=GL_LINE && mode!=GL_FILL) {
       _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(mode)" );
@@ -154,7 +154,7 @@ _mesa_PolygonStipple( const GLubyte *pattern )
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    if (MESA_VERBOSE&VERBOSE_API)
-      fprintf(stderr, "glPolygonStipple\n");
+      _mesa_debug("glPolygonStipple\n");
 
    FLUSH_VERTICES(ctx, _NEW_POLYGONSTIPPLE);
    _mesa_unpack_polygon_stipple(pattern, ctx->PolygonStipple, &ctx->Unpack);
@@ -172,7 +172,7 @@ _mesa_GetPolygonStipple( GLubyte *dest )
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    if (MESA_VERBOSE&VERBOSE_API)
-      fprintf(stderr, "glGetPolygonStipple\n");
+      _mesa_debug("glGetPolygonStipple\n");
 
    _mesa_pack_polygon_stipple(ctx->PolygonStipple, dest, &ctx->Pack);
 }
@@ -186,7 +186,7 @@ _mesa_PolygonOffset( GLfloat factor, GLfloat units )
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    if (MESA_VERBOSE&VERBOSE_API)
-      fprintf(stderr, "glPolygonOffset %f %f\n", factor, units);
+      _mesa_debug("glPolygonOffset %f %f\n", factor, units);
 
    if (ctx->Polygon.OffsetFactor == factor &&
        ctx->Polygon.OffsetUnits == units)
index 39f6594..a2d4095 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: texobj.c,v 1.52 2002/02/15 16:32:06 brianp Exp $ */
+/* $Id: texobj.c,v 1.53 2002/06/13 04:49:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -565,8 +565,8 @@ _mesa_BindTexture( GLenum target, GLuint texName )
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
-      fprintf(stderr, "glBindTexture %s %d\n",
-             _mesa_lookup_enum_by_nr(target), (GLint) texName);
+      _mesa_debug("glBindTexture %s %d\n",
+                  _mesa_lookup_enum_by_nr(target), (GLint) texName);
 
    switch (target) {
       case GL_TEXTURE_1D:
index fe6d915..464bd3a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: texstate.c,v 1.72 2002/05/27 17:04:53 brianp Exp $ */
+/* $Id: texstate.c,v 1.73 2002/06/13 04:49:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -454,11 +454,11 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
    }
 
    if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
-      fprintf(stderr, "glTexEnv %s %s %.1f(%s) ...\n",
-             _mesa_lookup_enum_by_nr(target),
-             _mesa_lookup_enum_by_nr(pname),
-             *param,
-             _mesa_lookup_enum_by_nr((GLenum) (GLint) *param));
+      _mesa_debug("glTexEnv %s %s %.1f(%s) ...\n",
+                  _mesa_lookup_enum_by_nr(target),
+                  _mesa_lookup_enum_by_nr(pname),
+                  *param,
+                  _mesa_lookup_enum_by_nr((GLenum) (GLint) *param));
 
    /* Tell device driver about the new texture environment */
    if (ctx->Driver.TexEnv) {
@@ -950,10 +950,10 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params )
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
-      fprintf(stderr, "texPARAM %s %s %d...\n",
-             _mesa_lookup_enum_by_nr(target),
-             _mesa_lookup_enum_by_nr(pname),
-             eparam);
+      _mesa_debug("texPARAM %s %s %d...\n",
+                  _mesa_lookup_enum_by_nr(target),
+                  _mesa_lookup_enum_by_nr(pname),
+                  eparam);
 
 
    switch (target) {
@@ -1764,10 +1764,10 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
-      fprintf(stderr, "texGEN %s %s %x...\n",
-             _mesa_lookup_enum_by_nr(coord),
-             _mesa_lookup_enum_by_nr(pname),
-             *(int *)params);
+      _mesa_debug("texGEN %s %s %x...\n",
+                  _mesa_lookup_enum_by_nr(coord),
+                  _mesa_lookup_enum_by_nr(pname),
+                  *(int *)params);
 
    switch (coord) {
       case GL_S:
@@ -2303,8 +2303,8 @@ _mesa_ActiveTextureARB( GLenum target )
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
-      fprintf(stderr, "glActiveTexture %s\n",
-             _mesa_lookup_enum_by_nr(target));
+      _mesa_debug("glActiveTexture %s\n",
+                  _mesa_lookup_enum_by_nr(target));
 
    if (texUnit > ctx->Const.MaxTextureUnits) {
       _mesa_error(ctx, GL_INVALID_ENUM, "glActiveTextureARB(target)");
index f35e50c..4e03f21 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: varray.c,v 1.43 2002/04/21 18:49:18 brianp Exp $ */
+/* $Id: varray.c,v 1.44 2002/06/13 04:49:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -60,7 +60,7 @@ _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
    }
 
    if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API))
-      fprintf(stderr, "glVertexPointer( sz %d type %s stride %d )\n", size,
+      _mesa_debug("glVertexPointer( sz %d type %s stride %d )\n", size,
              _mesa_lookup_enum_by_nr( type ),
              stride);
 
@@ -112,7 +112,7 @@ _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr )
    }
 
    if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API))
-      fprintf(stderr, "glNormalPointer( type %s stride %d )\n",
+      _mesa_debug("glNormalPointer( type %s stride %d )\n",
              _mesa_lookup_enum_by_nr( type ),
              stride);
 
@@ -168,7 +168,7 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr)
    }
 
    if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API))
-      fprintf(stderr, "glColorPointer( sz %d type %s stride %d )\n", size,
+      _mesa_debug("glColorPointer( sz %d type %s stride %d )\n", size,
          _mesa_lookup_enum_by_nr( type ),
          stride);
 
@@ -320,10 +320,8 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type,
    }
 
    if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API))
-      fprintf(stderr,
-              "glSecondaryColorPointer( sz %d type %s stride %d )\n", size,
-         _mesa_lookup_enum_by_nr( type ),
-         stride);
+      _mesa_debug("glSecondaryColorPointer( sz %d type %s stride %d )\n",
+                  size, _mesa_lookup_enum_by_nr( type ), stride);
 
    switch (type) {
       case GL_BYTE:
@@ -389,7 +387,7 @@ _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride,
    }
 
    if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API))
-      fprintf(stderr, "glTexCoordPointer( unit %u sz %d type %s stride %d )\n",
+      _mesa_debug("glTexCoordPointer( unit %u sz %d type %s stride %d )\n",
          texUnit,
          size,
          _mesa_lookup_enum_by_nr( type ),
@@ -770,7 +768,7 @@ _mesa_LockArraysEXT(GLint first, GLsizei count)
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 
    if (MESA_VERBOSE & VERBOSE_API)
-      fprintf(stderr, "glLockArrays %d %d\n", first, count);
+      _mesa_debug("glLockArrays %d %d\n", first, count);
 
    if (first == 0 && count > 0 &&
        count <= (GLint) ctx->Const.MaxArrayLockSize) {
@@ -797,7 +795,7 @@ _mesa_UnlockArraysEXT( void )
    ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
 
    if (MESA_VERBOSE & VERBOSE_API)
-      fprintf(stderr, "glUnlockArrays\n");
+      _mesa_debug("glUnlockArrays\n");
 
    ctx->Array.LockFirst = 0;
    ctx->Array.LockCount = 0;
index 809ee68..60b389b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: s_context.c,v 1.32 2002/05/02 00:59:20 brianp Exp $ */
+/* $Id: s_context.c,v 1.33 2002/06/13 04:49:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -389,7 +389,7 @@ _swrast_Quad( GLcontext *ctx,
               const SWvertex *v2, const SWvertex *v3 )
 {
    if (SWRAST_DEBUG) {
-      fprintf(stderr, "_swrast_Quad\n");
+      _mesa_debug("_swrast_Quad\n");
       _swrast_print_vertex( ctx, v0 );
       _swrast_print_vertex( ctx, v1 );
       _swrast_print_vertex( ctx, v2 );
@@ -404,7 +404,7 @@ _swrast_Triangle( GLcontext *ctx, const SWvertex *v0,
                   const SWvertex *v1, const SWvertex *v2 )
 {
    if (SWRAST_DEBUG) {
-      fprintf(stderr, "_swrast_Triangle\n");
+      _mesa_debug("_swrast_Triangle\n");
       _swrast_print_vertex( ctx, v0 );
       _swrast_print_vertex( ctx, v1 );
       _swrast_print_vertex( ctx, v2 );
@@ -416,7 +416,7 @@ void
 _swrast_Line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 )
 {
    if (SWRAST_DEBUG) {
-      fprintf(stderr, "_swrast_Line\n");
+      _mesa_debug("_swrast_Line\n");
       _swrast_print_vertex( ctx, v0 );
       _swrast_print_vertex( ctx, v1 );
    }
@@ -427,7 +427,7 @@ void
 _swrast_Point( GLcontext *ctx, const SWvertex *v0 )
 {
    if (SWRAST_DEBUG) {
-      fprintf(stderr, "_swrast_Point\n");
+      _mesa_debug("_swrast_Point\n");
       _swrast_print_vertex( ctx, v0 );
    }
    SWRAST_CONTEXT(ctx)->Point( ctx, v0 );
@@ -437,7 +437,7 @@ void
 _swrast_InvalidateState( GLcontext *ctx, GLuint new_state )
 {
    if (SWRAST_DEBUG) {
-      fprintf(stderr, "_swrast_InvalidateState\n");
+      _mesa_debug("_swrast_InvalidateState\n");
    }
    SWRAST_CONTEXT(ctx)->InvalidateState( ctx, new_state );
 }
@@ -446,7 +446,7 @@ void
 _swrast_ResetLineStipple( GLcontext *ctx )
 {
    if (SWRAST_DEBUG) {
-      fprintf(stderr, "_swrast_ResetLineStipple\n");
+      _mesa_debug("_swrast_ResetLineStipple\n");
    }
    SWRAST_CONTEXT(ctx)->StippleCounter = 0;
 }
@@ -455,7 +455,7 @@ void
 _swrast_allow_vertex_fog( GLcontext *ctx, GLboolean value )
 {
    if (SWRAST_DEBUG) {
-      fprintf(stderr, "_swrast_allow_vertex_fog %d\n", value);
+      _mesa_debug("_swrast_allow_vertex_fog %d\n", value);
    }
    SWRAST_CONTEXT(ctx)->InvalidateState( ctx, _NEW_HINT );
    SWRAST_CONTEXT(ctx)->AllowVertexFog = value;
@@ -465,7 +465,7 @@ void
 _swrast_allow_pixel_fog( GLcontext *ctx, GLboolean value )
 {
    if (SWRAST_DEBUG) {
-      fprintf(stderr, "_swrast_allow_pixel_fog %d\n", value);
+      _mesa_debug("_swrast_allow_pixel_fog %d\n", value);
    }
    SWRAST_CONTEXT(ctx)->InvalidateState( ctx, _NEW_HINT );
    SWRAST_CONTEXT(ctx)->AllowPixelFog = value;
@@ -479,7 +479,7 @@ _swrast_CreateContext( GLcontext *ctx )
    SWcontext *swrast = (SWcontext *)CALLOC(sizeof(SWcontext));
 
    if (SWRAST_DEBUG) {
-      fprintf(stderr, "_swrast_CreateContext\n");
+      _mesa_debug("_swrast_CreateContext\n");
    }
 
    if (!swrast)
@@ -539,7 +539,7 @@ _swrast_DestroyContext( GLcontext *ctx )
    SWcontext *swrast = SWRAST_CONTEXT(ctx);
 
    if (SWRAST_DEBUG) {
-      fprintf(stderr, "_swrast_DestroyContext\n");
+      _mesa_debug("_swrast_DestroyContext\n");
    }
 
    FREE( swrast->span );
@@ -565,30 +565,32 @@ _swrast_print_vertex( GLcontext *ctx, const SWvertex *v )
    GLuint i;
 
    if (SWRAST_DEBUG_VERTICES) {
-      fprintf(stderr, "win %f %f %f %f\n",
-             v->win[0], v->win[1], v->win[2], v->win[3]);
+      _mesa_debug("win %f %f %f %f\n",
+                  v->win[0], v->win[1], v->win[2], v->win[3]);
 
       for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++)
         if (ctx->Texture.Unit[i]._ReallyEnabled)
-           fprintf(stderr, "texcoord[%d] %f %f %f %f\n", i,
-                   v->texcoord[i][0], v->texcoord[i][1],
-                   v->texcoord[i][2], v->texcoord[i][3]);
+           _mesa_debug("texcoord[%d] %f %f %f %f\n", i,
+                        v->texcoord[i][0], v->texcoord[i][1],
+                        v->texcoord[i][2], v->texcoord[i][3]);
 
 #if CHAN_TYPE == GL_FLOAT
-      fprintf(stderr, "color %f %f %f %f\n",
-             v->color[0], v->color[1], v->color[2], v->color[3]);
-      fprintf(stderr, "spec %f %f %f %f\n",
-             v->specular[0], v->specular[1], v->specular[2], v->specular[3]);
+      _mesa_debug("color %f %f %f %f\n",
+                  v->color[0], v->color[1], v->color[2], v->color[3]);
+      _mesa_debug("spec %f %f %f %f\n",
+                  v->specular[0], v->specular[1],
+                  v->specular[2], v->specular[3]);
 #else
-      fprintf(stderr, "color %d %d %d %d\n",
-             v->color[0], v->color[1], v->color[2], v->color[3]);
-      fprintf(stderr, "spec %d %d %d %d\n",
-             v->specular[0], v->specular[1], v->specular[2], v->specular[3]);
+      _mesa_debug("color %d %d %d %d\n",
+                  v->color[0], v->color[1], v->color[2], v->color[3]);
+      _mesa_debug("spec %d %d %d %d\n",
+                  v->specular[0], v->specular[1],
+                  v->specular[2], v->specular[3]);
 #endif
-      fprintf(stderr, "fog %f\n", v->fog);
-      fprintf(stderr, "index %d\n", v->index);
-      fprintf(stderr, "pointsize %f\n", v->pointSize);
-      fprintf(stderr, "\n");
+      _mesa_debug("fog %f\n", v->fog);
+      _mesa_debug("index %d\n", v->index);
+      _mesa_debug("pointsize %f\n", v->pointSize);
+      _mesa_debug("\n");
    }
 }
 
index 811c3e7..5a10afe 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ss_vb.c,v 1.16 2002/06/06 16:19:25 brianp Exp $ */
+/* $Id: ss_vb.c,v 1.17 2002/06/13 04:49:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -298,7 +298,7 @@ static void copy_pv_extras( GLcontext *ctx, GLuint dst, GLuint src )
 static void
 emit_invalid( GLcontext *ctx, GLuint start, GLuint end, GLuint newinputs )
 {
-   fprintf(stderr, "swrast_setup: invalid setup function\n");
+   _mesa_debug("swrast_setup: invalid setup function\n");
    (void) (ctx && start && end && newinputs);
 }
 
@@ -307,14 +307,14 @@ interp_invalid( GLcontext *ctx, GLfloat t,
                GLuint edst, GLuint eout, GLuint ein,
                GLboolean force_boundary )
 {
-   fprintf(stderr, "swrast_setup: invalid interp function\n");
+   _mesa_debug("swrast_setup: invalid interp function\n");
    (void) (ctx && t && edst && eout && ein && force_boundary);
 }
 
 static void 
 copy_pv_invalid( GLcontext *ctx, GLuint edst, GLuint esrc )
 {
-   fprintf(stderr, "swrast_setup: invalid copy_pv function\n");
+   _mesa_debug("swrast_setup: invalid copy_pv function\n");
    (void) (ctx && edst && esrc );
 }
 
@@ -361,7 +361,7 @@ static void init_standard( void )
 
 static void printSetupFlags(char *msg, GLuint flags )
 {
-   fprintf(stderr, "%s(%x): %s%s%s%s%s%s%s\n",
+   _mesa_debug("%s(%x): %s%s%s%s%s%s%s\n",
           msg,
           (int)flags,
           (flags & COLOR) ? "color, " : "",
index f477a35..5d78d10 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: t_imm_api.c,v 1.27 2002/04/19 12:32:14 brianp Exp $ */
+/* $Id: t_imm_api.c,v 1.28 2002/06/13 04:49:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -60,8 +60,8 @@ void _tnl_flush_immediate( GLcontext *ctx, struct immediate *IM )
    }
 
    if (MESA_VERBOSE & VERBOSE_IMMEDIATE)
-      fprintf(stderr, "_tnl_flush_immediate IM: %d compiling: %d\n",
-             IM->id, ctx->CompileFlag);
+      _mesa_debug("_tnl_flush_immediate IM: %d compiling: %d\n",
+                  IM->id, ctx->CompileFlag);
 
    if (IM->FlushElt == FLUSH_ELT_EAGER) {
       _tnl_translate_array_elts( ctx, IM, IM->LastPrimitive, IM->Count );
@@ -86,10 +86,9 @@ void _tnl_flush_vertices( GLcontext *ctx, GLuint flags )
    struct immediate *IM = TNL_CURRENT_IM(ctx);
 
    if (MESA_VERBOSE & VERBOSE_IMMEDIATE)
-      fprintf( stderr, 
-              "_tnl_flush_vertices flags %x IM(%d) %d..%d Flag[%d]: %x\n", 
-              flags, IM->id, IM->Start, IM->Count, IM->Start,
-              IM->Flag[IM->Start]);
+      _mesa_debug("_tnl_flush_vertices flags %x IM(%d) %d..%d Flag[%d]: %x\n", 
+                  flags, IM->id, IM->Start, IM->Count, IM->Start,
+                  IM->Flag[IM->Start]);
 
    if (IM->Flag[IM->Start])
       if ((flags & FLUSH_UPDATE_CURRENT) || IM->Count > IM->Start)
@@ -106,7 +105,7 @@ _tnl_save_Begin( GLenum mode )
    struct immediate *IM = TNL_CURRENT_IM(ctx);
    GLuint inflags, state;
 
-/*     fprintf(stderr, "%s: before: %x\n", __FUNCTION__, IM->BeginState); */
+/*     _mesa_debug("%s: before: %x\n", __FUNCTION__, IM->BeginState); */
 
    if (mode > GL_POLYGON) {
       _mesa_compile_error( ctx, GL_INVALID_ENUM, "_tnl_Begin" );
@@ -224,7 +223,7 @@ _tnl_Begin( GLenum mode )
       IM->LastPrimitive = count;
       IM->BeginState = (VERT_BEGIN_0|VERT_BEGIN_1);
 
-/*        fprintf(stderr, "%s: %x\n", __FUNCTION__, IM->BeginState);  */
+/*        _mesa_debug("%s: %x\n", __FUNCTION__, IM->BeginState);  */
 
       ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
       ctx->Driver.CurrentExecPrimitive = mode;
@@ -239,12 +238,12 @@ _tnl_Begin( GLenum mode )
 GLboolean
 _tnl_hard_begin( GLcontext *ctx, GLenum p )
 {
-/*     fprintf(stderr, "%s\n", __FUNCTION__); */
+/*     _mesa_debug("%s\n", __FUNCTION__); */
 
    if (!ctx->CompileFlag) {
       /* If not compiling, treat as a normal begin().
        */
-/*        fprintf(stderr, "%s: treating as glBegin\n", __FUNCTION__); */
+/*        _mesa_debug("%s: treating as glBegin\n", __FUNCTION__); */
       glBegin( p );
       return GL_TRUE;
    }
@@ -1206,7 +1205,7 @@ _tnl_Materialfv( GLenum face, GLenum pname, const GLfloat *params )
       return;
    
    if (MESA_VERBOSE & VERBOSE_API)
-      fprintf(stderr, "_tnl_Materialfv\n");
+      _mesa_debug("_tnl_Materialfv\n");
 
    if (tnl->IsolateMaterials &&
        !(IM->BeginState & VERT_BEGIN_1)) /* heuristic */
index 94da392..b269c75 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: t_imm_dlist.c,v 1.40 2002/04/19 00:45:50 brianp Exp $ */
+/* $Id: t_imm_dlist.c,v 1.41 2002/06/13 04:49:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -129,7 +129,7 @@ _tnl_compile_cassette( GLcontext *ctx, struct immediate *IM )
    GLuint new_beginstate;
 
    if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST)
-      fprintf(stderr, "_tnl_compiled_cassette IM: %d\n", IM->id); 
+      _mesa_debug("_tnl_compiled_cassette IM: %d\n", IM->id); 
 
    if (IM->FlushElt) {
       ASSERT (IM->FlushElt == FLUSH_ELT_LAZY); 
@@ -296,7 +296,7 @@ execute_compiled_cassette( GLcontext *ctx, void *data )
    TNLvertexcassette *node = (TNLvertexcassette *)data;
    struct immediate *IM = node->IM;
 
-/*     fprintf(stderr, "%s\n", __FUNCTION__); */
+/*     _mesa_debug("%s\n", __FUNCTION__); */
 
    IM->Start = node->Start;
    IM->CopyStart = node->Start;
@@ -317,9 +317,8 @@ execute_compiled_cassette( GLcontext *ctx, void *data )
       _tnl_print_cassette( IM );
 
    if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST) {
-      fprintf(stderr, "Run cassette %d, rows %d..%d, beginstate %x ",
-             IM->id,
-             IM->Start, IM->Count, IM->BeginState);
+      _mesa_debug("Run cassette %d, rows %d..%d, beginstate %x ",
+                  IM->id, IM->Start, IM->Count, IM->BeginState);
       _tnl_print_vert_flags("orflag", IM->OrFlag);
    }
 
@@ -401,8 +400,8 @@ print_compiled_cassette( GLcontext *ctx, void *data )
    TNLvertexcassette *node = (TNLvertexcassette *)data;
    struct immediate *IM = node->IM;
 
-   fprintf(stderr, "TNL-VERTEX-CASSETTE, id %u, rows %u..%u\n",
-          node->IM->id, node->Start, node->Count);
+   _mesa_debug("TNL-VERTEX-CASSETTE, id %u, rows %u..%u\n",
+               node->IM->id, node->Start, node->Count);
 
    IM->Start = node->Start;
    IM->CopyStart = node->Start;
index ff01dc5..c7cb0b0 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: t_imm_elt.c,v 1.16 2002/01/22 14:35:16 brianp Exp $ */
+/* $Id: t_imm_elt.c,v 1.17 2002/06/13 04:49:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -29,6 +29,7 @@
 
 #include "glheader.h"
 #include "colormac.h"
+#include "context.h"
 #include "mem.h"
 #include "mmath.h"
 #include "mtypes.h"
@@ -758,7 +759,7 @@ void _tnl_translate_array_elts( GLcontext *ctx, struct immediate *IM,
    GLuint i;
 
    if (MESA_VERBOSE&VERBOSE_IMMEDIATE)
-      fprintf(stderr, "exec_array_elements %d .. %d\n", start, count);
+      _mesa_debug("exec_array_elements %d .. %d\n", start, count);
 
    if (translate & VERT_BIT_POS) {
       _tnl_trans_elt_4f( IM->Attrib[VERT_ATTRIB_POS],
index 1b95f15..024da18 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: t_imm_eval.c,v 1.22 2002/04/09 16:56:52 keithw Exp $ */
+/* $Id: t_imm_eval.c,v 1.23 2002/06/13 04:49:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -194,8 +194,6 @@ static void eval2_obj_norm( GLvector4f *obj_ptr,
    GLfloat (*normal)[4] = norm_ptr->data;
    GLuint i;
 
-/*     fprintf(stderr, "%s\n", __FUNCTION__); */
-
    for (i = 0 ; !(flags[i] & VERT_BIT_END_VB) ; i++)
       if (flags[i] & (VERT_BIT_EVAL_C2|VERT_BIT_EVAL_P2)) {
         GLfloat u = (coord[i][0] - u1) * du;
@@ -611,7 +609,6 @@ void _tnl_eval_immediate( GLcontext *ctx, struct immediate *IM )
       GLuint generated = 0;
 
       if (copycount) {
-/*      fprintf(stderr, "%s: Copy normals\n", __FUNCTION__);  */
         copy_3f( store->Attrib[VERT_ATTRIB_NORMAL] + IM->CopyStart,
                   tmp->Normal.data, copycount );
       }
index 2480206..f4ee150 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: t_imm_exec.c,v 1.39 2002/04/19 12:32:14 brianp Exp $ */
+/* $Id: t_imm_exec.c,v 1.40 2002/06/13 04:49:17 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -72,8 +72,7 @@ static void reset_input( GLcontext *ctx,
       MEMSET(IM->Flag + start, 0, sizeof(GLuint) * (IM->Count+2-start));
 
    if (MESA_VERBOSE & VERBOSE_IMMEDIATE)
-      fprintf(stderr, "reset_input: IM(%d) new %x\n", 
-             IM->id, beginstate);
+      _mesa_debug("reset_input: IM(%d) new %x\n", IM->id, beginstate);
 
    IM->Start = start;
    IM->Count = start;
@@ -409,8 +408,6 @@ void _tnl_run_cassette( GLcontext *ctx, struct immediate *IM )
  */
 static void exec_vert_cassette( GLcontext *ctx, struct immediate *IM )
 {
-/*     fprintf(stderr, "%s\n", __FUNCTION__); */
-
    if (IM->FlushElt) {
       /* Orflag is computed twice, but only reach this code if app is
        * using a mixture of glArrayElement() and glVertex() while
@@ -436,8 +433,6 @@ static void exec_elt_cassette( GLcontext *ctx, struct immediate *IM )
    TNLcontext *tnl = TNL_CONTEXT(ctx);
    struct vertex_buffer *VB = &tnl->vb;
 
-/*      fprintf(stderr, "%s\n", __FUNCTION__);  */
-
    _tnl_vb_bind_arrays( ctx, ctx->Array.LockFirst, ctx->Array.LockCount );
 
    /* Take only elements and primitive information from the immediate:
@@ -518,9 +513,6 @@ void _tnl_execute_cassette( GLcontext *ctx, struct immediate *IM )
 
    if (ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1)
       ctx->Driver.NeedFlush &= ~FLUSH_STORED_VERTICES;
-
-/*     fprintf(stderr, "%s: NeedFlush: %x\n", __FUNCTION__,  */
-/*        ctx->Driver.NeedFlush); */
 }