Comment out __FUNCTION__ usage.
[mesa.git] / src / mesa / main / polygon.c
index 68bcbbe3b807c73aa0318cd8ddf35bf0169d4f9a..910b8a35933bf490100c5601b74b189196b66114 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: polygon.c,v 1.17 2000/12/26 05:09:29 keithw Exp $ */
+/* $Id: polygon.c,v 1.21 2001/03/22 00:36:27 gareth Exp $ */
 
 /*
  * Mesa 3-D graphics library
  * Version:  3.5
  *
- * Copyright (C) 1999-2000  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -47,10 +47,10 @@ _mesa_CullFace( GLenum mode )
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    if (MESA_VERBOSE&VERBOSE_API)
-      fprintf(stderr, "glCullFace %s\n", gl_lookup_enum_by_nr(mode));
+      fprintf(stderr, "glCullFace %s\n", _mesa_lookup_enum_by_nr(mode));
 
    if (mode!=GL_FRONT && mode!=GL_BACK && mode!=GL_FRONT_AND_BACK) {
-      gl_error( ctx, GL_INVALID_ENUM, "glCullFace" );
+      _mesa_error( ctx, GL_INVALID_ENUM, "glCullFace" );
       return;
    }
 
@@ -73,10 +73,10 @@ _mesa_FrontFace( GLenum mode )
    ASSERT_OUTSIDE_BEGIN_END(ctx);
 
    if (MESA_VERBOSE&VERBOSE_API)
-      fprintf(stderr, "glFrontFace %s\n", gl_lookup_enum_by_nr(mode));
+      fprintf(stderr, "glFrontFace %s\n", _mesa_lookup_enum_by_nr(mode));
 
    if (mode!=GL_CW && mode!=GL_CCW) {
-      gl_error( ctx, GL_INVALID_ENUM, "glFrontFace" );
+      _mesa_error( ctx, GL_INVALID_ENUM, "glFrontFace" );
       return;
    }
 
@@ -102,11 +102,11 @@ _mesa_PolygonMode( GLenum face, GLenum mode )
 
    if (MESA_VERBOSE&VERBOSE_API)
       fprintf(stderr, "glPolygonMode %s %s\n",
-             gl_lookup_enum_by_nr(face),
-             gl_lookup_enum_by_nr(mode));
+             _mesa_lookup_enum_by_nr(face),
+             _mesa_lookup_enum_by_nr(mode));
 
    if (mode!=GL_POINT && mode!=GL_LINE && mode!=GL_FILL) {
-      gl_error( ctx, GL_INVALID_ENUM, "glPolygonMode(mode)" );
+      _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(mode)" );
       return;
    }
 
@@ -132,12 +132,12 @@ _mesa_PolygonMode( GLenum face, GLenum mode )
       ctx->Polygon.BackMode = mode;
       break;
    default:
-      gl_error( ctx, GL_INVALID_ENUM, "glPolygonMode(face)" );
+      _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(face)" );
       return;
    }
 
    ctx->_TriangleCaps &= ~DD_TRI_UNFILLED;
-   if (ctx->Polygon.FrontMode!=GL_FILL || ctx->Polygon.BackMode!=GL_FILL) 
+   if (ctx->Polygon.FrontMode!=GL_FILL || ctx->Polygon.BackMode!=GL_FILL)
       ctx->_TriangleCaps |= DD_TRI_UNFILLED;
 
    if (ctx->Driver.PolygonMode) {
@@ -195,7 +195,10 @@ _mesa_PolygonOffset( GLfloat factor, GLfloat units )
    FLUSH_VERTICES(ctx, _NEW_POLYGON);
    ctx->Polygon.OffsetFactor = factor;
    ctx->Polygon.OffsetUnits = units;
-   ctx->Polygon.OffsetMRD = units * ctx->Visual.MRD;
+   ctx->Polygon.OffsetMRD = units * ctx->MRD;
+
+   if (ctx->Driver.PolygonOffset)
+      ctx->Driver.PolygonOffset( ctx, factor, units );
 }
 
 
@@ -204,5 +207,5 @@ void
 _mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
 {
    GET_CURRENT_CONTEXT(ctx);
-   _mesa_PolygonOffset(factor, bias * ctx->Visual.DepthMaxF );
+   _mesa_PolygonOffset(factor, bias * ctx->DepthMaxF );
 }