Re: [AD] 4.9.20

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


On Mon, 2010-05-24 at 22:48 +1000, Peter Wang wrote:
> On 2010-05-17, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> > Probably overdue for one, so I'll make it this weekend.
> 
> * I ran into a regression on my machine.  The glyph precision fixes
> introduced artefacts, e.g. ex_color and ex_warp_mouse screenshots
> attached.  Any ideas?  This is on X11/fglrx.
> 
> * The X11 fullscreen work (xrandr/xinerama) makes ex_winfull crash on my
> machine with the 'new' X11 visual selection, but not the 'old' visual
> selection.  This sounds like the same problem that Elias encountered in
> r13182, although that was before the X11 fullscreen work.
> I'll try to look into it.
> 

Does the attached patch fix it? I was sure we fixed this problem in that
allegro.cc thread back then - will check if I maybe forgot to apply one
of the patches.

I also attached how the examples look with my nvidia driver - somehow it
manages to draw them right even with the non-integer positions.

-- 
Elias Pschernig <elias.pschernig@xxxxxxxxxx>
diff --git a/addons/font/font.c b/addons/font/font.c
index 552d6c4..c9511e5 100644
--- a/addons/font/font.c
+++ b/addons/font/font.c
@@ -153,7 +153,8 @@ static int color_render_char(const ALLEGRO_FONT* f, int ch, float x,
 
     g = _al_font_color_find_glyph(f, ch);
     if(g) {
-        al_draw_bitmap(g, x, y + ((float)h - al_get_bitmap_height(g))/2.0f, 0);
+        al_draw_bitmap(g, (int)x, (int)(
+            y + ((float)h - al_get_bitmap_height(g))/2.0f), 0);
 
         w = al_get_bitmap_width(g);
     }
diff --git a/addons/ttf/ttf.c b/addons/ttf/ttf.c
index 9a46d0a..108f44a 100644
--- a/addons/ttf/ttf.c
+++ b/addons/ttf/ttf.c
@@ -166,7 +166,8 @@ static int render_glyph(ALLEGRO_FONT const *f, int prev, int ch,
     if (measure_glyph)
         *measure_glyph = glyph;
     else
-        al_draw_bitmap(glyph->bitmap, xpos + glyph->x + advance, ypos + glyph->y, 0);
+        al_draw_bitmap(glyph->bitmap, (int)(xpos + glyph->x + advance),
+        (int)(ypos + glyph->y), 0);
 
     advance += glyph->advance;
 

Attachment: ex_color.png
Description: PNG image

Attachment: ex_warp_mouse.png
Description: PNG image



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