summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/tilemap.h
diff options
context:
space:
mode:
author Alex W. Jackson <alex.w.jackson@gmail.com>2014-03-15 07:34:54 +0000
committer Alex W. Jackson <alex.w.jackson@gmail.com>2014-03-15 07:34:54 +0000
commit25db822531d1e3533f9c65baa656a6b548a30082 (patch)
tree27008f49daa85c4e2bf76de9c83eb960817c7d15 /src/emu/tilemap.h
parent9a3885ad4e113354c87fc063908d8bd7e7a4699d (diff)
Checkpoint 2:
gfxdecode devices must now be assigned a palette in MCFG. Added palette devices to several MESS drivers and devices to comply with this requirement. This palette is assigned as a default to the gfx_elements created by the device (but still not used for drawing yet, except in the UI graphics viewer) Tilemaps now have a pointer to a palette device and use that palette for rgb32 drawing, rather than the palette of the screen or bitmap they are drawing to (since rgb32 screens don't have palettes now). When a tilemap is created, it takes its palette from the gfxdecode device it was created with, but you can change a tilemap's palette device with set_palette() at any time (doing this does not mark the tilemap dirty, since all tilemaps use indexed bitmaps internally)
Diffstat (limited to 'src/emu/tilemap.h')
-rw-r--r--src/emu/tilemap.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/emu/tilemap.h b/src/emu/tilemap.h
index 9a28c2f3cab..2a2191ab4f2 100644
--- a/src/emu/tilemap.h
+++ b/src/emu/tilemap.h
@@ -491,6 +491,7 @@ public:
// getters
running_machine &machine() const;
tilemap_device *device() const { return m_device; }
+ palette_device *palette() const { return m_palette; }
tilemap_t *next() const { return m_next; }
void *user_data() const { return m_user_data; }
memory_array &basemem() { return m_basemem; }
@@ -510,6 +511,7 @@ public:
// setters
void enable(bool enable = true) { m_enable = enable; }
void set_user_data(void *user_data) { m_user_data = user_data; }
+ void set_palette(palette_device *palette) { m_palette = palette; }
void set_palette_offset(UINT32 offset) { m_palette_offset = offset; }
void set_scrolldx(int dx, int dx_flipped) { m_dx = dx; m_dx_flipped = dx_flipped; }
void set_scrolldy(int dy, int dy_flipped) { m_dy = dy; m_dy_flipped = dy_flipped; }
@@ -587,10 +589,10 @@ private:
void scanline_draw_masked_null(const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode);
void scanline_draw_opaque_ind16(UINT16 *dest, const UINT16 *source, int count, UINT8 *pri, UINT32 pcode);
void scanline_draw_masked_ind16(UINT16 *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, UINT8 *pri, UINT32 pcode);
- void scanline_draw_opaque_rgb32(UINT32 *dest, const UINT16 *source, int count, const rgb_t *pens, UINT8 *pri, UINT32 pcode);
- void scanline_draw_masked_rgb32(UINT32 *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const rgb_t *pens, UINT8 *pri, UINT32 pcode);
- void scanline_draw_opaque_rgb32_alpha(UINT32 *dest, const UINT16 *source, int count, const rgb_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha);
- void scanline_draw_masked_rgb32_alpha(UINT32 *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const rgb_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha);
+ void scanline_draw_opaque_rgb32(UINT32 *dest, const UINT16 *source, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode);
+ void scanline_draw_masked_rgb32(UINT32 *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode);
+ void scanline_draw_opaque_rgb32_alpha(UINT32 *dest, const UINT16 *source, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha);
+ void scanline_draw_masked_rgb32_alpha(UINT32 *dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha);
// internal helpers
void postload();
@@ -612,6 +614,7 @@ private:
// managers and devices
tilemap_manager * m_manager; // reference to the owning manager
tilemap_device * m_device; // pointer to our owning device
+ palette_device * m_palette; // palette used for drawing
tilemap_t * m_next; // pointer to next tilemap
void * m_user_data; // user data value