Author: crab
Date: Tue May 12 01:49:01 2009
New Revision: 35582

URL: http://svn.gna.org/viewcvs/wesnoth?rev=35582&view=rev
Log:
Backport of r35581 from trunk. Skip delay(20) in play_slice during ai_interact, 
do not redraw screen twice during ai_interact.

Modified:
    branches/1.6/src/controller_base.cpp
    branches/1.6/src/controller_base.hpp
    branches/1.6/src/playsingle_controller.cpp

Modified: branches/1.6/src/controller_base.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/src/controller_base.cpp?rev=35582&r1=35581&r2=35582&view=diff
==============================================================================
--- branches/1.6/src/controller_base.cpp (original)
+++ branches/1.6/src/controller_base.cpp Tue May 12 01:49:01 2009
@@ -179,7 +179,7 @@
        return scrolling;
 }
 
-void controller_base::play_slice()
+void controller_base::play_slice(bool is_delay_enabled)
 {
        CKey key;
        events::pump();
@@ -206,7 +206,9 @@
                        // scrolling ended, update the cursor and the 
brightened hex
                        get_mouse_handler_base().mouse_update(browse_);
                }
-               get_display().delay(20);
+               if (is_delay_enabled){
+                       get_display().delay(20);
+               }
        }
        slice_end();
 }

Modified: branches/1.6/src/controller_base.hpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/src/controller_base.hpp?rev=35582&r1=35581&r2=35582&view=diff
==============================================================================
--- branches/1.6/src/controller_base.hpp (original)
+++ branches/1.6/src/controller_base.hpp Tue May 12 01:49:01 2009
@@ -35,7 +35,7 @@
        controller_base(int ticks, const config& game_config, CVideo& video);
        virtual ~controller_base();
 
-       void play_slice();
+       void play_slice(bool is_delay_enabled = true);
 
        int get_ticks();
 

Modified: branches/1.6/src/playsingle_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/branches/1.6/src/playsingle_controller.cpp?rev=35582&r1=35581&r2=35582&view=diff
==============================================================================
--- branches/1.6/src/playsingle_controller.cpp (original)
+++ branches/1.6/src/playsingle_controller.cpp Tue May 12 01:49:01 2009
@@ -843,8 +843,7 @@
 
 void playsingle_controller::handle_generic_event(const std::string& name){
        if (name == "ai_user_interact"){
-               play_slice();
-               gui_->draw();
+               play_slice(false);
        }
 }
 


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

Reply via email to