summaryrefslogtreecommitdiff
path: root/library/include
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-09-07 11:36:45 +0400
committerAlexander Gavrilov2012-09-07 11:36:45 +0400
commite925d8f4d999817d3ccf7f3180e7abee382e03b4 (patch)
tree5a48c08b6c8a45aa3cf85e7d4b05e79cc2d4e028 /library/include
parentc971a819def1c5cc29dc926f62456c336a1dfa17 (diff)
downloaddfhack-e925d8f4d999817d3ccf7f3180e7abee382e03b4.tar.gz
dfhack-e925d8f4d999817d3ccf7f3180e7abee382e03b4.tar.bz2
dfhack-e925d8f4d999817d3ccf7f3180e7abee382e03b4.tar.xz
Add an API function for reading tiles from the screen buffers.
Diffstat (limited to 'library/include')
-rw-r--r--library/include/modules/Screen.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/library/include/modules/Screen.h b/library/include/modules/Screen.h
index 492e1eec..4f47205f 100644
--- a/library/include/modules/Screen.h
+++ b/library/include/modules/Screen.h
@@ -65,6 +65,9 @@ namespace DFHack
} tile_mode;
int8_t tile_fg, tile_bg;
+ bool valid() const { return tile >= 0; }
+ bool empty() const { return ch == 0 && tile == 0; }
+
Pen(char ch = 0, int8_t fg = 7, int8_t bg = 0, int tile = 0, bool color_tile = false)
: ch(ch), fg(fg&7), bg(bg), bold(!!(fg&8)),
tile(tile), tile_mode(color_tile ? CharColor : AsIs), tile_fg(0), tile_bg(0)
@@ -92,6 +95,9 @@ namespace DFHack
/// Paint one screen tile with the given pen
DFHACK_EXPORT bool paintTile(const Pen &pen, int x, int y);
+ /// Retrieves one screen tile from the buffer
+ DFHACK_EXPORT Pen readTile(int x, int y);
+
/// Paint a string onto the screen. Ignores ch and tile of pen.
DFHACK_EXPORT bool paintString(const Pen &pen, int x, int y, const std::string &text);