summaryrefslogtreecommitdiffstats
path: root/src/video_core/pica.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-11-12 23:33:21 +0100
committerbunnei <bunneidev@gmail.com>2016-02-05 23:17:29 +0100
commitafbef525163af1b28e5b7493e58383d442762228 (patch)
treee68783a7770e400136654ae315021ecee24d6e21 /src/video_core/pica.h
parentpica: Implement decoding of basic fragment lighting components. (diff)
downloadyuzu-afbef525163af1b28e5b7493e58383d442762228.tar
yuzu-afbef525163af1b28e5b7493e58383d442762228.tar.gz
yuzu-afbef525163af1b28e5b7493e58383d442762228.tar.bz2
yuzu-afbef525163af1b28e5b7493e58383d442762228.tar.lz
yuzu-afbef525163af1b28e5b7493e58383d442762228.tar.xz
yuzu-afbef525163af1b28e5b7493e58383d442762228.tar.zst
yuzu-afbef525163af1b28e5b7493e58383d442762228.zip
Diffstat (limited to 'src/video_core/pica.h')
-rw-r--r--src/video_core/pica.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/video_core/pica.h b/src/video_core/pica.h
index 178a4b83f..b82ecf68a 100644
--- a/src/video_core/pica.h
+++ b/src/video_core/pica.h
@@ -662,17 +662,18 @@ struct Regs {
LN = 3, // Cosine of the angle between the light and the normal vectors
};
- struct {
- union LightColor {
- BitField< 0, 10, u32> b;
- BitField<10, 10, u32> g;
- BitField<20, 10, u32> r;
-
- Math::Vec3f ToVec3f() const {
- return Math::MakeVec((f32)r / 255.f, (f32)g / 255.f, (f32)b / 255.f);
- }
- };
+ union LightColor {
+ BitField< 0, 10, u32> b;
+ BitField<10, 10, u32> g;
+ BitField<20, 10, u32> r;
+
+ Math::Vec3f ToVec3f() const {
+ // These fields are 10 bits wide, however 255 corresponds to 1.0f for each color component
+ return Math::MakeVec((f32)r / 255.f, (f32)g / 255.f, (f32)b / 255.f);
+ }
+ };
+ struct {
struct LightSrc {
LightColor specular_0; // material.specular_0 * light.specular_0
LightColor specular_1; // material.specular_1 * light.specular_1