-/* $Id: imports.c,v 1.9 2001/03/27 19:18:02 gareth Exp $ */
+/* $Id: imports.c,v 1.10 2001/07/16 15:54:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
/* Must be before '#undef getenv' for inclusion in XFree86.
*/
-static char *
+static char * CAPI
_mesa_getenv(__GLcontext *gc, const char *var)
{
(void) gc;
abort();
}
-static int
+static int CAPI
_mesa_atoi(__GLcontext *gc, const char *str)
{
(void) gc;
return atoi(str);
}
-static int
+static int CAPI
_mesa_sprintf(__GLcontext *gc, char *str, const char *fmt, ...)
{
/* XXX fix this */
return sprintf(str, fmt);
}
-static void *
+static void * CAPI
_mesa_fopen(__GLcontext *gc, const char *path, const char *mode)
{
return fopen(path, mode);
}
-static int
+static int CAPI
_mesa_fclose(__GLcontext *gc, void *stream)
{
return fclose((FILE *) stream);
}
-static int
+static int CAPI
_mesa_fprintf(__GLcontext *gc, void *stream, const char *fmt, ...)
{
/* XXX fix this */
-/* $Id: texstore.c,v 1.31 2001/07/13 20:07:37 brianp Exp $ */
+/* $Id: texstore.c,v 1.32 2001/07/16 15:54:23 brianp Exp $ */
/*
* Mesa 3-D graphics library
const GLint srcRowStride = _mesa_image_row_stride(srcPacking,
srcWidth, srcFormat, srcType);
const GLint widthInBytes = srcWidth * texComponents * sizeof(GLchan);
- GLchan *dst = (GLchan *) texDestAddr + dstYoffset * dstRowStride
- + dstXoffset * texComponents;
+ GLchan *dst = (GLchan *) texDestAddr
+ + dstYoffset * (dstRowStride / sizeof(GLchan))
+ + dstXoffset * texComponents;
if (srcRowStride == widthInBytes && dstRowStride == widthInBytes) {
MEMCPY(dst, src, srcHeight * widthInBytes);
}
GLint i;
for (i = 0; i < srcHeight; i++) {
MEMCPY(dst, src, widthInBytes);
- src += srcRowStride;
- dst += dstRowStride;
+ src += (srcRowStride / sizeof(GLchan));
+ dst += (dstRowStride / sizeof(GLchan));
}
}
return; /* all done */
srcFormat, srcType, 0, 0, 0);
const GLint srcRowStride = _mesa_image_row_stride(srcPacking,
srcWidth, srcFormat, srcType);
- GLchan *dst = (GLchan *) texDestAddr + dstYoffset * dstRowStride
- + dstXoffset * texComponents;
+ GLchan *dst = (GLchan *) texDestAddr
+ + dstYoffset * (dstRowStride / sizeof(GLchan))
+ + dstXoffset * texComponents;
GLint i, j;
for (i = 0; i < srcHeight; i++) {
const GLchan *s = src;
*d++ = *s++; /*blue*/
s++; /*alpha*/
}
- src += srcRowStride;
- dst += dstRowStride;
+ src += (srcRowStride / sizeof(GLchan));
+ dst += (dstRowStride / sizeof(GLchan));
}
return; /* all done */
}
const GLenum texType = CHAN_TYPE;
GLint img, row;
GLchan *dest = (GLchan *) texDestAddr + dstZoffset * dstImageStride
- + dstYoffset * dstRowStride
- + dstXoffset * texComponents;
+ + dstYoffset * (dstRowStride / sizeof(GLchan))
+ + dstXoffset * texComponents;
for (img = 0; img < srcDepth; img++) {
GLchan *destRow = dest;
for (row = 0; row < srcHeight; row++) {
srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0);
_mesa_unpack_index_span(ctx, srcWidth, texType, destRow,
srcType, src, srcPacking, transferOps);
- destRow += dstRowStride;
+ destRow += (dstRowStride / sizeof(GLchan));
}
dest += dstImageStride;
}
GLint img, row;
GLubyte *dest = (GLubyte *) texDestAddr
+ dstZoffset * dstImageStride
- + dstYoffset * dstRowStride
+ + dstYoffset * (dstRowStride / sizeof(GLchan))
+ dstXoffset * texComponents;
for (img = 0; img < srcDepth; img++) {
GLubyte *destRow = dest;
srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0);
_mesa_unpack_depth_span(ctx, srcWidth, (GLfloat *) destRow,
srcType, src, srcPacking);
- destRow += dstRowStride;
+ destRow += (dstRowStride / sizeof(GLchan));
}
dest += dstImageStride;
}
/* packing and transfer ops after convolution */
srcf = convImage;
dest = (GLchan *) texDestAddr + (dstZoffset + img) * dstImageStride
- + dstYoffset * dstRowStride;
+ + dstYoffset * (dstRowStride / sizeof(GLchan));
for (row = 0; row < convHeight; row++) {
_mesa_pack_float_rgba_span(ctx, convWidth,
(const GLfloat (*)[4]) srcf,
transferOps
& IMAGE_POST_CONVOLUTION_BITS);
srcf += convWidth * 4;
- dest += dstRowStride;
+ dest += (dstRowStride / sizeof(GLchan));
}
}
*/
GLint img, row;
GLchan *dest = (GLchan *) texDestAddr + dstZoffset * dstImageStride
- + dstYoffset * dstRowStride
- + dstXoffset * texComponents;
+ + dstYoffset * (dstRowStride / sizeof(GLchan))
+ + dstXoffset * texComponents;
for (img = 0; img < srcDepth; img++) {
GLchan *destRow = dest;
for (row = 0; row < srcHeight; row++) {
_mesa_unpack_chan_color_span(ctx, srcWidth, texDestFormat,
destRow, srcFormat, srcType, srcRow,
srcPacking, transferOps);
- destRow += dstRowStride;
+ destRow += (dstRowStride / sizeof(GLchan));
}
dest += dstImageStride;
}