sets internal the number of vertices post-clipping and the epsilon clipping + a little cleanup
This commit is contained in:
parent
bdc2a6e26e
commit
6bacc7de2e
22
src/external/rlsw.h
vendored
22
src/external/rlsw.h
vendored
|
|
@ -164,19 +164,6 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
// Under normal circumstances, clipping a polygon can add at most one vertex per clipping plane
|
||||
// Considering the largest polygon involved is a quadrilateral (4 vertices),
|
||||
// and that clipping occurs against both the frustum (6 planes) and the scissors (4 planes),
|
||||
// the maximum number of vertices after clipping is:
|
||||
// 4 (original vertices) + 6 (frustum planes) + 4 (scissors planes) = 14
|
||||
#ifndef SW_MAX_CLIPPED_POLYGON_VERTICES
|
||||
#define SW_MAX_CLIPPED_POLYGON_VERTICES 14
|
||||
#endif
|
||||
|
||||
#ifndef SW_CLIP_EPSILON
|
||||
#define SW_CLIP_EPSILON 1e-4f
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// OpenGL Compatibility Types
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
@ -870,6 +857,13 @@ SWAPI void swGetFramebufferAttachmentParameteriv(SWattachment attachment, SWatta
|
|||
#define SW_DEG2RAD (SW_PI/180.0f)
|
||||
#define SW_RAD2DEG (180.0f/SW_PI)
|
||||
|
||||
// When clipping a convex polygon against a plane, at most one vertex is added.
|
||||
// Starting from a quadrilateral (4 vertices), clipped sequentially against
|
||||
// the frustum (6 planes) then the scissor rectangle (4 planes):
|
||||
// 4 + 6 + 4 = 14 vertices maximum.
|
||||
#define SW_MAX_CLIPPED_POLYGON_VERTICES 14
|
||||
#define SW_CLIP_EPSILON 1e-4f
|
||||
|
||||
#define SW_HANDLE_NULL 0u
|
||||
#define SW_POOL_SLOT_LIVE 0x80u // bit7 of the generation byte
|
||||
#define SW_POOL_SLOT_VER_MASK 0x7Fu // bits6:0 = anti-ABA counter
|
||||
|
|
@ -4232,13 +4226,11 @@ void swClear(uint32_t bitmask)
|
|||
|
||||
if ((bitmask & (SW_COLOR_BUFFER_BIT)) && (RLSW.colorBuffer != NULL) && (RLSW.colorBuffer->pixels != NULL))
|
||||
{
|
||||
int size = RLSW.colorBuffer->width*RLSW.colorBuffer->height;
|
||||
sw_framebuffer_fill_color(RLSW.colorBuffer, RLSW.clearColor);
|
||||
}
|
||||
|
||||
if ((bitmask & (SW_DEPTH_BUFFER_BIT)) && (RLSW.depthBuffer != NULL) && (RLSW.depthBuffer->pixels != NULL))
|
||||
{
|
||||
int size = RLSW.depthBuffer->width*RLSW.depthBuffer->height;
|
||||
sw_framebuffer_fill_depth(RLSW.depthBuffer, RLSW.clearDepth);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user