[AD] COLORCONV_KEEP_ALPHA

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


As suggested by Gideon Weems at a.cc, here is a patch to add a
COLORCONV_KEEP_ALPHA flag.  I have committed it; I hope that's okay.

http://www.allegro.cc/forums/view_thread.php?_id=507553

Peter
Index: docs/src/allegro._tx
===================================================================
RCS file: /cvsroot/alleg/allegro/docs/src/allegro._tx,v
retrieving revision 1.351
diff -u -r1.351 allegro._tx
--- docs/src/allegro._tx	10 Jul 2005 21:13:08 -0000	1.351
+++ docs/src/allegro._tx	17 Jul 2005 15:00:22 -0000
@@ -5258,6 +5258,8 @@
 				    // 24 &lt-&gt 32-bit
       COLORCONV_MOST                // all but hi/truecolor &lt-&gt 256
       COLORCONV_DITHER              // dither during all color reductions
+      COLORCONV_KEEP_ALPHA          // convert everything to current format
+                                    // unless it would lose alpha information
 <endblock>
    If you enable the COLORCONV_DITHER flag, dithering will be performed 
    whenever truecolor graphics are converted into a hicolor or paletted 
Index: include/allegro/gfx.h
===================================================================
RCS file: /cvsroot/alleg/allegro/include/allegro/gfx.h,v
retrieving revision 1.16
diff -u -r1.16 gfx.h
--- include/allegro/gfx.h	7 Mar 2005 22:55:22 -0000	1.16
+++ include/allegro/gfx.h	17 Jul 2005 15:00:22 -0000
@@ -378,6 +378,12 @@
                                      COLORCONV_REDUCE_TRUE_TO_HI |   \
                                      COLORCONV_24_EQUALS_32)
 
+#define COLORCONV_KEEP_ALPHA        (COLORCONV_TOTAL                 \
+                                     & ~(COLORCONV_32A_TO_8 |        \
+                                         COLORCONV_32A_TO_15 |       \
+                                         COLORCONV_32A_TO_16 |       \
+                                         COLORCONV_32A_TO_24))
+
 AL_FUNC(GFX_MODE_LIST *, get_gfx_mode_list, (int card));
 AL_FUNC(void, destroy_gfx_mode_list, (GFX_MODE_LIST *gfx_mode_list));
 AL_FUNC(void, set_color_depth, (int depth));


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