clang-modernize -loop-convert

and some manual adjustments
This commit is contained in:
Tillmann Karras
2014-03-03 06:25:15 +01:00
parent f401263867
commit c89f04a7c5
22 changed files with 339 additions and 293 deletions

View File

@ -54,12 +54,12 @@ void DoState(PointerWrap &p)
{
ZSlope.DoState(p);
WSlope.DoState(p);
for (auto& ColorSlope : ColorSlopes)
for (int n=0; n<4; ++n)
ColorSlope[n].DoState(p);
for (auto& TexSlope : TexSlopes)
for (int n=0; n<3; ++n)
TexSlope[n].DoState(p);
for (auto& color_slopes_1d : ColorSlopes)
for (Slope& color_slope : color_slopes_1d)
color_slope.DoState(p);
for (auto& tex_slopes_1d : TexSlopes)
for (Slope& tex_slope : tex_slopes_1d)
tex_slope.DoState(p);
p.Do(vertex0X);
p.Do(vertex0Y);
p.Do(vertexOffsetX);

View File

@ -33,8 +33,10 @@ void Tev::Init()
FixedConstants[7] = 223;
FixedConstants[8] = 255;
for (int i = 0; i < 4; i++)
Zero16[i] = 0;
for (s16& comp : Zero16)
{
comp = 0;
}
m_ColorInputLUT[0][RED_INP] = &Reg[0][RED_C]; m_ColorInputLUT[0][GRN_INP] = &Reg[0][GRN_C]; m_ColorInputLUT[0][BLU_INP] = &Reg[0][BLU_C]; // prev.rgb
m_ColorInputLUT[1][RED_INP] = &Reg[0][ALP_C]; m_ColorInputLUT[1][GRN_INP] = &Reg[0][ALP_C]; m_ColorInputLUT[1][BLU_INP] = &Reg[0][ALP_C]; // prev.aaa
@ -148,21 +150,27 @@ void Tev::SetRasColor(int colorChan, int swaptable)
break;
case 5: // alpha bump
{
for(int i = 0; i < 4; i++)
RasColor[i] = AlphaBump;
for (s16& comp : RasColor)
{
comp = AlphaBump;
}
}
break;
case 6: // alpha bump normalized
{
u8 normalized = AlphaBump | AlphaBump >> 5;
for(int i = 0; i < 4; i++)
RasColor[i] = normalized;
for (s16& comp : RasColor)
{
comp = normalized;
}
}
break;
default: // zero
{
for(int i = 0; i < 4; i++)
RasColor[i] = 0;
for (s16& comp : RasColor)
{
comp = 0;
}
}
break;
}