mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-27 23:08:47 +00:00
abs() works on ints, not floats. Use fabsf() to avoid the double conversions.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5956 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
4000df2c66
commit
669de4890a
6 changed files with 17 additions and 16 deletions
|
@ -205,8 +205,8 @@ inline void CalculateLOD(s32 &lod, bool &linear, u32 texmap, u32 texcoord)
|
|||
float *uv0 = rasterBlock.Pixel[0][0].Uv[texcoord];
|
||||
float *uv1 = rasterBlock.Pixel[1][1].Uv[texcoord];
|
||||
|
||||
sDelta = abs(uv0[0] - uv1[0]);
|
||||
tDelta = abs(uv0[1] - uv1[1]);
|
||||
sDelta = fabsf(uv0[0] - uv1[0]);
|
||||
tDelta = fabsf(uv0[1] - uv1[1]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -214,8 +214,8 @@ inline void CalculateLOD(s32 &lod, bool &linear, u32 texmap, u32 texcoord)
|
|||
float *uv1 = rasterBlock.Pixel[1][0].Uv[texcoord];
|
||||
float *uv2 = rasterBlock.Pixel[0][1].Uv[texcoord];
|
||||
|
||||
sDelta = max(abs(uv0[0] - uv1[0]), abs(uv0[0] - uv2[0]));
|
||||
tDelta = max(abs(uv0[1] - uv1[1]), abs(uv0[1] - uv2[1]));
|
||||
sDelta = max(fabsf(uv0[0] - uv1[0]), fabsf(uv0[0] - uv2[0]));
|
||||
tDelta = max(fabsf(uv0[1] - uv1[1]), fabsf(uv0[1] - uv2[1]));
|
||||
}
|
||||
|
||||
// get LOD in s28.4
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue