diff options
| author | Daniel Borca <dborca@users.sourceforge.net> | 2004-10-18 07:49:26 +0000 | 
|---|---|---|
| committer | Daniel Borca <dborca@users.sourceforge.net> | 2004-10-18 07:49:26 +0000 | 
| commit | 13ec04c480a9b681f35b191d93e5aa00ded70b54 (patch) | |
| tree | c0ffdabb78de049e5e59a6dddbe4ba4b6606b7f1 | |
| parent | b430a1ae226308c04dab2a62b5e9127dfed25b2c (diff) | |
use RowStride instead of Width in texel fetchers.
changed some pointers to be (char *) instead of (long)
| -rw-r--r-- | src/mesa/main/texcompress_fxt1.c | 22 | 
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index c33a003737..ec7971e91f 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -178,7 +178,7 @@ fetch_texel_2d_rgba_fxt1( const struct gl_texture_image *texImage,                            GLint i, GLint j, GLint k, GLchan *texel )  {     (void) k; -   fxt1_decode_1(texImage->Data, texImage->Width, i, j, texel); +   fxt1_decode_1(texImage->Data, texImage->RowStride, i, j, texel);  } @@ -189,7 +189,7 @@ fetch_texel_2d_f_rgba_fxt1( const struct gl_texture_image *texImage,     /* just sample as GLchan and convert to float here */     GLchan rgba[4];     (void) k; -   fxt1_decode_1(texImage->Data, texImage->Width, i, j, rgba); +   fxt1_decode_1(texImage->Data, texImage->RowStride, i, j, rgba);     texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);     texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);     texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]); @@ -202,7 +202,7 @@ fetch_texel_2d_rgb_fxt1( const struct gl_texture_image *texImage,                           GLint i, GLint j, GLint k, GLchan *texel )  {     (void) k; -   fxt1_decode_1(texImage->Data, texImage->Width, i, j, texel); +   fxt1_decode_1(texImage->Data, texImage->RowStride, i, j, texel);     texel[ACOMP] = 255;  } @@ -214,7 +214,7 @@ fetch_texel_2d_f_rgb_fxt1( const struct gl_texture_image *texImage,     /* just sample as GLchan and convert to float here */     GLchan rgba[4];     (void) k; -   fxt1_decode_1(texImage->Data, texImage->Width, i, j, rgba); +   fxt1_decode_1(texImage->Data, texImage->RowStride, i, j, rgba);     texel[RCOMP] = CHAN_TO_FLOAT(rgba[RCOMP]);     texel[GCOMP] = CHAN_TO_FLOAT(rgba[GCOMP]);     texel[BCOMP] = CHAN_TO_FLOAT(rgba[BCOMP]); @@ -1548,7 +1548,7 @@ static unsigned char _rgb_scale_6[] = {  static void -fxt1_decode_1HI (unsigned long code, int t, unsigned char *rgba) +fxt1_decode_1HI (unsigned char *code, int t, unsigned char *rgba)  {     const unsigned long *cc; @@ -1579,7 +1579,7 @@ fxt1_decode_1HI (unsigned long code, int t, unsigned char *rgba)  static void -fxt1_decode_1CHROMA (unsigned long code, int t, unsigned char *rgba) +fxt1_decode_1CHROMA (unsigned char *code, int t, unsigned char *rgba)  {     const unsigned long *cc;     unsigned long kk; @@ -1602,7 +1602,7 @@ fxt1_decode_1CHROMA (unsigned long code, int t, unsigned char *rgba)  static void -fxt1_decode_1MIXED (unsigned long code, int t, unsigned char *rgba) +fxt1_decode_1MIXED (unsigned char *code, int t, unsigned char *rgba)  {     const unsigned long *cc;     unsigned int col[2][3]; @@ -1680,7 +1680,7 @@ fxt1_decode_1MIXED (unsigned long code, int t, unsigned char *rgba)  static void -fxt1_decode_1ALPHA (unsigned long code, int t, unsigned char *rgba) +fxt1_decode_1ALPHA (unsigned char *code, int t, unsigned char *rgba)  {     const unsigned long *cc; @@ -1752,7 +1752,7 @@ void  fxt1_decode_1 (const void *texture, int width,                 int i, int j, unsigned char *rgba)  { -   static void (*decode_1[]) (unsigned long, int, unsigned char *) = { +   static void (*decode_1[]) (unsigned char *, int, unsigned char *) = {        fxt1_decode_1HI,     /* cc-high   = "00?" */        fxt1_decode_1HI,     /* cc-high   = "00?" */        fxt1_decode_1CHROMA, /* cc-chroma = "010" */ @@ -1763,8 +1763,8 @@ fxt1_decode_1 (const void *texture, int width,        fxt1_decode_1MIXED   /* mixed     = "1??" */     }; -   unsigned long code = (unsigned long)texture + -                        ((j / 4) * (width / 8) + (i / 8)) * 16; +   unsigned char *code = (unsigned char *)texture + +                         ((j / 4) * (width / 8) + (i / 8)) * 16;     int mode = CC_SEL((unsigned long *)code, 125);     int t = i & 7;  | 
