Fix alpha blending for SW transform

This commit is contained in:
raven02 2013-01-10 22:21:28 +08:00
parent 79c9c29251
commit 4e683911c7

View file

@ -384,9 +384,9 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
c1[j] = 0.0f;
}
} else {
c0[0] = ((gstate.materialambient >> 16) & 0xFF) / 255.f;
c0[0] = (gstate.materialambient & 0xFF) / 255.f;
c0[1] = ((gstate.materialambient >> 8) & 0xFF) / 255.f;
c0[2] = (gstate.materialambient & 0xFF) / 255.f;
c0[2] = ((gstate.materialambient >> 16) & 0xFF) / 255.f;
c0[3] = (gstate.materialalpha & 0xFF) / 255.f;
}
@ -443,9 +443,9 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
if (reader.hasColor0()) {
reader.ReadColor0(unlitColor);
} else {
unlitColor[0] = ((gstate.materialambient >> 16) & 0xFF) / 255.f;
unlitColor[0] = (gstate.materialambient & 0xFF) / 255.f;
unlitColor[1] = ((gstate.materialambient >> 8) & 0xFF) / 255.f;
unlitColor[2] = (gstate.materialambient & 0xFF) / 255.f;
unlitColor[2] = ((gstate.materialambient >> 16) & 0xFF) / 255.f;
unlitColor[3] = (gstate.materialalpha & 0xFF) / 255.f;
}
float litColor0[4];
@ -474,8 +474,8 @@ void TransformDrawEngine::SoftwareTransformAndDraw(
c1[j] = 0.0f;
}
} else {
c0[0] = ((gstate.materialambient >> 16) & 0xFF) / 255.f;
c0[1] = ((gstate.materialambient >> 8) & 0xFF) / 255.f;
c0[0] = ((gstate.materialambient >> 8) & 0xFF) / 255.f;
c0[1] = (gstate.materialambient & 0xFF) / 255.f;
c0[2] = (gstate.materialambient & 0xFF) / 255.f;
c0[3] = (gstate.materialalpha & 0xFF) / 255.f;
}