diff options
| author | NeoBrainX <NeoBrainX@googlemail.com> | 2010-10-29 21:37:20 +0000 |
|---|---|---|
| committer | NeoBrainX <NeoBrainX@googlemail.com> | 2010-10-29 21:37:20 +0000 |
| commit | f7d1184d873fdc2a5eb7ae74c3bb59e01c078d05 (patch) | |
| tree | 5051b8222e2d1c67d0ea26130e3069cb156d8f1a /Source | |
| parent | 6edb5f48471454b2bee0045e5a7dddd9a7736290 (diff) | |
VideoCommon: Properly upscale the mantissa of some fog params.
Might fix games with minor gfx glitches, try e.g. Super Mario Sunshine or Super Mario Galaxy 2.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6319 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/VideoCommon/Src/BPMemory.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/Src/BPMemory.h b/Source/Core/VideoCommon/Src/BPMemory.h index 0fa4f1cdfc..a9b4be0907 100644 --- a/Source/Core/VideoCommon/Src/BPMemory.h +++ b/Source/Core/VideoCommon/Src/BPMemory.h @@ -650,7 +650,7 @@ union FogParam0 float GetA() { union { u32 i; float f; } dummy; - dummy.i = ((u32)sign<<31)|((u32)exponent<<23)|((u32)mantissa<<12); + dummy.i = ((u32)sign<<31)|((u32)exponent<<23)|((u32)mantissa * 0x7FFFFF / 0x7FF); // scale mantissa from 11 to 23 bits return dummy.f; } @@ -671,7 +671,7 @@ union FogParam3 // amount to subtract from eyespacez after range adjustment float GetC() { union { u32 i; float f; } dummy; - dummy.i = ((u32)c_sign << 31) | ((u32)c_exp << 23) | ((u32)c_mant << 12); + dummy.i = ((u32)c_sign << 31) | ((u32)c_exp << 23) | ((u32)c_mant * 0x7FFFFF / 0x7FF); // scale mantissa from 11 to 23 bits return dummy.f; } |
