From 58a4fbec35500d744cb966d43885734b4da5f7d9 Mon Sep 17 00:00:00 2001 From: ennewalker Date: Sun, 20 Jan 2008 18:11:48 +0000 Subject: Fixing tile caching bug (resulting in temporarily disappearing items/monsters.) Added sanctuary art. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3310 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/rltiles/dc-misc.txt | 2 ++ crawl-ref/source/rltiles/effect/sanctuary.bmp | Bin 0 -> 2102 bytes crawl-ref/source/spells3.cc | 2 ++ crawl-ref/source/tile1.cc | 17 ++++++++++------- crawl-ref/source/tile2.cc | 6 ++++-- crawl-ref/source/tiles.h | 1 + 6 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 crawl-ref/source/rltiles/effect/sanctuary.bmp diff --git a/crawl-ref/source/rltiles/dc-misc.txt b/crawl-ref/source/rltiles/dc-misc.txt index 8888e8ad51..e9bc3b1a14 100644 --- a/crawl-ref/source/rltiles/dc-misc.txt +++ b/crawl-ref/source/rltiles/dc-misc.txt @@ -25,6 +25,8 @@ cloud_grey_smoke CLOUD_GREY_SMOKE cloud_miasma CLOUD_MIASMA cloud_purp_smoke CLOUD_PURP_SMOKE +sanctuary SANCTUARY + #########MAP %sdir dc-misc %corpse 0 diff --git a/crawl-ref/source/rltiles/effect/sanctuary.bmp b/crawl-ref/source/rltiles/effect/sanctuary.bmp new file mode 100644 index 0000000000..871f29d29c Binary files /dev/null and b/crawl-ref/source/rltiles/effect/sanctuary.bmp differ diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 4df5708550..0a62f4473d 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -896,7 +896,9 @@ bool cast_sanctuary(const int power) you.flash_colour = WHITE; viewwindow( true, false ); holy_word( 100, true ); +#ifndef USE_TILE delay(1000); +#endif env.sanctuary_pos.x = you.x_pos; env.sanctuary_pos.y = you.y_pos; diff --git a/crawl-ref/source/tile1.cc b/crawl-ref/source/tile1.cc index 468230529a..dfebea3178 100644 --- a/crawl-ref/source/tile1.cc +++ b/crawl-ref/source/tile1.cc @@ -1712,8 +1712,6 @@ int tileidx_item_throw(const item_def &item, int dx, int dy) int tileidx_feature(int object) { - int ch = TILE_ERROR; - switch (object) { case DNGN_UNSEEN: @@ -3879,17 +3877,22 @@ void tile_finish_dngn(unsigned int *tileb, int cx, int cy) finalize_tile(&tileb[count+1], is_special, wall_flv, floor_flv, special_flv); + const coord_def gc(gx, gy); + if (is_excluded(gc)) + { + tileb[count+1] |= TILE_FLAG_TRAVEL_EX; + } + if (in_bounds) { - const coord_def gc(gx, gy); - if (is_excluded(gc)) + if (is_bloodcovered(gx, gy)) { - tileb[count+1] |= TILE_FLAG_TRAVEL_EX; + tileb[count+1] |= TILE_FLAG_BLOOD; } - if (is_bloodcovered(gx, gy)) + if (is_sanctuary(gx, gy)) { - tileb[count+1] |= TILE_FLAG_BLOOD; + tileb[count+1] |= TILE_FLAG_SANCTUARY; } } diff --git a/crawl-ref/source/tile2.cc b/crawl-ref/source/tile2.cc index 1a92a9b4ad..7d294688f1 100644 --- a/crawl-ref/source/tile2.cc +++ b/crawl-ref/source/tile2.cc @@ -438,7 +438,7 @@ static int tcache_find_id_normal(int kind, int *fg, int *bg, int *is_new) if ((int)tc0->id[0] == fg[0] && (int)tc0->id[1] == bg[0]) break; - if ((int)tc0->id[0] == 0 || next == NULL) + if (next == NULL) { //end of used cache *is_new = 1; @@ -701,6 +701,9 @@ void tcache_compose_normal(int ix, int *fg, int *bg) if (new_bg) tcache_overlay(tc_img, ix, new_bg, TREGION_0_NORMAL, &c, NULL); + if ((bg0 & TILE_FLAG_SANCTUARY) && !(bg0 & TILE_FLAG_UNSEEN)) + tcache_overlay(tc_img, ix, TILE_SANCTUARY, TREGION_0_NORMAL, &c, NULL); + // Tile cursor if (bg0 & TILE_FLAG_CURSOR) { @@ -793,7 +796,6 @@ void tcache_compose_normal(int ix, int *fg, int *bg) tcache_overlay(tc_img, ix, TILE_TRAVEL_EXCLUSION, TREGION_0_NORMAL, &c, NULL); } - } // Tile cursor diff --git a/crawl-ref/source/tiles.h b/crawl-ref/source/tiles.h index a7b99711aa..81853bde5a 100644 --- a/crawl-ref/source/tiles.h +++ b/crawl-ref/source/tiles.h @@ -153,6 +153,7 @@ enum tile_flags TILE_FLAG_BLOOD = 0x00010000, TILE_FLAG_NEW_STAIR = 0x00020000, TILE_FLAG_TRAVEL_EX = 0x00040000, + TILE_FLAG_SANCTUARY = 0x00080000, // General TILE_FLAG_MASK = 0x000007FF -- cgit v1.2.3-54-g00ecf