mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-09 15:44:14 +00:00
replace non_turbo_delay() by delay(10) to decrease cpu load
This commit is contained in:
parent
3d96d323f0
commit
0e2fcec80a
@ -164,7 +164,7 @@ std::string recruit_unit(const gamemap& map, int side,
|
||||
disp->invalidate(recruit_location);
|
||||
disp->draw();
|
||||
events::pump();
|
||||
disp->non_turbo_delay();
|
||||
disp->delay(10);
|
||||
}
|
||||
un->second.set_standing(*disp,recruit_location);
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ bool animate_unit_advancement(const game_data& info,unit_map& units, gamemap::lo
|
||||
gui.invalidate(loc);
|
||||
gui.draw();
|
||||
events::pump();
|
||||
gui.non_turbo_delay();
|
||||
gui.delay(10);
|
||||
}
|
||||
}
|
||||
|
||||
@ -161,7 +161,7 @@ bool animate_unit_advancement(const game_data& info,unit_map& units, gamemap::lo
|
||||
gui.invalidate(loc);
|
||||
gui.draw();
|
||||
events::pump();
|
||||
gui.non_turbo_delay();
|
||||
gui.delay(10);
|
||||
}
|
||||
u->second.set_standing(gui,u->first);
|
||||
gui.invalidate(loc);
|
||||
|
@ -1163,7 +1163,7 @@ bool event_handler::handle_event_command(const queued_event& event_info,
|
||||
screen->invalidate(loc);
|
||||
screen->draw();
|
||||
events::pump();
|
||||
screen->non_turbo_delay();
|
||||
screen->delay(10);
|
||||
}
|
||||
un->second.set_standing(*screen,un->first);
|
||||
}
|
||||
@ -1781,7 +1781,7 @@ bool event_handler::handle_event_command(const queued_event& event_info,
|
||||
screen->invalidate(u->first);
|
||||
screen->draw();
|
||||
events::pump();
|
||||
screen->non_turbo_delay();
|
||||
screen->delay(10);
|
||||
}
|
||||
u->second.set_standing(*screen,u->first);
|
||||
screen->invalidate(u->first);
|
||||
@ -2152,7 +2152,7 @@ bool pump()
|
||||
return false;
|
||||
|
||||
bool result = false;
|
||||
|
||||
|
||||
while(events_queue.empty() == false) {
|
||||
queued_event ev = events_queue.front();
|
||||
events_queue.pop_front(); //pop now for exception safety
|
||||
|
@ -47,7 +47,7 @@ void teleport_unit_between(display& disp, const gamemap::location& a, const game
|
||||
disp.place_temporary_unit(temp_unit, a);
|
||||
disp.draw();
|
||||
events::pump();
|
||||
disp.non_turbo_delay();
|
||||
disp.delay(10);
|
||||
}
|
||||
}
|
||||
if (!disp.fogged(b.x, b.y)) { // teleport
|
||||
@ -58,7 +58,7 @@ void teleport_unit_between(display& disp, const gamemap::location& a, const game
|
||||
disp.place_temporary_unit(temp_unit, b);
|
||||
disp.draw();
|
||||
events::pump();
|
||||
disp.non_turbo_delay();
|
||||
disp.delay(10);
|
||||
}
|
||||
}
|
||||
temp_unit.set_standing(disp,b);
|
||||
@ -97,7 +97,7 @@ void move_unit_between(display& disp, const gamemap& map, const gamemap::locatio
|
||||
temp_unit.set_offset(pos);
|
||||
disp.draw();
|
||||
events::pump();
|
||||
disp.non_turbo_delay();
|
||||
disp.delay(10);
|
||||
|
||||
mvt_time = SDL_GetTicks() -start_time;
|
||||
}
|
||||
@ -185,7 +185,7 @@ void unit_die(display& disp,const gamemap::location& loc, unit& u, const attack_
|
||||
disp.invalidate(loc);
|
||||
disp.draw();
|
||||
events::pump();
|
||||
disp.non_turbo_delay();
|
||||
disp.delay(10);
|
||||
}
|
||||
u.set_standing(disp,loc);
|
||||
disp.update_display();
|
||||
@ -357,7 +357,7 @@ bool unit_attack_ranged(display& disp, unit_map& units,
|
||||
if(leader_loc.valid() && leader->second.get_animation()->animation_finished() ) {
|
||||
leader->second.set_standing(disp,leader_loc,true);
|
||||
}
|
||||
disp.non_turbo_delay();
|
||||
disp.delay(10);
|
||||
// we use missile animation because it's the only one not reseted in the middle to go to standing
|
||||
animation_time = missile_animation.get_animation_time();
|
||||
missile_animation.update_current_frame();
|
||||
@ -476,7 +476,7 @@ bool unit_attack(display& disp, unit_map& units,
|
||||
if(leader_loc.valid()) disp.invalidate(leader_loc);
|
||||
disp.draw();
|
||||
events::pump();
|
||||
disp.non_turbo_delay();
|
||||
disp.delay(10);
|
||||
|
||||
animation_time = attacker.get_animation()->get_animation_time();
|
||||
}
|
||||
@ -513,7 +513,7 @@ bool unit_attack(display& disp, unit_map& units,
|
||||
if(leader_loc.valid() && leader->second.get_animation()->animation_finished() ) {
|
||||
leader->second.set_standing(disp,leader_loc,true);
|
||||
}
|
||||
disp.non_turbo_delay();
|
||||
disp.delay(10);
|
||||
animation_time = attacker.get_animation()->get_animation_time();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user