Re: [AD] 6bit limitation of paletted modes. |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> It seems then that support for 8bit DACs would be in (almost) every
> machine that newer allegro versions would support. In this case,
> wouldn't it be possible that the 6bit DAC be emulated through the 8bit
> one?
I'm not sure, but I think Allegro already does this in Windows.
> I mean older programs that assume 6bit components would still show the
> correct colors, just in 1/4 the brightness (0-63 instead if 0-255).
Which, in my opinion, is quite unacceptable. People will start complaining
that their code looked fine in older versions but doesn't now.
> That means that a simple x4 scaling would render the correct result.
> Then a compatibility mode could be added (so the scaling is handled
> automatically), via an al_enable_6bit_palette() call after setting the
> color depth; this would require minimal changes to (fairly recent)
> existing programs (just add this and recompile).
It would have to be the default - not nescessarily a bad idea, but I'm not
sure this is the best solution.
> And, in any case,
> older programs that rely on older allegro versions wouldn't work with
> the newer allegro out of the box.
They will if they use the compatibility layer.
Right now, there's no way to tell a programme to disable the compatibility
layer, it's something we should make possible at some point.
> This could be a fairly clean solution regarding the end user (who
> programs with allegro), since it would need minimal source code
> changes (and most examples that use palettes would continue to work
> without changing the palette generation code immediately, which can be
> quite a lot of work). What do you think?
Sounds good on the surface of it, but I haven't thought about this much
yet. And, I'd have to look how this would fit with the new GFX API Bob
originally proposed.
> PS: Is there any concrete benefit of using 0.0-1.0 ranges in paletted
> modes? This would result in a 4fold size increase of the RGB struct.
That's assuming palettes would consist of RGB structs - might as well by
some other colour space. The way Allegro stores a palette internally need
not be limited to the way the hardware stores it, or even how the palette
interface is presented: routines may accept ranges of 0.0-1.0 for colours
and still store them as chars in the range 0-255.
Independent of that, OpenGL and PostScript also use floating point RGB
values, to name a few (although I'll freely admit that PostScript is not
that useful to Allegro).
Evert