Merge pull request #5719 from unknownbrackets/gpu-minor

Don't calculate lighting when not enabled (software transform)
This commit is contained in:
Henrik Rydgård 2014-03-25 09:19:33 +01:00
commit 9ba51adb89

View File

@ -398,11 +398,12 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
} else {
unlitColor = Vec4f::FromRGBA(gstate.getMaterialAmbientRGBA());
}
float litColor0[4];
float litColor1[4];
lighter.Light(litColor0, litColor1, unlitColor.AsArray(), out, normal);
if (gstate.isLightingEnabled()) {
float litColor0[4];
float litColor1[4];
lighter.Light(litColor0, litColor1, unlitColor.AsArray(), out, normal);
// Don't ignore gstate.lmode - we should send two colors in that case
for (int j = 0; j < 4; j++) {
c0[j] = litColor0[j];