const GLushort *s = ((const GLushort *) src);
GLuint i;
for (i = 0; i < n; i++) {
- dst[i][RCOMP] = UBYTE_TO_FLOAT( s[i] & 0xff );
- dst[i][GCOMP] = UBYTE_TO_FLOAT( s[i] >> 8 );
+ dst[i][RCOMP] = UBYTE_TO_FLOAT( s[i] >> 8 );
+ dst[i][GCOMP] = UBYTE_TO_FLOAT( s[i] & 0xff );
dst[i][BCOMP] = 0.0;
dst[i][ACOMP] = 1.0;
}
GLint i, GLint j, GLint k, GLfloat *texel )
{
const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- texel[RCOMP] = UBYTE_TO_FLOAT( s & 0xff );
- texel[GCOMP] = UBYTE_TO_FLOAT( s >> 8 );
+ texel[RCOMP] = UBYTE_TO_FLOAT( s >> 8 );
+ texel[GCOMP] = UBYTE_TO_FLOAT( s & 0xff );
texel[BCOMP] = 0.0;
texel[ACOMP] = 1.0;
}
{
const GLubyte *rgba = (const GLubyte *) texel;
GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- *dst = PACK_COLOR_88(rgba[GCOMP], rgba[RCOMP]);
+ *dst = PACK_COLOR_88(rgba[RCOMP], rgba[GCOMP]);
}
#endif