summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tilereg.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-07 10:44:55 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-07 10:44:55 +0000
commite73443245850c17be63996e97549416d6cba1759 (patch)
treeca57253e1c3b350117bd63e320d714c7a3204a60 /crawl-ref/source/tilereg.cc
parent1219201e4079858b2963b4c943488e1c0b93d26c (diff)
downloadcrawl-ref-e73443245850c17be63996e97549416d6cba1759.tar.gz
crawl-ref-e73443245850c17be63996e97549416d6cba1759.zip
Tiles: Save per-character equipment setting and use it in the character
selection menu. TODO: Use this instead of dolls.txt for initialising dolls, falling back on dolls.txt if name.tdl cannot be found and for new characters. I've tried displaying floor type but found it resulted in an information overload, and also distracts from the main information (species, equipment), esp. since it's mostly floor and most of the tile is covered anyway. I left it in (though commented out), so it's in the repository, but will remove it afterwards. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10122 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tilereg.cc')
-rw-r--r--crawl-ref/source/tilereg.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc
index 6ac5035efa..1d99c60697 100644
--- a/crawl-ref/source/tilereg.cc
+++ b/crawl-ref/source/tilereg.cc
@@ -558,6 +558,37 @@ static void _fill_doll_equipment(dolls_data &result)
result.parts[TILEP_PART_DRCHEAD] = 0;
}
+// Writes equipment information into per-character doll file.
+void save_doll_file(FILE *dollf)
+{
+ ASSERT(dollf);
+
+ dolls_data result = player_doll;
+
+ const bool halo = inside_halo(you.pos());
+ result.parts[TILEP_PART_HALO] = halo ? TILEP_HALO_TSO : 0;
+ result.parts[TILEP_PART_ENCH] =
+ (you.duration[DUR_LIQUID_FLAMES] ? TILEP_ENCH_STICKY_FLAME : 0);
+
+ _fill_doll_equipment(result);
+
+ // Write into file.
+ char fbuf[80];
+ tilep_print_parts(fbuf, result.parts, true);
+ fprintf(dollf, "%s\n", fbuf);
+
+// const coord_def c = you.pos();
+// int feat = tileidx_feature(grd(c), c.x, c.y);
+// if (feat == TILE_FLOOR_NORMAL)
+// feat = env.tile_flv(c).floor;
+// else if (feat == TILE_WALL_NORMAL)
+// feat = env.tile_flv(c).wall;
+// fprintf(dollf, "floor=%d\n", feat);
+
+ if (you.attribute[ATTR_HELD] > 0)
+ fprintf(dollf, "net\n");
+}
+
// Allow player to choose between up to 10 premade dolls, or replace them
// with the job default, using current equipment, or a random doll.
// If the player makes any changes while browsing the selections, i.e.
@@ -3330,8 +3361,12 @@ bool ImageManager::load_textures()
if (!m_textures[TEX_PLAYER].load_texture("player.png", mip))
return (false);
+ if (!m_textures[TEX_DEFAULT].load_texture("main.png", mip))
+ return (false);
+
m_textures[TEX_DUNGEON].set_info(TILE_DNGN_MAX, &tile_dngn_info);
m_textures[TEX_PLAYER].set_info(TILEP_PLAYER_MAX, &tile_player_info);
+ m_textures[TEX_DEFAULT].set_info(TILE_MAIN_MAX, &tile_main_info);
return (true);
}