improve performance of wesnoth.delay(0)
In this case we don't need to call SDL_GetTicks() or game_display_->delay(10)
This commit is contained in:
parent
85bbfa90cc
commit
9aa6722622
1 changed files with 4 additions and 0 deletions
|
@ -3517,6 +3517,10 @@ int game_lua_kernel::intf_color_adjust(lua_State *L)
|
|||
int game_lua_kernel::intf_delay(lua_State *L)
|
||||
{
|
||||
lua_Integer delay = luaL_checkinteger(L, 1);
|
||||
if(delay == 0) {
|
||||
play_controller_.play_slice(false);
|
||||
return 0;
|
||||
}
|
||||
if(luaW_toboolean(L, 2) && game_display_ && game_display_->turbo_speed() > 0) {
|
||||
delay /= game_display_->turbo_speed();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue