From e77acf6a339e608932dfec9500e0ed8557fd2d05 Mon Sep 17 00:00:00 2001 From: haranp Date: Thu, 8 Nov 2007 18:30:21 +0000 Subject: Better map dumping (Darshan) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2823 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/chardump.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/chardump.cc') 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 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( -- cgit v1.2.3-54-g00ecf