diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-23 19:58:45 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-06-23 19:58:45 +0000 |
commit | 32ba97b96685241b1e30299f313c15d20d103998 (patch) | |
tree | 8ab81f56171f4a2f179f24db66d4794f9908770d /crawl-ref/source/maps.cc | |
parent | d09478f5fd2fbbc23a3d0785d201ab7e7c8e2d8f (diff) | |
download | crawl-ref-32ba97b96685241b1e30299f313c15d20d103998.tar.gz crawl-ref-32ba97b96685241b1e30299f313c15d20d103998.zip |
Step 1 of .des file Lua-isation. The dungeon compiler converts .des files to
Lua (Lua code can be embedded with {{ <lua code here> }} constructs) that is
run to produce the final map.
Some maps may be broken, this is untested, lots more work needs to be done.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1629 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/maps.cc')
-rw-r--r-- | crawl-ref/source/maps.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc index 7c1ff8421f..97a2eec5d8 100644 --- a/crawl-ref/source/maps.cc +++ b/crawl-ref/source/maps.cc @@ -102,6 +102,8 @@ static int write_vault(const map_def &mdef, map_type map, // Mirror the map if appropriate, resolve substitutable symbols (?), static void resolve_map(map_def &map) { + map.reinit(); + map.run_lua(true); map.resolve(); // Mirroring is possible for any map that does not explicitly forbid it. @@ -370,10 +372,13 @@ static void parse_maps(const std::string &s) void read_maps() { - parse_maps( lc_desfile = datafile_path( "splev.des" ) ); - parse_maps( lc_desfile = datafile_path( "vaults.des" ) ); - parse_maps( lc_desfile = datafile_path( "entry.des" ) ); - parse_maps( lc_desfile = datafile_path( "ebranch.des" ) ); + static const char *map_files[] = + { + "entry.des", "splev.des", "vaults.des", "ebranch.des" + }; + + for (unsigned i = 0; i < ARRAYSIZE(map_files); ++i) + parse_maps( lc_desfile = datafile_path( map_files[i] ) ); for (int i = 0, size = Options.extra_levels.size(); i < size; ++i) { |