Author: mordante
Date: Sat May 30 10:21:53 2009
New Revision: 35935
URL: http://svn.gna.org/viewcvs/wesnoth?rev=35935&view=rev
Log:
Clear the dirty state for not drawn widgets.
The dirty flag caused a big slowdown in certain cases so needs to be
cleared.
Modified:
trunk/src/gui/widgets/window.cpp
Modified: trunk/src/gui/widgets/window.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/window.cpp?rev=35935&r1=35934&r2=35935&view=diff
==============================================================================
--- trunk/src/gui/widgets/window.cpp (original)
+++ trunk/src/gui/widgets/window.cpp Sat May 30 10:21:53 2009
@@ -514,6 +514,12 @@
* - draw [rbegin, rend) the fore ground of all widgets. For
items
* which have two layers eg window or panel it draws the
foreground
* layer. For other widgets it's a nop.
+ *
+ * Before drawing there needs to be determined whether a dirty
widget
+ * really needs to be redrawn. If the widget doesn't need to be
+ * redrawing either being not VISIBLE or has status NOT_DRAWN.
If
+ * it's not drawn it's still set not dirty to avoid it keep
getting
+ * on the dirty list.
*/
for(std::vector<twidget*>::iterator itor = item.begin();
@@ -521,6 +527,12 @@
if((**itor).get_visible() != twidget::VISIBLE
|| (**itor).get_drawing_action() ==
twidget::NOT_DRAWN) {
+
+ for(std::vector<twidget*>::iterator citor =
itor;
+ citor != item.end(); ++citor) {
+
+ (**citor).set_dirty(false);
+ }
item.erase(itor, item.end());
break;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits