21 if ((uintptr_t)keys == UINT32_MAX)
30 if (time >= last_time)
37 int lo = 1, hi = last;
41 int mid = (lo + hi) >> 1;
66 return (uint8_t)(packed >> 31);
85 uint32_t half_extent = ((vertical ? size->
height : size->
width) + 1) / 2;
89 unsigned shift = vertical ? 8 : 0;
90 uint32_t speed = ((packed >> (16 + shift)) & 0xff) + 1;
99 return (uint8_t)(start + (((end - start) * weight) >>
MATH_Q12_SHIFT));
112 frame %= 2 * duration;
113 if (frame > duration)
114 frame = 2 * duration - frame;
117 if (frame <= hold || frame >= duration)
120 color->
r = endpoint->
r;
121 color->
g = endpoint->
g;
122 color->
b = endpoint->
b;
134 int32_t frame_count_q12)
136 uint32_t packed = *state;
159 uint32_t position = (uint32_t)(((int64_t)frames->
frameRateQ16 * frame) >> 16);
166 uint32_t phase = position % period;
167 uint32_t selected = phase;
168 uint32_t random_frame = 0;
170 selected = last - phase;
174 selected = 2 * last - phase;
181 while (random_frame == previous);
182 selected = random_frame;
185 *state = modes | (random_frame << 17) | (phase << 9) | slot;
191 int32_t complement = (int32_t)((uint32_t)
MATH_Q12_ONE - weight);
192 return (int16_t)((((int64_t)complement * next) >>
MATH_Q12_SHIFT) +
197 int32_t frame,
bool per_vertex)
208 while ((uint32_t)(int32_t)next->
frame_number < (uint32_t)frame)
234 uint32_t vertices_left = (int32_t)controller->
vertex_count;
235 if (!count || !vertices_left)
242 memcpy(local_keys, keys, count *
sizeof(*keys));
253 if (count > 1 && duration && !per_vertex)
256 frame = 2 * duration - frame;
260 for (; vertices_left; --vertices_left, ++target)
265 if (sample >= duration)
#define ANIMATION_SPLINE_REPEAT_ENDPOINT
#define ANIMATION_LOCAL_COLOR_KEY_CAPACITY
#define ANIMATION_PLAYBACK_PINGPONG
@ ANIMATION_VERTEX_COLOR_REFLECT
#define ANIMATION_COLOR_COMPONENT_MAX
#define ANIMATION_UV_SCROLL_FRAME_SCALE
#define ANIMATION_SPLINE_TIME_Q6_MASK
#define ANIMATION_VERTEX_COLOR_TIME_MODE_MASK
#define ANIMATION_TIME_BIAS_MASK
@ ANIMATION_CONTROLLER_UV_SCROLL
@ ANIMATION_CONTROLLER_FRAMES
@ ANIMATION_CONTROLLER_COLOR
#define ANIMATION_PLAYBACK_ONCE
#define ANIMATION_VISIBILITY_TIME_Q6_MASK
#define ANIM_CTRL_STATE_ONCE
#define ANIM_CTRL_STATE_MODE_MASK
#define ANIM_CTRL_STATE_RANDOM_FRAME_MASK
#define ANIM_CTRL_STATE_PINGPONG
#define ANIM_CTRL_STATE_SLOT_MASK
#define ANIM_CTRL_STATE_RANDOM
uint32_t Animation_PackedControllerState
#define ANIM_CTRL_STATE_PHASE_MASK
#define ANIM_CTRL_STATE_DISABLED
#define ANIMATION_SPLINE_WRAP_SAMPLE_TIME
#define ANIM_CTRL_STATE_REVERSE
#define g_animationStateQueueCount
void Animation_ProcessVertexColor(struct Animation_VertexColorController *controller, struct Mesh_NodeExtended *mesh)
bool Animation_ProcessController(struct Material_Node **material_nodes, Animation_PackedControllerState *state, int32_t frame_count_q12)
static void scroll_texture_axis(struct Material_Node *node, int32_t frame, bool vertical)
static void update_material_color(struct Material_Node *node, uint32_t frame)
static uint8_t clamp_color(int channel)
static uint8_t blend_color_byte(uint8_t start, uint8_t end, int32_t weight)
void Animation_QueueStateChange(int32_t anim_state)
static int16_t blend_color_delta(int16_t previous, int16_t next, int32_t weight)
static struct Math_ColorRGBI16 sample_vertex_color(const struct Animation_VertexColorKeyframe *keys, int32_t frame, bool per_vertex)
uint8_t Animation_CheckKeyframeActive(uint32_t sample_time, struct Animation_SplineChannelVis *channel)
uint32_t Math_GenerateRandom(uint32_t range)
int32_t packed_time_bias_and_end_time
Animation_SplineChannelFlags channel_flags
struct Animation_VisibilityKeyframe * keyframes_or_minus_one_sentinel
struct Animation_VertexColorKeyframe * keyframe_array
struct Animation_VertexColorTarget * target_array
struct Math_ColorRGBI16 delta
int32_t inv_frame_delta_q12
struct Math_ColorRGB8 base_color
union Animation_VisibilityTiming timing_and_visibility
uint8_t transition_frames
struct Math_ColorRGB8 start_color
struct Math_ColorRGB8 end_color
struct Material_TableEntry * material
struct Material_RuntimeDescriptor ** frame_table
struct Math_SizeU8 dimensions_minus_1
struct Material_RuntimeDescriptor * texture_descriptor
uint32_t packed_uv_scroll
struct Math_ColorRGB8 color_adjust
struct Mesh_RuntimeVertex * scene_vertex_data
struct Math_ColorRGB8 color
#define g_animQueuedStateChange