Apply the new ground_level method.
[crawl.git] / crawl-ref / source / tilereg-dgn.h
blob51fc21d82afdfdb18f5ec5e59f70a7a3f3441b54
1 /*
2 * File: tilereg_dgn.h
3 * Created by: ennewalker on Sat Jan 5 01:33:53 2008 UTC
4 */
6 #ifdef USE_TILE
7 #ifndef TILEREG_DGN_H
8 #define TILEREG_DGN_H
10 #include "tilereg.h"
11 #include "tiledgnbuf.h"
12 #include "viewgeom.h"
13 #include <vector>
15 class mcache_entry;
17 struct TextTag
19 std::string tag;
20 coord_def gc;
23 bool tile_dungeon_tip(const coord_def &gc, std::string &tip);
24 int tile_click_cell(const coord_def &gc, unsigned char mod);
26 class DungeonRegion : public TileRegion
28 public:
29 DungeonRegion(const TileRegionInit &init);
30 virtual ~DungeonRegion();
32 virtual void render();
33 virtual void clear();
34 virtual int handle_mouse(MouseEvent &event);
35 virtual bool update_tip_text(std::string &tip);
36 virtual bool update_alt_text(std::string &alt);
37 virtual void on_resize();
39 void load_dungeon(const crawl_view_buffer &vbuf, const coord_def &gc);
40 void place_cursor(cursor_type type, const coord_def &gc);
41 bool on_screen(const coord_def &gc) const;
43 void clear_text_tags(text_tag_type type);
44 void add_text_tag(text_tag_type type, const std::string &tag,
45 const coord_def &gc);
47 const coord_def &get_cursor() const { return m_cursor[CURSOR_MOUSE]; }
49 void add_overlay(const coord_def &gc, int idx);
50 void clear_overlays();
52 protected:
53 void pack_buffers();
54 void pack_cursor(cursor_type type, unsigned int tile);
56 void draw_minibars();
58 int get_buffer_index(const coord_def &gc);
59 void to_screen_coords(const coord_def &gc, coord_def *pc) const;
61 crawl_view_buffer m_vbuf;
62 int m_cx_to_gx;
63 int m_cy_to_gy;
64 coord_def m_cursor[CURSOR_MAX];
65 coord_def m_last_clicked_grid;
66 std::vector<TextTag> m_tags[TAG_MAX];
68 DungeonCellBuffer m_buf_dngn;
69 ShapeBuffer m_buf_flash;
71 struct tile_overlay
73 coord_def gc;
74 tileidx_t idx;
76 std::vector<tile_overlay> m_overlays;
79 #endif
80 #endif