From 000d1214c24dfa432e38c30b9c1758ca27913cc3 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Wed, 19 Feb 2020 03:34:10 +0300 Subject: [PATCH] BlendMode.Filter is now a proper filter --- src/engine/e_graphics.pas | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/engine/e_graphics.pas b/src/engine/e_graphics.pas index 4612a40..de31fa5 100644 --- a/src/engine/e_graphics.pas +++ b/src/engine/e_graphics.pas @@ -994,17 +994,12 @@ begin else glDisable(GL_BLEND); - if Blending = TBlending.Blend then - glBlendFunc(GL_SRC_ALPHA, GL_ONE) - else - if Blending = TBlending.Filter then - glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR) - else - if Blending = TBlending.Invert then - glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO) - else - if Alpha > 0 then - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + case Blending of + TBlending.None: if Alpha > 0 then glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + TBlending.Blend: glBlendFunc(GL_SRC_ALPHA, GL_ONE); + TBlending.Invert: glBlendFunc(GL_ONE_MINUS_DST_COLOR, GL_ZERO); + TBlending.Filter: glBlendFunc(GL_ZERO, GL_SRC_COLOR); + end; glDisable(GL_TEXTURE_2D); glColor4ub(Red, Green, Blue, 255-Alpha); @@ -1020,7 +1015,6 @@ begin glEnd(); glColor4ub(e_Colors.R, e_Colors.G, e_Colors.B, 255); - glDisable(GL_BLEND); end; -- 2.29.2