From ccd8ab9d731d18d9fa3d6c29ed6bb9c8ab220c5d Mon Sep 17 00:00:00 2001 From: dshaligram Date: Sun, 8 Jul 2007 20:59:26 +0000 Subject: Added debugging code to generate multiple dungeons (all branches and levels) and gather statistics on maps used and Lua errors encountered. To use it, run "crawl -mapstat" with a full-debug build. Output will be mapgen.log in the current directory. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1805 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/initfile.cc | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/initfile.cc') diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index 73b10fc005..82d888ed4f 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -586,7 +586,7 @@ void game_options::reset_options() prev_weapon = WPN_UNKNOWN; prev_book = SBT_NO_SELECTION; prev_randpick = false; - remember_name = false; + remember_name = true; #ifdef USE_ASCII_CHARACTERS char_set = CSET_ASCII; @@ -2548,6 +2548,7 @@ enum commandline_option_type { CLO_SCOREFILE, CLO_MORGUE, CLO_MACRO, + CLO_MAPSTAT, CLO_NOPS }; @@ -2555,7 +2556,7 @@ enum commandline_option_type { static const char *cmd_ops[] = { "scores", "name", "race", "class", "pizza", "plain", "dir", "rc", "tscores", "vscores", "scorefile", "morgue", - "macro" }; + "macro", "mapstat" }; const int num_cmd_ops = CLO_NOPS; bool arg_seen[num_cmd_ops]; @@ -2671,6 +2672,20 @@ bool parse_args( int argc, char **argv, bool rc_only ) } break; + case CLO_MAPSTAT: + crawl_state.map_stat_gen = true; + if (next_is_param) + { + SysEnv.map_gen_iters = atoi(next_arg); + if (SysEnv.map_gen_iters < 1) + SysEnv.map_gen_iters = 1; + else if (SysEnv.map_gen_iters > 10000) + SysEnv.map_gen_iters = 10000; + } + else + SysEnv.map_gen_iters = 100; + break; + case CLO_MACRO: if (!next_is_param) return (false); @@ -2708,9 +2723,6 @@ bool parse_args( int argc, char **argv, bool rc_only ) if (!next_is_param) return (false); - // if (strlen(next_arg) != 1) - // return (false); - if (!rc_only) { if (o == 2) -- cgit v1.2.3-54-g00ecf