aboutsummaryrefslogtreecommitdiff
path: root/src/level.zig
diff options
context:
space:
mode:
authortslil clingman <>2021-10-10 21:01:14 -0400
committertslil clingman <>2021-10-10 21:01:14 -0400
commite014c4a063b05f7e417b4fd593a4f7033b0e4a9f (patch)
tree6a30d92aae015b8bee0eb1110df4bbcfbb1aa209 /src/level.zig
parentcb15709551921e111d2648f7d6545e4d0e3fdcd6 (diff)
Untested first mock up of polygon intersection in square
Diffstat (limited to 'src/level.zig')
-rw-r--r--src/level.zig25
1 files changed, 16 insertions, 9 deletions
diff --git a/src/level.zig b/src/level.zig
index a5d7330..dce2a14 100644
--- a/src/level.zig
+++ b/src/level.zig
@@ -18,26 +18,33 @@
const std = @import("std");
pub const Object = struct {
- height : f32,
- width : f32,
- texture : u8,
- pos_x : f32,
- pos_y : f32,
- pos_z : f32 = 0,
+ height: f32,
+ width: f32,
+ texture: u8,
+ pos_x: f32,
+ pos_y: f32,
+ pos_z: f32 = 0,
};
pub const Cell = struct {
floor_height: f32 = 0,
- ceiling_height : f32 = DEFAULT_HEIGHT,
+ ceiling_height: f32 = DEFAULT_HEIGHT,
draw_down: bool = false,
lower_texture: u8 = 0,
upper_texture: u8 = 0,
floor_texture: u8 = 0,
ceiling_texture: u8 = 2,
- pub const floor = Cell{ };
+ vertices: [][2]f32 = [][2]f32{
+ .{ 0, 0 },
+ .{ 1, 0 },
+ .{ 1, 1 },
+ .{ 0, 1 },
+ },
- pub const DEFAULT_HEIGHT : f32 = 4;
+ pub const floor = Cell{};
+
+ pub const DEFAULT_HEIGHT: f32 = 4;
};
pub const Map = struct {