diff options
author | mdaenzer <mdaenzer> | 2003-02-23 02:29:16 +0000 |
---|---|---|
committer | mdaenzer <mdaenzer> | 2003-02-23 02:29:16 +0000 |
commit | 55e21d4019358a13aa67422d9076d3c1472ada54 (patch) | |
tree | 1baf216b72ba29fff5c98fa45430077eeda43d6d /xc/lib/GL | |
parent | 3b9bd4e1718be9b77a7ab522aa622c36e8f99d68 (diff) |
endianness fixes
Diffstat (limited to 'xc/lib/GL')
-rw-r--r-- | xc/lib/GL/mesa/src/drv/r200/r200_maos_arrays.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/xc/lib/GL/mesa/src/drv/r200/r200_maos_arrays.c b/xc/lib/GL/mesa/src/drv/r200/r200_maos_arrays.c index 19ed677cb..501a04070 100644 --- a/xc/lib/GL/mesa/src/drv/r200/r200_maos_arrays.c +++ b/xc/lib/GL/mesa/src/drv/r200/r200_maos_arrays.c @@ -66,18 +66,18 @@ static void emit_ubyte_rgba3( GLcontext *ctx, int count ) { int i; - char *out = (char *)(rvb->start + rvb->address); + r200_color_t *out = (r200_color_t *)(rvb->start + rvb->address); if (R200_DEBUG & DEBUG_VERTS) fprintf(stderr, "%s count %d stride %d out %p\n", __FUNCTION__, count, stride, out); for (i = 0; i < count; i++) { - out[0] = *data; - out[1] = *(data+1); - out[2] = *(data+2); - out[3] = 0xFF; - out += 4; + out->red = *data; + out->green = *(data+1); + out->blue = *(data+2); + out->alpha = 0xFF; + out++; data += stride; } } @@ -118,13 +118,15 @@ static void emit_ubyte_rgba4( GLcontext *ctx, fprintf(stderr, "%s count %d stride %d\n", __FUNCTION__, count, stride); - if (stride == 4) - COPY_DWORDS( out, data, count ); - else + if (stride == 4) { + for (i = 0; i < count; i++) + ((int *)out)[i] = LE32_TO_CPU(((int *)data)[i]); + } else { for (i = 0; i < count; i++) { - *out++ = *(int *)data; + *(int *)out++ = LE32_TO_CPU(*(int *)data); data += stride; } + } } |