[iortcw] 470/497: All: Rend2: Use correct sunlight color for sunlight specular

Simon McVittie smcv at debian.org
Fri Sep 8 10:37:56 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit b7cea7d9786a3c7f3af290a8e845097f053082f8
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Thu Dec 10 12:09:39 2015 -0500

    All: Rend2: Use correct sunlight color for sunlight specular
---
 MP/code/rend2/tr_scene.c | 25 ++++++++++---------------
 SP/code/rend2/tr_scene.c | 25 ++++++++++---------------
 2 files changed, 20 insertions(+), 30 deletions(-)

diff --git a/MP/code/rend2/tr_scene.c b/MP/code/rend2/tr_scene.c
index c2b96f1..eb0a372 100644
--- a/MP/code/rend2/tr_scene.c
+++ b/MP/code/rend2/tr_scene.c
@@ -451,35 +451,30 @@ void RE_BeginScene(const refdef_t *fd)
 	}
 	else
 	{
+#if defined(USE_OVERBRIGHT)
+		float scale = pow(2, r_mapOverBrightBits->integer - tr.overbrightBits - 8);
+#else
+		float scale = (1 << r_mapOverBrightBits->integer) / 255.0f;
+#endif
 		tr.refdef.colorScale = r_forceSun->integer ? r_forceSunMapLightScale->value : tr.mapLightScale;
 
+		if (r_forceSun->integer)
+			VectorScale(tr.sunLight, scale * r_forceSunLightScale->value, tr.refdef.sunCol);
+		else
+			VectorScale(tr.sunLight, scale, tr.refdef.sunCol);
+
 		if (r_sunlightMode->integer == 1)
 		{
-			tr.refdef.sunCol[0] =
-			tr.refdef.sunCol[1] =
-			tr.refdef.sunCol[2] = 1.0f;
-
 			tr.refdef.sunAmbCol[0] =
 			tr.refdef.sunAmbCol[1] =
 			tr.refdef.sunAmbCol[2] = r_forceSun->integer ? r_forceSunAmbientScale->value : tr.sunShadowScale;
 		}
 		else
 		{
-#if defined(USE_OVERBRIGHT)
-			float scale = pow(2, r_mapOverBrightBits->integer - tr.overbrightBits - 8);
-#else
-			float scale = (1 << r_mapOverBrightBits->integer) / 255.0f;
-#endif
 			if (r_forceSun->integer)
-			{
-				VectorScale(tr.sunLight, scale * r_forceSunLightScale->value,   tr.refdef.sunCol);
 				VectorScale(tr.sunLight, scale * r_forceSunAmbientScale->value, tr.refdef.sunAmbCol);
-			}
 			else
-			{
-				VectorScale(tr.sunLight, scale,                     tr.refdef.sunCol);
 				VectorScale(tr.sunLight, scale * tr.sunShadowScale, tr.refdef.sunAmbCol);
-			}
 		}
 	}
 
diff --git a/SP/code/rend2/tr_scene.c b/SP/code/rend2/tr_scene.c
index 2a21068..7064df4 100644
--- a/SP/code/rend2/tr_scene.c
+++ b/SP/code/rend2/tr_scene.c
@@ -464,35 +464,30 @@ void RE_BeginScene(const refdef_t *fd)
 	}
 	else
 	{
+#if defined(USE_OVERBRIGHT)
+		float scale = pow(2, r_mapOverBrightBits->integer - tr.overbrightBits - 8);
+#else
+		float scale = (1 << r_mapOverBrightBits->integer) / 255.0f;
+#endif
 		tr.refdef.colorScale = r_forceSun->integer ? r_forceSunMapLightScale->value : tr.mapLightScale;
 
+		if (r_forceSun->integer)
+			VectorScale(tr.sunLight, scale * r_forceSunLightScale->value, tr.refdef.sunCol);
+		else
+			VectorScale(tr.sunLight, scale, tr.refdef.sunCol);
+
 		if (r_sunlightMode->integer == 1)
 		{
-			tr.refdef.sunCol[0] =
-			tr.refdef.sunCol[1] =
-			tr.refdef.sunCol[2] = 1.0f;
-
 			tr.refdef.sunAmbCol[0] =
 			tr.refdef.sunAmbCol[1] =
 			tr.refdef.sunAmbCol[2] = r_forceSun->integer ? r_forceSunAmbientScale->value : tr.sunShadowScale;
 		}
 		else
 		{
-#if defined(USE_OVERBRIGHT)
-			float scale = pow(2, r_mapOverBrightBits->integer - tr.overbrightBits - 8);
-#else
-			float scale = (1 << r_mapOverBrightBits->integer) / 255.0f;
-#endif
 			if (r_forceSun->integer)
-			{
-				VectorScale(tr.sunLight, scale * r_forceSunLightScale->value,   tr.refdef.sunCol);
 				VectorScale(tr.sunLight, scale * r_forceSunAmbientScale->value, tr.refdef.sunAmbCol);
-			}
 			else
-			{
-				VectorScale(tr.sunLight, scale,                     tr.refdef.sunCol);
 				VectorScale(tr.sunLight, scale * tr.sunShadowScale, tr.refdef.sunAmbCol);
-			}
 		}
 	}
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list