summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/drawgfx.h
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2017-05-28 11:11:19 +0200
committer Olivier Galibert <galibert@pobox.com>2017-05-28 22:04:01 +0200
commit53feb420a4d19327a86a4abbd4c7c83fa8152e0f (patch)
tree10102d5c18901dbb4f11e9ba2ae4bba77a1d5937 /src/emu/drawgfx.h
parent8ad55eced85d9d31c21a416b044e435c74242756 (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.h')
-rw-r--r--src/emu/drawgfx.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/emu/drawgfx.h b/src/emu/drawgfx.h
index 4ff720b3054..fa1fe95b5e3 100644
--- a/src/emu/drawgfx.h
+++ b/src/emu/drawgfx.h
@@ -151,8 +151,8 @@ public:
#ifdef UNUSED_FUNCTION
gfx_element();
#endif
- gfx_element(device_palette_interface &palette, const gfx_layout &gl, const u8 *srcdata, u32 xormask, u32 total_colors, u32 color_base);
- gfx_element(device_palette_interface &palette, u8 *base, u16 width, u16 height, u32 rowbytes, u32 total_colors, u32 color_base, u32 color_granularity);
+ gfx_element(device_palette_interface *palette, const gfx_layout &gl, const u8 *srcdata, u32 xormask, u32 total_colors, u32 color_base);
+ gfx_element(device_palette_interface *palette, u8 *base, u16 width, u16 height, u32 rowbytes, u32 total_colors, u32 color_base, u32 color_granularity);
// getters
device_palette_interface &palette() const { return *m_palette; }
@@ -269,7 +269,7 @@ private:
void decode(u32 code);
// internal state
- device_palette_interface *m_palette; // palette used for drawing
+ device_palette_interface *m_palette; // palette used for drawing (optional when used as a pure decoder)
u16 m_width; // current pixel width of each element (changeable with source clipping)
u16 m_height; // current pixel height of each element (changeable with source clipping)