[iortcw] 226/497: All: Rend2: Update readme / Don't segfault if r_ext_multitexture is disabled
Simon McVittie
smcv at debian.org
Fri Sep 8 10:36: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 4135c220ff19431c56c3da95c6f3441de7461d2d
Author: M4N4T4RMS at gmail.com <M4N4T4RMS at gmail.com@e65d2741-a53d-b2dc-ae96-bb75fa5e4c4a>
Date: Mon Sep 29 11:50:14 2014 +0000
All: Rend2: Update readme / Don't segfault if r_ext_multitexture is disabled
---
MP/code/rend2/tr_backend.c | 5 ++++-
MP/code/rend2/tr_shader.c | 7 +++++--
MP/rend2-readme.txt | 6 ------
SP/code/rend2/tr_backend.c | 5 ++++-
SP/code/rend2/tr_shader.c | 6 ++++--
SP/rend2-readme.txt | 6 ------
6 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/MP/code/rend2/tr_backend.c b/MP/code/rend2/tr_backend.c
index 812aa66..d01f66a 100644
--- a/MP/code/rend2/tr_backend.c
+++ b/MP/code/rend2/tr_backend.c
@@ -83,6 +83,9 @@ void GL_SelectTexture( int unit ) {
if (!(unit >= 0 && unit <= 31))
ri.Error( ERR_DROP, "GL_SelectTexture: unit = %i", unit );
+ if (!qglActiveTextureARB)
+ ri.Error( ERR_DROP, "GL_SelectTexture: multitexture disabled" );
+
qglActiveTextureARB( GL_TEXTURE0_ARB + unit );
glState.currenttmu = unit;
@@ -1911,7 +1914,7 @@ const void *RB_PostProcess(const void *data)
if (srcFbo)
{
- if (r_hdr->integer && (r_toneMap->integer || r_forceToneMap->integer))
+ if (r_hdr->integer && (r_toneMap->integer || r_forceToneMap->integer) && qglActiveTextureARB)
{
autoExposure = r_autoExposure->integer || r_forceAutoExposure->integer;
RB_ToneMap(srcFbo, srcBox, NULL, dstBox, autoExposure);
diff --git a/MP/code/rend2/tr_shader.c b/MP/code/rend2/tr_shader.c
index 2f74f36..a422f28 100644
--- a/MP/code/rend2/tr_shader.c
+++ b/MP/code/rend2/tr_shader.c
@@ -2432,7 +2432,7 @@ static void CollapseStagesToLightall(shaderStage_t *diffuse,
}
-static qboolean CollapseStagesToGLSL(void)
+static int CollapseStagesToGLSL(void)
{
int i, j, numStages;
qboolean skip = qfalse;
@@ -3174,7 +3174,9 @@ static shader_t *FinishShader( void ) {
//
// look for multitexture potential
//
- stage = CollapseStagesToGLSL();
+ if ( qglActiveTextureARB ) {
+ stage = CollapseStagesToGLSL();
+ }
if ( shader.lightmapIndex >= 0 && !hasLightmapStage ) {
if ( vertexLightmap ) {
@@ -3854,6 +3856,7 @@ CreateInternalShaders
static void CreateInternalShaders( void ) {
tr.numShaders = 0;
+ // init the default shader
InitShader( "<default>", LIGHTMAP_NONE );
stages[0].bundle[0].image[0] = tr.defaultImage;
stages[0].active = qtrue;
diff --git a/MP/rend2-readme.txt b/MP/rend2-readme.txt
index e2f823a..1d39ad8 100644
--- a/MP/rend2-readme.txt
+++ b/MP/rend2-readme.txt
@@ -79,12 +79,6 @@ Cvars for simple rendering features:
0 - No. (default)
1 - Yes.
- r_softOverbright - Enable software overbrighting. This enables
- overbrighting even in a window. Is disabled
- when r_toneMap 1 and r_hdr 1.
- 0 - No.
- 1 - Yes. (default)
-
Cvars for HDR and tonemapping:
r_hdr - Do scene rendering in a framebuffer with
high dynamic range. (Less banding, and
diff --git a/SP/code/rend2/tr_backend.c b/SP/code/rend2/tr_backend.c
index 8bb9f5d..25933f6 100644
--- a/SP/code/rend2/tr_backend.c
+++ b/SP/code/rend2/tr_backend.c
@@ -83,6 +83,9 @@ void GL_SelectTexture( int unit ) {
if (!(unit >= 0 && unit <= 31))
ri.Error( ERR_DROP, "GL_SelectTexture: unit = %i", unit );
+ if (!qglActiveTextureARB)
+ ri.Error( ERR_DROP, "GL_SelectTexture: multitexture disabled" );
+
qglActiveTextureARB( GL_TEXTURE0_ARB + unit );
glState.currenttmu = unit;
@@ -2158,7 +2161,7 @@ const void *RB_PostProcess(const void *data)
if (srcFbo)
{
- if (r_hdr->integer && (r_toneMap->integer || r_forceToneMap->integer))
+ if (r_hdr->integer && (r_toneMap->integer || r_forceToneMap->integer) && qglActiveTextureARB)
{
autoExposure = r_autoExposure->integer || r_forceAutoExposure->integer;
RB_ToneMap(srcFbo, srcBox, NULL, dstBox, autoExposure);
diff --git a/SP/code/rend2/tr_shader.c b/SP/code/rend2/tr_shader.c
index b728caf..4520f4e 100644
--- a/SP/code/rend2/tr_shader.c
+++ b/SP/code/rend2/tr_shader.c
@@ -2453,7 +2453,7 @@ static void CollapseStagesToLightall(shaderStage_t *diffuse,
}
-static qboolean CollapseStagesToGLSL(void)
+static int CollapseStagesToGLSL(void)
{
int i, j, numStages;
qboolean skip = qfalse;
@@ -3194,7 +3194,9 @@ static shader_t *FinishShader( void ) {
//
// look for multitexture potential
//
- stage = CollapseStagesToGLSL();
+ if ( qglActiveTextureARB ) {
+ stage = CollapseStagesToGLSL();
+ }
if ( shader.lightmapIndex >= 0 && !hasLightmapStage ) {
if ( vertexLightmap ) {
diff --git a/SP/rend2-readme.txt b/SP/rend2-readme.txt
index f1fce84..1414b7c 100644
--- a/SP/rend2-readme.txt
+++ b/SP/rend2-readme.txt
@@ -79,12 +79,6 @@ Cvars for simple rendering features:
0 - No. (default)
1 - Yes.
- r_softOverbright - Enable software overbrighting. This enables
- overbrighting even in a window. Is disabled
- when r_toneMap 1 and r_hdr 1.
- 0 - No.
- 1 - Yes. (default)
-
Cvars for HDR and tonemapping:
r_hdr - Do scene rendering in a framebuffer with
high dynamic range. (Less banding, and
--
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