From e0692885c5c8d535115338b797565bffa85811e6 Mon Sep 17 00:00:00 2001 From: AnErrupTion Date: Sat, 6 Dec 2025 14:34:47 +0100 Subject: [PATCH] Make delay floating point in dur format Signed-off-by: AnErrupTion --- src/animations/DurFile.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/animations/DurFile.zig b/src/animations/DurFile.zig index a79d653..86b951d 100644 --- a/src/animations/DurFile.zig +++ b/src/animations/DurFile.zig @@ -30,7 +30,7 @@ fn read_decompress_file(allocator: Allocator, file_path: []const u8) ![]u8 { const Frame = struct { frameNumber: i32, - delay: i32, + delay: f32, contents: [][]u8, colorMap: [][][]i32, @@ -398,7 +398,7 @@ fn draw(self: *DurFile) void { const delta_time = time_current - self.time_previous; // Convert delay from sec to ms - const delay_time: u32 = @intCast(current_frame.delay * 1000); + const delay_time: u32 = @intFromFloat(current_frame.delay * 1000); if (delta_time > (self.frame_time + delay_time)) { self.time_previous = time_current;