diff options
author | Brian Paul <[email protected]> | 2005-05-05 00:10:18 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2005-05-05 00:10:18 +0000 |
commit | 286c4cc201390e868c4f9b5ebe14c40db2d74a5d (patch) | |
tree | 333685288a4f9127477cc0218b2ae63583a0dc1a /src/mesa/swrast | |
parent | b3e878ad900b9ab9d417fb31175a116c9dc1edc8 (diff) |
more updates for users of s_spantemp.h
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_spantemp.h | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/src/mesa/swrast/s_spantemp.h b/src/mesa/swrast/s_spantemp.h index a60d45fb901..4ccf031cb26 100644 --- a/src/mesa/swrast/s_spantemp.h +++ b/src/mesa/swrast/s_spantemp.h @@ -124,32 +124,33 @@ NAME(put_row)( GLcontext *ctx, struct gl_renderbuffer *rb, } } -#if 00 +#if (FORMAT == GL_RGBA) || (FORMAT == GL_RGBA8) static void -NAME(write_rgb_span)( const GLcontext *ctx, struct gl_renderbuffer *rb, - GLuint count, GLint x, GLint y, - CONST GLchan rgb[][3], const GLubyte mask[] ) +NAME(put_row_rgb)( GLcontext *ctx, struct gl_renderbuffer *rb, + GLuint count, GLint x, GLint y, + const void *values, const GLubyte mask[] ) { #ifdef SPAN_VARS SPAN_VARS #endif +#if FORMAT == GL_RGBA + const GLchan (*src)[3] = (const GLchan (*)[3]) values; +#elif FORMAT == GL_RGBA8 + const GLubyte (*src)[3] = (const GLubyte (*)[3]) values; +#else +#error bad format +#endif GLuint i; INIT_PIXEL_PTR(pixel, x, y); - if (mask) { - for (i = 0; i < count; i++) { - if (mask[i]) { - STORE_RGB_PIXEL(pixel, x+i, y, rgb[i][RCOMP], rgb[i][GCOMP], - rgb[i][BCOMP]); - } - INC_PIXEL_PTR(pixel); - } - } - else { - for (i = 0; i < count; i++) { - STORE_RGB_PIXEL(pixel, x+i, y, rgb[i][RCOMP], rgb[i][GCOMP], - rgb[i][BCOMP]); - INC_PIXEL_PTR(pixel); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { +#ifdef STORE_PIXEL_RGB + STORE_PIXEL_RGB(pixel, x + i, y, src[i]); +#else + STORE_PIXEL(pixel, x + i, y, src[i]); +#endif } + INC_PIXEL_PTR(pixel); } } #endif @@ -245,5 +246,6 @@ NAME(put_mono_values)( GLcontext *ctx, struct gl_renderbuffer *rb, #undef INIT_PIXEL_PTR #undef INC_PIXEL_PTR #undef STORE_PIXEL +#undef STORE_PIXEL_RGB #undef FETCH_PIXEL #undef FORMAT |