mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-29 20:28:56 +00:00
Fix the last few warnings in Dolphin on my system.
This commit is contained in:
parent
49ed752126
commit
e5d5365bac
3 changed files with 35 additions and 7 deletions
|
@ -302,8 +302,7 @@ void PixelShaderManager::SetConstants()
|
|||
float GC_ALIGNED16(material[4]);
|
||||
float NormalizationCoef = 1 / 255.0f;
|
||||
|
||||
// TODO: This code is wrong. i goes out of range for xfregs.ambColor.
|
||||
for (int i = 0; i < 4; ++i)
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
if (nMaterialsChanged & (1 << i))
|
||||
{
|
||||
|
@ -317,6 +316,21 @@ void PixelShaderManager::SetConstants()
|
|||
SetPSConstant4fv(C_PMATERIALS + i, material);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
if (nMaterialsChanged & (1 << (i + 2)))
|
||||
{
|
||||
u32 data = *(xfregs.matColor + i);
|
||||
|
||||
material[0] = ((data >> 24) & 0xFF) * NormalizationCoef;
|
||||
material[1] = ((data >> 16) & 0xFF) * NormalizationCoef;
|
||||
material[2] = ((data >> 8) & 0xFF) * NormalizationCoef;
|
||||
material[3] = ( data & 0xFF) * NormalizationCoef;
|
||||
|
||||
SetPSConstant4fv(C_PMATERIALS + i + 2, material);
|
||||
}
|
||||
}
|
||||
|
||||
nMaterialsChanged = 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue