diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2001-08-14 14:08:44 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2001-08-14 14:08:44 +0000 |
commit | 60174c1aef7c6650a800f16f103a4f9ed2d1004e (patch) | |
tree | 6d3f3866ab1ac2506e79637685f1a0432759e2bb /src/mesa/swrast/s_texture.c | |
parent | 76a52525c7edcefcb40a1cbc9ce88d6c6e402f1a (diff) |
Fixes for 32-bit GLchans: smooth/flat/textured triangles seem to work now.
Diffstat (limited to 'src/mesa/swrast/s_texture.c')
-rw-r--r-- | src/mesa/swrast/s_texture.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index 3d8b41de60..9c3e2c5b5f 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -1,4 +1,4 @@ -/* $Id: s_texture.c,v 1.37 2001/08/07 22:05:11 brianp Exp $ */ +/* $Id: s_texture.c,v 1.38 2001/08/14 14:08:44 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -910,8 +910,7 @@ opt_sample_rgba_2d( GLcontext *ctx, GLuint texUnit, const GLint colMask = img->Width - 1; const GLint rowMask = img->Height - 1; const GLint shift = img->WidthLog2; - GLuint k; - GLchan (*ptr_rgba)[4] = rgba; + GLuint i; (void) u; (void) lambda; ASSERT(tObj->WrapS==GL_REPEAT); @@ -919,12 +918,12 @@ opt_sample_rgba_2d( GLcontext *ctx, GLuint texUnit, ASSERT(img->Border==0); ASSERT(img->Format==GL_RGBA); - for (k=0; k<n; k++, ptr_rgba ++) { - GLint i = IFLOOR(s[k] * width) & colMask; - GLint j = IFLOOR(t[k] * height) & rowMask; - GLint pos = (j << shift) | i; - GLchan *texel = ((GLchan *) img->Data) + (pos << 2); /* pos*4 */ - COPY_CHAN4 (ptr_rgba, texel); + for (i = 0; i < n; i++) { + const GLint col = IFLOOR(s[i] * width) & colMask; + const GLint row = IFLOOR(t[i] * height) & rowMask; + const GLint pos = (row << shift) | col; + const GLchan *texel = ((GLchan *) img->Data) + (pos << 2); /* pos*4 */ + COPY_CHAN4(rgba[i], texel); } } |