summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/files.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-02-06 16:03:52 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-02-06 16:03:52 +0000
commit24be3228d463d6b2501cbca9368e14e91ab42182 (patch)
tree5fd30f60a43e1e69188bce4e30646c3e89e288b2 /crawl-ref/source/files.cc
parentf878a03c781fd57fea8447caaecee847ab576d8b (diff)
downloadcrawl-ref-24be3228d463d6b2501cbca9368e14e91ab42182.tar.gz
crawl-ref-24be3228d463d6b2501cbca9368e14e91ab42182.zip
Tutorial (JPEG) and some formatting cleanup.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@924 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/files.cc')
-rw-r--r--crawl-ref/source/files.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index b8b5aa518d..7ea4991c0d 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -76,6 +76,7 @@
#include "stuff.h"
#include "tags.h"
#include "travel.h"
+#include "tutorial.h"
#ifdef SHARED_FILES_CHMOD_PRIVATE
#define DO_CHMOD_PRIVATE(x) chmod( (x), SHARED_FILES_CHMOD_PRIVATE )
@@ -1202,6 +1203,16 @@ void save_game(bool leave_game)
DO_CHMOD_PRIVATE(notesFile.c_str());
}
+ /* tutorial */
+
+ std::string tutorFile = get_savedir_filename(you.your_name, "", "tut");
+ FILE *tutorf = fopen(tutorFile.c_str(), "wb");
+ if (tutorf) {
+ save_tutorial(tutorf);
+ fclose(tutorf);
+ DO_CHMOD_PRIVATE(tutorFile.c_str());
+ }
+
std::string charFile = get_savedir_filename(you.your_name, "", "sav");
FILE *charf = fopen(charFile.c_str(), "wb");
if (!charf)
@@ -1399,6 +1410,15 @@ void restore_game(void)
load_notes(notesf);
fclose(notesf);
}
+
+ /* tutorial */
+
+ std::string tutorFile = get_savedir_filename(you.your_name, "", "tut");
+ FILE *tutorf = fopen(tutorFile.c_str(), "rb");
+ if (tutorf) {
+ load_tutorial(tutorf);
+ fclose(tutorf);
+ }
}
static bool determine_version( FILE *restoreFile,