Create vertex_t and move h data to it

This commit is contained in:
2024-07-13 22:00:48 +01:00
parent b0bf4f593b
commit e236cd8bbe
3 changed files with 81 additions and 116 deletions

View File

@@ -10,13 +10,15 @@
#define INVALID_VERTEX -1
typedef struct {
vec3f_t position;
f32 h;
} vertex_t;
typedef struct {
i64 idx0;
i64 idx1;
i64 idx2;
f32 h0;
f32 h1;
f32 h2;
colour_t colour;
} scene_triangle_t;
@@ -24,6 +26,7 @@ MAKE_LIST_TYPE(f32);
MAKE_LIST_TYPE(vec2i_t);
MAKE_LIST_TYPE(vec3f_t);
MAKE_LIST_TYPE(vec4f_t);
MAKE_LIST_TYPE(vertex_t);
MAKE_LIST_TYPE(scene_triangle_t);
typedef struct {
@@ -42,7 +45,7 @@ typedef struct {
} triangle_t;
typedef struct {
list_vec3f_t *vertices;
list_vertex_t *vertices;
list_scene_triangle_t *triangles;
} model_t;
#define NULL_MODEL ((model_t){0})