CC: Fix blend function, it's different for cc enabled

This commit is contained in:
Casian Andrei 2012-09-23 15:32:24 +03:00
parent 2dcf424d63
commit b17071555d

View file

@ -1247,15 +1247,16 @@ void SceneOpenGL2Window::prepareStates(TextureType type, qreal opacity, qreal br
opaque = false;
if (!opaque) {
glEnable(GL_BLEND);
// if (!options->isColorCorrected()) {
if (options->isColorCorrected()) {
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
} else {
if (alpha) {
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
} else {
glBlendColor((float)opacity, (float)opacity, (float)opacity, (float)opacity);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA);
glBlendFunc(GL_ONE, GL_ONE_MINUS_CONSTANT_ALPHA);
}
// } else
// glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
}
const qreal rgb = brightness * opacity;