summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/glide
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2004-11-10 15:46:52 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2004-11-10 15:46:52 +0000
commit60909388ab136d849d99eab49e782a53772a618f (patch)
tree84a981ea2e79b5e6477d05991119a23efa4429a5 /src/mesa/drivers/glide
parentf00d7edd746e4d1eec2d497419f21fb3b04f8bd4 (diff)
GL_(UN)PACK_SKIP_IMAGES should only be applied to 3D texture pack/unpacking
and ignored for 1D and 2D images. Need to pass in image dimensions (1,2,3) to the _mesa_image_address() function. This change gets propogated to some other routines. Also added new _mesa_image_address[123]d() convenience functions.
Diffstat (limited to 'src/mesa/drivers/glide')
-rw-r--r--src/mesa/drivers/glide/fxdd.c68
1 files changed, 30 insertions, 38 deletions
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c
index 74d0dc008c..69c1d7e51a 100644
--- a/src/mesa/drivers/glide/fxdd.c
+++ b/src/mesa/drivers/glide/fxdd.c
@@ -525,10 +525,10 @@ fxDDDrawBitmap2 (GLcontext *ctx, GLint px, GLint py,
for (row = 0; row < height; row++) {
const GLubyte *src =
- (const GLubyte *) _mesa_image_address(finalUnpack,
- bitmap, width, height,
- GL_COLOR_INDEX, GL_BITMAP,
- 0, row, 0);
+ (const GLubyte *) _mesa_image_address2d(finalUnpack,
+ bitmap, width, height,
+ GL_COLOR_INDEX, GL_BITMAP,
+ row, 0);
if (finalUnpack->LsbFirst) {
/* least significan bit first */
GLubyte mask = 1U << (finalUnpack->SkipPixels & 0x7);
@@ -684,10 +684,10 @@ fxDDDrawBitmap4 (GLcontext *ctx, GLint px, GLint py,
for (row = 0; row < height; row++) {
const GLubyte *src =
- (const GLubyte *) _mesa_image_address(finalUnpack,
- bitmap, width, height,
- GL_COLOR_INDEX, GL_BITMAP,
- 0, row, 0);
+ (const GLubyte *) _mesa_image_address2d(finalUnpack,
+ bitmap, width, height,
+ GL_COLOR_INDEX, GL_BITMAP,
+ row, 0);
if (finalUnpack->LsbFirst) {
/* least significan bit first */
GLubyte mask = 1U << (finalUnpack->SkipPixels & 0x7);
@@ -762,9 +762,9 @@ fxDDReadPixels565 (GLcontext * ctx,
const GLint srcStride = info.strideInBytes / 2; /* stride in GLushorts */
const GLushort *src = (const GLushort *) info.lfbPtr
+ (winY - y) * srcStride + (winX + x);
- GLubyte *dst = (GLubyte *) _mesa_image_address(packing, dstImage,
+ GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing, dstImage,
width, height, format,
- type, 0, 0, 0);
+ type, 0, 0);
GLint dstStride =
_mesa_image_row_stride(packing, width, format, type);
@@ -875,9 +875,9 @@ fxDDReadPixels555 (GLcontext * ctx,
const GLint srcStride = info.strideInBytes / 2; /* stride in GLushorts */
const GLushort *src = (const GLushort *) info.lfbPtr
+ (winY - y) * srcStride + (winX + x);
- GLubyte *dst = (GLubyte *) _mesa_image_address(packing, dstImage,
+ GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing, dstImage,
width, height, format,
- type, 0, 0, 0);
+ type, 0, 0);
GLint dstStride =
_mesa_image_row_stride(packing, width, format, type);
@@ -988,9 +988,9 @@ fxDDReadPixels8888 (GLcontext * ctx,
const GLint srcStride = info.strideInBytes / 4; /* stride in GLuints */
const GLuint *src = (const GLuint *) info.lfbPtr
+ (winY - y) * srcStride + (winX + x);
- GLubyte *dst = (GLubyte *) _mesa_image_address(packing, dstImage,
+ GLubyte *dst = (GLubyte *) _mesa_image_address2d(packing, dstImage,
width, height, format,
- type, 0, 0, 0);
+ type, 0, 0);
GLint dstStride =
_mesa_image_row_stride(packing, width, format, type);
@@ -1155,9 +1155,8 @@ fxDDDrawPixels555 (GLcontext * ctx, GLint x, GLint y,
if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
GLint row;
for (row = 0; row < height; row++) {
- GLubyte *src = (GLubyte *) _mesa_image_address(finalUnpack, pixels,
- width, height, format,
- type, 0, row, 0);
+ GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack,
+ pixels, width, height, format, type, row, 0);
GLint col;
for (col = 0; col < width; col++) {
dst[col] = TDFXPACKCOLOR1555(src[2], src[1], src[0], src[3]);
@@ -1169,9 +1168,8 @@ fxDDDrawPixels555 (GLcontext * ctx, GLint x, GLint y,
else if (format == GL_RGB && type == GL_UNSIGNED_BYTE) {
GLint row;
for (row = 0; row < height; row++) {
- GLubyte *src = (GLubyte *) _mesa_image_address(finalUnpack, pixels,
- width, height, format,
- type, 0, row, 0);
+ GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack,
+ pixels, width, height, format, type, row, 0);
GLint col;
for (col = 0; col < width; col++) {
dst[col] = TDFXPACKCOLOR1555(src[2], src[1], src[0], 255);
@@ -1292,9 +1290,8 @@ fxDDDrawPixels565 (GLcontext * ctx, GLint x, GLint y,
if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
GLint row;
for (row = 0; row < height; row++) {
- GLubyte *src = (GLubyte *) _mesa_image_address(finalUnpack, pixels,
- width, height, format,
- type, 0, row, 0);
+ GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack,
+ pixels, width, height, format, type, row, 0);
GLint col;
for (col = 0; col < width; col++) {
dst[col] = TDFXPACKCOLOR565(src[2], src[1], src[0]);
@@ -1306,9 +1303,8 @@ fxDDDrawPixels565 (GLcontext * ctx, GLint x, GLint y,
else if (format == GL_RGB && type == GL_UNSIGNED_BYTE) {
GLint row;
for (row = 0; row < height; row++) {
- GLubyte *src = (GLubyte *) _mesa_image_address(finalUnpack, pixels,
- width, height, format,
- type, 0, row, 0);
+ GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack,
+ pixels, width, height, format, type, row, 0);
GLint col;
for (col = 0; col < width; col++) {
dst[col] = TDFXPACKCOLOR565(src[2], src[1], src[0]);
@@ -1429,9 +1425,8 @@ fxDDDrawPixels565_rev (GLcontext * ctx, GLint x, GLint y,
if (format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
GLint row;
for (row = 0; row < height; row++) {
- GLubyte *src = (GLubyte *) _mesa_image_address(finalUnpack, pixels,
- width, height, format,
- type, 0, row, 0);
+ GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack,
+ pixels, width, height, format, type, row, 0);
GLint col;
for (col = 0; col < width; col++) {
dst[col] = TDFXPACKCOLOR565(src[0], src[1], src[2]);
@@ -1443,9 +1438,8 @@ fxDDDrawPixels565_rev (GLcontext * ctx, GLint x, GLint y,
else if (format == GL_RGB && type == GL_UNSIGNED_BYTE) {
GLint row;
for (row = 0; row < height; row++) {
- GLubyte *src = (GLubyte *) _mesa_image_address(finalUnpack, pixels,
- width, height, format,
- type, 0, row, 0);
+ GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack,
+ pixels, width, height, format, type, row, 0);
GLint col;
for (col = 0; col < width; col++) {
dst[col] = TDFXPACKCOLOR565(src[0], src[1], src[2]);
@@ -1568,9 +1562,8 @@ fxDDDrawPixels8888 (GLcontext * ctx, GLint x, GLint y,
const GLint widthInBytes = width * 4;
GLint row;
for (row = 0; row < height; row++) {
- GLubyte *src = (GLubyte *) _mesa_image_address(finalUnpack, pixels,
- width, height, format,
- type, 0, row, 0);
+ GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack,
+ pixels, width, height, format, type, row, 0);
MEMCPY(dst, src, widthInBytes);
dst += dstStride;
}
@@ -1578,9 +1571,8 @@ fxDDDrawPixels8888 (GLcontext * ctx, GLint x, GLint y,
else if (format == GL_RGB && type == GL_UNSIGNED_BYTE) {
GLint row;
for (row = 0; row < height; row++) {
- GLubyte *src = (GLubyte *) _mesa_image_address(finalUnpack, pixels,
- width, height, format,
- type, 0, row, 0);
+ GLubyte *src = (GLubyte *) _mesa_image_address2d(finalUnpack,
+ pixels, width, height, format, type, 0, row, 0);
GLint col;
for (col = 0; col < width; col++) {
dst[col] = TDFXPACKCOLOR8888(src[2], src[1], src[0], 255);