diff options
author | chai <chaifix@163.com> | 2019-12-08 10:59:54 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-12-08 10:59:54 +0800 |
commit | fb2791c41847d76327b6665398b44be41a44c02d (patch) | |
tree | e6083a40093f04520079b89e87fbcc47caf5f598 /src/core/clip.c | |
parent | 8518e135ff5c312bd5a3b496d400c751aa3bd5b3 (diff) |
*misc
Diffstat (limited to 'src/core/clip.c')
-rw-r--r-- | src/core/clip.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/core/clip.c b/src/core/clip.c index 071b14b..382c766 100644 --- a/src/core/clip.c +++ b/src/core/clip.c @@ -1,8 +1,6 @@ #include "clip.h" #include "shader.h" -/*from mesa3d*/ - typedef enum { POSITIVE_W, POSITIVE_X, @@ -131,12 +129,11 @@ static bool clip_against_plane(Plane plane, uint varying_flag, ClippedBuffer* sr } #define CLIP(plane, from, to) \ -do { \ -is_cull = clip_against_plane(plane, varying_flag, from, to); \ -if (is_cull) { \ - buffer->count = 0;/*cull this triangle*/ \ - return 1; \ -} \ +do { \ + if (clip_against_plane(plane, varying_flag, from, to)) { \ + buffer->count = 0;/*cull this triangle*/ \ + return 1; \ + } \ }while(0) bool clip_triangle(Vec4* c0, Vec4* c1, Vec4* c2, Vert* v0, Vert* v1, Vert* v2, uint varying_flag, ClippedBuffer* buffer) { @@ -189,8 +186,6 @@ bool clip_triangle(Vec4* c0, Vec4* c1, Vec4* c2, Vert* v0, Vert* v1, Vert* v2, u INIT_CLIP_VERT(2); #undef INIT_CLIP_VERT - bool is_cull = FALSE; - CLIP(POSITIVE_W, &temp, buffer); CLIP(POSITIVE_X, buffer, &temp); CLIP(NEGATIVE_X, &temp, buffer); |