[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] truecolor fonts
- From: "Peter Hull" <peterhull90@xxxxxxxxxx>
- Date: Mon, 27 Mar 2006 19:45:20 +0100
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=PAAbujHJ/U0qZXGpbuQIHAr4Ki22NYMQeSGelbRYZbKCvbRmuERzxgVjrEyvNZ1EVpsf8NGpgVcHbehgP5g/rRMLCG3OpuUB/8jD5eKUpzluKOr+InaCmDamDv43jjvy2tXuxlQt7FaPrFd0UbWMyxOJlLBKz5ZawEhNwDo0hQk=
In this part:
+
+ if (fad->format == GL_RGBA) {
+ clear_to_color(bmp, bitmap_mask_color(bmp));
+ }
+ else {
+ clear_bitmap(bmp);
+ }
Would just
+ clear_to_color(bmp, bitmap_mask_color(bmp));
work?
Pete
On 27/03/06, Milan Mimica <
milan.mimica@xxxxxxxxxx> wrote: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);