summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorJon Taylor <[email protected]>2000-12-28 02:00:27 +0000
committerJon Taylor <[email protected]>2000-12-28 02:00:27 +0000
commit4e96ac080ae05a4439d3104638e645b3a7494642 (patch)
tree9deabe3e9297b781fb0e4c16dcca9d5e742934cb /src/mesa
parenta884b4b81168df26b2e049ea765af92c393b850b (diff)
Fixed GGIMesa build problems.
Swrast triangle drawing fixes.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/ggi/default/stubs.c55
-rw-r--r--src/mesa/drivers/ggi/ggimesa.c20
2 files changed, 28 insertions, 47 deletions
diff --git a/src/mesa/drivers/ggi/default/stubs.c b/src/mesa/drivers/ggi/default/stubs.c
index a47d0ff4cca..8730088348b 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;
diff --git a/src/mesa/drivers/ggi/ggimesa.c b/src/mesa/drivers/ggi/ggimesa.c
index b10f74ec0cf..cc22ba32b7e 100644
--- a/src/mesa/drivers/ggi/ggimesa.c
+++ b/src/mesa/drivers/ggi/ggimesa.c
@@ -54,7 +54,7 @@ static char *ggimesaconffile = ggimesaconfstub + GGIMESATAGLEN;
int _ggimesaDebugSync = 0;
uint32 _ggimesaDebugState = 0;
-static void gl_ggiUpdateState(GLcontext *ctx);
+static void gl_ggiUpdateState(GLcontext *ctx, GLuint new_state);
static int changed(ggi_visual_t vis, int whatchanged);
static void gl_ggiGetSize(GLcontext *ctx, GLuint *width, GLuint *height)
@@ -137,20 +137,6 @@ static GLbitfield gl_ggiClear(GLcontext *ctx,GLbitfield mask, GLboolean all,
return mask & (~GL_COLOR_BUFFER_BIT);
}
-#if 0
-static GLboolean gl_ggiSetBuffer(GLcontext *ctx, GLenum mode)
-{
- GGIMESADPRINT_CORE("gl_ggiSetBuffer() called\n");
-
- if (mode == GL_FRONT)
- GGICTX->active_buffer = 1;
- else
- GGICTX->active_buffer = 0;
-
- return GL_TRUE;
-}
-#endif
-
/* Set the buffer used for drawing */
static GLboolean gl_ggiSetDrawBuffer(GLcontext *ctx, GLenum mode)
{
@@ -254,9 +240,7 @@ static void gl_ggiSetupPointers(GLcontext *ctx)
ctx->Driver.LineFunc = _swsetup_Line;
ctx->Driver.TriangleFunc = _swsetup_Triangle;
ctx->Driver.QuadFunc = _swsetup_Quad;
- ctx->Driver.RasterSetup = _swsetup_RasterSetup;
- ctx->Driver.RegisterVB = _swsetup_RegisterVB;
- ctx->Driver.UnregisterVB = _swsetup_UnregisterVB;
+
}
static int gl_ggiInitInfo(GGIMesaContext ctx, struct ggi_mesa_info *info)