summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-10-08 20:08:31 +0200
committerRobert Vollmert <rvollmert@gmx.net>2009-10-08 20:13:13 +0200
commit9cc7466db06f418c165ed79fd6bfdfe334a6a568 (patch)
tree67dfdfb1c6612a84db7423ab00d8518753edc88a
parent2fb004a5ae4d47af8151a821f296c25426fbe1e4 (diff)
downloadcrawl-ref-9cc7466db06f418c165ed79fd6bfdfe334a6a568.tar.gz
crawl-ref-9cc7466db06f418c165ed79fd6bfdfe334a6a568.zip
Remove legacy losight() function.
Also remove an obsoleted variant of grid_appearance.
-rw-r--r--crawl-ref/source/los.cc7
-rw-r--r--crawl-ref/source/los.h3
-rw-r--r--crawl-ref/source/losparam.cc31
-rw-r--r--crawl-ref/source/losparam.h16
-rw-r--r--crawl-ref/source/terrain.cc13
-rw-r--r--crawl-ref/source/terrain.h1
6 files changed, 4 insertions, 67 deletions
diff --git a/crawl-ref/source/los.cc b/crawl-ref/source/los.cc
index 85ea3002af..6aa70e0661 100644
--- a/crawl-ref/source/los.cc
+++ b/crawl-ref/source/los.cc
@@ -829,13 +829,6 @@ void losight(env_show_grid& sh, const los_param& dat)
sh(o+sh_o) = dat.appearance(o);
}
-void losight(env_show_grid &sh, feature_grid &gr,
- const coord_def& center, bool clear_walls_block,
- bool ignore_clouds)
-{
- losight(sh, los_param_compat(gr, center, clear_walls_block, ignore_clouds));
-}
-
void losight_permissive(env_show_grid &sh, const coord_def& center)
{
for (int x = -ENV_SHOW_OFFSET; x <= ENV_SHOW_OFFSET; ++x)
diff --git a/crawl-ref/source/los.h b/crawl-ref/source/los.h
index 0eca7e4fc4..c28561724b 100644
--- a/crawl-ref/source/los.h
+++ b/crawl-ref/source/los.h
@@ -31,9 +31,6 @@ bool grid_see_grid(const coord_def& p1, const coord_def& p2,
dungeon_feature_type allowed = DNGN_UNSEEN);
void clear_rays_on_exit();
-void losight(env_show_grid &sh, feature_grid &gr,
- const coord_def& center, bool clear_walls_block = false,
- bool ignore_clouds = false);
void losight(env_show_grid& sh, const los_param& dat);
void calc_show_los();
diff --git a/crawl-ref/source/losparam.cc b/crawl-ref/source/losparam.cc
index 7c01d088c9..85e0954499 100644
--- a/crawl-ref/source/losparam.cc
+++ b/crawl-ref/source/losparam.cc
@@ -101,34 +101,3 @@ opacity_type los_param_solid::opacity(const coord_def& p) const
else
return OPC_CLEAR;
}
-
-
-/* los_param_compat */
-
-los_param_compat::los_param_compat(const feature_grid& gr, const coord_def& c,
- bool sb, bool ic)
- : los_param_base(c), grid(gr), solid_blocks(sb), ignore_clouds(ic)
-{
-}
-
-dungeon_feature_type los_param_compat::feature(const coord_def& p) const
-{
- return grid(trans(p));
-}
-
-unsigned los_param_compat::appearance(const coord_def& p) const
-{
- return grid_appearance(grid, trans(p));
-}
-
-opacity_type los_param_compat::opacity(const coord_def& p) const
-{
- dungeon_feature_type f = feature(p);
- if (grid_is_opaque(f) || solid_blocks && grid_is_solid(f))
- return OPC_OPAQUE;
- else if (!ignore_clouds && is_opaque_cloud(cloud_idx(p)))
- return OPC_HALF;
- else
- return OPC_CLEAR;
-}
-
diff --git a/crawl-ref/source/losparam.h b/crawl-ref/source/losparam.h
index db88db38d3..fba1506b42 100644
--- a/crawl-ref/source/losparam.h
+++ b/crawl-ref/source/losparam.h
@@ -75,20 +75,4 @@ struct los_param_solid : los_param_base
opacity_type opacity(const coord_def& p) const;
};
-// Provides a compatible set of parameters for use with the
-// legacy losight() function.
-struct los_param_compat : los_param_base
-{
- feature_grid grid;
- bool solid_blocks;
- bool ignore_clouds;
-
- los_param_compat(const feature_grid& gr, const coord_def& c,
- bool sb, bool ic);
-
- dungeon_feature_type feature(const coord_def& p) const;
- unsigned appearance(const coord_def& p) const;
- opacity_type opacity(const coord_def& p) const;
-};
-
#endif
diff --git a/crawl-ref/source/terrain.cc b/crawl-ref/source/terrain.cc
index ee0efbde29..527ee90e14 100644
--- a/crawl-ref/source/terrain.cc
+++ b/crawl-ref/source/terrain.cc
@@ -365,16 +365,11 @@ unsigned int show_appearance(const coord_def &ep)
dungeon_feature_type grid_appearance(const coord_def &gc)
{
- return grid_appearance(grd, gc);
-}
-
-dungeon_feature_type grid_appearance(const feature_grid &gr, const coord_def &gc)
-{
- dungeon_feature_type grid = gr(gc);
- if (grid == DNGN_SECRET_DOOR)
- grid = grid_secret_door_appearance(gc);
+ dungeon_feature_type feat = env.grid(gc);
+ if (feat == DNGN_SECRET_DOOR)
+ feat = grid_secret_door_appearance(gc);
- return grid;
+ return feat;
}
dungeon_feature_type grid_secret_door_appearance(const coord_def &where)
diff --git a/crawl-ref/source/terrain.h b/crawl-ref/source/terrain.h
index 1c0adc0b1d..05dd845f42 100644
--- a/crawl-ref/source/terrain.h
+++ b/crawl-ref/source/terrain.h
@@ -53,7 +53,6 @@ void find_connected_range(coord_def d, dungeon_feature_type ft_min,
void get_door_description(int door_size, const char** adjective, const char** noun);
dungeon_feature_type grid_secret_door_appearance(const coord_def &where);
dungeon_feature_type grid_appearance(const coord_def &gc);
-dungeon_feature_type grid_appearance(const feature_grid &gr, const coord_def &gc);
unsigned int show_appearance(const coord_def &ep);
bool grid_destroys_items(dungeon_feature_type grid);