diff options
author | Enne Walker <enne.walker@gmail.com> | 2010-06-01 11:31:59 -0400 |
---|---|---|
committer | Enne Walker <enne.walker@gmail.com> | 2010-06-01 12:58:16 -0400 |
commit | 4887d8a2cdc8a33748724fe7732d2ab97d53a5f1 (patch) | |
tree | 6269094f3140feb270c228f4bcf40add8e389543 /crawl-ref/source/tilereg-dgn.cc | |
parent | 63cc52422890d554e57e565cd0606fcc0f7c930b (diff) | |
download | crawl-ref-4887d8a2cdc8a33748724fe7732d2ab97d53a5f1.tar.gz crawl-ref-4887d8a2cdc8a33748724fe7732d2ab97d53a5f1.zip |
Add wiz-only tile idx debug tooltips on dungeon.
Hovering the mouse over any cell on the dungeon display will now display the
contents of tile_fg, tile_bk_fg, and crawl_view.vbuf[x]->tile_fg (and the
corresponding background tiles too). It displays them as index, flag (as hex),
and then name (with multiple names for any mcache entries that comprise
multiple tiles). This should help debug weird tiles display issues.
Diffstat (limited to 'crawl-ref/source/tilereg-dgn.cc')
-rw-r--r-- | crawl-ref/source/tilereg-dgn.cc | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/crawl-ref/source/tilereg-dgn.cc b/crawl-ref/source/tilereg-dgn.cc index 78c5f1d48c..cb71eb8e10 100644 --- a/crawl-ref/source/tilereg-dgn.cc +++ b/crawl-ref/source/tilereg-dgn.cc @@ -30,6 +30,7 @@ #include "terrain.h" #include "tiledef-main.h" #include "tilefont.h" +#include "tilepick.h" #include "traps.h" #include "travel.h" #include "viewgeom.h" @@ -910,7 +911,44 @@ bool DungeonRegion::update_tip_text(std::string &tip) if (!map_bounds(m_cursor[CURSOR_MOUSE])) return (false); - return (tile_dungeon_tip(m_cursor[CURSOR_MOUSE], tip)); + const coord_def gc = m_cursor[CURSOR_MOUSE]; + bool ret = (tile_dungeon_tip(gc, tip)); + +#ifdef WIZARD + if (you.wizard) + { + if (ret) + tip += "\n\n"; + + if (you.see_cell(gc)) + { + const coord_def ep = view2show(grid2view(gc)); + + tip += make_stringf("GC(%d, %d) EP(%d, %d)\n\n", + gc.x, gc.y, ep.x, ep.y); + + tip += tile_debug_string(env.tile_fg(ep), env.tile_bg(ep), ' '); + } + else + { + tip += make_stringf("GC(%d, %d) [out of sight]\n\n", gc.x, gc.y); + } + + tip += tile_debug_string(env.tile_bk_fg(gc), env.tile_bk_bg(gc), 'B'); + + if (!m_vbuf.empty()) + { + const screen_cell_t *vbuf = m_vbuf; + const coord_def vc(gc.x - m_cx_to_gx, gc.y - m_cy_to_gy); + const screen_cell_t &cell = vbuf[crawl_view.viewsz.x * vc.y + vc.x]; + tip += tile_debug_string(cell.tile_fg, cell.tile_bg, 'V'); + } + + ret = true; + } +#endif + + return (ret); } bool tile_dungeon_tip(const coord_def &gc, std::string &tip) |