diff options
author | Jude Brown <bookofjude@users.sourceforge.net> | 2009-12-06 18:42:17 +1000 |
---|---|---|
committer | Jude Brown <bookofjude@users.sourceforge.net> | 2009-12-06 18:42:17 +1000 |
commit | d301b53bfcffcd69c5830c6e440b97c66d37b4ce (patch) | |
tree | 1ee6e9643fd61e04985336cfa6d6b887768aee5e /crawl-ref | |
parent | d8e6385908a20759971c30898b5b52da811cbd00 (diff) | |
download | crawl-ref-d301b53bfcffcd69c5830c6e440b97c66d37b4ce.tar.gz crawl-ref-d301b53bfcffcd69c5830c6e440b97c66d37b4ce.zip |
Temporary hack to make set_border_fill_type work.
See the comment in l_dgn.cc:dgn_set_border_fill_type. Should be replaced
with something that works on map_lines instead, but this will do for the
meantime.
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/l_dgn.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/mapdef.cc | 4 | ||||
-rw-r--r-- | crawl-ref/source/maps.h | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/crawl-ref/source/l_dgn.cc b/crawl-ref/source/l_dgn.cc index 9daa433332..b7891b2c7f 100644 --- a/crawl-ref/source/l_dgn.cc +++ b/crawl-ref/source/l_dgn.cc @@ -928,6 +928,10 @@ bool _valid_border_feat (dungeon_feature_type feat) || feat == DNGN_SHALLOW_WATER || feat == DNGN_FLOOR)); } +// XXX: Currently, this is hacked so that map_def->border_fill_type is marsalled +// when the maps are stored. This relies on the individual map Lua prelude +// being executed whenever maps are loaded and verified, which means that +// the next time the map is loaded, border_fill_type is already stored. static int lua_dgn_set_border_fill_type (lua_State *ls) { MAP(ls, 1, map); diff --git a/crawl-ref/source/mapdef.cc b/crawl-ref/source/mapdef.cc index 4e9247e553..da247ec176 100644 --- a/crawl-ref/source/mapdef.cc +++ b/crawl-ref/source/mapdef.cc @@ -1987,6 +1987,8 @@ void map_def::write_index(writer& outf) const marshallString4(outf, place_loaded_from.filename); marshallLong(outf, place_loaded_from.lineno); marshallShort(outf, orient); + // XXX: This is a hack. See the comment in l_dgn.cc. + marshallShort(outf, static_cast<short>(border_fill_type)); marshallLong(outf, chance_priority); marshallLong(outf, chance); marshallLong(outf, weight); @@ -2003,6 +2005,8 @@ void map_def::read_index(reader& inf) unmarshallString4(inf, place_loaded_from.filename); place_loaded_from.lineno = unmarshallLong(inf); orient = static_cast<map_section_type>( unmarshallShort(inf) ); + // XXX: Hack. See the comment in l_dgn.cc. + border_fill_type = static_cast<dungeon_feature_type>( unmarshallShort(inf) ); chance_priority = unmarshallLong(inf); chance = unmarshallLong(inf); weight = unmarshallLong(inf); diff --git a/crawl-ref/source/maps.h b/crawl-ref/source/maps.h index c05d5515b5..37f0f22841 100644 --- a/crawl-ref/source/maps.h +++ b/crawl-ref/source/maps.h @@ -66,7 +66,7 @@ typedef std::vector<coord_def> point_vector; extern map_place_check_t map_place_valid; extern point_vector map_anchor_points; -const int MAP_CACHE_VERSION = 1011; +const int MAP_CACHE_VERSION = 1012; #ifdef DEBUG_DIAGNOSTICS |