mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-26 07:45:33 +01:00
Merge pull request #6894 from lioncash/mem
BPMemory: Use Common::BitCast where applicable
This commit is contained in:
commit
bb2c3bd572
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#include "VideoCommon/BPMemory.h"
|
#include "VideoCommon/BPMemory.h"
|
||||||
|
|
||||||
#include <cstring>
|
#include "Common/BitUtils.h"
|
||||||
|
|
||||||
// BP state
|
// BP state
|
||||||
// STATE_TO_SAVE
|
// STATE_TO_SAVE
|
||||||
@ -56,9 +56,7 @@ float FogParams::GetA() const
|
|||||||
const u32 integral = (static_cast<u32>(a.sign) << 31) | (static_cast<u32>(a.exp) << 23) |
|
const u32 integral = (static_cast<u32>(a.sign) << 31) | (static_cast<u32>(a.exp) << 23) |
|
||||||
(static_cast<u32>(a.mant) << 12);
|
(static_cast<u32>(a.mant) << 12);
|
||||||
|
|
||||||
float real;
|
return Common::BitCast<float>(integral);
|
||||||
std::memcpy(&real, &integral, sizeof(u32));
|
|
||||||
return real;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float FogParams::GetC() const
|
float FogParams::GetC() const
|
||||||
@ -73,7 +71,5 @@ float FogParams::GetC() const
|
|||||||
const u32 integral = (c_proj_fsel.c_sign.Value() << 31) | (c_proj_fsel.c_exp.Value() << 23) |
|
const u32 integral = (c_proj_fsel.c_sign.Value() << 31) | (c_proj_fsel.c_exp.Value() << 23) |
|
||||||
(c_proj_fsel.c_mant.Value() << 12);
|
(c_proj_fsel.c_mant.Value() << 12);
|
||||||
|
|
||||||
float real;
|
return Common::BitCast<float>(integral);
|
||||||
std::memcpy(&real, &integral, sizeof(u32));
|
|
||||||
return real;
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user