diff options
author | Florian Diebold <flodiebold@gmail.com> | 2011-12-15 13:35:02 +0100 |
---|---|---|
committer | Florian Diebold <flodiebold@gmail.com> | 2011-12-15 13:35:02 +0100 |
commit | f1b6bbb821a1e2a4737af790f7a7e881cf889af4 (patch) | |
tree | c25f6a29a402e2f4553ed018eed97d33e28cb80f /crawl-ref/source/tilereg-mon.cc | |
parent | ddd98b694eadc4600f4b80b42c544835ad044e77 (diff) | |
parent | b7ff298762cbca7293e05266f358b5c39fec90bd (diff) | |
download | crawl-ref-f1b6bbb821a1e2a4737af790f7a7e881cf889af4.tar.gz crawl-ref-f1b6bbb821a1e2a4737af790f7a7e881cf889af4.zip |
Merge branch 'tiles-monster-info'
Diffstat (limited to 'crawl-ref/source/tilereg-mon.cc')
-rw-r--r-- | crawl-ref/source/tilereg-mon.cc | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/crawl-ref/source/tilereg-mon.cc b/crawl-ref/source/tilereg-mon.cc index 2154c9f9db..61385cabcf 100644 --- a/crawl-ref/source/tilereg-mon.cc +++ b/crawl-ref/source/tilereg-mon.cc @@ -7,6 +7,7 @@ #include "process_desc.h" #include "cio.h" +#include "coord.h" #include "directn.h" #include "env.h" #include "libutil.h" @@ -66,11 +67,11 @@ int MonsterRegion::handle_mouse(MouseEvent &event) unsigned int item_idx = cursor_index(); - const monster* mon = get_monster(item_idx); + const monster_info* mon = get_monster(item_idx); if (!mon) return (0); - const coord_def &gc = mon->position; + const coord_def &gc = mon->pos; tiles.place_cursor(CURSOR_MOUSE, gc); if (event.event != MouseEvent::PRESS) @@ -97,11 +98,11 @@ bool MonsterRegion::update_tip_text(std::string &tip) return (false); unsigned int item_idx = cursor_index(); - const monster* mon = get_monster(item_idx); + const monster_info* mon = get_monster(item_idx); if (!mon) return (false); - return (tile_dungeon_tip(mon->position, tip)); + return (tile_dungeon_tip(mon->pos, tip)); } bool MonsterRegion::update_tab_tip_text(std::string &tip, bool active) @@ -121,11 +122,11 @@ bool MonsterRegion::update_alt_text(std::string &alt) return (false); } - const monster* mon = get_monster(item_idx); + const monster_info* mon = get_monster(item_idx); if (!mon) return (false); - const coord_def &gc = mon->position; + const coord_def &gc = mon->pos; describe_info inf; if (!you.see_cell(gc)) @@ -141,7 +142,7 @@ bool MonsterRegion::update_alt_text(std::string &alt) return (true); } -const monster* MonsterRegion::get_monster(unsigned int idx) const +const monster_info* MonsterRegion::get_monster(unsigned int idx) const { if (idx >= m_items.size()) return (NULL); @@ -150,7 +151,7 @@ const monster* MonsterRegion::get_monster(unsigned int idx) const if (item.idx >= static_cast<int>(m_mon_info.size())) return (NULL); - return (m_mon_info[item.idx].mon()); + return &(m_mon_info[item.idx]); } void MonsterRegion::pack_buffers() @@ -166,10 +167,10 @@ void MonsterRegion::pack_buffers() bool cursor = (i < m_items.size()) ? (m_items[i].flag & TILEI_FLAG_CURSOR) : false; - const monster* mon = get_monster(i++); + const monster_info* mon = get_monster(i++); if (mon) { - const coord_def gc = mon->position; + const coord_def gc = mon->pos; const coord_def ep = grid2show(gc); if (crawl_view.in_los_bounds_g(gc)) @@ -189,7 +190,7 @@ void MonsterRegion::pack_buffers() } // Fill the rest of the space with out of sight floor tiles. - int tileidx = env.tile_default.floor + m_flavour[i] % num_floor; + int tileidx = env.tile_default.floor + m_flavour[i-1] % num_floor; m_buf.add_dngn_tile(tileidx, x, y); m_buf.add_icons_tile(TILEI_MESH, x, y); } @@ -208,11 +209,11 @@ void MonsterRegion::draw_tag() if (idx == -1) return; - const monster* mon = get_monster(idx); + const monster_info* mon = get_monster(idx); if (!mon) return; - std::string desc = mon->name(DESC_A); + std::string desc = mon->proper_name(DESC_A); draw_desc(desc.c_str()); } |