summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/chardump.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-25 16:49:55 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-25 17:19:18 +0100
commit70814e4479cc89bf71b3af33e2779795a5bdd6c6 (patch)
treea3f82789f47bb6d8c478ecc6264acce5459c280e /crawl-ref/source/chardump.cc
parent9734b6dd43839c3f38c330369c935d92ad403222 (diff)
downloadcrawl-ref-70814e4479cc89bf71b3af33e2779795a5bdd6c6.tar.gz
crawl-ref-70814e4479cc89bf71b3af33e2779795a5bdd6c6.zip
Add option to dump zone index to dump_map.
Diffstat (limited to 'crawl-ref/source/chardump.cc')
-rw-r--r--crawl-ref/source/chardump.cc12
1 files changed, 9 insertions, 3 deletions
diff --git a/crawl-ref/source/chardump.cc b/crawl-ref/source/chardump.cc
index a1effb544a..56d92419bf 100644
--- a/crawl-ref/source/chardump.cc
+++ b/crawl-ref/source/chardump.cc
@@ -1253,7 +1253,7 @@ static std::string morgue_directory()
return (dir);
}
-void dump_map(FILE *fp, bool debug)
+void dump_map(FILE *fp, bool debug, bool dist)
{
// Duplicate the screenshot() trick.
FixedVector<unsigned, NUM_DCHAR_TYPES> char_table_bk;
@@ -1274,6 +1274,12 @@ void dump_map(FILE *fp, bool debug)
fputc('@', fp);
else if (grd[x][y] == DNGN_FLOOR_SPECIAL)
fputc('?', fp);
+ else if (dist && grd[x][y] == DNGN_FLOOR
+ && travel_point_distance[x][y] > 0
+ && travel_point_distance[x][y] < 10)
+ {
+ fputc('0' + travel_point_distance[x][y], fp);
+ }
else
fputc(get_feature_def(grd[x][y]).symbol, fp);
}
@@ -1308,13 +1314,13 @@ void dump_map(FILE *fp, bool debug)
init_show_table();
}
-void dump_map(const char* fname, bool debug)
+void dump_map(const char* fname, bool debug, bool dist)
{
FILE* fp = fopen(fname, "w");
if (!fp)
return;
- dump_map(fp, debug);
+ dump_map(fp, debug, dist);
fclose(fp);
}