diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-20 20:08:15 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2006-12-20 20:08:15 +0000 |
commit | ebe5e29212f88a4db612ffe5707c08aaa01f818e (patch) | |
tree | fb0a90f1ae4f92250010ffca50f3300797b49379 /crawl-ref/source/tags.cc | |
parent | 1aabb3c12726b02bce39e5f9ec843e18640b1fdd (diff) | |
download | crawl-ref-ebe5e29212f88a4db612ffe5707c08aaa01f818e.tar.gz crawl-ref-ebe5e29212f88a4db612ffe5707c08aaa01f818e.zip |
Refactored out branches into branch.h and branch.cc.
NOTE: This commit is *buggy*; the final Hell vaults contain buggy runes
now. Will fix later; this is a benchmark, since hopefully everything else
works.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@682 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tags.cc')
-rw-r--r-- | crawl-ref/source/tags.cc | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc index 834bef02dd..e2d1f13b55 100644 --- a/crawl-ref/source/tags.cc +++ b/crawl-ref/source/tags.cc @@ -68,6 +68,7 @@ #include "AppHdr.h" #include "abl-show.h" +#include "branch.h" #include "enum.h" #include "externs.h" #include "files.h" @@ -92,7 +93,7 @@ extern std::map<level_pos, god_type> altars_present; extern std::map<level_pos, portal_type> portals_present; // temp file pairs used for file level cleanup -FixedArray < bool, MAX_LEVELS, MAX_BRANCHES > tmp_file_pairs; +FixedArray < bool, MAX_LEVELS, NUM_BRANCHES > tmp_file_pairs; // static helpers static void tag_construct_you(struct tagHeader &th); @@ -871,13 +872,13 @@ static void tag_construct_you_dungeon(struct tagHeader &th) marshallByte(th,you.unique_creatures[j]); /* unique beasties */ // how many branches? - marshallByte(th, MAX_BRANCHES); - for (j = 0; j < 30; ++j) - marshallByte(th,you.branch_stairs[j]); + marshallByte(th, NUM_BRANCHES); + for (j = 0; j < NUM_BRANCHES; ++j) + marshallLong(th, branches[j].startdepth); marshallShort(th, MAX_LEVELS); for (i = 0; i < MAX_LEVELS; ++i) - for (j = 0; j < MAX_BRANCHES; ++j) + for (j = 0; j < NUM_BRANCHES; ++j) marshallBoolean(th, tmp_file_pairs[i][j]); marshallMap(th, stair_level, @@ -1164,12 +1165,18 @@ static void tag_read_you_dungeon(struct tagHeader &th) // how many branches? count_c = unmarshallByte(th); for (j = 0; j < count_c; ++j) - you.branch_stairs[j] = unmarshallByte(th); + branches[j].startdepth = unmarshallLong(th); + + cprintf("found %d branches\n", (int)count_c); count_s = unmarshallShort(th); + cprintf("found %d maxlevel\n", (int)count_s); for (i = 0; i < count_s; ++i) + { +// cprintf("i = %d\n", i); for (j = 0; j < count_c; ++j) tmp_file_pairs[i][j] = unmarshallBoolean(th); + } unmarshallMap(th, stair_level, unmarshall_long_as<branch_type>, unmarshall_level_id); |