mirror of
https://github.com/aelurum/AssetStudio.git
synced 2026-11-15 19:28:48 -05:00
Replace Math with MathF
This commit is contained in:
@@ -256,7 +256,7 @@ namespace AssetStudio
|
||||
}
|
||||
|
||||
int lastComponent = (int)(flags & 3);
|
||||
q[lastComponent] = (float)Math.Sqrt(1 - sum);
|
||||
q[lastComponent] = MathF.Sqrt(1 - sum);
|
||||
if ((flags & 4) != 0u)
|
||||
q[lastComponent] = -q[lastComponent];
|
||||
data[i] = q;
|
||||
|
||||
@@ -1006,7 +1006,7 @@ namespace AssetStudio
|
||||
var zsqr = 1 - x * x - y * y;
|
||||
float z;
|
||||
if (zsqr >= 0f)
|
||||
z = (float)Math.Sqrt(zsqr);
|
||||
z = MathF.Sqrt(zsqr);
|
||||
else
|
||||
{
|
||||
z = 0;
|
||||
@@ -1036,7 +1036,7 @@ namespace AssetStudio
|
||||
var zsqr = 1 - x * x - y * y;
|
||||
float z;
|
||||
if (zsqr >= 0f)
|
||||
z = (float)Math.Sqrt(zsqr);
|
||||
z = MathF.Sqrt(zsqr);
|
||||
else
|
||||
{
|
||||
z = 0;
|
||||
|
||||
@@ -181,19 +181,19 @@ namespace AssetStudio
|
||||
{
|
||||
case TextureFormat.ASTC_RGBA_5x5:
|
||||
// https://registry.khronos.org/webgl/extensions/WEBGL_compressed_texture_astc/
|
||||
imgDataSize = (int)(Math.Floor((m_Width + 4) / 5f) * Math.Floor((m_Height + 4) / 5f) * 16);
|
||||
imgDataSize = (int)(MathF.Floor((m_Width + 4) / 5f) * MathF.Floor((m_Height + 4) / 5f) * 16);
|
||||
break;
|
||||
case TextureFormat.ASTC_RGBA_6x6:
|
||||
imgDataSize = (int)(Math.Floor((m_Width + 5) / 6f) * Math.Floor((m_Height + 5) / 6f) * 16);
|
||||
imgDataSize = (int)(MathF.Floor((m_Width + 5) / 6f) * MathF.Floor((m_Height + 5) / 6f) * 16);
|
||||
break;
|
||||
case TextureFormat.ASTC_RGBA_8x8:
|
||||
imgDataSize = (int)(Math.Floor((m_Width + 7) / 8f) * Math.Floor((m_Height + 7) / 8f) * 16);
|
||||
imgDataSize = (int)(MathF.Floor((m_Width + 7) / 8f) * MathF.Floor((m_Height + 7) / 8f) * 16);
|
||||
break;
|
||||
case TextureFormat.ASTC_RGBA_10x10:
|
||||
imgDataSize = (int)(Math.Floor((m_Width + 9) / 10f) * Math.Floor((m_Height + 9) / 10f) * 16);
|
||||
imgDataSize = (int)(MathF.Floor((m_Width + 9) / 10f) * MathF.Floor((m_Height + 9) / 10f) * 16);
|
||||
break;
|
||||
case TextureFormat.ASTC_RGBA_12x12:
|
||||
imgDataSize = (int)(Math.Floor((m_Width + 11) / 12f) * Math.Floor((m_Height + 11) / 12f) * 16);
|
||||
imgDataSize = (int)(MathF.Floor((m_Width + 11) / 12f) * MathF.Floor((m_Height + 11) / 12f) * 16);
|
||||
break;
|
||||
case TextureFormat.DXT1:
|
||||
case TextureFormat.EAC_R:
|
||||
|
||||
Reference in New Issue
Block a user