Namespace list functions

This commit is contained in:
2024-06-23 21:17:54 +01:00
parent ab469b8f37
commit f72568c135
2 changed files with 12 additions and 12 deletions

View File

@@ -28,7 +28,7 @@ void draw_line(window_t *wnd, line_t line, colour_t colour) {
}
for (i32 x = x0; x <= x1; ++x) {
set_pixel(wnd, x, (i32)(get(values, x - x0)), colour);
set_pixel(wnd, x, (i32)(list_get(values, x - x0)), colour);
}
} else {
if (line.p1.y < line.p0.y) {
@@ -41,25 +41,25 @@ void draw_line(window_t *wnd, line_t line, colour_t colour) {
}
for (i32 y = y0; y <= y1; ++y) {
set_pixel(wnd, (i32)(get(values, y - y0)), y, colour);
set_pixel(wnd, (i32)(list_get(values, y - y0)), y, colour);
}
}
destroy_list(f32, values);
list_destroy(f32, values);
}
internal list_float_t *interpolate(i32 i0, f32 d0, i32 i1, f32 d1) {
list_float_t *values;
if (i0 == i1) {
values = create_list_with_capacity(f32, 20);
values = list_create_with_capacity(f32, 20);
if (values) {
append(f32, values, d0);
list_append(f32, values, d0);
}
return values;
}
values = create_list(f32);
values = list_create(f32);
if (!values) {
return NULL;
}
@@ -68,7 +68,7 @@ internal list_float_t *interpolate(i32 i0, f32 d0, i32 i1, f32 d1) {
f32 d = d0;
for (i32 i = i0; i <= i1; ++i) {
append(f32, values, d);
list_append(f32, values, d);
d += a;
}