Hack to hide debug cubes in Super Mario Sunshine

... while not breaking other games.
This commit is contained in:
Pokechu22
2021-02-22 19:03:06 -08:00
parent e62610e6bc
commit c583cac568
11 changed files with 34 additions and 34 deletions

View File

@ -136,6 +136,18 @@ void VertexShaderManager::Dirty()
// TODO: A cleaner way to control the matrices without making a mess in the parameters field
void VertexShaderManager::SetConstants()
{
if (constants.missing_color_hex != g_ActiveConfig.iMissingColorValue)
{
const float a = (g_ActiveConfig.iMissingColorValue) & 0xFF;
const float b = (g_ActiveConfig.iMissingColorValue >> 8) & 0xFF;
const float g = (g_ActiveConfig.iMissingColorValue >> 16) & 0xFF;
const float r = (g_ActiveConfig.iMissingColorValue >> 24) & 0xFF;
constants.missing_color_hex = g_ActiveConfig.iMissingColorValue;
constants.missing_color_value = {r / 255, g / 255, b / 255, a / 255};
dirty = true;
}
if (nTransformMatricesChanged[0] >= 0)
{
int startn = nTransformMatricesChanged[0] / 4;
@ -615,17 +627,6 @@ void VertexShaderManager::SetVertexFormat(u32 components)
constants.components = components;
dirty = true;
}
// The default alpha channel seems to depend on the number of components in the vertex format.
// If the vertex attribute has an alpha channel, zero is used, otherwise one.
const auto g0 = g_main_cp_state.vtx_attr[g_main_cp_state.last_id].g0;
const u32 color_chan_alpha = (g0.Color0Elements == ColorComponentCount::RGB ? 1 : 0) |
(g0.Color1Elements == ColorComponentCount::RGB ? 2 : 0);
if (color_chan_alpha != constants.color_chan_alpha)
{
constants.color_chan_alpha = color_chan_alpha;
dirty = true;
}
}
void VertexShaderManager::SetTexMatrixInfoChanged(int index)