1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-13 13:31:48 +00:00

Add 64-bit versions of core power of 2 functions

This commit is contained in:
Aaron Franke
2025-05-19 09:53:53 -07:00
parent 64b09905c7
commit f6f1df7d73
25 changed files with 161 additions and 124 deletions

View File

@@ -4550,7 +4550,7 @@ struct AnimationCompressionDataState {
return 1;
}
}
return nearest_shift(p_delta);
return nearest_shift((uint32_t)p_delta);
}
void _compute_max_shifts(uint32_t p_from, uint32_t p_to, uint32_t *max_shifts, uint32_t &max_frame_delta_shift) const {
@@ -4561,7 +4561,7 @@ struct AnimationCompressionDataState {
for (uint32_t i = p_from + 1; i <= p_to; i++) {
int32_t frame_delta = temp_packets[i].frame - temp_packets[i - 1].frame;
max_frame_delta_shift = MAX(max_frame_delta_shift, nearest_shift(frame_delta));
max_frame_delta_shift = MAX(max_frame_delta_shift, nearest_shift((uint32_t)frame_delta));
for (uint32_t j = 0; j < components; j++) {
int32_t diff = _compute_delta16_signed(temp_packets[i - 1].data[j], temp_packets[i].data[j]);
uint32_t shift = _compute_shift_bits_signed(diff);