summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tags.cc
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-01 02:22:31 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-01 02:22:31 +0000
commit2e4aeb705dc8383ddc846ea17613251df8601847 (patch)
treedca212cd8072eccc0fc259a3a677bafc739ecee8 /crawl-ref/source/tags.cc
parenta2bd3ea6e687bee89ff41074c713af99e8bd9886 (diff)
downloadcrawl-ref-2e4aeb705dc8383ddc846ea17613251df8601847.tar.gz
crawl-ref-2e4aeb705dc8383ddc846ea17613251df8601847.zip
[2054793] Partial implementation of the request to have COLOUR tags affect tile choice. Vaults can now override the default tileset (walls and floors) for an entire level. This has been pushed to vaults where it makes sense (sewers, ice caves, ziggurats, bazaars, Shoals:5, Zot).
ROCKTILE and FLOORTILE can be used when authoring vaults to set these values, both of which take a single tile name as a string. These values are ignored in console builds. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7700 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tags.cc')
-rw-r--r--crawl-ref/source/tags.cc25
1 files changed, 17 insertions, 8 deletions
diff --git a/crawl-ref/source/tags.cc b/crawl-ref/source/tags.cc
index e7af317cb2..8cdb33306c 100644
--- a/crawl-ref/source/tags.cc
+++ b/crawl-ref/source/tags.cc
@@ -1975,12 +1975,16 @@ void tag_construct_level_tiles(writer &th)
marshallByte(th, rle_count);
// flavour
+ marshallShort(th, env.tile_default.wall);
+ marshallShort(th, env.tile_default.floor);
+ marshallShort(th, env.tile_default.special);
+
for (int count_x = 0; count_x < GXM; count_x++)
for (int count_y = 0; count_y < GYM; count_y++)
{
- marshallByte(th, env.tile_flv[count_x][count_y].wall);
- marshallByte(th, env.tile_flv[count_x][count_y].floor);
- marshallByte(th, env.tile_flv[count_x][count_y].special);
+ marshallShort(th, env.tile_flv[count_x][count_y].wall);
+ marshallShort(th, env.tile_flv[count_x][count_y].floor);
+ marshallShort(th, env.tile_flv[count_x][count_y].special);
}
mcache.construct(th);
@@ -2305,12 +2309,16 @@ void tag_read_level_tiles(struct reader &th)
}
// flavour
+ env.tile_default.wall = unmarshallShort(th);
+ env.tile_default.floor = unmarshallShort(th);
+ env.tile_default.special = unmarshallShort(th);
+
for (int x = 0; x < gx; x++)
for (int y = 0; y < gy; y++)
{
- env.tile_flv[x][y].wall = unmarshallByte(th);
- env.tile_flv[x][y].floor = unmarshallByte(th);
- env.tile_flv[x][y].special = unmarshallByte(th);
+ env.tile_flv[x][y].wall = unmarshallShort(th);
+ env.tile_flv[x][y].floor = unmarshallShort(th);
+ env.tile_flv[x][y].special = unmarshallShort(th);
}
if (ver > TILETAG_PRE_MCACHE)
@@ -2324,6 +2332,9 @@ void tag_read_level_tiles(struct reader &th)
static void tag_missing_level_tiles()
{
#ifdef USE_TILE
+ tile_init_default_flavour();
+ tile_clear_flavour();
+
for (int i = 0; i < GXM; i++)
for (int j = 0; j < GYM; j++)
{
@@ -2337,8 +2348,6 @@ static void tag_missing_level_tiles()
mcache.clear_all();
TileNewLevel(true);
-
-
#endif
}