Re: [AD] cleaning up....

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


ICRUZBAL <ICRUZBAL@xxxxxxxxxxx> writes:

> > I think it should take pointers to functions which take line number
> > and return pointer to the beginning of that line.  Then these
> > functions may call bank switching routines if necessary (it might be
> > necessary for DGA driver).
> > 
> > /* From one Allegro format to another Allegro format.  */
> > void update_bpp_to_bpp (unsigned char *(*get_src_line) (int line),
> >                        unsigned char *(*get_dst_line) (int line),
> >                        int x, int y, int w, int h);
> 
> Too complicated... Why don't perform bank switching out of these 
> functions? in Windows it's not necessary, and two calls to functions 
> for each line will be a huge overhead

One function, if source bitmap is always Allegro memory bitmap.
It can be designed to update rectangular region, or to update section
of one line.  In the first case it might be necessary to call bank
switching routine when switching between lines, in the second case it
will be necessary to call line update routine for each line.  I don't
see huge difference here. IMHO, there will be no big difference
between version which uses (unsigned char**) for destination and
version which uses (unsigned char *(*bank_switch) (int line)) for
destination.

We can make two versions, with and without bank switching, but IMHO,
for most programs there will be small (if any) difference between
them.

> 
> lookup tables are great if source or dest are 8 bit, but IMHO with for 
> example 16 to 32, it's better to use shifts than a table of 64K 
> entries, if using MMX you can convert 2/4/8 pixels at the same time

X version supports destination truecolor formats with any reasonable
amount of bits per r,g,b components.  I have not even tried to make
generic version using shifts, so I can not say anything about possible
speed difference.

-- 
Michael Bukin



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