style tweaks
This commit is contained in:
parent
7ac973b4b8
commit
f9824eb9c2
16
src/external/rlsw.h
vendored
16
src/external/rlsw.h
vendored
|
|
@ -124,11 +124,11 @@
|
|||
#endif
|
||||
|
||||
#ifndef SW_FRAMEBUFFER_COLOR_TYPE
|
||||
#define SW_FRAMEBUFFER_COLOR_TYPE R8G8B8A8
|
||||
#define SW_FRAMEBUFFER_COLOR_TYPE R8G8B8A8 // Or R5G6B5, R3G3B2, etc; see `sw_pixelformat_t`
|
||||
#endif
|
||||
|
||||
#ifndef SW_FRAMEBUFFER_DEPTH_TYPE
|
||||
#define SW_FRAMEBUFFER_DEPTH_TYPE D32
|
||||
#define SW_FRAMEBUFFER_DEPTH_TYPE D32 // Or D16, D8
|
||||
#endif
|
||||
|
||||
#ifndef SW_MAX_PROJECTION_STACK_SIZE
|
||||
|
|
@ -1442,7 +1442,7 @@ static inline bool sw_is_texture_valid(sw_handle_t id)
|
|||
|
||||
static inline bool sw_is_texture_complete(sw_texture_t* tex)
|
||||
{
|
||||
return tex && tex->pixels != NULL;
|
||||
return (tex != NULL) && (tex->pixels != NULL);
|
||||
}
|
||||
|
||||
static inline bool sw_is_texture_filter_valid(int filter)
|
||||
|
|
@ -4062,7 +4062,7 @@ void swBlitPixels(int xDst, int yDst, int wDst, int hDst, int xSrc, int ySrc, in
|
|||
|
||||
// Check if the sizes are identical after clamping the source to avoid unexpected issues
|
||||
// TODO: REVIEW: This repeats the operations if true, so a copy function can be made without these checks
|
||||
if (xDst == xSrc && yDst == ySrc && wDst == wSrc && hDst == hSrc)
|
||||
if ((xDst == xSrc) && (yDst == ySrc) && (wDst == wSrc) && (hDst == hSrc))
|
||||
{
|
||||
swReadPixels(xSrc, ySrc, wSrc, hSrc, format, type, pixels);
|
||||
}
|
||||
|
|
@ -5044,20 +5044,20 @@ void swTexImage2D(int width, int height, SWformat format, SWtype type, const voi
|
|||
|
||||
void swTexSubImage2D(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels)
|
||||
{
|
||||
if (!sw_is_texture_complete(RLSW.boundTexture) || !pixels || width <= 0 || height <= 0)
|
||||
if (!sw_is_texture_complete(RLSW.boundTexture) || (!pixels) || (width <= 0) || (height <= 0))
|
||||
{
|
||||
RLSW.errCode = SW_INVALID_VALUE;
|
||||
return;
|
||||
}
|
||||
|
||||
if (x < 0 || y < 0 || x + width > RLSW.boundTexture->width || y + height > RLSW.boundTexture->height)
|
||||
if ((x < 0) || (y < 0) || (x + width > RLSW.boundTexture->width) || (y + height > RLSW.boundTexture->height))
|
||||
{
|
||||
RLSW.errCode = SW_INVALID_VALUE;
|
||||
return;
|
||||
}
|
||||
|
||||
sw_pixelformat_t pFormat = sw_pixel_get_format(format, type);
|
||||
if (pFormat <= 0 || pFormat >= SW_PIXELFORMAT_COUNT)
|
||||
if ((pFormat <= 0) || (pFormat >= SW_PIXELFORMAT_COUNT))
|
||||
{
|
||||
RLSW.errCode = SW_INVALID_ENUM;
|
||||
return;
|
||||
|
|
@ -5588,7 +5588,7 @@ static void SW_RASTER_QUAD(const sw_vertex_t *a, const sw_vertex_t *b,
|
|||
|
||||
float w = (float)(xMax - xMin);
|
||||
float h = (float)(yMax - yMin);
|
||||
if (w <= 0 || h <= 0) return;
|
||||
if ((w <= 0) || (h <= 0)) return;
|
||||
|
||||
float wRcp = 1.0f/w;
|
||||
float hRcp = 1.0f/h;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user