summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tags.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-10 02:06:42 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-10 02:13:09 -0800
commit5e9e9773f748ab17c8298cd212c77bf5ea1b2051 (patch)
treeb08649df9d56d86f99290ca09c0c3b38f3c40cda /crawl-ref/source/tags.cc
parent2ebed5e396b655383be577ec55cfb756fcf328d4 (diff)
downloadcrawl-ref-5e9e9773f748ab17c8298cd212c77bf5ea1b2051.tar.gz
crawl-ref-5e9e9773f748ab17c8298cd212c77bf5ea1b2051.zip
tags: Store minorVersion in reader class
Store the minor version of a savefile being read into the reader class, so that it doesn't need to be passed around as a method/function parameter everywhere.
Diffstat (limited to 'crawl-ref/source/tags.cc')
-rw-r--r--crawl-ref/source/tags.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index 9dbe2fced8..421593bc5c 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -134,6 +134,11 @@ void reader::read(void *data, size_t size)
}
}
+char reader::getMinorVersion()
+{
+ return _minorVersion;
+}
+
void writer::writeByte(unsigned char ch)
{
if (_file)
@@ -703,7 +708,7 @@ tag_type tag_read(FILE *fp, char minorVersion)
short tag_id;
std::vector<unsigned char> buf;
{
- reader tmp(fp);
+ reader tmp(fp, minorVersion);
tag_id = unmarshallShort(tmp);
if (tag_id < 0)
return TAG_NO_TAG;
@@ -720,7 +725,7 @@ tag_type tag_read(FILE *fp, char minorVersion)
unwind_var<int> tag_minor_version(_tag_minor_version, minorVersion);
// Ok, we have data now.
- reader th(buf);
+ reader th(buf, minorVersion);
switch (tag_id)
{
case TAG_YOU: tag_read_you(th, minorVersion); break;