GRAPHICS: Reset GL's current color in drawDimPlane()

Per convention, in residualvm the default GL current color
should be (1.0f, 1.0f, 1.0f). If a function changes the color,
it is required to reset it before returning.

This fixes the issue that some videos were not correctly displayed
until the next glColor call (e.g. when drawing the sub-titles) was
issued.
This commit is contained in:
Christian Krause 2014-11-05 20:53:26 +01:00
parent 8b616ea590
commit 1c43404192
2 changed files with 6 additions and 0 deletions

View file

@ -2015,6 +2015,7 @@ void GfxOpenGL::drawDimPlane() {
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor4f(0.0f, 0.0f, 0.0f, _dimLevel);
glBegin(GL_QUADS);
glVertex2f(0, 0);
glVertex2f(1.0, 0);
@ -2022,6 +2023,8 @@ void GfxOpenGL::drawDimPlane() {
glVertex2f(0, 1.0);
glEnd();
glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
glDisable(GL_BLEND);
glDepthMask(GL_TRUE);
glEnable(GL_DEPTH_TEST);