diff options
author | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-24 06:52:51 +0000 |
---|---|---|
committer | j-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-24 06:52:51 +0000 |
commit | 50f205740cbe6255684e79433d7d6aaee9e512f9 (patch) | |
tree | cb31e507444148fe9ed3ef824de1a84ed7fa7319 /crawl-ref/source/tilereg.cc | |
parent | 34c9b0d27cbe6115c602e45c2f5f1a10132be7de (diff) | |
download | crawl-ref-50f205740cbe6255684e79433d7d6aaee9e512f9.tar.gz crawl-ref-50f205740cbe6255684e79433d7d6aaee9e512f9.zip |
Apply my previous commit to trunk.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10029 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tilereg.cc')
-rw-r--r-- | crawl-ref/source/tilereg.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index 1710eab6ee..627c6f7259 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -364,6 +364,9 @@ static bool _load_doll_data(const char *fn, dolls_data *dolls, int max, int count = 0; while (fscanf(fp, "%s", fbuf) != EOF) { + if (fbuf[0] == '#') // Skip comment lines. + continue; + if (*cur == count++) { tilep_scan_parts(fbuf, dolls[0].parts); @@ -379,10 +382,12 @@ static bool _load_doll_data(const char *fn, dolls_data *dolls, int max, } else // Load up to max dolls from file. { - for (int count = 0; count < max && fscanf(fp, "%s", fbuf) != EOF; - ++count) + for (int count = 0; count < max && fscanf(fp, "%s", fbuf) != EOF; ) { - tilep_scan_parts(fbuf, dolls[count].parts); + if (fbuf[0] == '#') // Skip comment lines. + continue; + + tilep_scan_parts(fbuf, dolls[count++].parts); } } @@ -709,6 +714,12 @@ void TilePlayerEdit() fprintf(fp, "NUM=%02d\n", num == -1 ? 0 : num); + // Print some explanatory comments. May contain no spaces! + fprintf(fp, "#Legend:\n"); + fprintf(fp, "#***:equipment/123:index/000:none\n"); + fprintf(fp, "#Shadow/Gender/Cloak/Boots/Legs/Body/Gloves/Weapon/Shield/Hair/Beard/Helmet\n"); + fprintf(fp, "#--:Sex:Clk:Bts:Leg:Bdy:Glv:Wpn:Shd:Hai:Brd:Hlm\n"); + char fbuf[80]; for (unsigned int i = 0; i < NUM_MAX_DOLLS; ++i) { |