diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-11-25 16:49:55 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-11-25 17:19:18 +0100 |
commit | 70814e4479cc89bf71b3af33e2779795a5bdd6c6 (patch) | |
tree | a3f82789f47bb6d8c478ecc6264acce5459c280e /crawl-ref | |
parent | 9734b6dd43839c3f38c330369c935d92ad403222 (diff) | |
download | crawl-ref-70814e4479cc89bf71b3af33e2779795a5bdd6c6.tar.gz crawl-ref-70814e4479cc89bf71b3af33e2779795a5bdd6c6.zip |
Add option to dump zone index to dump_map.
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/chardump.cc | 12 | ||||
-rw-r--r-- | crawl-ref/source/chardump.h | 4 |
2 files changed, 11 insertions, 5 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); } diff --git a/crawl-ref/source/chardump.h b/crawl-ref/source/chardump.h index 953d5653d1..17fa1fe246 100644 --- a/crawl-ref/source/chardump.h +++ b/crawl-ref/source/chardump.h @@ -30,8 +30,8 @@ bool dump_char(const std::string &fname, bool show_prices, bool full_id = false, const scorefile_entry *se = NULL); -void dump_map(const char* fname, bool debug = false); -void dump_map(FILE *fp, bool debug = false); +void dump_map(const char* fname, bool debug = false, bool dist = false); +void dump_map(FILE *fp, bool debug = false, bool dist = false); void display_notes(); std::string munge_description(const std::string &inStr); const char *hunger_level(void); |