summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/travel.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-20 01:40:57 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-20 01:40:57 +0000
commitd89d2d6b352ea604241c3b4b89e714ff4112df22 (patch)
tree3f0054de5de5d64a75cd0d9b9458e7097f40b831 /crawl-ref/source/travel.cc
parent467446254ef22c7d361764d1244a8d83fd285f95 (diff)
downloadcrawl-ref-d89d2d6b352ea604241c3b4b89e714ff4112df22.tar.gz
crawl-ref-d89d2d6b352ea604241c3b4b89e714ff4112df22.zip
Tiles: Show excluded squares in minimap
(darkcyan, and overridden by any feature, monster or item) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3302 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/travel.cc')
-rw-r--r--crawl-ref/source/travel.cc29
1 files changed, 27 insertions, 2 deletions
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc
index 9401d4b510..3796137fe1 100644
--- a/crawl-ref/source/travel.cc
+++ b/crawl-ref/source/travel.cc
@@ -33,6 +33,9 @@
#include "stash.h"
#include "stuff.h"
#include "terrain.h"
+#ifdef USE_TILE
+ #include "tiles.h"
+#endif
#include "traps.h"
#include "travel.h"
#include "tutorial.h"
@@ -236,6 +239,21 @@ bool is_exclude_root(const coord_def &p)
return (find_exclude_root(p));
}
+#ifdef USE_TILE
+// update Gmap for squares surrounding exclude centre
+static void tile_exclude_gmap_update(const coord_def p)
+{
+ for (int x = -8; x < 8; x++)
+ for (int y = -8; y < 8; y++)
+ {
+ int px = p.x+x, py = p.y+y;
+ if (in_bounds(coord_def(px,py)))
+ GmapUpdate(px, py, env.map[px][py].glyph(), true);
+ }
+ GmapDisplay(p.x,p.y);
+}
+#endif
+
const char *run_mode_name(int runmode)
{
return runmode == RMODE_TRAVEL? "travel" :
@@ -266,9 +284,12 @@ void clear_excludes()
// Sanity checks
if (you.level_type == LEVEL_LABYRINTH || you.level_type == LEVEL_ABYSS)
return;
-
+#ifdef USE_TILE
+ for (int i = curr_excludes.size()-1; i >= 0; i--)
+ toggle_exclude(curr_excludes[i].pos);
+#else
curr_excludes.clear();
-
+#endif
if (can_travel_interlevel())
{
LevelInfo &li = travel_cache.get_level_info(level_id::current());
@@ -303,6 +324,10 @@ void toggle_exclude(const coord_def &p)
set_exclude(p, 0);
else
set_exclude(p, LOS_RADIUS);
+
+#ifdef USE_TILE
+ tile_exclude_gmap_update(p);
+#endif
}
void set_exclude(const coord_def &p, int radius)