mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-26 23:59:54 -06:00
LightingShaderGen: Resolve -Wshadow warnings
Given how the lambda doesn't capture anything, we can move this to a internally linked function, which prevents any name shadowing.
This commit is contained in:
@ -214,12 +214,10 @@ void GenerateCustomLightingHeaderDetails(ShaderCode* out, u32 enablelighting, u3
|
|||||||
out->Write("\tint light_count;\n");
|
out->Write("\tint light_count;\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenerateCustomLightingImplementation(ShaderCode* out, const LightingUidData& uid_data,
|
static void GenerateLighting(ShaderCode* out, const LightingUidData& uid_data, int index,
|
||||||
std::string_view in_color_name)
|
|
||||||
{
|
|
||||||
auto generate_lighting = [](ShaderCode* out, const LightingUidData& uid_data, int index,
|
|
||||||
int litchan_index, u32 channel_index, u32 custom_light_index,
|
int litchan_index, u32 channel_index, u32 custom_light_index,
|
||||||
bool alpha) {
|
bool alpha)
|
||||||
|
{
|
||||||
const auto attnfunc =
|
const auto attnfunc =
|
||||||
static_cast<AttenuationFunc>((uid_data.attnfunc >> (2 * litchan_index)) & 0x3);
|
static_cast<AttenuationFunc>((uid_data.attnfunc >> (2 * litchan_index)) & 0x3);
|
||||||
|
|
||||||
@ -249,8 +247,11 @@ void GenerateCustomLightingImplementation(ShaderCode* out, const LightingUidData
|
|||||||
name, custom_light_index, LIGHT_COL_PARAMS(index, alpha ? "a" : "rgb"));
|
name, custom_light_index, LIGHT_COL_PARAMS(index, alpha ? "a" : "rgb"));
|
||||||
}
|
}
|
||||||
out->Write("\t}}\n");
|
out->Write("\t}}\n");
|
||||||
};
|
}
|
||||||
|
|
||||||
|
void GenerateCustomLightingImplementation(ShaderCode* out, const LightingUidData& uid_data,
|
||||||
|
std::string_view in_color_name)
|
||||||
|
{
|
||||||
for (u32 i = 0; i < 8; i++)
|
for (u32 i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
for (u32 channel_index = 0; channel_index < NUM_XF_COLOR_CHANNELS; channel_index++)
|
for (u32 channel_index = 0; channel_index < NUM_XF_COLOR_CHANNELS; channel_index++)
|
||||||
@ -330,7 +331,7 @@ void GenerateCustomLightingImplementation(ShaderCode* out, const LightingUidData
|
|||||||
{
|
{
|
||||||
if ((uid_data.light_mask & (1 << (i + 8 * j))) != 0)
|
if ((uid_data.light_mask & (1 << (i + 8 * j))) != 0)
|
||||||
{
|
{
|
||||||
generate_lighting(out, uid_data, i, j, j, light_count, false);
|
GenerateLighting(out, uid_data, i, j, j, light_count, false);
|
||||||
light_count++;
|
light_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -344,7 +345,7 @@ void GenerateCustomLightingImplementation(ShaderCode* out, const LightingUidData
|
|||||||
{
|
{
|
||||||
if ((uid_data.light_mask & (1 << (i + 8 * (j + 2)))) != 0)
|
if ((uid_data.light_mask & (1 << (i + 8 * (j + 2)))) != 0)
|
||||||
{
|
{
|
||||||
generate_lighting(out, uid_data, i, j + 2, j, light_count, true);
|
GenerateLighting(out, uid_data, i, j + 2, j, light_count, true);
|
||||||
light_count++;
|
light_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user