Re: [AD] Colorconv blitters

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Please find attached a patch to remove the byteswapping part.

Pete

Evert Glebbeek wrote:

It still has to go byte-by-byte via _colorconv_rgb_map[], though, or
doesn't
it? I don't quite understand that code fully.

Ah yes, you're quite right. I don't think I use the colourmap features much, so I mentally skipped over that part. ;)
Still shouldn't need endianesse conversions though.

Evert


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl



Index: src/misc/ccolconv.c
===================================================================
RCS file: /cvsroot/alleg/allegro/src/misc/ccolconv.c,v
retrieving revision 1.4
diff -u -r1.4 ccolconv.c
--- src/misc/ccolconv.c	10 Apr 2005 14:12:31 -0000	1.4
+++ src/misc/ccolconv.c	23 Oct 2005 16:50:00 -0000
@@ -50,30 +50,18 @@
    for (y = src_rect->height; y; y--) {
       for (x = width >> 2; x; x--) {
          src_data = *(unsigned int *)src;
-#ifdef ALLEGRO_LITTLE_ENDIAN
 	 dest_data = _colorconv_rgb_map[src_data & 0xff];
 	 dest_data |= (_colorconv_rgb_map[(src_data >> 8) & 0xff] << 8);
 	 dest_data |= (_colorconv_rgb_map[(src_data >> 16) & 0xff] << 16);
 	 dest_data |= (_colorconv_rgb_map[src_data >> 24] << 24);
-#else
-	 dest_data = _colorconv_rgb_map[(src_data >> 24) & 0xff];
-	 dest_data |= (_colorconv_rgb_map[(src_data >> 16) & 0xff] << 8);
-	 dest_data |= (_colorconv_rgb_map[(src_data >> 8) & 0xff] << 16);
-	 dest_data |= (_colorconv_rgb_map[src_data & 0xff] << 24);
-#endif
 	 *(unsigned int *)dest = dest_data;
 	 src += 4;
 	 dest += 4;
       }
       if (width & 0x2) {
          src_data = *(unsigned short *)src;
-#ifdef ALLEGRO_LITTLE_ENDIAN
 	 dest_data = _colorconv_rgb_map[src_data & 0xff];
 	 dest_data |= (_colorconv_rgb_map[src_data >> 8] << 8);
-#else
-	 dest_data = _colorconv_rgb_map[src_data & 0xff] << 8;
-	 dest_data |= _colorconv_rgb_map[src_data >> 8];
-#endif
 	 *(unsigned short *)dest = (unsigned short)dest_data;
 	 src += 2;
 	 dest += 2;



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/