Author: esr
Date: Sun Jun 24 06:31:59 2007
New Revision: 18427

URL: http://svn.gna.org/viewcvs/wesnoth?rev=18427&view=rev
Log:
Lift portions of the draw logic.

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=18427&r1=18426&r2=18427&view=diff
==============================================================================
--- trunk/src/display.cpp (original)
+++ trunk/src/display.cpp Sun Jun 24 06:31:59 2007
@@ -690,6 +690,23 @@
        update_rect(loc);
 }
 
+void map_display::draw_all_panels()
+{
+       surface const screen(screen_.getSurface());
+
+       const std::vector<theme::panel>& panels = theme_.panels();
+       for(std::vector<theme::panel>::const_iterator p = panels.begin(); p != 
panels.end(); ++p) {
+               draw_panel(video(),*p,buttons_);
+       }
+
+       const std::vector<theme::label>& labels = theme_.labels();
+       for(std::vector<theme::label>::const_iterator i = labels.begin(); i != 
labels.end(); ++i) {
+               draw_label(video(),screen,*i);
+       }
+
+       create_buttons();
+}
+
 /**
  * Proof-of-concept of the new background still has some flaws
  * * upon scrolling the background static (so maps scrolls over wood)
@@ -1210,20 +1227,7 @@
        int simulate_delay = 0;
 
        if(!panelsDrawn_) {
-               surface const screen(screen_.getSurface());
-
-               const std::vector<theme::panel>& panels = theme_.panels();
-               for(std::vector<theme::panel>::const_iterator p = 
panels.begin(); p != panels.end(); ++p) {
-                       draw_panel(video(),*p,buttons_);
-               }
-
-               const std::vector<theme::label>& labels = theme_.labels();
-               for(std::vector<theme::label>::const_iterator i = 
labels.begin(); i != labels.end(); ++i) {
-                       draw_label(video(),screen,*i);
-               }
-
-               create_buttons();
-
+               draw_all_panels();
                //invalidate the reports so they are redrawn
                
std::fill(reports_,reports_+sizeof(reports_)/sizeof(*reports_),reports::report());
                invalidateGameStatus_ = true;

Modified: trunk/src/display.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.hpp?rev=18427&r1=18426&r2=18427&view=diff
==============================================================================
--- trunk/src/display.hpp (original)
+++ trunk/src/display.hpp Sun Jun 24 06:31:59 2007
@@ -170,6 +170,8 @@
 
        std::vector<std::string> get_fog_shroud_graphics(const 
gamemap::location& loc);
 
+       void draw_all_panels();
+
 protected:
        CVideo& screen_;
        const gamemap& map_;


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

Reply via email to