Author: esr
Date: Sun Jun 24 11:27:48 2007
New Revision: 18430
URL: http://svn.gna.org/viewcvs/wesnoth?rev=18430&view=rev
Log:
Reports were cleared twice on redraw_everytything, once in that function and
once in the following draw(). I don't think this is necessary, and it's in
the way of my refactoring project.
Suspect this commit if we start to have glitches in updates of the
report fields on screen.
Modified:
trunk/src/display.cpp
trunk/src/display.hpp
Modified: trunk/src/display.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.cpp?rev=18430&r1=18429&r2=18430&view=diff
==============================================================================
--- trunk/src/display.cpp (original)
+++ trunk/src/display.cpp Sun Jun 24 11:27:48 2007
@@ -68,6 +68,7 @@
theme_(theme_cfg,screen_area()), zoom_(DefaultZoom),
builder_(cfg, level, map),
minimap_(NULL), redrawMinimap_(false), redraw_background_(true),
+ invalidateAll_(true),
fps_handle_(0)
{
if(non_interactive()) {
@@ -748,7 +749,7 @@
temp_unit_(NULL),
status_(status),
teams_(t), nextDraw_(0),
- invalidateAll_(true), invalidateUnit_(true),
+ invalidateUnit_(true),
invalidateGameStatus_(true), panelsDrawn_(false),
currentTeam_(0), activeTeam_(0),
turbo_speed_(2), turbo_(false), grid_(false), sidebarScaling_(1.0),
@@ -1191,6 +1192,8 @@
bounds_check_position();
+ invalidateGameStatus_ = true;
+
for(size_t n = 0; n != reports::NUM_REPORTS; ++n) {
reportRects_[n] = empty_rect;
reportSurfaces_[n].assign(NULL);
@@ -1226,11 +1229,7 @@
if(!panelsDrawn_) {
draw_all_panels();
- //invalidate the reports so they are redrawn
-
std::fill(reports_,reports_+sizeof(reports_)/sizeof(*reports_),reports::report());
- invalidateGameStatus_ = true;
panelsDrawn_ = true;
-
changed = true;
}
Modified: trunk/src/display.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.hpp?rev=18430&r1=18429&r2=18430&view=diff
==============================================================================
--- trunk/src/display.hpp (original)
+++ trunk/src/display.hpp Sun Jun 24 11:27:48 2007
@@ -148,6 +148,7 @@
// Will be overridden in the display subclass
bool fogged(const gamemap::location& loc UNUSED) const {return false;};
bool shrouded(const gamemap::location& loc UNUSED) const {return
false;};
+ void invalidate(const gamemap::location& loc)
{invalidated_.insert(loc);};
//debug function to toggle the "sunset" mode the map area
//become progressively darker except where hexes are refreshed
@@ -170,7 +171,6 @@
std::vector<std::string> get_fog_shroud_graphics(const
gamemap::location& loc);
- void draw_all_panels();
protected:
CVideo& screen_;
@@ -182,14 +182,20 @@
surface minimap_;
bool redrawMinimap_;
bool redraw_background_;
+ bool invalidateAll_;
// Not set by the initializer
std::vector<gui::button> buttons_;
+ std::set<gamemap::location> invalidated_;
//composes and draws the terrains on a tile
void draw_terrain_on_tile(const gamemap::location& loc,
const time_of_day& tod,
image::TYPE image_type,
ADJACENT_TERRAIN_TYPE type);
+
+ // redraw all panels associated with the map display
+ void draw_all_panels();
+
private:
//the handle for the label which displays frames per second
int fps_handle_;
@@ -533,8 +539,6 @@
void invalidate_route();
- std::set<gamemap::location> invalidated_;
- bool invalidateAll_;
bool invalidateUnit_;
bool invalidateGameStatus_;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits