Re: [AD] Old problems that still persist on Allegro 4.2 beta 3

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


On Fri, 2005-05-27 at 17:30 +0200, Elias Pschernig wrote:
> > 
> > Some quick thoughts, I'll have a closer look later today.
> > 
> > -   num = end - begin+1;
> > +   num = end - begin;
> 

Just found this :)

typedef struct FONT_MONO_DATA 
{
   int begin, end;                  /* first char and one-past-the-end char */
   FONT_GLYPH **glyphs;             /* our glyphs */
   struct FONT_MONO_DATA *next;     /* linked list structure */
} FONT_MONO_DATA;

typedef struct FONT_COLOR_DATA
{
   int begin, end;                  /* first char and one-past-the-end char */
   BITMAP **bitmaps;                /* our glyphs */
   struct FONT_COLOR_DATA *next;    /* linked list structure */
} FONT_COLOR_D

So yeah, needs changing, and also for mono data. And I found some more
places where it is wrong, should I fix them and commit?

Oh, and what do you think about a function:

void attach_font(FONT *font1, FONT *font2)

Which would attach font2 to font1. The only advantage over
color_merge_fonts would be efficiency. E.g. if there are 10 font ranges
which should be merged to a single font, and each range has 100 glyphs,
then with merge_font there are:
9 font creations and 19 destructions, with 1+2+3+4+5+6+7+8+9 = 45 range
creations (4500 create_bitmaps calls) and 36 range destructions... and
so on... compared to the old grabber who used 0. attach_font would be as
efficient as the old grabber again.

-- 
Elias Pschernig





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