[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: [AD] truecolor fonts
- From: Milan Mimica <milan.mimica@xxxxxxxxxx>
- Date: Mon, 27 Mar 2006 19:03:17 +0200
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:subject:content-type; b=SxPKo0nCwdVaeCCUXVTTTVNRR3xdFFyYed7nPoGp3YDMjyZ5fDJhp875ID+3XQGe03io5mfijuYBj3mJSU0uSNVkLq1YgkP6tCtEnO8599RhpBUVwkQTMkcok6CCIUMBXIByrpwWo6jy9ZsD3L4SEQKLuPbqF2w7l60o87O8qe0=
This one fixes truecolor fonts displaying. Based on some patch from Elias.
--
Milan Mimica
http://sparklet.sf.net
Index: src/fontconv.c
===================================================================
RCS file: /cvsroot/allegrogl/alleggl/src/fontconv.c,v
retrieving revision 1.39
diff -u -p -r1.39 fontconv.c
--- src/fontconv.c 21 Jan 2006 16:43:35 -0000 1.39
+++ src/fontconv.c 27 Mar 2006 16:56:54 -0000
@@ -389,7 +389,13 @@ static FONT_AGL_DATA* copy_glyph_range(F
free(coords);
return NULL;
}
- clear_bitmap(bmp);
+
+ if (fad->format == GL_RGBA) {
+ clear_to_color(bmp, bitmap_mask_color(bmp));
+ }
+ else {
+ clear_bitmap(bmp);
+ }
/* blit every glyph from the range to the new bitmap */
w = 0;
@@ -1525,7 +1525,12 @@ static int draw_glyphs(BITMAP *bmp, FONT
destroy_bitmap(rgbbmp);
}
else {
- clear_bitmap(bmp);
+ if (format == GL_RGBA8) {
+ clear_to_color(bmp, bitmap_mask_color(bmp));
+ }
+ else {
+ clear_bitmap(bmp);
+ }
for (i = 0; i < end - beg; i++) {
usetc(buf + usetc(buf, glyphs[i].glyph_num + beg), 0);
@@ -1837,6 +1861,10 @@ static GLuint aglf_upload_texture(BITMAP
|| format == 1) {
flags |= AGL_TEXTURE_ALPHA_ONLY;
}
+
+ if (format == GL_RGBA8)
+ flags |= AGL_TEXTURE_MASKED;
+
TRACE("* Want texture format: 0x%x\n", format);
texture = allegro_gl_make_texture_ex(flags, bmp, format);