From d301b53bfcffcd69c5830c6e440b97c66d37b4ce Mon Sep 17 00:00:00 2001 From: Jude Brown Date: Sun, 6 Dec 2009 18:42:17 +1000 Subject: 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. --- crawl-ref/source/l_dgn.cc | 4 ++++ crawl-ref/source/mapdef.cc | 4 ++++ crawl-ref/source/maps.h | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) 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(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( unmarshallShort(inf) ); + // XXX: Hack. See the comment in l_dgn.cc. + border_fill_type = static_cast( 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 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 -- cgit v1.2.3-54-g00ecf