summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-04-26 18:43:22 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-04-26 18:43:22 +0000
commitedc16a5f7a89584490be0824a1d96e2f3426998b (patch)
treed07a27e528522b93bf3dfdb5e5ac0fd6e8484a85 /src/mesa
parente440bcf41a9d21d3e0b118472564eedaf09b44fe (diff)
fix a few stride computations in _mesa_texstore_rgba()
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/texstore.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index fab0fad3b4..2b614e90d3 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -560,7 +560,7 @@ swizzle_copy(GLubyte *dst, GLuint dstComponents, const GLubyte *src,
GLuint srcComponents, const GLubyte *map, GLuint count)
{
GLubyte tmp[8];
- GLint i;
+ GLuint i;
tmp[ZERO] = 0x0;
tmp[ONE] = 0xff;
@@ -637,6 +637,8 @@ _mesa_swizzle_ubyte_image(GLcontext *ctx,
+ dstYoffset * dstRowStride
+ dstXoffset * dstComponents;
+ (void) ctx;
+
compute_component_mapping(srcFormat, GL_RGBA, srcmap);
for (i = 0; i < 4; i++)
@@ -790,10 +792,10 @@ _mesa_texstore_rgba(GLcontext *ctx, GLuint dims,
srcType == CHAN_TYPE) {
/* extract RGB from RGBA */
int img, row, col;
- GLchan *dstImage = (GLchan *) (GLubyte *) dstAddr
- + dstZoffset * dstImageStride
- + dstYoffset * dstRowStride
- + dstXoffset * dstFormat->TexelBytes;
+ GLchan *dstImage = (GLchan *) ((GLubyte *) dstAddr
+ + dstZoffset * dstImageStride
+ + dstYoffset * dstRowStride
+ + dstXoffset * dstFormat->TexelBytes);
for (img = 0; img < srcDepth; img++) {
const GLint srcRowStride = _mesa_image_row_stride(srcPacking,
srcWidth, srcFormat, srcType);
@@ -806,10 +808,10 @@ _mesa_texstore_rgba(GLcontext *ctx, GLuint dims,
dstRow[col * 3 + GCOMP] = srcRow[col * 4 + GCOMP];
dstRow[col * 3 + BCOMP] = srcRow[col * 4 + BCOMP];
}
- dstRow += dstRowStride;
+ dstRow += dstRowStride / sizeof(GLchan);
srcRow = (GLchan *) ((GLubyte *) srcRow + srcRowStride);
}
- dstImage += dstImageStride;
+ dstImage += dstImageStride / sizeof(GLchan);
}
}
else {