GraphicsBitmap: Allow constructing a wrapper bitmap around 8-bit pixels

This will be very useful for optimizing games like DOOM. :^)
This commit is contained in:
Andreas Kling 2019-09-14 11:19:49 +02:00
parent 813deaed45
commit ec5091fa7d
Notes: sideshowbarker 2024-07-19 12:07:08 +09:00

View file

@ -48,7 +48,8 @@ GraphicsBitmap::GraphicsBitmap(Format format, const Size& size, size_t pitch, RG
, m_pitch(pitch)
, m_format(format)
{
ASSERT(format != Format::Indexed8);
if (format == Format::Indexed8)
m_palette = new RGBA32[256];
}
GraphicsBitmap::GraphicsBitmap(Format format, const Size& size, MappedFile&& mapped_file)