Merge pull request #97290 from fire/fix-animation-compression

Fix animation compression going the wrong way
This commit is contained in:
Rémi Verschelde 2024-09-25 12:39:18 +02:00
commit 65c94ec873
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 3 additions and 3 deletions

View File

@ -4804,9 +4804,9 @@ void Animation::compress(uint32_t p_page_size, uint32_t p_fps, float p_split_tol
continue; // This track is exhausted (all keys were added already), don't consider. continue; // This track is exhausted (all keys were added already), don't consider.
} }
} }
double key_time = track_get_key_time(uncomp_track, time_tracks[i].key_index);
uint32_t key_frame = double(track_get_key_time(uncomp_track, time_tracks[i].key_index)) / frame_len; double result = key_time / frame_len;
uint32_t key_frame = Math::fast_ftoi(result);
if (time_tracks[i].needs_start_frame && key_frame > base_page_frame) { if (time_tracks[i].needs_start_frame && key_frame > base_page_frame) {
start_frame = true; start_frame = true;
best_frame = base_page_frame; best_frame = base_page_frame;