diff options
author | Enne Walker <ennewalker@users.sourceforge.net> | 2010-04-19 20:00:06 -0400 |
---|---|---|
committer | Enne Walker <ennewalker@users.sourceforge.net> | 2010-04-25 19:33:13 -0400 |
commit | 8305dc11a61b732984b4bf2a2f8c8f48af84630e (patch) | |
tree | 9f605e327b60ab79111ae7c25bec938ed2261a0b /crawl-ref/source/tilereg-dgn.h | |
parent | edacdc0db313c0f5385631dfcf560f1fdf8e7c8a (diff) | |
download | crawl-ref-8305dc11a61b732984b4bf2a2f8c8f48af84630e.tar.gz crawl-ref-8305dc11a61b732984b4bf2a2f8c8f48af84630e.zip |
Split tilereg.h/cc into multiple files.
No functional changes, just rearranging and exposing functions where
needed.
Diffstat (limited to 'crawl-ref/source/tilereg-dgn.h')
-rw-r--r-- | crawl-ref/source/tilereg-dgn.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/crawl-ref/source/tilereg-dgn.h b/crawl-ref/source/tilereg-dgn.h new file mode 100644 index 0000000000..b4681d995e --- /dev/null +++ b/crawl-ref/source/tilereg-dgn.h @@ -0,0 +1,82 @@ +/* + * File: tilereg_dgn.h + * Created by: ennewalker on Sat Jan 5 01:33:53 2008 UTC + */ + +#ifdef USE_TILE +#ifndef TILEREG_DGN_H +#define TILEREG_DGN_H + +#include "tilereg.h" +#include <vector> + +class mcache_entry; + +struct TextTag +{ + std::string tag; + coord_def gc; +}; + +class DungeonRegion : public TileRegion +{ +public: + DungeonRegion(const TileRegionInit &init); + virtual ~DungeonRegion(); + + virtual void render(); + virtual void clear(); + virtual int handle_mouse(MouseEvent &event); + virtual bool update_tip_text(std::string &tip); + virtual bool update_alt_text(std::string &alt); + virtual void on_resize(); + + void load_dungeon(unsigned int* tileb, int cx_to_gx, int cy_to_gy); + void place_cursor(cursor_type type, const coord_def &gc); + bool on_screen(const coord_def &gc) const; + + void clear_text_tags(text_tag_type type); + void add_text_tag(text_tag_type type, const std::string &tag, + const coord_def &gc); + + const coord_def &get_cursor() const { return m_cursor[CURSOR_MOUSE]; } + + void add_overlay(const coord_def &gc, int idx); + void clear_overlays(); + +protected: + void pack_background(unsigned int bg, int x, int y); + void pack_mcache(mcache_entry *entry, int x, int y, bool submerged); + void pack_player(int x, int y, bool submerged); + void pack_foreground(unsigned int bg, unsigned int fg, int x, int y); + void pack_fg_flags(unsigned int bg, unsigned int fg, int x, int y); + void pack_doll(const dolls_data &doll, int x, int y, bool submerged, bool ghost); + void pack_cursor(cursor_type type, unsigned int tile); + void pack_buffers(); + + void draw_minibars(); + + int get_buffer_index(const coord_def &gc); + void to_screen_coords(const coord_def &gc, coord_def& pc) const; + + std::vector<unsigned int> m_tileb; + int m_cx_to_gx; + int m_cy_to_gy; + coord_def m_cursor[CURSOR_MAX]; + std::vector<TextTag> m_tags[TAG_MAX]; + + TileBuffer m_buf_dngn; + SubmergedTileBuffer m_buf_doll; + SubmergedTileBuffer m_buf_main_trans; + TileBuffer m_buf_main; + + struct tile_overlay + { + coord_def gc; + int idx; + }; + std::vector<tile_overlay> m_overlays; +}; + +#endif +#endif |