port scripts to new zig

This commit is contained in:
LordMZTE 2023-05-15 11:35:54 +02:00
parent a3c21be56a
commit cefaf24168
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
2 changed files with 4 additions and 3 deletions

View file

@ -86,7 +86,7 @@ pub fn winContent(state: *State) !void {
for (preset_qualities) |quality| {
if (c.igSelectable_Bool(quality.ptr, false, 0, .{ .x = 0.0, .y = 0.0 })) {
std.mem.set(u8, &state.quality_buf, 0);
@memset(&state.quality_buf, 0);
std.mem.copy(u8, &state.quality_buf, quality);
}
}

View file

@ -32,11 +32,12 @@ pub const Options = struct {
};
pub fn render(writer: anytype, options: Options) !void {
try (Renderer(@TypeOf(writer)){
var renderer = Renderer(@TypeOf(writer)){
.last_style = null,
.writer = writer,
.options = options,
}).render();
};
try renderer.render();
}
fn Renderer(comptime Writer: type) type {