[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Bit-Depth and Graphics stuff....



Le Wed, 7 Jul 2010 20:17:01 +0200
Peter Persson <pep.fishmoose@gmail.com> a écrit:

> 7 jul 2010 kl. 20.09 skrev Jo Even Skarstein:
> 
> > No, the way to do this is to first transform the bitmaps to a generic
> > format (such a format already exists in VDI for 8 bit and less), and
> > then transform this generic format to the screen format.
> 
> Is this a good idea in truecolor?
> 
> To be honest, it's not even a good idea in palette modes, because performance is just horrible. A chunky2planar conversion -> buffer which is then blitted to the screen is just so much faster.
> Using the Device Independent format in 8bpp chunky just means losing tons of CPU, because you'll first convert a chunky bitmap to consecutive planes, then the VDI will convert that image back to chunky.
> 
> Since he has to add custom code for hicolor/truecolor, wouldn't it make sense to add conversion code for palette modes as well? Patrice, correct me if I'm wrong, but I'm 99.999% sure SDL does this).

When blitting stuff with VDI, you have the choice between:

- Device independent format:
each bitplane is stored completely one after the other, like in IMG
files. Do not know how it works for true colour blits.

- Device dependent format:
in this case you must know the format completely (bitplanes, chunky,
bits organization in true colour), and this is what I use in SDL. This
requires much less operations for the VDI, but a bit more for the
application. The app needs to write the data precisely in the screen
format.

-- 
Patrice Mandin
WWW: http://pmandin.atari.org/
Programmeur Linux, Atari
Spécialité: Développement, jeux

"who writes the code, decides"