-/* $Id: texstore.c,v 1.35 2002/03/19 16:47:05 brianp Exp $ */
+/* $Id: texstore.c,v 1.36 2002/04/04 16:59:05 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.2
+ * Version: 4.1
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
/* color index texture */
const GLenum texType = CHAN_TYPE;
GLint img, row;
- GLchan *dest = (GLchan *) texDestAddr + dstZoffset * dstImageStride
+ GLchan *dest = (GLchan *) texDestAddr
+ + dstZoffset * (dstImageStride / sizeof(GLchan))
+ dstYoffset * (dstRowStride / sizeof(GLchan))
+ dstXoffset * texComponents;
for (img = 0; img < srcDepth; img++) {
/* packing and transfer ops after convolution */
srcf = convImage;
- dest = (GLchan *) texDestAddr + (dstZoffset + img) * dstImageStride
+ dest = (GLchan *) texDestAddr
+ + (dstZoffset + img) * (dstImageStride / sizeof(GLchan))
+ dstYoffset * (dstRowStride / sizeof(GLchan));
for (row = 0; row < convHeight; row++) {
_mesa_pack_float_rgba_span(ctx, convWidth,
* no convolution
*/
GLint img, row;
- GLchan *dest = (GLchan *) texDestAddr + dstZoffset * dstImageStride
+ GLchan *dest = (GLchan *) texDestAddr
+ + dstZoffset * (dstImageStride / sizeof(GLchan))
+ dstYoffset * (dstRowStride / sizeof(GLchan))
+ dstXoffset * texComponents;
for (img = 0; img < srcDepth; img++) {
srcPacking, transferOps);
destRow += (dstRowStride / sizeof(GLchan));
}
- dest += dstImageStride;
+ dest += dstImageStride / sizeof(GLchan);
}
}
}
* srcWidth, srcHeight, srcDepth - size of source iamge
* dstX/Y/Zoffset - as specified by glTexSubImage
* dstRowStride - stride between dest rows in bytes
- * dstImagetride - stride between dest images in bytes
+ * dstImageStride - stride between dest images in bytes
* srcFormat, srcType - incoming image format and datatype
* srcAddr - source image address
* srcPacking - packing params of source image