Author: shadowmaster
Date: Wed Mar 21 09:23:30 2012
New Revision: 53593

URL: http://svn.gna.org/viewcvs/wesnoth?rev=53593&view=rev
Log:
gui2/teditor_settings: Use a cheaper, less CPU-intensive solution to refresh 
tiles after changing ToD settings

Instead of refreshing the entire display, this solution simply
invalidates all gamemap tiles and requests them to be redrawn, saving a
lot of CPU time and making continuous operations (i.e. dragging one of
the sliders around) smoother. We still need to redraw the dialog,
though, and there's a hack involved to avoid a floating slice of it
appearing in the middle of the process.

Modified:
    trunk/src/gui/dialogs/editor_settings.cpp

Modified: trunk/src/gui/dialogs/editor_settings.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/dialogs/editor_settings.cpp?rev=53593&r1=53592&r2=53593&view=diff
==============================================================================
--- trunk/src/gui/dialogs/editor_settings.cpp (original)
+++ trunk/src/gui/dialogs/editor_settings.cpp Wed Mar 21 09:23:30 2012
@@ -127,10 +127,19 @@
                        , custom_tod_green_field_->get_widget_value(window)
                        , custom_tod_blue_field_->get_widget_value(window));
 
+       // 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();
+
        if(display_) {
-               display_->redraw_everything();
-       }
-
+               // invalidate all tiles so they are redrawn with the new ToD 
tint next
+               display_->invalidate_all();
+               // redraw tiles
+               display_->draw();
+       }
+
+       // Redraw this window again.
        window.set_dirty(true);
 }
 


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to