From 7ac9f20ef352f7de53a1ab7b68ec371b03857966 Mon Sep 17 00:00:00 2001 From: ennewalker Date: Tue, 20 Jan 2009 04:13:07 +0000 Subject: Adding FTILE/RTILE vault commands for setting per-glyph floor and rock tiles. Most vaults with COLOUR tags now also use FTILE/RTILE. FLOORCOL, ROCKCOL, FLOORTILE, and ROCKTILE have been renamed to LFLOORCOL, LROCKCOL, LFLOORTILE, and LROCKTILE to emphasize the fact that they are a per-level setting (similar to LFLAGS) and to disambiguate them from COLOUR/FTILE/RTILE. This change also fixes green water not appearing green outside of the sewers and vaults (like the ice cave) not getting their default tiles set appropriately due to a recent change. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8615 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/tilepick.cc | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'crawl-ref/source/tilepick.cc') diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc index 75703a9fa4..d6beec8f86 100644 --- a/crawl-ref/source/tilepick.cc +++ b/crawl-ref/source/tilepick.cc @@ -34,12 +34,6 @@ REVISION("$Rev$"); #include "travel.h" #include "view.h" -static inline bool _is_sewers() -{ - return (you.level_type == LEVEL_PORTAL_VAULT - && you.level_type_name == "sewer"); -} - void TileNewLevel(bool first_time) { tiles.clear_minimap(); @@ -2353,7 +2347,7 @@ int tileidx_feature(int object, int gx, int gy) case DNGN_LAVA: return TILE_DNGN_LAVA; case DNGN_DEEP_WATER: - if (_is_sewers() || env.grid_colours[gx][gy] == GREEN + if (env.grid_colours[gx][gy] == GREEN || env.grid_colours[gx][gy] == LIGHTGREEN) { return TILE_DNGN_DEEP_WATER_MURKY; @@ -2362,7 +2356,7 @@ int tileidx_feature(int object, int gx, int gy) case DNGN_SHALLOW_WATER: { int t = TILE_DNGN_SHALLOW_WATER; - if (_is_sewers() || env.grid_colours[gx][gy] == GREEN + if (env.grid_colours[gx][gy] == GREEN || env.grid_colours[gx][gy] == LIGHTGREEN) { t = TILE_DNGN_SHALLOW_WATER_MURKY; @@ -3968,13 +3962,12 @@ int jitter(SpecialIdx i) void tile_clear_flavour() { - for (int y = 0; y < GYM; y++) - for (int x = 0; x < GXM; x++) - { - env.tile_flv[x][y].floor = 0; - env.tile_flv[x][y].wall = 0; - env.tile_flv[x][y].special = 0; - } + for (rectangle_iterator ri(1); ri; ++ri) + { + env.tile_flv(*ri).floor = 0; + env.tile_flv(*ri).wall = 0; + env.tile_flv(*ri).special = 0; + } } // For floors and walls that have not already been set to a particular tile, @@ -3990,14 +3983,19 @@ void tile_init_flavour(const coord_def &gc) if (!in_bounds(gc)) return; - int wall_rnd = random2(tile_dngn_count(env.tile_default.wall)); - int floor_rnd = random2(tile_dngn_count(env.tile_default.floor)); - if (!env.tile_flv(gc).floor) + { + int floor_rnd = random2(tile_dngn_count(env.tile_default.floor)); env.tile_flv(gc).floor = env.tile_default.floor + floor_rnd; + } + if (!env.tile_flv(gc).wall) + { + int wall_rnd = random2(tile_dngn_count(env.tile_default.wall)); env.tile_flv(gc).wall = env.tile_default.wall + wall_rnd; + } + if (grd(gc) == DNGN_CLOSED_DOOR || grd(gc) == DNGN_OPEN_DOOR) { // Check for horizontal gates. -- cgit v1.2.3-54-g00ecf