Author: alink
Date: Tue Sep 14 07:37:46 2010
New Revision: 46489
URL: http://svn.gna.org/viewcvs/wesnoth?rev=46489&view=rev
Log:
Kill an always true bool
Supposed to track change but broken. Not worth the trouble since when there is
no change, there is not much to skip
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=46489&r1=46488&r2=46489&view=diff
==============================================================================
--- trunk/src/display.cpp (original)
+++ trunk/src/display.cpp Tue Sep 14 07:37:46 2010
@@ -1222,12 +1222,10 @@
}
}
-bool display::draw_init()
-{
- bool changed = false;
-
+void display::draw_init()
+{
if (get_map().empty()) {
- return changed;
+ return;
}
if(benchmark) {
@@ -1237,7 +1235,6 @@
if(!panelsDrawn_) {
draw_all_panels();
panelsDrawn_ = true;
- changed = true;
}
if(redraw_background_) {
@@ -1263,11 +1260,9 @@
redrawMinimap_ = true;
}
-
- return changed;
-}
-
-void display::draw_wrap(bool update,bool force,bool changed)
+}
+
+void display::draw_wrap(bool update, bool force)
{
static const int time_between_draws = preferences::draw_delay();
const int current_time = SDL_GetTicks();
@@ -1276,21 +1271,17 @@
if(redrawMinimap_) {
redrawMinimap_ = false;
draw_minimap();
- changed = true;
}
if(update) {
- if(force || changed) {
- update_display();
- if(!force && wait_time > 0) {
- // If it's not time yet to draw, delay until it
is
- SDL_Delay(wait_time);
- }
+ update_display();
+ if(!force && wait_time > 0) {
+ // If it's not time yet to draw, delay until it is
+ SDL_Delay(wait_time);
}
// Set the theortical next draw time
nextDraw_ += time_between_draws;
-
// If the next draw already should have been finished,
// we'll enter an update frenzy, so make sure that the
@@ -1946,7 +1937,7 @@
local_tod_light_ = has_time_area() &&
preferences::get("local_tod_light", false);
- bool changed = draw_init();
+ draw_init();
pre_draw();
// invalidate all that needs to be invalidated
invalidate_animations();
@@ -1969,19 +1960,17 @@
* ran if invalidated_.empty() == true.
*/
if(!invalidated_.empty() || preferences::show_haloes()) {
- changed = true;
draw_invalidated();
invalidated_.clear();
}
drawing_buffer_commit();
post_commit();
draw_sidebar();
- /** @todo FIXME: This changed can probably be smarter */
- changed = true;
+
// Simulate slow PC:
//SDL_Delay(2*simulate_delay + rand() % 20);
}
- draw_wrap(update, force, changed);
+ draw_wrap(update, force);
}
map_labels& display::labels()
Modified: trunk/src/display.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.hpp?rev=46489&r1=46488&r2=46489&view=diff
==============================================================================
--- trunk/src/display.hpp (original)
+++ trunk/src/display.hpp Tue Sep 14 07:37:46 2010
@@ -823,8 +823,8 @@
* Invalidate controls and panels when changed after they have been
drawn
* initially. Useful for dynamic theme modification.
*/
- bool draw_init();
- void draw_wrap(bool update,bool force,bool changed);
+ void draw_init();
+ void draw_wrap(bool update,bool force);
/** Used to indicate to drawing funtions that we are doing a map
screenshot */
bool map_screenshot_;
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits