* José Fonseca <j_r_fonseca@yahoo.co.uk>
*/
-#include "glheader.h"
-#include "mtypes.h"
-#include "colormac.h"
-#include "macros.h"
+#include "main/glheader.h"
+#include "main/mtypes.h"
+#include "main/colormac.h"
+#include "main/macros.h"
#include "swrast/swrast.h"
#include "swrast_setup/swrast_setup.h"
MACH64_PRIM_POLYGON,
};
-static void mach64RasterPrimitive( GLcontext *ctx, GLuint hwprim );
-static void mach64RenderPrimitive( GLcontext *ctx, GLenum prim );
+static void mach64RasterPrimitive( struct gl_context *ctx, GLuint hwprim );
+static void mach64RenderPrimitive( struct gl_context *ctx, GLenum prim );
/* FIXME: Remove this when native template is finished. */
#define COPY_VERTEX_OOA( vb, vertsize, v, n ) DO_COPY_VERTEX( vb, vertsize, v, n, 1 )
-static __inline void mach64_draw_quad( mach64ContextPtr mmesa,
+static INLINE void mach64_draw_quad( mach64ContextPtr mmesa,
mach64VertexPtr v0,
mach64VertexPtr v1,
mach64VertexPtr v2,
mach64VertexPtr v3 )
{
#if MACH64_NATIVE_VTXFMT
- GLcontext *ctx = mmesa->glCtx;
+ struct gl_context *ctx = mmesa->glCtx;
const GLuint vertsize = mmesa->vertex_size;
GLint a;
GLfloat ooa;
#endif
}
-static __inline void mach64_draw_triangle( mach64ContextPtr mmesa,
+static INLINE void mach64_draw_triangle( mach64ContextPtr mmesa,
mach64VertexPtr v0,
mach64VertexPtr v1,
mach64VertexPtr v2 )
{
#if MACH64_NATIVE_VTXFMT
- GLcontext *ctx = mmesa->glCtx;
+ struct gl_context *ctx = mmesa->glCtx;
GLuint vertsize = mmesa->vertex_size;
GLint a;
GLfloat ooa;
#endif
}
-static __inline void mach64_draw_line( mach64ContextPtr mmesa,
+static INLINE void mach64_draw_line( mach64ContextPtr mmesa,
mach64VertexPtr v0,
mach64VertexPtr v1 )
{
#if MACH64_NATIVE_VTXFMT
- GLcontext *ctx = mmesa->glCtx;
+ struct gl_context *ctx = mmesa->glCtx;
const GLuint vertsize = mmesa->vertex_size;
/* 2 fractional bits for hardware: */
const int width = (int) (2.0 * CLAMP(mmesa->glCtx->Line.Width,
#endif
}
-static __inline void mach64_draw_point( mach64ContextPtr mmesa,
+static INLINE void mach64_draw_point( mach64ContextPtr mmesa,
mach64VertexPtr v0 )
{
#if MACH64_NATIVE_VTXFMT
- GLcontext *ctx = mmesa->glCtx;
+ struct gl_context *ctx = mmesa->glCtx;
const GLuint vertsize = mmesa->vertex_size;
/* 2 fractional bits for hardware: */
GLint sz = (GLint) (2.0 * CLAMP(mmesa->glCtx->Point.Size,
#define DO_POINTS 1
#define DO_FULL_QUAD 1
-#define HAVE_RGBA 1
#define HAVE_SPEC 1
#define HAVE_BACK_COLORS 0
#define HAVE_HW_FLATSHADE 1
#define LOCAL_VARS(n) \
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx); \
- GLuint color[n], spec[n]; \
+ GLuint color[n] = { 0 }; \
+ GLuint spec[n] = { 0 }; \
GLuint vertex_size = mmesa->vertex_size; \
const GLuint xyoffset = 9; \
const GLuint coloroffset = 8; \
mach64Vertex *v1,
mach64Vertex *v2 )
{
- GLcontext *ctx = mmesa->glCtx;
+ struct gl_context *ctx = mmesa->glCtx;
SWvertex v[3];
mach64_translate_vertex( ctx, v0, &v[0] );
mach64_translate_vertex( ctx, v1, &v[1] );
mach64Vertex *v0,
mach64Vertex *v1 )
{
- GLcontext *ctx = mmesa->glCtx;
+ struct gl_context *ctx = mmesa->glCtx;
SWvertex v[2];
mach64_translate_vertex( ctx, v0, &v[0] );
mach64_translate_vertex( ctx, v1, &v[1] );
mach64_fallback_point( mach64ContextPtr mmesa,
mach64Vertex *v0 )
{
- GLcontext *ctx = mmesa->glCtx;
+ struct gl_context *ctx = mmesa->glCtx;
SWvertex v[1];
mach64_translate_vertex( ctx, v0, &v[0] );
_swrast_Point( ctx, &v[0] );
/* Render clipped primitives */
/**********************************************************************/
-static void mach64RenderClippedPoly( GLcontext *ctx, const GLuint *elts,
+static void mach64RenderClippedPoly( struct gl_context *ctx, const GLuint *elts,
GLuint n )
{
mach64ContextPtr mmesa = MACH64_CONTEXT( ctx );
}
-static void mach64RenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj )
+static void mach64RenderClippedLine( struct gl_context *ctx, GLuint ii, GLuint jj )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
tnl->Driver.Render.Line( ctx, ii, jj );
}
#if MACH64_NATIVE_VTXFMT
-static void mach64FastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
+static void mach64FastRenderClippedPoly( struct gl_context *ctx, const GLuint *elts,
GLuint n )
{
mach64ContextPtr mmesa = MACH64_CONTEXT( ctx );
assert( vb == vbchk );
}
#else
-static void mach64FastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
+static void mach64FastRenderClippedPoly( struct gl_context *ctx, const GLuint *elts,
GLuint n )
{
mach64ContextPtr mmesa = MACH64_CONTEXT( ctx );
#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED)
-static void mach64ChooseRenderState(GLcontext *ctx)
+static void mach64ChooseRenderState(struct gl_context *ctx)
{
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
GLuint flags = ctx->_TriangleCaps;
/* Validate state at pipeline start */
/**********************************************************************/
-static void mach64RunPipeline( GLcontext *ctx )
+static void mach64RunPipeline( struct gl_context *ctx )
{
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
* and lines, points and bitmaps.
*/
-static void mach64RasterPrimitive( GLcontext *ctx, GLuint hwprim )
+static void mach64RasterPrimitive( struct gl_context *ctx, GLuint hwprim )
{
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
}
}
-static void mach64RenderPrimitive( GLcontext *ctx, GLenum prim )
+static void mach64RenderPrimitive( struct gl_context *ctx, GLenum prim )
{
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
GLuint hw = hw_prim[prim];
}
-static void mach64RenderStart( GLcontext *ctx )
+static void mach64RenderStart( struct gl_context *ctx )
{
/* Check for projective texturing. Make sure all texcoord
* pointers point to something. (fix in mesa?)
mach64CheckTexSizes( ctx );
}
-static void mach64RenderFinish( GLcontext *ctx )
+static void mach64RenderFinish( struct gl_context *ctx )
{
if (MACH64_CONTEXT(ctx)->RenderIndex & MACH64_FALLBACK_BIT)
_swrast_flush( ctx );
return fallbackStrings[i];
}
-void mach64Fallback( GLcontext *ctx, GLuint bit, GLboolean mode )
+void mach64Fallback( struct gl_context *ctx, GLuint bit, GLboolean mode )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
mach64ContextPtr mmesa = MACH64_CONTEXT(ctx);
/* Initialization. */
/**********************************************************************/
-void mach64InitTriFuncs( GLcontext *ctx )
+void mach64InitTriFuncs( struct gl_context *ctx )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
static int firsttime = 1;