From 3df29dc54c509c983dc8a0e23eab4160d48144f2 Mon Sep 17 00:00:00 2001 From: chai Date: Sun, 8 Dec 2019 00:23:50 +0800 Subject: +clipping --- src/core/vert.c | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) (limited to 'src/core/vert.c') diff --git a/src/core/vert.c b/src/core/vert.c index 0e62087..95469d3 100644 --- a/src/core/vert.c +++ b/src/core/vert.c @@ -1,42 +1,16 @@ #include "vert.h" -Vert* vert_new(uint comp) { +Vert* vert_new() { Vert* vert = ssrM_new(Vert); - vert->comp = comp; - vert->position = ssrM_new(Vec3); - vert->normal = ssrM_new(Vec3); - vert->tangent = ssrM_new(Vec3); - vert->uv = ssrM_new(Vec2); return vert; } -void vert_init(Vert* v, uint comp) { +void vert_init(Vert* v) { ssr_assert(v); - v->comp = comp; v->index = 0; - if ((comp & VERTMASK_POSITION) && !v->position) - v->position = ssrM_new(Vec3); - else if (!(comp & VERTMASK_POSITION) && v->position) - ssrM_free(v->position); - if ((comp & VERTMASK_NORMAL) && !v->normal) - v->normal = ssrM_new(Vec3); - else if (!(comp & VERTMASK_NORMAL) && v->normal) - ssrM_free(v->normal); - if ((comp & VERTMASK_TANGENT) && !v->tangent) - v->tangent = ssrM_new(Vec3); - else if (!(comp & VERTMASK_TANGENT) && v->tangent) - ssrM_free(v->tangent); - if ((comp & VERTMASK_UV) && !v->uv) - v->uv = ssrM_new(Vec2); - else if (!(comp & VERTMASK_UV) && v->uv) - ssrM_free(v->uv); } void vert_free(Vert* v) { ssr_assert(v); - if (v->position) ssrM_free(v->position); - if (v->normal) ssrM_free(v->normal); - if (v->tangent) ssrM_free(v->tangent); - if (v->uv) ssrM_free(v->uv); ssrM_free(v); } \ No newline at end of file -- cgit v1.1-26-g67d0