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-text.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-text.h')
-rw-r--r-- | crawl-ref/source/tilereg-text.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/crawl-ref/source/tilereg-text.h b/crawl-ref/source/tilereg-text.h new file mode 100644 index 0000000000..b8410bc5d0 --- /dev/null +++ b/crawl-ref/source/tilereg-text.h @@ -0,0 +1,67 @@ +/* + * File: tilereg_text.h + * Created by: ennewalker on Sat Jan 5 01:33:53 2008 UTC + */ + +#ifdef USE_TILE +#ifndef TILEREG_TEXT_H +#define TILEREG_TEXT_H + +#include "tilereg.h" + +class TextRegion : public Region +{ +public: + TextRegion(FontWrapper *font); + virtual ~TextRegion(); + + virtual void render(); + virtual void clear(); + + // STATIC - + // TODO enne - move these to TilesFramework? + + // where now printing? what color? + static int print_x; + static int print_y; + static int text_col; + // which region now printing? + static class TextRegion *text_mode; + // display cursor? where is the cursor now? + static int cursor_flag; + static class TextRegion *cursor_region; + static int cursor_x; + static int cursor_y; + + // class methods + static void cgotoxy(int x, int y); + static int wherex(); + static int wherey(); + //static int get_number_of_lines(void); + static void _setcursortype(int curstype); + static void textbackground(int bg); + static void textcolor(int col); + + // Object's method + void clear_to_end_of_line(void); + void putch(unsigned char chr); + void writeWChar(unsigned char *ch); + + unsigned char *cbuf; //text backup + unsigned char *abuf; //textcolor backup + + int cx_ofs; //cursor x offset + int cy_ofs; //cursor y offset + + void addstr(char *buffer); + void addstr_aux(char *buffer, int len); + void adjust_region(int *x1, int *x2, int y); + void scroll(); + +protected: + virtual void on_resize(); + FontWrapper *m_font; +}; + +#endif +#endif |