summaryrefslogtreecommitdiffstats
path: root/src/emu/tilemap.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2016-09-02 18:04:38 -0400
committer AJR <ajrhacker@users.noreply.github.com>2016-09-02 18:04:38 -0400
commit0a8652e03f82e8bda55dcea445ce88b1c5038d1c (patch)
tree9ab289431cbee5b705eea93efa7ea01cb6cf78be /src/emu/tilemap.cpp
parentc357acd3dfe1c2a508df2974d9dd135a7e5cb8e9 (diff)
More new features for UI graphics viewer
- Mouse over GFX tiles to reveal pixel values - Mouse over tilemap to reveal tile codes and colors - UI tilemap scrolling controls are now orientation-relative - Make mouse visible everywhere in UI graphics viewer by treating it like a menu - Add all necessary getters to tilemap_t and a few more (nw) - Add comment about role of decoder in tilemap creation (nw)
Diffstat (limited to 'src/emu/tilemap.cpp')
-rw-r--r--src/emu/tilemap.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/emu/tilemap.cpp b/src/emu/tilemap.cpp
index 54dc5cc9d8e..5659169a19b 100644
--- a/src/emu/tilemap.cpp
+++ b/src/emu/tilemap.cpp
@@ -1475,6 +1475,27 @@ void tilemap_t::draw_debug(screen_device &screen, bitmap_rgb32 &dest, UINT32 scr
}
+//-------------------------------------------------
+// get_info_debug - extract info for one tile
+//-------------------------------------------------
+
+void tilemap_t::get_info_debug(UINT32 col, UINT32 row, int &gfxnum, int &code, int &color)
+{
+ // first map to the memory index
+ tilemap_memory_index memindex = memory_index(col, row);
+
+ // next invoke the get info callback
+ m_tile_get_info(*this, m_tileinfo, memindex);
+
+ // get the GFX number and code
+ gfxnum = m_tileinfo.gfxnum;
+ code = m_tileinfo.code;
+
+ // work back from the palette base to get the color
+ gfx_element *gfx = m_tileinfo.decoder->gfx(gfxnum);
+ color = (m_tileinfo.palette_base - gfx->colorbase()) / gfx->granularity();
+}
+
//**************************************************************************
// TILEMAP MANAGER