Author: mordante
Date: Sat Nov 22 23:11:52 2008
New Revision: 30984
URL: http://svn.gna.org/viewcvs/wesnoth?rev=30984&view=rev
Log:
Remove some unused size caching in tgrid::tchild.
Modified:
trunk/src/gui/widgets/grid.cpp
trunk/src/gui/widgets/grid.hpp
Modified: trunk/src/gui/widgets/grid.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/grid.cpp?rev=30984&r1=30983&r2=30984&view=diff
==============================================================================
--- trunk/src/gui/widgets/grid.cpp (original)
+++ trunk/src/gui/widgets/grid.cpp Sat Nov 22 23:11:52 2008
@@ -738,14 +738,13 @@
return border_space();
}
- // NOTE best_size_ might be removed all together
- best_size_ = widget_->get_best_size() + border_space();
+ const tpoint best_size = widget_->get_best_size() + border_space();
DBG_G_L << "tgrid::tchild:"
<< " has widget " << true
- << " returning " << best_size_
+ << " returning " << best_size
<< ".\n";
- return best_size_;
+ return best_size;
}
void tgrid::tchild::set_size(tpoint origin, tpoint size)
Modified: trunk/src/gui/widgets/grid.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/grid.hpp?rev=30984&r1=30983&r2=30984&view=diff
==============================================================================
--- trunk/src/gui/widgets/grid.hpp (original)
+++ trunk/src/gui/widgets/grid.hpp Sat Nov 22 23:11:52 2008
@@ -257,9 +257,6 @@
flags_(0),
border_size_(0),
widget_(0),
- best_size_(0, 0),
- minimum_size_(0, 0),
- maximum_size_(0, 0),
clip_()
// Fixme make a class wo we can store some properties
in the cache
@@ -287,16 +284,16 @@
const std::string& id() const;
unsigned get_flags() const { return flags_; }
- void set_flags(const unsigned flags) { flags_ = flags;
set_dirty(); }
+ void set_flags(const unsigned flags) { flags_ = flags; }
unsigned get_border_size() const { return border_size_; }
void set_border_size(const unsigned border_size)
- { border_size_ = border_size; set_dirty(); }
+ { border_size_ = border_size; }
const twidget* widget() const { return widget_; }
twidget* widget() { return widget_; }
- void set_widget(twidget* widget) { widget_ = widget;
set_dirty(); }
+ void set_widget(twidget* widget) { widget_ = widget; }
private:
/** The flags for the border and cell setup. */
@@ -316,18 +313,6 @@
*/
twidget* widget_;
- /**
- * The best size for this cell, determined by the best size of
the
- * widget and the border_size_ and flags_.
- */
- mutable tpoint best_size_;
-
- /** The minimum size for this cell, like best_size_. */
- mutable tpoint minimum_size_;
-
- /** The maximum size for this cell, like best_size_. */
- mutable tpoint maximum_size_;
-
/** Returns the space needed for the border. */
tpoint border_space() const;
@@ -336,17 +321,6 @@
* container.
*/
SDL_Rect clip_;
-
- /**
- * Sets the calculations to be dirty, this means all caches are
simply
- * cleared.
- */
- void set_dirty() // FIXME rename to clear cache??
- {
- best_size_ = tpoint(0, 0);
- minimum_size_ = tpoint(0, 0);
- maximum_size_ = tpoint(0, 0);
- }
}; // class tchild
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits