Merge branch 'gallium-0.1' into gallium-0.2
[mesa.git] / src / mesa / drivers / dri / mga / mgatris.c
index 2b7ea05b142cbba262508e660c13e4494ed1ea06..d2a8a693d7b964415a53a4e4f7b2a566600ba8eb 100644 (file)
@@ -24,7 +24,6 @@
  * Authors:
  *    Keith Whitwell <keith@tungstengraphics.com>
  */
-/* $XFree86: xc/lib/GL/mesa/src/drv/mga/mgatris.c,v 1.10 2002/10/30 12:51:36 alanh Exp $ */
 
 #include "mtypes.h"
 #include "macros.h"
@@ -67,7 +66,7 @@ do {                                          \
 } while (0)
 #endif
 
-static void __inline__ mga_draw_triangle( mgaContextPtr mmesa,
+static void INLINE mga_draw_triangle( mgaContextPtr mmesa,
                                           mgaVertexPtr v0,
                                           mgaVertexPtr v1,
                                           mgaVertexPtr v2 )
@@ -82,7 +81,7 @@ static void __inline__ mga_draw_triangle( mgaContextPtr mmesa,
 }
 
 
-static void __inline__ mga_draw_quad( mgaContextPtr mmesa,
+static void INLINE mga_draw_quad( mgaContextPtr mmesa,
                                       mgaVertexPtr v0,
                                       mgaVertexPtr v1,
                                       mgaVertexPtr v2,
@@ -101,11 +100,13 @@ static void __inline__ mga_draw_quad( mgaContextPtr mmesa,
 }
 
 
-static __inline__ void mga_draw_point( mgaContextPtr mmesa,
+static INLINE void mga_draw_point( mgaContextPtr mmesa,
                                        mgaVertexPtr tmp )
 {
-   GLfloat sz = mmesa->glCtx->Point._Size * .5;
-   int vertex_size = mmesa->vertex_size;
+   const GLfloat sz = 0.5 * CLAMP(mmesa->glCtx->Point.Size,
+                                  mmesa->glCtx->Const.MinPointSize,
+                                  mmesa->glCtx->Const.MaxPointSize);
+   const int vertex_size = mmesa->vertex_size;
    GLuint *vb = mgaAllocDmaLow( mmesa, 6 * 4 * vertex_size );
    int j;
    
@@ -158,14 +159,16 @@ static __inline__ void mga_draw_point( mgaContextPtr mmesa,
 }
 
 
-static __inline__ void mga_draw_line( mgaContextPtr mmesa,
+static INLINE void mga_draw_line( mgaContextPtr mmesa,
                                      mgaVertexPtr v0,
                                      mgaVertexPtr v1 )
 {
    GLuint vertex_size = mmesa->vertex_size;
    GLuint *vb = mgaAllocDmaLow( mmesa, 6 * 4 * vertex_size );
    GLfloat dx, dy, ix, iy;
-   GLfloat width = mmesa->glCtx->Line._Width;
+   const GLfloat width = CLAMP(mmesa->glCtx->Line.Width,
+                               mmesa->glCtx->Const.MinLineWidth,
+                               mmesa->glCtx->Const.MaxLineWidth);
    GLint j;
 
 #if 0