From 0b9e11a1d4e82b22c02353ba5c31b87b772e9825 Mon Sep 17 00:00:00 2001 From: mcmartin Date: Mon, 26 Dec 2005 08:41:15 +0000 Subject: [PATCH] Reworked OpenGL fades to be more in line with transitions and PureSDL fades git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2115 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/src/sc2code/libs/graphics/sdl/opengl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sc2/src/sc2code/libs/graphics/sdl/opengl.c b/sc2/src/sc2code/libs/graphics/sdl/opengl.c index 4306cb84f..b4049e769 100644 --- a/sc2/src/sc2code/libs/graphics/sdl/opengl.c +++ b/sc2/src/sc2code/libs/graphics/sdl/opengl.c @@ -412,18 +412,18 @@ TFB_GL_SwapBuffers (int force_full_redraw) if (fade_amount < 255) { - c = fade_amount / 255.0f; - glBlendFunc (GL_DST_COLOR, GL_ZERO); + c = (255 - fade_amount) / 255.0f; + glColor4f (0, 0, 0, c); } else { c = (fade_amount - 255) / 255.0f; - glBlendFunc (GL_ONE, GL_ONE); + glColor4f (1, 1, 1, c); } glDisable (GL_TEXTURE_2D); + glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable (GL_BLEND); - glColor4f (c, c, c, 1); TFB_GL_DrawQuad (); }