diff options
author | chai <chaifix@163.com> | 2019-12-08 00:23:50 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-12-08 00:23:50 +0800 |
commit | 3df29dc54c509c983dc8a0e23eab4160d48144f2 (patch) | |
tree | d8c5287c9979e731e373e7a1481aadd79d3f071b /src/core/vert.c | |
parent | 8e684dc0c76708e3174f005aebcaabc144b85500 (diff) |
+clipping
Diffstat (limited to 'src/core/vert.c')
-rw-r--r-- | src/core/vert.c | 30 |
1 files changed, 2 insertions, 28 deletions
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 |