[ioquake3] 28/39: OpenGL2: Load images with "_nh" suffix as parallax normalmaps.
Simon McVittie
smcv at debian.org
Sat Nov 5 20:26:24 UTC 2016
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian/master
in repository ioquake3.
commit ffcec94f5032a4945f6b82bd4dd64fb3ebf9f7f6
Author: SmileTheory <SmileTheory at gmail.com>
Date: Thu Oct 27 02:10:40 2016 -0700
OpenGL2: Load images with "_nh" suffix as parallax normalmaps.
---
code/renderergl2/tr_shader.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/code/renderergl2/tr_shader.c b/code/renderergl2/tr_shader.c
index c055076..574cfb1 100644
--- a/code/renderergl2/tr_shader.c
+++ b/code/renderergl2/tr_shader.c
@@ -2247,10 +2247,22 @@ static void CollapseStagesToLightall(shaderStage_t *diffuse,
image_t *normalImg;
imgFlags_t normalFlags = (diffuseImg->flags & ~(IMGFLAG_GENNORMALMAP | IMGFLAG_SRGB)) | IMGFLAG_NOLIGHTSCALE;
+ // try a normalheight image first
COM_StripExtension(diffuseImg->imgName, normalName, MAX_QPATH);
- Q_strcat(normalName, MAX_QPATH, "_n");
+ Q_strcat(normalName, MAX_QPATH, "_nh");
- normalImg = R_FindImageFile(normalName, IMGTYPE_NORMAL, normalFlags);
+ normalImg = R_FindImageFile(normalName, IMGTYPE_NORMALHEIGHT, normalFlags);
+
+ if (normalImg)
+ {
+ parallax = qtrue;
+ }
+ else
+ {
+ // try a normal image ("_n" suffix)
+ normalName[strlen(normalName) - 1] = '\0';
+ normalImg = R_FindImageFile(normalName, IMGTYPE_NORMAL, normalFlags);
+ }
if (normalImg)
{
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git
More information about the Pkg-games-commits
mailing list