From bf288cdaff4633e2898b707b70a8c8b353af174b Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Fri, 20 Nov 2009 22:21:29 +0100 Subject: Remove unused crawl_exit_hook. --- crawl-ref/source/directn.cc | 13 ------------- crawl-ref/source/env.h | 2 -- crawl-ref/source/libunix.cc | 6 ------ crawl-ref/source/state.h | 11 ----------- crawl-ref/source/tilesdl.cc | 6 ------ 5 files changed, 38 deletions(-) (limited to 'crawl-ref/source') 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 input_line_strs; unsigned int input_line_curr; - // Hooks to call if get shut down unexpectedly. - std::vector 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; -- cgit v1.2.3-54-g00ecf