diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-24 16:27:58 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-24 16:27:58 +0000 |
commit | 93f5fdd067279f953af9440fa7c712985e6ecf34 (patch) | |
tree | 177f36448c1dbeedf772d627e654714c704d6b22 /crawl-ref/source/util | |
parent | c633d5d2b956aab18819d51236982db57ee17134 (diff) | |
download | crawl-ref-93f5fdd067279f953af9440fa7c712985e6ecf34.tar.gz crawl-ref-93f5fdd067279f953af9440fa7c712985e6ecf34.zip |
Implemented .des file caching (speeds startup a fair bit): .des files are
parsed only once (unless they're modified again). Crawl also keeps only map
stubs in memory (name, place, orient, tags) and loads the map body only when it
is actually selected by the dungeon builder.
This probably breaks the Windows build, will be fixed soonish.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1637 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/util')
-rw-r--r-- | crawl-ref/source/util/levcomp.cc | 19 | ||||
-rw-r--r-- | crawl-ref/source/util/levcomp.h | 12 | ||||
-rw-r--r-- | crawl-ref/source/util/levcomp.ypp | 5 |
3 files changed, 3 insertions, 33 deletions
diff --git a/crawl-ref/source/util/levcomp.cc b/crawl-ref/source/util/levcomp.cc deleted file mode 100644 index af92a23bb6..0000000000 --- a/crawl-ref/source/util/levcomp.cc +++ /dev/null @@ -1,19 +0,0 @@ -#include "AppHdr.h" -#include "levcomp.h" -#include <vector> - -std::string lc_desfile; -map_def lc_map; -level_range lc_range; -depth_ranges lc_default_depths; - -extern int yylineno; - -void reset_map_parser() -{ - lc_map.init(); - lc_range.reset(); - lc_default_depths.clear(); - - yylineno = 1; -} diff --git a/crawl-ref/source/util/levcomp.h b/crawl-ref/source/util/levcomp.h deleted file mode 100644 index c3bf3a73ea..0000000000 --- a/crawl-ref/source/util/levcomp.h +++ /dev/null @@ -1,12 +0,0 @@ -#include <cstdio> -#include <string> -#include <vector> -#include "mapdef.h" -#include "maps.h" - -extern map_def lc_map; -extern level_range lc_range; -extern depth_ranges lc_default_depths; -extern std::string lc_desfile; - -void reset_map_parser(); diff --git a/crawl-ref/source/util/levcomp.ypp b/crawl-ref/source/util/levcomp.ypp index 757fc02504..bedd60c7ba 100644 --- a/crawl-ref/source/util/levcomp.ypp +++ b/crawl-ref/source/util/levcomp.ypp @@ -3,9 +3,9 @@ #include "AppHdr.h" #include "clua.h" #include "libutil.h" -#include "levcomp.h" #include "luadgn.h" #include "mapdef.h" +#include "maps.h" #include "stuff.h" #include <map> @@ -106,7 +106,8 @@ level : name metalines map_def metalines if (!lc_map.has_depth() && !lc_default_depths.empty()) lc_map.add_depths(lc_default_depths.begin(), lc_default_depths.end()); - add_parsed_map( lc_map ); + lc_map.set_file(lc_desfile); + add_parsed_map(lc_map); } ; |