summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tags.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-05 06:10:49 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-05 06:10:49 +0000
commit1db9c68406e0892e1ac7331dfd3b412b31741cb7 (patch)
treedabc507f32d87ba59c660f45fffa6b5b9042e6c5 /crawl-ref/source/tags.cc
parent70d59beabaddfbb2edefee1f610e16881c8ff771 (diff)
downloadcrawl-ref-1db9c68406e0892e1ac7331dfd3b412b31741cb7.tar.gz
crawl-ref-1db9c68406e0892e1ac7331dfd3b412b31741cb7.zip
Shaft traps (trap doors) [1792195] and level annotation [1769009]
added, with the shaft traps changed as per comments on SF; shafts aren't randomly generated yet, so this doesn't change gameplay. Changed DNGN_TRAP_III to DNGN_TRAP_NATURAL, of which trap type the shaft traps are the only current member. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2328 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tags.cc')
-rw-r--r--crawl-ref/source/tags.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index 757717c248..8b8eb8db18 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -96,6 +96,7 @@ extern std::map<branch_type, level_id> stair_level;
extern std::map<level_pos, shop_type> shops_present;
extern std::map<level_pos, god_type> altars_present;
extern std::map<level_pos, portal_type> portals_present;
+extern std::map<level_id, std::string> level_annotations;
// temp file pairs used for file level cleanup
FixedArray < bool, MAX_LEVELS, NUM_BRANCHES > tmp_file_pairs;
@@ -423,6 +424,12 @@ void marshallString(struct tagHeader &th, const std::string &data, int maxSize)
th.offset += len;
}
+// To pass to marsahllMap
+static void marshall_string(struct tagHeader &th, const std::string &data)
+{
+ marshallString(th, data);
+}
+
// string -- unmarshall length & string data
int unmarshallCString(struct tagHeader &th, char *data, int maxSize)
{
@@ -456,6 +463,12 @@ std::string unmarshallString(tagHeader &th, int maxSize)
return (res);
}
+// To pass to unmarshallMap
+static std::string unmarshall_string(struct tagHeader &th)
+{
+ return unmarshallString(th);
+}
+
// boolean (to avoid system-dependant bool implementations)
void marshallBoolean(struct tagHeader &th, bool data)
{
@@ -1039,6 +1052,8 @@ static void tag_construct_you_dungeon(struct tagHeader &th)
marshall_level_pos, marshall_as_long<god_type>);
marshallMap(th, portals_present,
marshall_level_pos, marshall_as_long<portal_type>);
+ marshallMap(th, level_annotations,
+ marshall_level_id, marshall_string);
marshallPlaceInfo(th, you.global_info);
std::vector<PlaceInfo> list = you.get_all_place_info();
@@ -1435,6 +1450,8 @@ static void tag_read_you_dungeon(struct tagHeader &th)
unmarshall_level_pos, unmarshall_long_as<god_type>);
unmarshallMap(th, portals_present,
unmarshall_level_pos, unmarshall_long_as<portal_type>);
+ unmarshallMap(th, level_annotations,
+ unmarshall_level_id, unmarshall_string);
PlaceInfo place_info = unmarshallPlaceInfo(th);
ASSERT(place_info.is_global());