{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLubyte *s;
const char *t;
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLbyte *s;
const char *t;
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLushort *s;
const char *t;
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
else
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLshort *s;
const char *t;
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
else
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLuint *s;
const char *t;
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
else
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLint *s;
const char *t;
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
else
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
{
int i, j, k;
int newwidth, newheight;
+ int padBytes;
GLfloat *s;
const char *t;
newwidth = width / 2;
newheight = height / 2;
+ padBytes = ysize - (width*group_size);
s = dataout;
t = (const char *)datain;
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
else
}
t += group_size;
}
+ t += padBytes;
t += ysize;
}
}
glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
+#if 0
+ /* don't change ROW_LENGTH until the non-power-of-two path below */
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+#endif
level = userLevel;
/* level userLevel+1 is in srcImage; level userLevel already saved */
level = userLevel+1;
} else { /* user's image is *not* nice power-of-2 sized square */
+#if 1
+ /* see above */
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
+#endif
memreq = image_size(newwidth, newheight, format, type);
switch(type) {
case GL_UNSIGNED_BYTE:
int halfHeight= height / 2;
int halfDepth= depth / 2;
const char *src= (const char *)dataIn;
- int padBytes= rowSizeInBytes - (width * groupSizeInBytes);
+ int rowPadBytes= rowSizeInBytes - (width * groupSizeInBytes);
+ int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes);
int outIndex= 0;
assert((width == 1 || height == 1) && depth >= 2);
/* skip over to next horizontal square of 4 */
src+= groupSizeInBytes;
} /* for jj */
- src+= padBytes;
+ src+= rowPadBytes;
src+= rowSizeInBytes;
} /* for ii */
src+= elementSizeInBytes;
} /* for cc */
- src+= padBytes;
+ src+= rowPadBytes;
/* skip over to next vertical square of 4 */
src+= rowSizeInBytes;
} /* for jj */
+ src+= imagePadBytes;
src+= imageSizeInBytes;
} /* for ii */
int halfHeight= height / 2;
int halfDepth= depth / 2;
const char *src= (const char *) dataIn;
- int padBytes= rowSizeInBytes - (width*groupSizeInBytes);
+ int rowPadBytes= rowSizeInBytes - (width*groupSizeInBytes);
+ int imagePadBytes= imageSizeInBytes - (width*height*groupSizeInBytes);
int outIndex= 0;
for (dd= 0; dd < halfDepth; dd++) {
src+= groupSizeInBytes;
} /* for jj */
/* skip past pad bytes, if any, to get to next row */
- src+= padBytes;
+ src+= rowPadBytes;
/* src is at beginning of a row here, but it's the second row of
* the square block of 4 pixels that we just worked on so we
src+= rowSizeInBytes;
} /* for ii */
+ /* skip past pad bytes, if any, to get to next image */
+ src+= imagePadBytes;
+
src+= imageSizeInBytes;
} /* for dd */