2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2009 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 03:09:55 +00:00
|
|
|
// Refer to the license.txt file included.
|
2009-06-22 09:31:30 +00:00
|
|
|
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "VideoCommon/BPMemory.h"
|
2009-06-22 09:31:30 +00:00
|
|
|
|
2017-01-23 20:48:14 +00:00
|
|
|
#include <cstring>
|
|
|
|
|
2009-07-26 09:52:35 +00:00
|
|
|
// BP state
|
2009-06-22 09:31:30 +00:00
|
|
|
// STATE_TO_SAVE
|
|
|
|
BPMemory bpmem;
|
2017-01-23 20:48:14 +00:00
|
|
|
|
|
|
|
float FogParam0::GetA() const
|
|
|
|
{
|
|
|
|
// scale mantissa from 11 to 23 bits
|
|
|
|
const u32 integral = (static_cast<u32>(sign) << 31) | (static_cast<u32>(exponent) << 23) |
|
|
|
|
(static_cast<u32>(mantissa) << 12);
|
|
|
|
|
|
|
|
float real;
|
|
|
|
std::memcpy(&real, &integral, sizeof(u32));
|
|
|
|
return real;
|
|
|
|
}
|
|
|
|
|
|
|
|
float FogParam3::GetC() const
|
|
|
|
{
|
|
|
|
// scale mantissa from 11 to 23 bits
|
2015-10-11 00:37:41 +00:00
|
|
|
const u32 integral = (c_sign.Value() << 31) | (c_exp.Value() << 23) | (c_mant.Value() << 12);
|
2017-01-23 20:48:14 +00:00
|
|
|
|
|
|
|
float real;
|
|
|
|
std::memcpy(&real, &integral, sizeof(u32));
|
|
|
|
return real;
|
|
|
|
}
|