Refactor old code documentation
This commit is contained in:
@@ -600,31 +600,19 @@ void RenderTools::ComputeSphereModelDrawMatrix(const RenderView& view, const Flo
|
||||
resultIsViewInside = Float3::DistanceSquared(view.Position, position) < Math::Square(radius * 1.1f); // Manually tweaked bias
|
||||
}
|
||||
|
||||
int32 MipLevelsCount(int32 width, bool useMipLevels)
|
||||
int32 MipLevelsCount(int32 width)
|
||||
{
|
||||
if (!useMipLevels)
|
||||
return 1;
|
||||
|
||||
int32 result = 1;
|
||||
while (width > 1)
|
||||
{
|
||||
width >>= 1;
|
||||
result++;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
int32 MipLevelsCount(int32 width, int32 height, bool useMipLevels)
|
||||
int32 MipLevelsCount(int32 width, int32 height)
|
||||
{
|
||||
// Check if use mip maps
|
||||
if (!useMipLevels)
|
||||
{
|
||||
// No mipmaps chain, only single mip map
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Count mip maps
|
||||
int32 result = 1;
|
||||
while (width > 1 || height > 1)
|
||||
{
|
||||
@@ -637,11 +625,8 @@ int32 MipLevelsCount(int32 width, int32 height, bool useMipLevels)
|
||||
return result;
|
||||
}
|
||||
|
||||
int32 MipLevelsCount(int32 width, int32 height, int32 depth, bool useMipLevels)
|
||||
int32 MipLevelsCount(int32 width, int32 height, int32 depth)
|
||||
{
|
||||
if (!useMipLevels)
|
||||
return 1;
|
||||
|
||||
int32 result = 1;
|
||||
while (width > 1 || height > 1 || depth > 1)
|
||||
{
|
||||
@@ -653,7 +638,6 @@ int32 MipLevelsCount(int32 width, int32 height, int32 depth, bool useMipLevels)
|
||||
depth >>= 1;
|
||||
result++;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -136,23 +136,11 @@ public:
|
||||
static void ComputeSphereModelDrawMatrix(const RenderView& view, const Float3& position, float radius, Matrix& resultWorld, bool& resultIsViewInside);
|
||||
};
|
||||
|
||||
// Calculate mip levels count for a texture 1D
|
||||
// @param width Most detailed mip width
|
||||
// @param useMipLevels True if use mip levels, otherwise false (use only 1 mip)
|
||||
// @returns Mip levels count
|
||||
extern int32 MipLevelsCount(int32 width, bool useMipLevels = true);
|
||||
// Calculates mip levels count for a texture 1D.
|
||||
extern int32 MipLevelsCount(int32 width);
|
||||
|
||||
// Calculate mip levels count for a texture 2D
|
||||
// @param width Most detailed mip width
|
||||
// @param height Most detailed mip height
|
||||
// @param useMipLevels True if use mip levels, otherwise false (use only 1 mip)
|
||||
// @returns Mip levels count
|
||||
extern int32 MipLevelsCount(int32 width, int32 height, bool useMipLevels = true);
|
||||
// Calculates mip levels count for a texture 2D.
|
||||
extern int32 MipLevelsCount(int32 width, int32 height);
|
||||
|
||||
// Calculate mip levels count for a texture 3D
|
||||
// @param width Most detailed mip width
|
||||
// @param height Most detailed mip height
|
||||
// @param depth Most detailed mip depths
|
||||
// @param useMipLevels True if use mip levels, otherwise false (use only 1 mip)
|
||||
// @returns Mip levels count
|
||||
extern int32 MipLevelsCount(int32 width, int32 height, int32 depth, bool useMipLevels = true);
|
||||
// Calculates mip levels count for a texture 3D.
|
||||
extern int32 MipLevelsCount(int32 width, int32 height, int32 depth);
|
||||
|
||||
Reference in New Issue
Block a user