summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/rltiles/dc-item.txt24
-rw-r--r--crawl-ref/source/spells2.cc4
-rw-r--r--crawl-ref/source/tilepick.cc52
-rw-r--r--crawl-ref/source/tilepick.h2
-rw-r--r--crawl-ref/source/view.cc18
5 files changed, 68 insertions, 32 deletions
diff --git a/crawl-ref/source/rltiles/dc-item.txt b/crawl-ref/source/rltiles/dc-item.txt
index 70720d3b30..8b7519b091 100644
--- a/crawl-ref/source/rltiles/dc-item.txt
+++ b/crawl-ref/source/rltiles/dc-item.txt
@@ -230,7 +230,7 @@ effect/bolt5 MI_BOLT5
effect/bolt6 MI_BOLT6
effect/bolt7 MI_BOLT7
-dart1 MI_DART
+dart1 MI_DART UNSEEN_MISSILE
dart2
dart-p MI_DART_POISONED
steel_dart1 MI_DART_STEEL
@@ -431,7 +431,7 @@ i-archery BRAND_ARM_ARCHERY
###########OBJ_WANDS
%sdir item/wand
-gem_iron WAND_OFFSET /*iron*/
+gem_iron WAND_OFFSET UNSEEN_WAND
gem_brass
gem_bone
gem_wood
@@ -472,7 +472,7 @@ i-disintegration WAND_DISINTEGRATION
%back none
#################OBJ_FOOD
%sdir item/food
-meat_ration FOOD_MEAT_RATION
+meat_ration FOOD_MEAT_RATION UNSEEN_FOOD
bread_ration FOOD_BREAD_RATION
pear FOOD_PEAR
apple FOOD_APPLE
@@ -521,7 +521,7 @@ chunk_brands/i-rotten FOOD_INEDIBLE
#################OBJ_UNKNOWN_I
##################OBJ_SCROLLS
%sdir item/scroll
-scroll SCROLL
+scroll SCROLL UNSEEN_SCROLL
%back scroll
%sdir item/scroll
@@ -556,7 +556,7 @@ i-silence SCR_SILENCE
##################OBJ_JEWELLERY
############ring
%sdir item/ring
-wooden RING_NORMAL_OFFSET /*wood*/
+wooden RING_NORMAL_OFFSET UNSEEN_RING
silver
gold
iron
@@ -619,7 +619,7 @@ i-c-teleport RING_TELEPORT_CONTROL
###amulets
%sdir item/amulet
-crystal_white AMU_NORMAL_OFFSET /*zirconium*/
+crystal_white AMU_NORMAL_OFFSET UNSEEN_AMULET
stone3_blue
face1_gold
stone3_green
@@ -670,7 +670,7 @@ i-stasis AMU_STASIS
####################OBJ_POTIONS
%sdir item/potion
-clear POTION_OFFSET /*clear*/
+clear POTION_OFFSET UNSEEN_POTION
brilliant_blue
black
silver
@@ -743,7 +743,7 @@ magenta
yellow
white
##########leather 8
-parchment BOOK_LEATHER_OFFSET
+parchment BOOK_LEATHER_OFFSET UNSEEN_BOOK
leather
tan
plaid
@@ -774,7 +774,7 @@ thin
#####################OBJ_STAVES
%sdir item/staff
-staff00 STAFF_OFFSET /*curved*/
+staff00 STAFF_OFFSET UNSEEN_STAFF
staff01
staff02
staff03
@@ -831,14 +831,14 @@ i-rod_venom ROD_VENOM
#OBJ_ORBS
%sdir item/misc
-misc_orb ORB
+misc_orb ORB UNSEEN_ORB
misc_orb2
#OBJ_MISCELLANY
misc_bottle MISC_BOTTLED_EFREET
misc_crystal MISC_CRYSTAL_BALL_OF_ENERGY
misc_crystal MISC_CRYSTAL_BALL_OF_FIXATION
-misc_crystal MISC_CRYSTAL_BALL_OF_SEEING
+misc_crystal MISC_CRYSTAL_BALL_OF_SEEING UNSEEN_MISC
misc_fan MISC_AIR_ELEMENTAL_FAN
misc_lamp MISC_LAMP_OF_FIRE
misc_stone MISC_STONE_OF_EARTH_ELEMENTALS
@@ -973,4 +973,4 @@ runes/rune_snake MISC_RUNE_SNAKE
#handled in dc-corpse.txt
#OBJ_GOLD
-gold_pile GOLD
+gold_pile GOLD UNSEEN_GOLD
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index 34a7091873..2ab4435d6a 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -157,10 +157,6 @@ static bool _mark_detected_creature(coord_def where, const monsters *mon,
set_map_knowledge_obj(where, show_type(mons_detected_base(mon->type)));
set_map_knowledge_detected_mons(where);
-#ifdef USE_TILE
- tile_place_monster(where, mon, false, true);
-#endif
-
return (found_good);
}
diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc
index d293be6c0b..1c9e05dbe6 100644
--- a/crawl-ref/source/tilepick.cc
+++ b/crawl-ref/source/tilepick.cc
@@ -364,6 +364,33 @@ tileidx_t tileidx_out_of_bounds(int branch)
return (TILE_DNGN_UNSEEN | TILE_FLAG_UNSEEN);
}
+void tileidx_out_of_los(tileidx_t *fg, tileidx_t *bg, const coord_def& gc)
+{
+ // Player memory.
+ tileidx_t mem_fg = env.tile_bk_fg(gc);
+ tileidx_t mem_bg = env.tile_bk_bg(gc);
+
+ // Detected info is just stored in map_knowledge and doesn't get
+ // written to what the player remembers. We'll feather that in here.
+
+ const map_cell &cell = env.map_knowledge(gc);
+
+ // Override terrain for magic mapping.
+ if (!cell.seen() && is_terrain_mapped(gc))
+ *bg = _tileidx_feature_base(cell.feat());
+ else
+ *bg = mem_bg;
+ *bg |= tileidx_unseen_flag(gc);
+
+ // Override foreground for monsters/items
+ if (is_map_knowledge_detected_mons(gc))
+ *fg = _tileidx_monster_base(cell.object.mons);
+ else if (is_map_knowledge_detected_item(gc))
+ *fg = tileidx_show_item(cell.object.item);
+ else
+ *fg = mem_fg;
+}
+
static bool _is_skeleton(const int z_type)
{
return (z_type == MONS_SKELETON_SMALL || z_type == MONS_SKELETON_LARGE);
@@ -3015,6 +3042,31 @@ tileidx_t tileidx_item_throw(const item_def &item, int dx, int dy)
return tileidx_item(item);
}
+tileidx_t tileidx_show_item(int show_item_type)
+{
+ switch (show_item_type)
+ {
+ default:
+ case SHOW_ITEM_NONE: return (0);
+ case SHOW_ITEM_ORB: return (TILE_UNSEEN_ORB);
+ case SHOW_ITEM_WEAPON: return (TILE_UNSEEN_WEAPON);
+ case SHOW_ITEM_ARMOUR: return (TILE_UNSEEN_ARMOUR);
+ case SHOW_ITEM_WAND: return (TILE_UNSEEN_WAND);
+ case SHOW_ITEM_FOOD: return (TILE_UNSEEN_FOOD);
+ case SHOW_ITEM_SCROLL: return (TILE_UNSEEN_SCROLL);
+ case SHOW_ITEM_RING: return (TILE_UNSEEN_RING);
+ case SHOW_ITEM_POTION: return (TILE_UNSEEN_POTION);
+ case SHOW_ITEM_MISSILE: return (TILE_UNSEEN_MISSILE);
+ case SHOW_ITEM_BOOK: return (TILE_UNSEEN_BOOK);
+ case SHOW_ITEM_STAVE: return (TILE_UNSEEN_STAFF);
+ case SHOW_ITEM_MISCELLANY: return (TILE_UNSEEN_MISC);
+ case SHOW_ITEM_CORPSE: return (TILE_UNSEEN_CORPSE);
+ case SHOW_ITEM_GOLD: return (TILE_UNSEEN_GOLD);
+ case SHOW_ITEM_AMULET: return (TILE_UNSEEN_AMULET);
+ case SHOW_ITEM_DETECTED: return (TILE_UNSEEN_ITEM);
+ }
+}
+
tileidx_t tileidx_cloud(const cloud_struct &cl)
{
int type = cl.type;
diff --git a/crawl-ref/source/tilepick.h b/crawl-ref/source/tilepick.h
index 07a6ea982b..030b890bff 100644
--- a/crawl-ref/source/tilepick.h
+++ b/crawl-ref/source/tilepick.h
@@ -19,6 +19,7 @@ class monsters;
// Tile index lookup from Crawl data.
tileidx_t tileidx_feature(const coord_def &gc);
tileidx_t tileidx_out_of_bounds(int branch);
+void tileidx_out_of_los(tileidx_t *fg, tileidx_t *bg, const coord_def& gc);
tileidx_t tileidx_monster(const monsters *mon);
tileidx_t tileidx_monster_detected(const monsters *mon);
@@ -27,6 +28,7 @@ tileidx_t tileidx_draco_job(const monsters *mon);
tileidx_t tileidx_item(const item_def &item);
tileidx_t tileidx_item_throw(const item_def &item, int dx, int dy);
+tileidx_t tileidx_show_item(int show_item_type);
tileidx_t tileidx_cloud(const cloud_struct &cl);
tileidx_t tileidx_bolt(const bolt &bolt);
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index fd2f09736b..4219a85631 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -790,13 +790,7 @@ static void _draw_outside_los(screen_cell_t *cell, const coord_def &gc)
cell->colour = Options.colour_map ? real_colour(get_map_col(gc, false))
: DARKGREY;
#ifdef USE_TILE
- tileidx_t bg = env.tile_bk_bg(gc);
- tileidx_t fg = env.tile_bk_fg(gc);
- if (bg == 0 && fg == 0)
- tileidx_unseen(&fg, &bg, get_map_knowledge_char(gc), gc);
-
- cell->tile_fg = fg;
- cell->tile_bg = bg | tileidx_unseen_flag(gc);
+ tileidx_out_of_los(&cell->tile_fg, &cell->tile_bg, gc);
#endif
}
@@ -844,15 +838,7 @@ static void _draw_los_backup(screen_cell_t *cell,
cell->colour = Options.colour_map ? real_colour(get_map_col(gc, false))
: DARKGREY;
#ifdef USE_TILE
- tileidx_t bg = env.tile_bk_bg(gc);
- tileidx_t fg = env.tile_bk_fg(gc);
- if (bg != 0 || fg != 0)
- {
- cell->tile_fg = fg;
- cell->tile_bg = bg | tileidx_unseen_flag(gc);
- }
- else
- tileidx_unseen(&cell->tile_fg, &cell->tile_bg, cell->glyph, gc);
+ tileidx_out_of_los(&cell->tile_fg, &cell->tile_bg, gc);
#endif
}