Skip to content

Commit

Permalink
GUI2/Window: removed empty undraw() function
Browse files Browse the repository at this point in the history
This was emptied earlier in my refactor when window unrendering was removed. I simply hadn't
removed the function yet.
  • Loading branch information
Vultraz committed Mar 18, 2018
1 parent 3154ab4 commit 6c04ae2
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 29 deletions.
15 changes: 5 additions & 10 deletions src/gui/dialogs/editor/custom_tod.cpp
Expand Up @@ -270,19 +270,14 @@ void custom_tod::color_slider_callback(window& window)
current_tod.color.g = color_field_g_->get_widget_value(window);
current_tod.color.b = color_field_b_->get_widget_value(window);

update_tod_display(window);
update_tod_display();
}

void custom_tod::update_tod_display(window& window)
void custom_tod::update_tod_display()
{
display* disp = display::get_singleton();
assert(disp && "Display pointer is null!");

// Prevent a floating slice of window appearing alone over the
// theme UI sidebar after redrawing tiles and before we have a
// chance to redraw the rest of this window.
window.undraw();

// NOTE: We only really want to re-render the gamemap tiles here.
// Redrawing everything is a significantly more expensive task.
// At this time, tiles are the only elements on which ToD tint is
Expand Down Expand Up @@ -329,17 +324,17 @@ void custom_tod::update_selected_tod_info(window& window)
const std::string new_index_str = formatter() << (current_tod_ + 1) << "/" << times_.size();
find_widget<label>(&window, "tod_number", false).set_label(new_index_str);

update_tod_display(window);
update_tod_display();
}

void custom_tod::copy_to_clipboard_callback(tod_attribute_getter getter)
{
desktop::clipboard::copy_to_clipboard(getter(get_selected_tod()).second, false);
}

void custom_tod::post_show(window& window)
void custom_tod::post_show(window& /*window*/)
{
update_tod_display(window);
update_tod_display();

if(get_retval() == retval::OK) {
// TODO: save ToD
Expand Down
2 changes: 1 addition & 1 deletion src/gui/dialogs/editor/custom_tod.hpp
Expand Up @@ -59,7 +59,7 @@ class custom_tod : public modal_dialog

void color_slider_callback(window& window);

void update_tod_display(window& window);
void update_tod_display();

void update_lawful_bonus(window& window);

Expand Down
1 change: 0 additions & 1 deletion src/gui/dialogs/modeless_dialog.cpp
Expand Up @@ -63,7 +63,6 @@ void modeless_dialog::hide()
remove_from_window_stack(window_.get());
}

window_->undraw();
window_.reset(nullptr); }
}

Expand Down
12 changes: 0 additions & 12 deletions src/gui/widgets/window.cpp
Expand Up @@ -611,18 +611,6 @@ void window::draw()
}
}

void window::undraw()
{
#if 0
if(restore_ && restorer_) {
SDL_Rect rect = get_rectangle();
sdl_blit(restorer_, 0, video_.getSurface(), &rect);
// Since the old area might be bigger as the new one, invalidate
// it.
}
#endif // 0
}

window::invalidate_layout_blocker::invalidate_layout_blocker(window& window)
: window_(window)
{
Expand Down
5 changes: 0 additions & 5 deletions src/gui/widgets/window.hpp
Expand Up @@ -147,11 +147,6 @@ class window : public panel, public cursor::setter
*/
void draw();

/**
* Undraws the window.
*/
void undraw();

/** The status of the window. */
enum status {
NEW, /**< The window is new and not yet shown. */
Expand Down

0 comments on commit 6c04ae2

Please sign in to comment.