Re: [AD] Font drawing bug |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Trent Gamblin wrote:
Yes we should. It would be simple.. just a call to
al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, al_map_rgb(255, 255,
255));... that should do a straight copy. Well, it appears that the
font addon does that already.
It doesn't. Here's the patch.
I think we need a al_push_blender()/al_pop_blender().
--
Milan Mimica
http://sparklet.sf.net
Index: addons/font/fontbmp.c
===================================================================
--- addons/font/fontbmp.c (revision 10327)
+++ addons/font/fontbmp.c (working copy)
@@ -206,6 +206,8 @@
int end = -1;
A5FONT_FONT *f;
A5FONT_FONT_COLOR_DATA* cf;
+ int src_mode, dst_mode;
+ ALLEGRO_COLOR blend_color, white;
ASSERT(bmp)
import_x = 0;
@@ -227,8 +229,14 @@
return 0;
al_set_target_bitmap(cf->glyphs);
+
+ al_get_blender(&src_mode, &dst_mode, &blend_color);
+ white = al_map_rgb(255, 255, 255);
+ al_set_blender(ALLEGRO_ONE, ALLEGRO_ZERO, white);
+
al_draw_bitmap(bmp, 0, 0, 0);
+ al_set_blender(src_mode, dst_mode, blend_color);
_al_pop_target_bitmap();
_al_pop_new_bitmap_parameters();