summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKendall Bennett <[email protected]>2003-10-02 23:50:44 +0000
committerKendall Bennett <[email protected]>2003-10-02 23:50:44 +0000
commitadbbea9b5123b7866cf5b31a6011b428b5ccc079 (patch)
tree00ad15d38aaac9c2d0b8fc5ccecf23b7308ea4cc
parenta75246f8f5fa951d62b6b40db5bf47517b50d459 (diff)
Fixed bugs in Mesa software span rendering for color index modes
-rw-r--r--src/mesa/main/glheader.h4
-rw-r--r--src/mesa/swrast/s_spantemp.h26
2 files changed, 19 insertions, 11 deletions
diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h
index 86827324688..0f93539a81b 100644
--- a/src/mesa/main/glheader.h
+++ b/src/mesa/main/glheader.h
@@ -278,7 +278,9 @@ typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESC
#endif
-#ifdef DEBUG
+#if defined(__SCITECH_SNAP__) && defined(CHECKED)
+# define ASSERT(X) _CHECK(X)
+#elif defined(DEBUG)
# define ASSERT(X) assert(X)
#else
# define ASSERT(X)
diff --git a/src/mesa/swrast/s_spantemp.h b/src/mesa/swrast/s_spantemp.h
index 3452b0b2842..c48b35b90a8 100644
--- a/src/mesa/swrast/s_spantemp.h
+++ b/src/mesa/swrast/s_spantemp.h
@@ -188,6 +188,7 @@ NAME(read_rgba_pixels)( const GLcontext *ctx,
SPAN_VARS
#endif
GLuint i;
+ ASSERT(mask);
for (i = 0; i < n; i++) {
if (mask[i]) {
INIT_PIXEL_PTR(pixel, x[i], y[i]);
@@ -221,9 +222,6 @@ NAME(write_index32_span)( const GLcontext *ctx, GLuint n, GLint x, GLint y,
INC_PIXEL_PTR(pixel);
}
}
- else if (sizeof(*pixel) == sizeof(GLuint)) {
- _mesa_memcpy(pixel, index, n * sizeof(GLuint));
- }
else {
for (i = 0; i < n; i++) {
STORE_CI_PIXEL(pixel, index[i]);
@@ -250,9 +248,6 @@ NAME(write_index8_span)( const GLcontext *ctx, GLuint n, GLint x, GLint y,
INC_PIXEL_PTR(pixel);
}
}
- else if (sizeof(*pixel) == sizeof(GLubyte)) {
- _mesa_memcpy(pixel, index, n * sizeof(GLubyte));
- }
else {
for (i = 0; i < n; i++) {
STORE_CI_PIXEL(pixel, index[i]);
@@ -271,12 +266,20 @@ NAME(write_monoindex_span)( const GLcontext *ctx, GLuint n, GLint x, GLint y,
#endif
GLuint i;
INIT_PIXEL_PTR(pixel, x, y);
- for (i = 0; i < n; i++) {
- if (mask[i]) {
+ if (mask) {
+ for (i = 0; i < n; i++) {
+ if (mask[i]) {
+ STORE_CI_PIXEL(pixel, colorIndex);
+ }
+ INC_PIXEL_PTR(pixel);
+ }
+ }
+ else {
+ for (i = 0; i < n; i++) {
STORE_CI_PIXEL(pixel, colorIndex);
+ INC_PIXEL_PTR(pixel);
}
- INC_PIXEL_PTR(pixel);
- }
+ }
}
@@ -289,6 +292,7 @@ NAME(write_index_pixels)( const GLcontext *ctx,
SPAN_VARS
#endif
GLuint i;
+ ASSERT(mask);
for (i = 0; i < n; i++) {
if (mask[i]) {
INIT_PIXEL_PTR(pixel, x[i], y[i]);
@@ -307,6 +311,7 @@ NAME(write_monoindex_pixels)( const GLcontext *ctx,
SPAN_VARS
#endif
GLuint i;
+ ASSERT(mask);
for (i = 0; i < n; i++) {
if (mask[i]) {
INIT_PIXEL_PTR(pixel, x[i], y[i]);
@@ -341,6 +346,7 @@ NAME(read_index_pixels)( const GLcontext *ctx,
SPAN_VARS
#endif
GLuint i;
+ ASSERT(mask);
for (i = 0; i < n; i++) {
if (mask[i] ) {
INIT_PIXEL_PTR(pixel, x[i], y[i]);