From 4e96ac080ae05a4439d3104638e645b3a7494642 Mon Sep 17 00:00:00 2001 From: Jon Taylor Date: Thu, 28 Dec 2000 02:00:27 +0000 Subject: Fixed GGIMesa build problems. Swrast triangle drawing fixes. --- src/mesa/drivers/ggi/default/stubs.c | 55 +++++++++++++++++------------------- 1 file changed, 26 insertions(+), 29 deletions(-) (limited to 'src/mesa/drivers/ggi/default') diff --git a/src/mesa/drivers/ggi/default/stubs.c b/src/mesa/drivers/ggi/default/stubs.c index a47d0ff4cc..8730088348 100644 --- a/src/mesa/drivers/ggi/default/stubs.c +++ b/src/mesa/drivers/ggi/default/stubs.c @@ -29,6 +29,9 @@ #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" +#include "swrast/s_context.h" +#include "swrast/s_depth.h" +#include "swrast/s_triangle.h" /**********************************************************************/ /***** Write spans of pixels *****/ @@ -294,32 +297,25 @@ void GGIread_rgba_pixels( const GLcontext *ctx, } -triangle_func ggiGetTriangleFunc(GLcontext *ctx); +static swrast_tri_func ggimesa_stubs_get_triangle_func(GLcontext *ctx); -int GGIsetup_driver(GGIMesaContext ggictx,struct ggi_mesa_info *info) +int GGIsetup_driver(GGIMesaContext ggictx, struct ggi_mesa_info *info) { - GLcontext *ctx=ggictx->gl_ctx; + GLcontext *ctx = ggictx->gl_ctx; ctx->Driver.WriteRGBASpan = GGIwrite_rgba_span; ctx->Driver.WriteRGBSpan = GGIwrite_rgb_span; -// ctx->Driver.WriteMonoRGBASpan = GGIwrite_mono_span; ctx->Driver.WriteRGBAPixels = GGIwrite_rgba_pixels; -// ctx->Driver.WriteMonoRGBAPixels = GGIwrite_mono_pixels; ctx->Driver.WriteCI32Span = GGIwrite_ci32_span; ctx->Driver.WriteCI8Span = GGIwrite_ci8_span; -// ctx->Driver.WriteMonoCISpan = GGIwrite_mono_span; ctx->Driver.WriteCI32Pixels = GGIwrite_ci32_pixels; -// ctx->Driver.WriteMonoCIPixels = GGIwrite_mono_pixels; ctx->Driver.ReadCI32Span = GGIread_ci32_span; ctx->Driver.ReadRGBASpan = GGIread_rgba_span; ctx->Driver.ReadCI32Pixels = GGIread_ci32_pixels; ctx->Driver.ReadRGBAPixels = GGIread_rgba_pixels; - ctx->Driver.RegisterVB = _swsetup_RegisterVB; - ctx->Driver.UnregisterVB = _swsetup_UnregisterVB; - return 0; } @@ -329,37 +325,38 @@ void GGIupdate_state(GLcontext *ctx) } -void GGItriangle_flat(GLcontext *ctx,GLuint v0,GLuint v1,GLuint v2,GLuint pv) +void GGItriangle_flat(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1, const SWvertex *v2) { //#define INTERP_Z 1 -//#define INTERP_RGB 1 -//#define INTERP_ALPHA 1 +#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define SETUP_CODE \ - GLubyte r = VB->ColorPtr->data[pv][0]; \ - GLubyte g = VB->ColorPtr->data[pv][1]; \ - GLubyte b = VB->ColorPtr->data[pv][2]; \ - GLubyte a = VB->ColorPtr->data[pv][3]; \ - (*ctx->Driver.Color)(ctx,r,g,b,a); +#define SETUP_CODE \ + ggi_color color; \ + color.r = v0->color[0]; \ + color.g = v0->color[1]; \ + color.b = v0->color[2]; \ + color.a = v0->color[3]; \ + ggiSetGCForeground(VIS, ggiMapColor(VIS, &color)); #define INNER_LOOP(LEFT,RIGHT,Y) \ ggiDrawHLine(VIS,LEFT,FLIP(Y),RIGHT-LEFT); -//#include "tritemp.h" +#include "swrast/s_tritemp.h" } -void GGItriangle_flat_depth(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint pv) +static void GGItriangle_flat_depth(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1, const SWvertex *v2) { #define INTERP_Z 1 #define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE -#define SETUP_CODE \ - GLubyte r = VB->ColorPtr->data[pv][0]; \ - GLubyte g = VB->ColorPtr->data[pv][1]; \ - GLubyte b = VB->ColorPtr->data[pv][2]; \ - GLubyte a = VB->ColorPtr->data[pv][3]; \ - (*ctx->Driver.Color)(ctx,r,g,b,a); +#define SETUP_CODE \ + ggi_color color; \ + color.r = v0->color[0]; \ + color.g = v0->color[1]; \ + color.b = v0->color[2]; \ + color.a = v0->color[3]; \ + ggiSetGCForeground(VIS, ggiMapColor(VIS, &color)); #define INNER_LOOP(LEFT,RIGHT,Y) \ { \ @@ -386,11 +383,11 @@ void GGItriangle_flat_depth(GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLu if (length) ggiDrawHLine(VIS,startx,yy,length); \ } -//#include "tritemp.h" +#include "swrast/s_tritemp.h" } -triangle_func ggiGetTriangleFunc(GLcontext *ctx) +static swrast_tri_func ggimesa_stubs_get_triangle_func(GLcontext *ctx) { if (ctx->Stencil.Enabled) return NULL; if (ctx->Polygon.SmoothFlag) return NULL; -- cgit v1.2.3