mesa: clean-up _mesa_lookup_prim_by_nr()
[mesa.git] / src / mesa / main / debug.c
index 9bcfc1008a8852f402733053645ceecfdd279c35..a6a909b48ced8d5e4b8e4a75036db0bdd1164757 100644 (file)
 #include "texobj.h"
 
 
-/**
- * Primitive names
- */
-const char *_mesa_prim_name[GL_POLYGON+4] = {
-   "GL_POINTS",
-   "GL_LINES",
-   "GL_LINE_LOOP",
-   "GL_LINE_STRIP",
-   "GL_TRIANGLES",
-   "GL_TRIANGLE_STRIP",
-   "GL_TRIANGLE_FAN",
-   "GL_QUADS",
-   "GL_QUAD_STRIP",
-   "GL_POLYGON",
-   "outside begin/end",
-   "inside unknown primitive",
-   "unknown state"
-};
-
-
 static const char *
 tex_target_name(GLenum tgt)
 {
@@ -85,13 +65,12 @@ void
 _mesa_print_state( const char *msg, GLuint state )
 {
    _mesa_debug(NULL,
-          "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+          "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
           msg,
           state,
           (state & _NEW_MODELVIEW)       ? "ctx->ModelView, " : "",
           (state & _NEW_PROJECTION)      ? "ctx->Projection, " : "",
           (state & _NEW_TEXTURE_MATRIX)  ? "ctx->TextureMatrix, " : "",
-          (state & _NEW_COLOR_MATRIX)    ? "ctx->ColorMatrix, " : "",
           (state & _NEW_ACCUM)           ? "ctx->Accum, " : "",
           (state & _NEW_COLOR)           ? "ctx->Color, " : "",
           (state & _NEW_DEPTH)           ? "ctx->Depth, " : "",
@@ -121,7 +100,7 @@ void
 _mesa_print_tri_caps( const char *name, GLuint flags )
 {
    _mesa_debug(NULL,
-          "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
+          "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s\n",
           name,
           flags,
           (flags & DD_FLATSHADE)           ? "flat-shade, " : "",
@@ -134,9 +113,7 @@ _mesa_print_tri_caps( const char *name, GLuint flags )
           (flags & DD_TRI_SMOOTH)          ? "tri-smooth, " : "",
           (flags & DD_LINE_SMOOTH)         ? "line-smooth, " : "",
           (flags & DD_LINE_STIPPLE)        ? "line-stipple, " : "",
-          (flags & DD_LINE_WIDTH)          ? "line-wide, " : "",
           (flags & DD_POINT_SMOOTH)        ? "point-smooth, " : "",
-          (flags & DD_POINT_SIZE)          ? "point-size, " : "",
           (flags & DD_POINT_ATTEN)         ? "point-atten, " : "",
           (flags & DD_TRI_CULL_FRONT_BACK) ? "cull-all, " : ""
       );
@@ -234,7 +211,7 @@ static void add_debug_flags( const char *debug )
 
 
 void 
-_mesa_init_debug( GLcontext *ctx )
+_mesa_init_debug( struct gl_context *ctx )
 {
    char *c;
 
@@ -315,7 +292,7 @@ write_texture_image(struct gl_texture_object *texObj,
                               buffer, texObj, img);
 
       /* make filename */
-      sprintf(s, "/tmp/tex%u.l%u.f%u.ppm", texObj->Name, level, face);
+      _mesa_snprintf(s, sizeof(s), "/tmp/tex%u.l%u.f%u.ppm", texObj->Name, level, face);
 
       printf("  Writing image level %u to %s\n", level, s);
       write_ppm(s, buffer, img->Width, img->Height, 4, 0, 1, 2, GL_FALSE);
@@ -357,7 +334,7 @@ write_renderbuffer_image(const struct gl_renderbuffer *rb)
                           format, type, &ctx->DefaultPacking, buffer);
 
    /* make filename */
-   sprintf(s, "/tmp/renderbuffer%u.ppm", rb->Name);
+   _mesa_snprintf(s, sizeof(s), "/tmp/renderbuffer%u.ppm", rb->Name);
 
    printf("  Writing renderbuffer image to %s\n", s);
    write_ppm(s, buffer, rb->Width, rb->Height, 4, 0, 1, 2, GL_TRUE);
@@ -579,7 +556,7 @@ _mesa_dump_stencil_buffer(const char *filename)
  * Quick and dirty function to "print" a texture to stdout.
  */
 void
-_mesa_print_texture(GLcontext *ctx, const struct gl_texture_image *img)
+_mesa_print_texture(struct gl_context *ctx, const struct gl_texture_image *img)
 {
 #if CHAN_TYPE != GL_UNSIGNED_BYTE
    _mesa_problem(NULL, "PrintTexture not supported");