diff options
author | 2017-05-28 11:11:19 +0200 | |
---|---|---|
committer | 2017-05-28 22:04:01 +0200 | |
commit | 53feb420a4d19327a86a4abbd4c7c83fa8152e0f (patch) | |
tree | 10102d5c18901dbb4f11e9ba2ae4bba77a1d5937 /src/emu/drawgfx.cpp | |
parent | 8ad55eced85d9d31c21a416b044e435c74242756 (diff) |
drawgfx: Make the palette optional [O. Galibert]
device_gfx_interface does two things:
- go from a possibly weird rom layout to a one-byte-per-pixel tiled layout
- draw the tiles so created
The second part requires a palette, but the first doesn't. And
low-level emulations of individual graphic chips (konami tilemap or
sprite generators for instance) are not supposed to care about the
palette. They just output bits which are partly indexes into
palettes, and partly not, and in any case become pen ids only much
further in the rendering chain. But they need access to the decoding
step, because one-byte-per-pixel is real nice.. So now such a device,
which inherits from device_gfx_interface, can call
set_palette_disable(true) and no palette tag will be required.
Calling the draw functions will segfault though.
As a side effect, the gfx_element constructor now takes a palette
pointer instead of a reference, since it's now optional.
Diffstat (limited to 'src/emu/drawgfx.cpp')
-rw-r--r-- | src/emu/drawgfx.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/emu/drawgfx.cpp b/src/emu/drawgfx.cpp index 7ba4d7bd7c5..edbfa1ec306 100644 --- a/src/emu/drawgfx.cpp +++ b/src/emu/drawgfx.cpp @@ -86,8 +86,8 @@ gfxdecode_device::gfxdecode_device(const machine_config &mconfig, const char *ta // gfx_element - constructor //------------------------------------------------- -gfx_element::gfx_element(device_palette_interface &palette, u8 *base, u16 width, u16 height, u32 rowbytes, u32 total_colors, u32 color_base, u32 color_granularity) - : m_palette(&palette), +gfx_element::gfx_element(device_palette_interface *palette, u8 *base, u16 width, u16 height, u32 rowbytes, u32 total_colors, u32 color_base, u32 color_granularity) + : m_palette(palette), m_width(width), m_height(height), m_startx(0), @@ -111,8 +111,8 @@ gfx_element::gfx_element(device_palette_interface &palette, u8 *base, u16 width, { } -gfx_element::gfx_element(device_palette_interface &palette, const gfx_layout &gl, const u8 *srcdata, u32 xormask, u32 total_colors, u32 color_base) - : m_palette(&palette), +gfx_element::gfx_element(device_palette_interface *palette, const gfx_layout &gl, const u8 *srcdata, u32 xormask, u32 total_colors, u32 color_base) + : m_palette(palette), m_width(0), m_height(0), m_startx(0), |