-/* $Id: svgamesa8.c,v 1.2 2000/01/22 20:08:36 brianp Exp $ */
+/* $Id: svgamesa8.c,v 1.6 2000/06/14 21:59:07 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.2
+ * Version: 3.3
* Copyright (C) 1995-2000 Brian Paul
*
* This library is free software; you can redistribute it and/or
* Additional authors: Slawomir Szczyrba <steev@hot.pl> (Mesa 3.2)
*/
+#ifdef HAVE_CONFIG_H
+#include "conf.h"
+#endif
+
+#ifdef SVGA
+
#include "svgapix.h"
+#include "svgamesa8.h"
-int __svga_drawpixel8(int x, int y, unsigned long c)
+static void __svga_drawpixel8(int x, int y, unsigned long c)
{
unsigned long offset;
-
y = SVGAInfo->height-y-1;
offset = y * SVGAInfo->linewidth + x;
- SVGABuffer.BackBuffer[offset]=c;
-
- return 0;
+ SVGABuffer.DrawBuffer[offset]=c;
}
-unsigned long __svga_getpixel8(int x, int y)
+static unsigned long __svga_getpixel8(int x, int y)
{
unsigned long offset;
-
y = SVGAInfo->height-y-1;
offset = y * SVGAInfo->linewidth + x;
- return SVGABuffer.BackBuffer[offset];
+ return SVGABuffer.ReadBuffer[offset];
}
void __set_index8( GLcontext *ctx, GLuint index )
{
int i,j;
- if (mask & GL_COLOR_BUFFER_BIT) {
-
- if (all)
- {
- memset(SVGABuffer.BackBuffer,SVGAMesa->clear_index,SVGABuffer.BufferSize);
- } else {
- for (i=x;i<width;i++)
- for (j=y;j<height;j++)
- __svga_drawpixel8(i,j,SVGAMesa->clear_index);
- }
- }
- return mask & (~GL_COLOR_BUFFER_BIT);
+ if (mask & DD_FRONT_LEFT_BIT) {
+ if (all) {
+ memset(SVGABuffer.FrontBuffer, SVGAMesa->clear_index, SVGABuffer.BufferSize);
+ }
+ else {
+ GLubyte *tmp = SVGABuffer.DrawBuffer;
+ SVGABuffer.DrawBuffer = SVGABuffer.FrontBuffer;
+ for (i=x;i<width;i++)
+ for (j=y;j<height;j++)
+ __svga_drawpixel8(i,j,SVGAMesa->clear_index);
+ SVGABuffer.DrawBuffer = tmp;
+ }
+ }
+ if (mask & DD_BACK_LEFT_BIT) {
+ if (all) {
+ memset(SVGABuffer.BackBuffer, SVGAMesa->clear_index, SVGABuffer.BufferSize);
+ }
+ else {
+ GLubyte *tmp = SVGABuffer.DrawBuffer;
+ SVGABuffer.DrawBuffer = SVGABuffer.BackBuffer;
+ for (i=x;i<width;i++)
+ for (j=y;j<height;j++)
+ __svga_drawpixel8(i,j,SVGAMesa->clear_index);
+ SVGABuffer.DrawBuffer = tmp;
+ }
+ }
+ return mask & (~(DD_FRONT_LEFT_BIT | DD_BACK_LEFT_BIT));
}
void __write_ci32_span8( const GLcontext *ctx, GLuint n, GLint x, GLint y,
}
}
+
+#else
+
+
+/* silence compiler warning */
+extern void _mesa_svga8_dummy_function(void);
+void _mesa_svga8_dummy_function(void)
+{
+}
+
+
+#endif