summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/chardump.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-08 18:30:21 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2007-11-08 18:30:21 +0000
commite77acf6a339e608932dfec9500e0ed8557fd2d05 (patch)
tree243d32a555e5a0ee0bd2bd1c45cbe5a30cc2d77c /crawl-ref/source/chardump.cc
parentb39226f02c5336c216d53f5400266090dd5ba4d2 (diff)
downloadcrawl-ref-e77acf6a339e608932dfec9500e0ed8557fd2d05.tar.gz
crawl-ref-e77acf6a339e608932dfec9500e0ed8557fd2d05.zip
Better map dumping (Darshan)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2823 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/chardump.cc')
-rw-r--r--crawl-ref/source/chardump.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/crawl-ref/source/chardump.cc b/crawl-ref/source/chardump.cc
index 15f6b6488a..20ff25ab8d 100644
--- a/crawl-ref/source/chardump.cc
+++ b/crawl-ref/source/chardump.cc
@@ -1133,6 +1133,13 @@ static std::string morgue_directory()
static void dump_map(const char* fname)
{
+ // Duplicate the screenshot() trick.
+ FixedVector<unsigned, NUM_DCHAR_TYPES> char_table_bk;
+ char_table_bk = Options.char_table;
+
+ init_char_table(CSET_ASCII);
+ init_feature_table();
+
FILE* fp = fopen(fname, "w");
if ( !fp )
return;
@@ -1153,13 +1160,17 @@ static void dump_map(const char* fname)
min_y = j;
}
- for ( int y = min_y; y < max_y; ++y )
+ for ( int y = min_y; y <= max_y; ++y )
{
- for ( int x = min_x; x < max_x; ++x )
+ for ( int x = min_x; x <= max_x; ++x )
fputc( env.map[x][y].glyph(), fp );
fputc('\n', fp);
}
fclose(fp);
+
+ // Restore char and feature tables
+ Options.char_table = char_table_bk;
+ init_feature_table();
}
static bool write_dump(