summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-20 18:11:48 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-20 18:11:48 +0000
commit58a4fbec35500d744cb966d43885734b4da5f7d9 (patch)
tree433b5f2bf84e05c1f556bf7daa15387db34866a6
parentb184952d37ef761e55a1035025da0288b5c21cf0 (diff)
downloadcrawl-ref-58a4fbec35500d744cb966d43885734b4da5f7d9.tar.gz
crawl-ref-58a4fbec35500d744cb966d43885734b4da5f7d9.zip
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
-rw-r--r--crawl-ref/source/rltiles/dc-misc.txt2
-rw-r--r--crawl-ref/source/rltiles/effect/sanctuary.bmpbin0 -> 2102 bytes
-rw-r--r--crawl-ref/source/spells3.cc2
-rw-r--r--crawl-ref/source/tile1.cc17
-rw-r--r--crawl-ref/source/tile2.cc6
-rw-r--r--crawl-ref/source/tiles.h1
6 files changed, 19 insertions, 9 deletions
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
--- /dev/null
+++ b/crawl-ref/source/rltiles/effect/sanctuary.bmp
Binary files 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