summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tileweb.h
diff options
context:
space:
mode:
authorFlorian Diebold <flodiebold@gmail.com>2012-04-17 15:24:03 +0200
committerFlorian Diebold <flodiebold@gmail.com>2012-04-19 17:02:30 +0200
commitf470cca4919095efe9e82e74f2f332cf1304517b (patch)
tree3b19ac5fea5939d3d7f6aded1088d94188d7d3a9 /crawl-ref/source/tileweb.h
parentc0bb57a73105370ce0dd4f004402f5ab802588ba (diff)
downloadcrawl-ref-f470cca4919095efe9e82e74f2f332cf1304517b.tar.gz
crawl-ref-f470cca4919095efe9e82e74f2f332cf1304517b.zip
Webtiles: Track cell dirtyness in more detail to improve performance.
In my completely unscientific tests, this vastly improves the cpu usage of webtiles while running or autoexploring without travel_delay=-1, bringing it almost to webtiles-in-terminal-mode levels (which are still somewhat higher than when running without webtiles support).
Diffstat (limited to 'crawl-ref/source/tileweb.h')
-rw-r--r--crawl-ref/source/tileweb.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/crawl-ref/source/tileweb.h b/crawl-ref/source/tileweb.h
index a8cabe538f..04d1b660b1 100644
--- a/crawl-ref/source/tileweb.h
+++ b/crawl-ref/source/tileweb.h
@@ -12,6 +12,7 @@
#include "viewgeom.h"
#include "map_knowledge.h"
#include <map>
+#include <bitset>
#include <sys/un.h>
class Menu;
@@ -178,6 +179,11 @@ protected:
coord_def m_next_view_tl;
coord_def m_next_view_br;
+ std::bitset<GXM * GYM> m_dirty_cells;
+ void mark_dirty(const coord_def& gc) { m_dirty_cells[gc.y * GXM + gc.x] = true; }
+ void mark_clean(const coord_def& gc) { m_dirty_cells[gc.y * GXM + gc.x] = false; }
+ bool is_dirty(const coord_def& gc) { return m_dirty_cells[gc.y * GXM + gc.x]; }
+
int m_current_flash_colour;
int m_next_flash_colour;