Re: [AD] Windowed drivers color conversion

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


> > Now, can you make it to be a common API, so we can use the same code
base
> > for all the windowed drivers? Or is it so tightly attached that this
would
> > break the Win32 port?
>
> Yes for the first question and no for the second one :-) I think. The
> prototype for all the functions is void _update_*(LPDDSURFACEDESC
src_desc,
> LPDDSURFACEDESC dest_desc), but the LPDDSURFACEDESC object actually
> describes a simple rectangle in (video) memory.

Ok, cool! Now, the first thing we need is to get rid of that Win32 native
parameter type; can you do it to accept different parameters?
Also, I've not seen a set of functions to convert truecolor to paletted
pixels... Have I missed something, or this type of conversion is not
supported by the asm code?

> > Of course we'd need both asm and C versions, for non i386 platforms...
>
> I'm ok to do the asm part; we must of course define first a common
> interface.

What about:

BLITTER_FUNC *_colconv_init(screen bitmap, pitch, allegro depth, real depth)
void _colconv_exit()

The first would check if conversion is needed (depths differ), and if not,
return NULL immediately. If they differ, a new internal temp bitmap is
allocated of the specified depth, and the screen bitmap being created (this
function is meant to be called inside the gfx driver init code) would be
altered to make its line pointers to point to the new temp bitmap lines (of
the wanted depth). The function would also save the real screen line
pointers in local module vars and return a blitter func that is aware of all
this, and should be in the form:

void _colconv_update_line_xx_to_yy(int line, int start_x, int end_x)

These three functions should all be in a separated module IMO, and the
windowed gfx drivers should take care about calling the line updater when
needed, inside the driver line switching routines (as it already is in X and
BeOS, don't know about Win32)

Of course this is just a general idea. Now give your opinions and details on
it!

--
Angelo Mottola
a.mottola@xxxxxxxxxx
http://www.ecplusplus.com



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