[iortcw] 61/497: All: Some various renderer cleanups (See notes)
Simon McVittie
smcv at debian.org
Fri Sep 8 10:36:20 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 5ec86cb4ee41830f91c4432c894403506381eefe
Author: M4N4T4RMS at gmail.com <M4N4T4RMS at gmail.com@e65d2741-a53d-b2dc-ae96-bb75fa5e4c4a>
Date: Tue Mar 11 14:51:49 2014 +0000
All: Some various renderer cleanups (See notes)
---
MP/code/rend2/tr_bsp.c | 24 +++++++++++++-----------
MP/code/rend2/tr_main.c | 3 ++-
MP/code/rend2/tr_shader.c | 4 ++--
MP/code/renderer/tr_bsp.c | 2 +-
MP/code/renderer/tr_shader.c | 4 ++--
SP/code/rend2/tr_bsp.c | 24 +++++++++++++-----------
SP/code/rend2/tr_main.c | 3 ++-
SP/code/rend2/tr_shader.c | 4 ++--
SP/code/renderer/tr_bsp.c | 2 +-
SP/code/renderer/tr_shader.c | 4 ++--
10 files changed, 40 insertions(+), 34 deletions(-)
diff --git a/MP/code/rend2/tr_bsp.c b/MP/code/rend2/tr_bsp.c
index 49dee69..c65b024 100644
--- a/MP/code/rend2/tr_bsp.c
+++ b/MP/code/rend2/tr_bsp.c
@@ -3072,7 +3072,7 @@ qboolean R_GetEntityToken( char *buffer, int size ) {
s = COM_Parse( &s_worldData.entityParsePoint );
Q_strncpyz( buffer, s, size );
- if ( !s_worldData.entityParsePoint || !s[0] ) {
+ if ( !s_worldData.entityParsePoint && !s[0] ) {
s_worldData.entityParsePoint = s_worldData.entityString;
return qfalse;
} else {
@@ -3099,7 +3099,8 @@ qboolean R_ParseSpawnVars( char *spawnVarChars, int maxSpawnVarChars, int *numSp
return qfalse;
}
if ( com_token[0] != '{' ) {
- ri.Printf( PRINT_ALL, "R_ParseSpawnVars: found %s when expecting {",com_token );
+ ri.Printf( PRINT_ALL, "R_ParseSpawnVars: found %s when expecting {\n",com_token );
+ return qfalse;
}
// go through all the key / value pairs
@@ -3108,7 +3109,8 @@ qboolean R_ParseSpawnVars( char *spawnVarChars, int maxSpawnVarChars, int *numSp
// parse key
if ( !R_GetEntityToken( keyname, sizeof( keyname ) ) ) {
- ri.Printf( PRINT_ALL, "R_ParseSpawnVars: EOF without closing brace" );
+ ri.Printf( PRINT_ALL, "R_ParseSpawnVars: EOF without closing brace\n" );
+ return qfalse;
}
if ( keyname[0] == '}' ) {
@@ -3117,18 +3119,18 @@ qboolean R_ParseSpawnVars( char *spawnVarChars, int maxSpawnVarChars, int *numSp
// parse value
if ( !R_GetEntityToken( com_token, sizeof( com_token ) ) ) {
- ri.Printf( PRINT_ALL, "R_ParseSpawnVars: EOF without closing brace" );
- break;
+ ri.Printf( PRINT_ALL, "R_ParseSpawnVars: EOF without closing brace\n" );
+ return qfalse;
}
if ( com_token[0] == '}' ) {
- ri.Printf( PRINT_ALL, "R_ParseSpawnVars: closing brace without data" );
- break;
+ ri.Printf( PRINT_ALL, "R_ParseSpawnVars: closing brace without data\n" );
+ return qfalse;
}
if ( *numSpawnVars == MAX_SPAWN_VARS ) {
- ri.Printf( PRINT_ALL, "R_ParseSpawnVars: MAX_SPAWN_VARS" );
- break;
+ ri.Printf( PRINT_ALL, "R_ParseSpawnVars: MAX_SPAWN_VARS\n" );
+ return qfalse;
}
keyLength = strlen(keyname) + 1;
@@ -3136,8 +3138,8 @@ qboolean R_ParseSpawnVars( char *spawnVarChars, int maxSpawnVarChars, int *numSp
if (numSpawnVarChars + keyLength + tokenLength > maxSpawnVarChars)
{
- ri.Printf( PRINT_ALL, "R_ParseSpawnVars: MAX_SPAWN_VAR_CHARS" );
- break;
+ ri.Printf( PRINT_ALL, "R_ParseSpawnVars: MAX_SPAWN_VAR_CHARS\n" );
+ return qfalse;
}
strcpy(spawnVarChars + numSpawnVarChars, keyname);
diff --git a/MP/code/rend2/tr_main.c b/MP/code/rend2/tr_main.c
index 18b871f..72763b0 100644
--- a/MP/code/rend2/tr_main.c
+++ b/MP/code/rend2/tr_main.c
@@ -3142,7 +3142,8 @@ void R_RenderCubemapSide( int cubemapIndex, int cubemapSide, qboolean subscene )
vec3_t ambient, directed, lightDir;
R_LightForPoint(tr.refdef.vieworg, ambient, directed, lightDir);
tr.refdef.colorScale = 766.0f / (directed[0] + directed[1] + directed[2] + 1.0f);
- if (directed[0] + directed[1] + directed[2] == 0)
+ // only print message for first side
+ if (directed[0] + directed[1] + directed[2] == 0 && cubemapSide == 0)
{
ri.Printf(PRINT_ALL, "cubemap %d (%f, %f, %f) is outside the lightgrid!\n", cubemapIndex, tr.refdef.vieworg[0], tr.refdef.vieworg[1], tr.refdef.vieworg[2]);
}
diff --git a/MP/code/rend2/tr_shader.c b/MP/code/rend2/tr_shader.c
index 95f5581..bc1a0b6 100644
--- a/MP/code/rend2/tr_shader.c
+++ b/MP/code/rend2/tr_shader.c
@@ -733,7 +733,7 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
else if ( !Q_stricmp( token, "animMap" ) ) {
token = COM_ParseExt( text, qfalse );
if ( !token[0] ) {
- ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'animMmap' keyword in shader '%s'\n", shader.name );
+ ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'animMap' keyword in shader '%s'\n", shader.name );
return qfalse;
}
stage->bundle[0].imageAnimationSpeed = atof( token );
@@ -770,7 +770,7 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
} else if ( !Q_stricmp( token, "videoMap" ) ) {
token = COM_ParseExt( text, qfalse );
if ( !token[0] ) {
- ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'videoMmap' keyword in shader '%s'\n", shader.name );
+ ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'videoMap' keyword in shader '%s'\n", shader.name );
return qfalse;
}
stage->bundle[0].videoMapHandle = ri.CIN_PlayCinematic( token, 0, 0, 256, 256, ( CIN_loop | CIN_silent | CIN_shader ) );
diff --git a/MP/code/renderer/tr_bsp.c b/MP/code/renderer/tr_bsp.c
index c8686d8..740a34e 100644
--- a/MP/code/renderer/tr_bsp.c
+++ b/MP/code/renderer/tr_bsp.c
@@ -2138,7 +2138,7 @@ qboolean R_GetEntityToken( char *buffer, int size ) {
s = COM_Parse( &s_worldData.entityParsePoint );
Q_strncpyz( buffer, s, size );
- if ( !s_worldData.entityParsePoint || !s[0] ) {
+ if ( !s_worldData.entityParsePoint && !s[0] ) {
s_worldData.entityParsePoint = s_worldData.entityString;
return qfalse;
} else {
diff --git a/MP/code/renderer/tr_shader.c b/MP/code/renderer/tr_shader.c
index fc7db3d..6722200 100644
--- a/MP/code/renderer/tr_shader.c
+++ b/MP/code/renderer/tr_shader.c
@@ -674,7 +674,7 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
else if ( !Q_stricmp( token, "animMap" ) ) {
token = COM_ParseExt( text, qfalse );
if ( !token[0] ) {
- ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'animMmap' keyword in shader '%s'\n", shader.name );
+ ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'animMap' keyword in shader '%s'\n", shader.name );
return qfalse;
}
stage->bundle[0].imageAnimationSpeed = atof( token );
@@ -709,7 +709,7 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
} else if ( !Q_stricmp( token, "videoMap" ) ) {
token = COM_ParseExt( text, qfalse );
if ( !token[0] ) {
- ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'videoMmap' keyword in shader '%s'\n", shader.name );
+ ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'videoMap' keyword in shader '%s'\n", shader.name );
return qfalse;
}
stage->bundle[0].videoMapHandle = ri.CIN_PlayCinematic( token, 0, 0, 256, 256, ( CIN_loop | CIN_silent | CIN_shader ) );
diff --git a/SP/code/rend2/tr_bsp.c b/SP/code/rend2/tr_bsp.c
index 50247ba..3ef67c1 100644
--- a/SP/code/rend2/tr_bsp.c
+++ b/SP/code/rend2/tr_bsp.c
@@ -3058,7 +3058,7 @@ qboolean R_GetEntityToken( char *buffer, int size ) {
s = COM_Parse( &s_worldData.entityParsePoint );
Q_strncpyz( buffer, s, size );
- if ( !s_worldData.entityParsePoint || !s[0] ) {
+ if ( !s_worldData.entityParsePoint && !s[0] ) {
s_worldData.entityParsePoint = s_worldData.entityString;
return qfalse;
} else {
@@ -3085,7 +3085,8 @@ qboolean R_ParseSpawnVars( char *spawnVarChars, int maxSpawnVarChars, int *numSp
return qfalse;
}
if ( com_token[0] != '{' ) {
- ri.Printf( PRINT_ALL, "R_ParseSpawnVars: found %s when expecting {",com_token );
+ ri.Printf( PRINT_ALL, "R_ParseSpawnVars: found %s when expecting {\n",com_token );
+ return qfalse;
}
// go through all the key / value pairs
@@ -3094,7 +3095,8 @@ qboolean R_ParseSpawnVars( char *spawnVarChars, int maxSpawnVarChars, int *numSp
// parse key
if ( !R_GetEntityToken( keyname, sizeof( keyname ) ) ) {
- ri.Printf( PRINT_ALL, "R_ParseSpawnVars: EOF without closing brace" );
+ ri.Printf( PRINT_ALL, "R_ParseSpawnVars: EOF without closing brace\n" );
+ return qfalse;
}
if ( keyname[0] == '}' ) {
@@ -3103,18 +3105,18 @@ qboolean R_ParseSpawnVars( char *spawnVarChars, int maxSpawnVarChars, int *numSp
// parse value
if ( !R_GetEntityToken( com_token, sizeof( com_token ) ) ) {
- ri.Printf( PRINT_ALL, "R_ParseSpawnVars: EOF without closing brace" );
- break;
+ ri.Printf( PRINT_ALL, "R_ParseSpawnVars: EOF without closing brace\n" );
+ return qfalse;
}
if ( com_token[0] == '}' ) {
- ri.Printf( PRINT_ALL, "R_ParseSpawnVars: closing brace without data" );
- break;
+ ri.Printf( PRINT_ALL, "R_ParseSpawnVars: closing brace without data\n" );
+ return qfalse;
}
if ( *numSpawnVars == MAX_SPAWN_VARS ) {
- ri.Printf( PRINT_ALL, "R_ParseSpawnVars: MAX_SPAWN_VARS" );
- break;
+ ri.Printf( PRINT_ALL, "R_ParseSpawnVars: MAX_SPAWN_VARS\n" );
+ return qfalse;
}
keyLength = strlen(keyname) + 1;
@@ -3122,8 +3124,8 @@ qboolean R_ParseSpawnVars( char *spawnVarChars, int maxSpawnVarChars, int *numSp
if (numSpawnVarChars + keyLength + tokenLength > maxSpawnVarChars)
{
- ri.Printf( PRINT_ALL, "R_ParseSpawnVars: MAX_SPAWN_VAR_CHARS" );
- break;
+ ri.Printf( PRINT_ALL, "R_ParseSpawnVars: MAX_SPAWN_VAR_CHARS\n" );
+ return qfalse;
}
strcpy(spawnVarChars + numSpawnVarChars, keyname);
diff --git a/SP/code/rend2/tr_main.c b/SP/code/rend2/tr_main.c
index 090f539..7fdee90 100644
--- a/SP/code/rend2/tr_main.c
+++ b/SP/code/rend2/tr_main.c
@@ -3190,7 +3190,8 @@ void R_RenderCubemapSide( int cubemapIndex, int cubemapSide, qboolean subscene )
vec3_t ambient, directed, lightDir;
R_LightForPoint(tr.refdef.vieworg, ambient, directed, lightDir);
tr.refdef.colorScale = 766.0f / (directed[0] + directed[1] + directed[2] + 1.0f);
- if (directed[0] + directed[1] + directed[2] == 0)
+ // only print message for first side
+ if (directed[0] + directed[1] + directed[2] == 0 && cubemapSide == 0)
{
ri.Printf(PRINT_ALL, "cubemap %d (%f, %f, %f) is outside the lightgrid!\n", cubemapIndex, tr.refdef.vieworg[0], tr.refdef.vieworg[1], tr.refdef.vieworg[2]);
}
diff --git a/SP/code/rend2/tr_shader.c b/SP/code/rend2/tr_shader.c
index 1e12c2c..41430d8 100644
--- a/SP/code/rend2/tr_shader.c
+++ b/SP/code/rend2/tr_shader.c
@@ -731,7 +731,7 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
else if ( !Q_stricmp( token, "animMap" ) ) {
token = COM_ParseExt( text, qfalse );
if ( !token[0] ) {
- ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'animMmap' keyword in shader '%s'\n", shader.name );
+ ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'animMap' keyword in shader '%s'\n", shader.name );
return qfalse;
}
stage->bundle[0].imageAnimationSpeed = atof( token );
@@ -768,7 +768,7 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
} else if ( !Q_stricmp( token, "videoMap" ) ) {
token = COM_ParseExt( text, qfalse );
if ( !token[0] ) {
- ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'videoMmap' keyword in shader '%s'\n", shader.name );
+ ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'videoMap' keyword in shader '%s'\n", shader.name );
return qfalse;
}
stage->bundle[0].videoMapHandle = ri.CIN_PlayCinematic( token, 0, 0, 256, 256, ( CIN_loop | CIN_silent | CIN_shader ) );
diff --git a/SP/code/renderer/tr_bsp.c b/SP/code/renderer/tr_bsp.c
index ef8ee38..22d5903 100644
--- a/SP/code/renderer/tr_bsp.c
+++ b/SP/code/renderer/tr_bsp.c
@@ -2134,7 +2134,7 @@ qboolean R_GetEntityToken( char *buffer, int size ) {
s = COM_Parse( &s_worldData.entityParsePoint );
Q_strncpyz( buffer, s, size );
- if ( !s_worldData.entityParsePoint || !s[0] ) {
+ if ( !s_worldData.entityParsePoint && !s[0] ) {
s_worldData.entityParsePoint = s_worldData.entityString;
return qfalse;
} else {
diff --git a/SP/code/renderer/tr_shader.c b/SP/code/renderer/tr_shader.c
index b15efce..9ee80fb 100644
--- a/SP/code/renderer/tr_shader.c
+++ b/SP/code/renderer/tr_shader.c
@@ -672,7 +672,7 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
else if ( !Q_stricmp( token, "animMap" ) ) {
token = COM_ParseExt( text, qfalse );
if ( !token[0] ) {
- ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'animMmap' keyword in shader '%s'\n", shader.name );
+ ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'animMap' keyword in shader '%s'\n", shader.name );
return qfalse;
}
stage->bundle[0].imageAnimationSpeed = atof( token );
@@ -706,7 +706,7 @@ static qboolean ParseStage( shaderStage_t *stage, char **text ) {
} else if ( !Q_stricmp( token, "videoMap" ) ) {
token = COM_ParseExt( text, qfalse );
if ( !token[0] ) {
- ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'videoMmap' keyword in shader '%s'\n", shader.name );
+ ri.Printf( PRINT_WARNING, "WARNING: missing parameter for 'videoMap' keyword in shader '%s'\n", shader.name );
return qfalse;
}
stage->bundle[0].videoMapHandle = ri.CIN_PlayCinematic( token, 0, 0, 256, 256, ( CIN_loop | CIN_silent | CIN_shader ) );
--
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