diff options
author | pauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-23 09:42:58 +0000 |
---|---|---|
committer | pauldubois <pauldubois@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-03-23 09:42:58 +0000 |
commit | 7a5387cbd6aa4682c7f2845bde065a9e0b828e23 (patch) | |
tree | 995b883e6d67e8c9011bb02133b83ce65dcfa47a /crawl-ref/source/tutorial.cc | |
parent | 922cba628d3d6377574a90c7a817c10d84ed7f85 (diff) | |
download | crawl-ref-7a5387cbd6aa4682c7f2845bde065a9e0b828e23.tar.gz crawl-ref-7a5387cbd6aa4682c7f2845bde065a9e0b828e23.zip |
This was originally going to be a small refactor of stash.cc before
getting into stash/item finding, but it ended up big. Removed the
read/writeThing API in favor of the marshall/unmarshallThing API. It
was slightly awkward in a couple spots where the format of writeThing
and marshallThing differed slightly (strings, level_id, level_pos).
Doesn't affect savegames.
When it's is okay to break savegames (maybe just before releasing
0.4?) it would be nice to remove the few remaining redundancies listed
above.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3828 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tutorial.cc')
-rw-r--r-- | crawl-ref/source/tutorial.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc index b43aef4b8d..8d0e910f1e 100644 --- a/crawl-ref/source/tutorial.cc +++ b/crawl-ref/source/tutorial.cc @@ -16,7 +16,6 @@ #include "tutorial.h" #include "cio.h" #include "command.h" -#include "files.h" #include "food.h" #include "format.h" #include "initfile.h" @@ -37,6 +36,7 @@ #include "spl-book.h" #include "spl-util.h" #include "stuff.h" +#include "tags.h" #include "terrain.h" #ifdef USE_TILE #include "tiles.h" @@ -60,26 +60,26 @@ static int get_tutorial_cols() #endif } -void save_tutorial( FILE* fp ) +void save_tutorial(writer& outf) { - writeLong( fp, TUTORIAL_VERSION); - writeShort( fp, Options.tutorial_type); + marshallLong( outf, TUTORIAL_VERSION); + marshallShort( outf, Options.tutorial_type); for ( long i = 0; i < TUT_EVENTS_NUM; ++i ) - writeShort( fp, Options.tutorial_events[i] ); + marshallShort( outf, Options.tutorial_events[i] ); } -void load_tutorial( FILE* fp ) +void load_tutorial(reader& inf) { Options.tutorial_left = 0; - int version = readLong(fp); + int version = unmarshallLong(inf); if (version != TUTORIAL_VERSION) return; - Options.tutorial_type = readShort(fp); + Options.tutorial_type = unmarshallShort(inf); for ( long i = 0; i < TUT_EVENTS_NUM; ++i ) { - Options.tutorial_events[i] = readShort(fp); + Options.tutorial_events[i] = unmarshallShort(inf); Options.tutorial_left += Options.tutorial_events[i]; } } |