diff --git a/src/display.cpp b/src/display.cpp index 3bb479ec2ebf..adca2577e422 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -72,7 +72,6 @@ namespace { const unsigned int MinZoom = zoom_levels.front(); const unsigned int MaxZoom = zoom_levels.back(); - size_t sunset_delay = 0; bool benchmark = false; @@ -1312,12 +1311,6 @@ void display::drawing_buffer_clear() drawing_buffer_.clear(); } -void display::sunset(const size_t delay) -{ - // This allow both parametric and toggle use - sunset_delay = (sunset_delay == 0 && delay == 0) ? 3 : delay; -} - void display::toggle_benchmark() { benchmark = !benchmark; @@ -1336,15 +1329,6 @@ void display::flip() surface& frameBuffer = video().getSurface(); - // This is just the debug function "sunset" to progressively darken the map area - static size_t sunset_timer = 0; - if (sunset_delay && ++sunset_timer > sunset_delay) { - sunset_timer = 0; - SDL_Rect r = map_outside_area(); // Use frameBuffer to also test the UI - const Uint32 color = SDL_MapRGBA(video().getSurface()->format,0,0,0,SDL_ALPHA_OPAQUE); - // Adjust the alpha if you want to balance cpu-cost / smooth sunset - sdl::fill_rect_alpha(r, color, 1, frameBuffer); - } font::draw_floating_labels(frameBuffer); events::raise_volatile_draw_event(); diff --git a/src/display.hpp b/src/display.hpp index 8159cd226b79..ac5fbd2f7ca5 100644 --- a/src/display.hpp +++ b/src/display.hpp @@ -437,15 +437,6 @@ class display : public filter_context, public video2::draw_layering void clear_mouseover_hex_overlay() { mouseover_hex_overlay_ = nullptr; } - /** - * Debug function to toggle the "sunset" mode. - * The map area become progressively darker, - * except where hexes are refreshed. - * delay is the number of frames between each darkening - * (0 to toggle). - */ - static void sunset(const size_t delay = 0); - /** Toggle to continuously redraw the screen. */ static void toggle_benchmark(); diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 7eac195a4e63..5978e734a930 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -103,8 +103,6 @@ class builder_window : public builder_styled_widget } // namespace implementation REGISTER_WIDGET(window) -unsigned window::sunset_ = 0; - namespace { #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS @@ -746,18 +744,6 @@ void window::draw() } if (dirty_list_.empty()) { - if (sunset_) { - /** @todo should probably be moved to event::sdl_event_handler::draw. */ - static unsigned i = 0; - if (++i % sunset_ == 0) { - SDL_Rect r = sdl::create_rect( - 0, 0, frame_buffer->w, frame_buffer->h); - const Uint32 color - = SDL_MapRGBA(frame_buffer->format, 0, 0, 0, SDL_ALPHA_OPAQUE); - - sdl::fill_rect_alpha(r, color, 1, frame_buffer); - } - } return; } diff --git a/src/gui/widgets/window.hpp b/src/gui/widgets/window.hpp index ad7659ef1e96..14a617e5bccf 100644 --- a/src/gui/widgets/window.hpp +++ b/src/gui/widgets/window.hpp @@ -440,11 +440,6 @@ class window : public panel, public cursor::setter click_dismiss_ = click_dismiss; } - static void set_sunset(const unsigned interval) - { - sunset_ = interval ? interval : 5; - } - bool get_need_layout() const { return need_layout_; @@ -612,15 +607,6 @@ class window : public panel, public cursor::setter /** Disable the escape key see our setter for more info. */ bool escape_disabled_; - /** - * Controls the sunset feature. - * - * If this value is not 0 it will darken the entire screen every - * sunset_th drawing request that nothing has been modified. It's a debug - * feature. - */ - static unsigned sunset_; - /** * Helper struct to force widgets the have the same size. * diff --git a/src/menu_events.cpp b/src/menu_events.cpp index 6833a95f6187..4ef6f0fd7b4f 100644 --- a/src/menu_events.cpp +++ b/src/menu_events.cpp @@ -1008,7 +1008,6 @@ class console_handler : public map_command_handler, private cha void do_control(); void do_controller(); void do_clear(); - void do_sunset(); void do_foreground(); void do_layers(); void do_fps(); @@ -1094,8 +1093,6 @@ class console_handler : public map_command_handler, private cha _("Query the controller status of a side."), _("")); register_command("clear", &console_handler::do_clear, _("Clear chat history.")); - register_command("sunset", &console_handler::do_sunset, - _("Visualize the screen refresh procedure."), "", "D"); register_command("foreground", &console_handler::do_foreground, _("Debug foreground terrain."), "", "D"); register_command("layers", &console_handler::do_layers, @@ -1489,11 +1486,7 @@ void console_handler::do_controller() void console_handler::do_clear() { menu_handler_.gui_->get_chat_manager().clear_chat_messages(); } -void console_handler::do_sunset() { - int delay = lexical_cast_default(get_data()); - menu_handler_.gui_->sunset(delay); - gui2::window::set_sunset(delay); -} + void console_handler::do_foreground() { menu_handler_.gui_->toggle_debug_foreground(); }