From f0b4a609a819d7925e0aaba3f86a57dcb2fb9fd9 Mon Sep 17 00:00:00 2001
From: Jaime Passos <lazymyuutsu@gmail.com>
Date: Tue, 3 Sep 2019 23:44:04 -0300
Subject: [PATCH] Very tiny fix

---
 src/hardware/r_opengl/r_opengl.c | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c
index ae6ff7d091..a44556f1dd 100644
--- a/src/hardware/r_opengl/r_opengl.c
+++ b/src/hardware/r_opengl/r_opengl.c
@@ -1649,26 +1649,15 @@ static void RenderDomeForReal(INT32 skytexture)
 
 EXPORT void HWRAPI(RenderSkyDome) (INT32 tex, INT32 texture_width, INT32 texture_height, FTransform transform)
 {
-	GLint shading_mode = GL_FLAT;
-	pglGetIntegerv(GL_SHADE_MODEL, &shading_mode);
-	pglShadeModel(GL_SMOOTH);
-
-	pglDepthMask(false);
-	pglDisable(GL_DEPTH_TEST);
-	pglDisable(GL_ALPHA_TEST);
-
-	SetBlend(PF_Translucent|PF_Clip|PF_NoZClip|PF_NoDepthTest|PF_Modulated);
+	SetBlend(PF_Translucent|PF_NoDepthTest|PF_Modulated);
+	SetTransform(&transform);
 
 	texw = texture_width;
 	texh = texture_height;
-	SetTransform(&transform);
 	RenderDomeForReal(tex);
 
-	pglEnable(GL_ALPHA_TEST);
-	pglEnable(GL_DEPTH_TEST);
-	pglDepthMask(true);
-
-	pglShadeModel(shading_mode);
+	// HWR_DrawSkyBackground left no blend flags after rendering the sky
+	SetBlend(0);
 }
 
 // ==========================================================================
-- 
GitLab