From 5e9e9773f748ab17c8298cd212c77bf5ea1b2051 Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Tue, 10 Nov 2009 02:06:42 -0800 Subject: 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. --- crawl-ref/source/tags.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/tags.h') diff --git a/crawl-ref/source/tags.h b/crawl-ref/source/tags.h index ce2ec65a68..c85796bef9 100644 --- a/crawl-ref/source/tags.h +++ b/crawl-ref/source/tags.h @@ -103,18 +103,23 @@ void marshallShowtype (writer &, const show_type &); class reader { public: - reader(FILE* input) - : _file(input), _pbuf(0), _read_offset(0) {} - reader(const std::vector& input) - : _file(0), _pbuf(&input), _read_offset(0) {} + reader(FILE* input, char minorVersion = TAG_MINOR_VERSION) + : _file(input), _pbuf(0), _read_offset(0), + _minorVersion(minorVersion) {} + reader(const std::vector& input, + char minorVersion = TAG_MINOR_VERSION) + : _file(0), _pbuf(&input), _read_offset(0), + _minorVersion(minorVersion) {} unsigned char readByte(); void read(void *data, size_t size); + char getMinorVersion(); private: FILE* _file; const std::vector* _pbuf; unsigned int _read_offset; + char _minorVersion; }; char unmarshallByte (reader &); -- cgit v1.2.3-54-g00ecf