diff options
| author | JMC47 <JMC4789@gmail.com> | 2021-06-10 03:38:24 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-10 03:38:24 -0400 |
| commit | a51d01bb809bddaa2c221b0e9a6d0b935a285bce (patch) | |
| tree | a8ebb37fd0c90eb6adc89b27fc3f82dc694ee26e /Source/Core/VideoBackends/Software/SWVertexLoader.cpp | |
| parent | e62610e6bc4f33234d8d5a7759ed5911bd25b8cb (diff) | |
| parent | 1500a0119bbb9086b0482a94b154612a0684f194 (diff) | |
Merge pull request #9532 from Pokechu22/debug-cube-hack
Hackfix for debug cubes
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]); } } |
