summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-20 22:21:29 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-20 22:21:29 +0100
commitbf288cdaff4633e2898b707b70a8c8b353af174b (patch)
tree9fa4f4e1f60e7ce270e099d15f5aa3b091972f8c
parent1a1d9ecee355cbea8bfc8d463faaae1d4d3fd2c2 (diff)
downloadcrawl-ref-bf288cdaff4633e2898b707b70a8c8b353af174b.tar.gz
crawl-ref-bf288cdaff4633e2898b707b70a8c8b353af174b.zip
Remove unused crawl_exit_hook.
-rw-r--r--crawl-ref/source/directn.cc13
-rw-r--r--crawl-ref/source/env.h2
-rw-r--r--crawl-ref/source/libunix.cc6
-rw-r--r--crawl-ref/source/state.h11
-rw-r--r--crawl-ref/source/tilesdl.cc6
5 files changed, 0 insertions, 38 deletions
diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc
index cec4ffa732..1a9ec50efa 100644
--- a/crawl-ref/source/directn.cc
+++ b/crawl-ref/source/directn.cc
@@ -876,19 +876,6 @@ static int _mlist_letter_to_index(char idx)
}
#endif
-crawl_exit_hook::crawl_exit_hook()
-{
- crawl_state.exit_hooks.push_back(this);
-}
-
-crawl_exit_hook::~crawl_exit_hook()
-{
- crawl_state.exit_hooks.erase(std::remove(crawl_state.exit_hooks.begin(),
- crawl_state.exit_hooks.end(),
- this),
- crawl_state.exit_hooks.end());
-}
-
range_view_annotator::range_view_annotator(int range)
{
if (Options.darken_beyond_range && range >= 0)
diff --git a/crawl-ref/source/env.h b/crawl-ref/source/env.h
index c110be03eb..a104a85e96 100644
--- a/crawl-ref/source/env.h
+++ b/crawl-ref/source/env.h
@@ -5,8 +5,6 @@
#include "monster.h"
#include "show.h"
-class crawl_exit_hook;
-
struct crawl_environment
{
public:
diff --git a/crawl-ref/source/libunix.cc b/crawl-ref/source/libunix.cc
index 1479396951..4c4ce8c952 100644
--- a/crawl-ref/source/libunix.cc
+++ b/crawl-ref/source/libunix.cc
@@ -376,12 +376,6 @@ void sighup_save_and_exit()
{
mpr("Received HUP signal, saved and exited game.", MSGCH_ERROR);
- // Clean up all the hooks.
- for (unsigned i = 0; i < crawl_state.exit_hooks.size(); ++i)
- crawl_state.exit_hooks[i]->restore_state();
-
- crawl_state.exit_hooks.clear();
-
// save_game(true) exits from the game. The "true" is also required
// to save changes to the current level.
save_game(true, "Received HUP signal, saved game.");
diff --git a/crawl-ref/source/state.h b/crawl-ref/source/state.h
index 93ae40675d..c7d9529f8d 100644
--- a/crawl-ref/source/state.h
+++ b/crawl-ref/source/state.h
@@ -13,14 +13,6 @@
class monsters;
class mon_acting;
-class crawl_exit_hook
-{
-public:
- crawl_exit_hook();
- virtual ~crawl_exit_hook();
- virtual void restore_state() = 0;
-};
-
struct god_act_state
{
public:
@@ -85,9 +77,6 @@ struct game_state
std::vector<std::string> input_line_strs;
unsigned int input_line_curr;
- // Hooks to call if get shut down unexpectedly.
- std::vector<crawl_exit_hook*> exit_hooks;
-
bool level_annotation_shown;
// Range beyond which view should be darkend, -1 == disabled.
diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc
index 6a92f492d9..51ed39ea10 100644
--- a/crawl-ref/source/tilesdl.cc
+++ b/crawl-ref/source/tilesdl.cc
@@ -918,13 +918,7 @@ int TilesFramework::getch_ck()
case SDL_QUIT:
if (crawl_state.need_save)
- {
- for (unsigned i = 0; i < crawl_state.exit_hooks.size(); ++i)
- crawl_state.exit_hooks[i]->restore_state();
-
- crawl_state.exit_hooks.clear();
save_game(true);
- }
exit(0);
break;