The Battle for Wesnoth  1.19.25+dev
Functions
animated.cpp File Reference

Global timeline management for the animation system. More...

#include "animated.hpp"
Include dependency graph for animated.cpp:

Go to the source code of this file.

Functions

void update_animation_timers (double acceleration)
 Updates both animation timelines. More...
 
std::chrono::steady_clock::time_point get_current_animation_tick (bool uses_acceleration)
 Gets the current time point for animations. More...
 

Detailed Description

Global timeline management for the animation system.

Maintains two parallel timelines:

Definition in file animated.cpp.

Function Documentation

◆ get_current_animation_tick()

std::chrono::steady_clock::time_point get_current_animation_tick ( bool  uses_acceleration)

Gets the current time point for animations.

Parameters
uses_accelerationIf true, returns accelerated timeline; otherwise normal timeline
Returns
Current time point on the selected timeline

Definition at line 49 of file animated.cpp.

Referenced by unit_animation_component::refresh().

◆ update_animation_timers()

void update_animation_timers ( double  acceleration = 1.0)

Updates both animation timelines.

Should be called once per frame before advancing any animations.

Parameters
accelerationMultiplier for the accelerated timeline (1.0 = normal speed)

Definition at line 38 of file animated.cpp.

Referenced by display::invalidate_animations(), and unit_animator::wait_until().