Skip delay(20) in play_slice during ai_interact,

...do not redraw screen twice during ai_interact.
This commit is contained in:
Iurii Chernyi 2009-05-11 23:29:26 +00:00
parent f291c96c1b
commit ac02ec159f
3 changed files with 6 additions and 5 deletions

View File

@ -179,7 +179,7 @@ bool controller_base::handle_scroll(CKey& key, int mousex, int mousey, int mouse
return scrolling;
}
void controller_base::play_slice()
void controller_base::play_slice(bool is_delay_enabled)
{
CKey key;
events::pump();
@ -206,7 +206,9 @@ void controller_base::play_slice()
// 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();
}

View File

@ -35,7 +35,7 @@ public:
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();

View File

@ -849,8 +849,7 @@ void playsingle_controller::play_ai_turn(){
void playsingle_controller::handle_generic_event(const std::string& name){
if (name == "ai_user_interact"){
play_slice();
gui_->draw();
play_slice(false);
}
}