From ebe5e29212f88a4db612ffe5707c08aaa01f818e Mon Sep 17 00:00:00 2001 From: haranp Date: Wed, 20 Dec 2006 20:08:15 +0000 Subject: 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 --- crawl-ref/source/tags.cc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source/tags.cc') 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 altars_present; extern std::map 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, unmarshall_level_id); -- cgit v1.2.3-54-g00ecf