diff options
| author | Pokechu22 <Pokechu022@gmail.com> | 2021-02-22 19:03:06 -0800 |
|---|---|---|
| committer | Pokechu22 <Pokechu022@gmail.com> | 2021-06-09 20:50:49 -0700 |
| commit | c583cac5681409222c4557e48cbad8caedc17c4d (patch) | |
| tree | 25323f4fcbf4acf96d3093c309fef8527e76b218 /Source/Core/VideoBackends/Software/SWVertexLoader.cpp | |
| parent | e62610e6bc4f33234d8d5a7759ed5911bd25b8cb (diff) | |
Hack to hide debug cubes in Super Mario Sunshine
... while not breaking other games.
Diffstat (limited to 'Source/Core/VideoBackends/Software/SWVertexLoader.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Software/SWVertexLoader.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp index fdcafc71bf..8a4268febf 100644 --- a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp +++ b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp @@ -180,14 +180,11 @@ static void ReadVertexAttribute(T* dst, DataReader src, const AttributeFormat& f static void ParseColorAttributes(InputVertexData* dst, DataReader& src, const PortableVertexDeclaration& vdec) { - const auto set_default_color = [](u8* color, int i) { - // The default alpha channel seems to depend on the number of components in the vertex format. - const auto& g0 = g_main_cp_state.vtx_attr[g_main_cp_state.last_id].g0; - const auto color_elements = i == 0 ? g0.Color0Elements.Value() : g0.Color1Elements.Value(); - color[0] = color_elements == ColorComponentCount::RGB ? 255 : 0; - color[1] = 255; - color[2] = 255; - color[3] = 255; + const auto set_default_color = [](std::array<u8, 4>& color) { + color[Tev::ALP_C] = g_ActiveConfig.iMissingColorValue & 0xFF; + color[Tev::BLU_C] = (g_ActiveConfig.iMissingColorValue >> 8) & 0xFF; + color[Tev::GRN_C] = (g_ActiveConfig.iMissingColorValue >> 16) & 0xFF; + color[Tev::RED_C] = (g_ActiveConfig.iMissingColorValue >> 24) & 0xFF; }; if (vdec.colors[0].enable) @@ -197,7 +194,7 @@ static void ParseColorAttributes(InputVertexData* dst, DataReader& src, if (vdec.colors[1].enable) ReadVertexAttribute<u8>(dst->color[1].data(), src, vdec.colors[1], 0, 4, true); else - set_default_color(dst->color[1].data(), 1); + set_default_color(dst->color[1]); } else { @@ -205,8 +202,8 @@ static void ParseColorAttributes(InputVertexData* dst, DataReader& src, if (vdec.colors[1].enable) ReadVertexAttribute<u8>(dst->color[0].data(), src, vdec.colors[1], 0, 4, true); else - set_default_color(dst->color[0].data(), 0); - set_default_color(dst->color[1].data(), 1); + set_default_color(dst->color[0]); + set_default_color(dst->color[1]); } } |
