split up user / testing definitions

This commit is contained in:
jonathan santis
2024-10-30 10:51:13 +01:00
parent 4ab7bf6ce1
commit 1634f96817
3 changed files with 23 additions and 17 deletions

View File

@@ -19,6 +19,8 @@ const getTermDimension = term.getTermDimension;
const movement = @import("movement.zig");
const mv_axis_border_bounce = movement.mv_axis_border_bounce;
const definitions = @import("definitions.zig");
pub fn main() !void {
var win = Winsize{};
@@ -48,10 +50,10 @@ fn draw() !void {
var buffer = try allocator.alloc(u8, buffer_size); //utf-8 can be 4 bytes long
defer allocator.free(buffer);
primitive.obj[0].a.x = 10;
print("primitive.obj[0].a.x:{}\n", .{primitive.obj[0].a.x});
print("primitive.obj[0].b.x:{}\n", .{primitive.obj[0].b.x});
print("primitive.obj[9].b.x:{}\n", .{primitive.obj[9].b.x});
definitions.obj[0].a.x = 10;
print("definitions.obj[0].a.x:{}\n", .{definitions.obj[0].a.x});
print("definitions.obj[0].b.x:{}\n", .{definitions.obj[0].b.x});
print("definitions.obj[9].b.x:{}\n", .{definitions.obj[9].b.x});
_ = try stdin.readUntilDelimiterOrEof(&buf, '\n');
//video loop
while (true) {
@@ -66,7 +68,7 @@ fn draw() !void {
slice[bytes_written + ii] = 0;
}
}
try triangle(buffer, w, primitive.vec);
try triangle(buffer, w, definitions.vec);
//_ = try bresenham(buffer, w, Point{ .x = 10, .y = 10, .z = 0 }, Point{ .x = 30, .y = 12, .z = 0 });
try out.print("\x1B[2J", .{});
@@ -87,7 +89,7 @@ fn draw() !void {
// mv_axis_border_bounce(w, &primitive.vec2.b, 'Y');
// mv_axis_border_bounce(w, &primitive.vec2.c, 'x');
// mv_axis_border_bounce(w, &primitive.vec2.c, 'y');
//try triangle(buffer, w, primitive.obj.vec);
//try triangle(buffer, w, definitions.obj.vec);
try fill_draw(w, buffer);
try out.print("{s}", .{buffer});