diff options
author | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-25 03:18:48 +0000 |
---|---|---|
committer | ennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-07-25 03:18:48 +0000 |
commit | 18fa676cf1f8c9dd674bec700c095187fab2ab0b (patch) | |
tree | 8076f94a3f3e97cd0ad3b7f41f1013885bf33820 | |
parent | 8c399dae34cfee1034b7ed74caab95589ca8646c (diff) | |
download | crawl-ref-18fa676cf1f8c9dd674bec700c095187fab2ab0b.tar.gz crawl-ref-18fa676cf1f8c9dd674bec700c095187fab2ab0b.zip |
Fixing Tiles minimap not being updated with magic mapping. Some other minor Tiles cleanup.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6678 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r-- | crawl-ref/source/player.cc | 1 | ||||
-rw-r--r-- | crawl-ref/source/tilepick.cc | 25 | ||||
-rw-r--r-- | crawl-ref/source/tilesdl.cc | 10 | ||||
-rw-r--r-- | crawl-ref/source/view.cc | 7 |
4 files changed, 18 insertions, 25 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index 57da963f84..2aa13c2613 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -2845,7 +2845,6 @@ void forget_map(unsigned char chance_forgotten, bool force) #ifdef USE_TILE tiles.clear_minimap(); - tile_clear_buf(); #endif } diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc index 6366363969..d5625c2b9a 100644 --- a/crawl-ref/source/tilepick.cc +++ b/crawl-ref/source/tilepick.cc @@ -36,7 +36,7 @@ struct mcache_entry int draco; }; -std::vector<mcache_entry> mcache; +static std::vector<mcache_entry> mcache; int get_base_idx_from_mcache(int tile_idx) { @@ -82,9 +82,6 @@ void tile_mcache_unlock() mcache.clear(); } -// tile index cache to reduce tileidx() calls -static FixedArray < unsigned int, GXM, GYM > tile_dngn; - static inline bool _is_bazaar() { return (you.level_type == LEVEL_PORTAL_VAULT @@ -104,7 +101,6 @@ void TileNewLevel(bool first_time) tiles.update_minimap(x, y); TileLoadWall(false); - tile_clear_buf(); if (first_time) tile_init_flavor(); @@ -3978,15 +3974,6 @@ void tile_init_flavor() } } -void tile_clear_buf() -{ - for (int y = 0; y < GYM; y++) - for (int x = 0; x < GXM; x++) - { - tile_dngn[x][y] = TILE_DNGN_UNSEEN; - } -} - // Called from view.cc. void tile_draw_floor() { @@ -4004,20 +3991,18 @@ void tile_draw_floor() if (object == DNGN_SECRET_DOOR) object = (int)grid_secret_door_appearance(gc); - tile_dngn[gc.x][gc.y] = tileidx_feature(object, gc.x, gc.y); + bg = tileidx_feature(object, gc.x, gc.y); if (is_travelable_stair((dungeon_feature_type)object) && !travel_cache.know_stair(gc)) { - tile_dngn[gc.x][gc.y] |= TILE_FLAG_NEW_STAIR; + bg |= TILE_FLAG_NEW_STAIR; } - bg = tile_dngn[gc.x][gc.y]; } else if (map_bounds(gc) && object != 0) { // outside border - tile_dngn[gc.x][gc.y] = tileidx_feature(object, gc.x, gc.y); - bg = tile_dngn[gc.x][gc.y]; + bg = tileidx_feature(object, gc.x, gc.y); } // init tiles env.tile_bg[ep.x-1][ep.y-1] = bg; @@ -4216,7 +4201,7 @@ void tile_place_monster(int gx, int gy, int idx, bool foreground, bool detected) if (foreground) { env.tile_fg[ep.x-1][ep.y-1] = t; - if (menv[idx].is_named()) + if (menv[idx].is_named() && !mons_friendly(&menv[idx])) { tiles.add_text_tag(TAG_NAMED_MONSTER, menv[idx].name(DESC_CAP_A), gc); diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index e7bb559c34..f09ece9c1d 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -789,6 +789,16 @@ void TilesFramework::update_minimap(int gx, int gy, map_feature f) f = MF_EXCL; } + if (f == MF_WALL || f == MF_FLOOR) + { + if (is_terrain_known(gx, gy) && !is_terrain_seen(gx, gy) + || is_envmap_detected_item(gx, gy) + || is_envmap_detected_mons(gx, gy)) + { + f = (f == MF_WALL) ? MF_MAP_WALL : MF_MAP_FLOOR; + } + } + m_region_map->set(gx, gy, f); } diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 6106fde3e3..816c615991 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -279,6 +279,9 @@ void set_terrain_mapped( int x, int y ) { env.map[x][y].flags &= (~MAP_CHANGED_FLAG); env.map[x][y].flags |= MAP_MAGIC_MAPPED_FLAG; +#ifdef USE_TILE + tiles.update_minimap(x, y); +#endif } void set_terrain_seen( int x, int y ) @@ -3686,10 +3689,6 @@ bool magic_mapping(int map_radius, int proportion, bool suppress_msg, } } -#ifdef USE_TILE - tile_clear_buf(); -#endif - return (true); } // end magic_mapping() |