Reviewed formating to follow raylib conventions #4429
This commit is contained in:
parent
7fedf9e0b8
commit
80b490c8f1
2 changed files with 19 additions and 20 deletions
21
src/rlgl.h
21
src/rlgl.h
|
@ -3417,9 +3417,10 @@ unsigned int rlLoadTextureCubemap(const void *data, int size, int format, int mi
|
||||||
{
|
{
|
||||||
if (format < RL_PIXELFORMAT_COMPRESSED_DXT1_RGB)
|
if (format < RL_PIXELFORMAT_COMPRESSED_DXT1_RGB)
|
||||||
{
|
{
|
||||||
if ((format == RL_PIXELFORMAT_UNCOMPRESSED_R32) || (format == RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32)
|
if ((format == RL_PIXELFORMAT_UNCOMPRESSED_R32) ||
|
||||||
|| (format == RL_PIXELFORMAT_UNCOMPRESSED_R16) || (format == RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16))
|
(format == RL_PIXELFORMAT_UNCOMPRESSED_R32G32B32A32) ||
|
||||||
TRACELOG(RL_LOG_WARNING, "TEXTURES: Cubemap requested format not supported");
|
(format == RL_PIXELFORMAT_UNCOMPRESSED_R16) ||
|
||||||
|
(format == RL_PIXELFORMAT_UNCOMPRESSED_R16G16B16A16)) TRACELOG(RL_LOG_WARNING, "TEXTURES: Cubemap requested format not supported");
|
||||||
else glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, mipmapLevel, glInternalFormat, mipSize, mipSize, 0, glFormat, glType, NULL);
|
else glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, mipmapLevel, glInternalFormat, mipSize, mipSize, 0, glFormat, glType, NULL);
|
||||||
}
|
}
|
||||||
else TRACELOG(RL_LOG_WARNING, "TEXTURES: Empty cubemap creation does not support compressed format");
|
else TRACELOG(RL_LOG_WARNING, "TEXTURES: Empty cubemap creation does not support compressed format");
|
||||||
|
@ -3446,10 +3447,10 @@ unsigned int rlLoadTextureCubemap(const void *data, int size, int format, int mi
|
||||||
glTexParameteriv(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask);
|
glTexParameteriv(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_SWIZZLE_RGBA, swizzleMask);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (face == 5) {
|
if (face == 5)
|
||||||
|
{
|
||||||
mipSize /= 2;
|
mipSize /= 2;
|
||||||
if (data != NULL)
|
if (data != NULL) dataPtr += dataSize*6; // Increment data pointer to next mipmap
|
||||||
dataPtr += dataSize * 6; // Increment data pointer to next mipmap
|
|
||||||
|
|
||||||
// Security check for NPOT textures
|
// Security check for NPOT textures
|
||||||
if (mipSize < 1) mipSize = 1;
|
if (mipSize < 1) mipSize = 1;
|
||||||
|
@ -3460,11 +3461,9 @@ unsigned int rlLoadTextureCubemap(const void *data, int size, int format, int mi
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set cubemap texture sampling parameters
|
// Set cubemap texture sampling parameters
|
||||||
if (mipmapCount > 1) {
|
if (mipmapCount > 1) glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
else glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||||
} else {
|
|
||||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
|
||||||
}
|
|
||||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||||
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||||
|
|
|
@ -2410,8 +2410,7 @@ void ImageMipmaps(Image *image)
|
||||||
|
|
||||||
mipSize = GetPixelDataSize(mipWidth, mipHeight, image->format);
|
mipSize = GetPixelDataSize(mipWidth, mipHeight, image->format);
|
||||||
|
|
||||||
if (i < image->mipmaps)
|
if (i < image->mipmaps) continue;
|
||||||
continue;
|
|
||||||
|
|
||||||
TRACELOGD("IMAGE: Generating mipmap level: %i (%i x %i) - size: %i - offset: 0x%x", i, mipWidth, mipHeight, mipSize, nextmip);
|
TRACELOGD("IMAGE: Generating mipmap level: %i (%i x %i) - size: %i - offset: 0x%x", i, mipWidth, mipHeight, mipSize, nextmip);
|
||||||
|
|
||||||
|
@ -4024,7 +4023,8 @@ void ImageDraw(Image *dst, Image src, Rectangle srcRec, Rectangle dstRec, Color
|
||||||
|
|
||||||
if (useSrcMod) UnloadImage(srcMod); // Unload source modified image
|
if (useSrcMod) UnloadImage(srcMod); // Unload source modified image
|
||||||
|
|
||||||
if (dst->mipmaps > 1 && src.mipmaps > 1) {
|
if ((dst->mipmaps > 1) && (src.mipmaps > 1))
|
||||||
|
{
|
||||||
Image mipmapDst = *dst;
|
Image mipmapDst = *dst;
|
||||||
mipmapDst.data = (char *)mipmapDst.data + GetPixelDataSize(mipmapDst.width, mipmapDst.height, mipmapDst.format);
|
mipmapDst.data = (char *)mipmapDst.data + GetPixelDataSize(mipmapDst.width, mipmapDst.height, mipmapDst.format);
|
||||||
mipmapDst.width /= 2;
|
mipmapDst.width /= 2;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue