fix * q3map_remapshader remaps anything fine, on all stages (effect is: postrenaming shader when things are have been done)
	* typo at -dirtmode

Radiant:

misc...
	* translucent textures are visible, while selected, too; +matching trans polys are visible simultaneously
This commit is contained in:
Garux 2017-08-01 13:32:31 +03:00
parent 9fed37bae0
commit 7ca7a54fe6
7 changed files with 18 additions and 8 deletions

View File

@ -2363,6 +2363,7 @@ void OpenGLShader::construct( const char* name ){
BlendFunc blendFunc = m_shader->getBlendFunc(); BlendFunc blendFunc = m_shader->getBlendFunc();
state.m_blend_src = convertBlendFactor( blendFunc.m_src ); state.m_blend_src = convertBlendFactor( blendFunc.m_src );
state.m_blend_dst = convertBlendFactor( blendFunc.m_dst ); state.m_blend_dst = convertBlendFactor( blendFunc.m_dst );
state.m_depthfunc = GL_LEQUAL;
if ( state.m_blend_src == GL_SRC_ALPHA || state.m_blend_dst == GL_SRC_ALPHA ) { if ( state.m_blend_src == GL_SRC_ALPHA || state.m_blend_dst == GL_SRC_ALPHA ) {
state.m_state |= RENDER_DEPTHWRITE; state.m_state |= RENDER_DEPTHWRITE;
} }

View File

@ -707,6 +707,7 @@ int BSPMain( int argc, char **argv ){
/* note it */ /* note it */
Sys_Printf( "--- BSP ---\n" ); Sys_Printf( "--- BSP ---\n" );
doingBSP = qtrue;
SetDrawSurfacesBuffer(); SetDrawSurfacesBuffer();
mapDrawSurfs = safe_malloc( sizeof( mapDrawSurface_t ) * MAX_MAP_DRAW_SURFS ); mapDrawSurfs = safe_malloc( sizeof( mapDrawSurface_t ) * MAX_MAP_DRAW_SURFS );
memset( mapDrawSurfs, 0, sizeof( mapDrawSurface_t ) * MAX_MAP_DRAW_SURFS ); memset( mapDrawSurfs, 0, sizeof( mapDrawSurface_t ) * MAX_MAP_DRAW_SURFS );

View File

@ -177,11 +177,12 @@ void SwapBSPFile( void ){
/* shaders (don't swap the name) */ /* shaders (don't swap the name) */
for ( i = 0; i < numBSPShaders ; i++ ) for ( i = 0; i < numBSPShaders ; i++ )
{ {
if ( doingBSP ){
si = ShaderInfoForShader( bspShaders[ i ].shader ); si = ShaderInfoForShader( bspShaders[ i ].shader );
if ( si->remapShader && si->remapShader[ 0 ] ) { if ( si->remapShader && si->remapShader[ 0 ] ) {
strcpy( bspShaders[ i ].shader, si->remapShader ); strcpy( bspShaders[ i ].shader, si->remapShader );
} }
}
bspShaders[ i ].contentFlags = LittleLong( bspShaders[ i ].contentFlags ); bspShaders[ i ].contentFlags = LittleLong( bspShaders[ i ].contentFlags );
bspShaders[ i ].surfaceFlags = LittleLong( bspShaders[ i ].surfaceFlags ); bspShaders[ i ].surfaceFlags = LittleLong( bspShaders[ i ].surfaceFlags );
} }

View File

@ -2791,12 +2791,11 @@ int LightMain( int argc, char **argv ){
lightAngleHL = ( atoi( argv[ i + 1 ] ) != 0 ); lightAngleHL = ( atoi( argv[ i + 1 ] ) != 0 );
if ( lightAngleHL ) { if ( lightAngleHL ) {
Sys_Printf( "Enabling half lambert light angle attenuation\n" ); Sys_Printf( "Enabling half lambert light angle attenuation\n" );
i++;
} }
else{ else{
Sys_Printf( "Disabling half lambert light angle attenuation\n" ); Sys_Printf( "Disabling half lambert light angle attenuation\n" );
i++;
} }
i++;
} }
} }
else if ( !strcmp( argv[ i ], "-nostyle" ) || !strcmp( argv[ i ], "-nostyles" ) ) { else if ( !strcmp( argv[ i ], "-nostyle" ) || !strcmp( argv[ i ], "-nostyles" ) ) {
@ -2842,7 +2841,7 @@ int LightMain( int argc, char **argv ){
Sys_Printf( "Enabling randomized dirtmapping\n" ); Sys_Printf( "Enabling randomized dirtmapping\n" );
} }
else{ else{
Sys_Printf( "Enabling ordered dir mapping\n" ); Sys_Printf( "Enabling ordered dirtmapping\n" );
} }
i++; i++;
} }

View File

@ -1291,13 +1291,13 @@ int ScaleBSPMain( int argc, char **argv ){
GetVectorForKey( &entities[ i ], "origin", vec ); GetVectorForKey( &entities[ i ], "origin", vec );
if ( ( vec[ 0 ] || vec[ 1 ] || vec[ 2 ] ) ) { if ( ( vec[ 0 ] || vec[ 1 ] || vec[ 2 ] ) ) {
if ( !strncmp( ValueForKey( &entities[i], "classname" ), "info_player_", 12 ) ) { if ( !strncmp( ValueForKey( &entities[i], "classname" ), "info_player_", 12 ) ) {
// vec[2] += spawn_ref; vec[2] += spawn_ref;
} }
vec[0] *= scale[0]; vec[0] *= scale[0];
vec[1] *= scale[1]; vec[1] *= scale[1];
vec[2] *= scale[2]; vec[2] *= scale[2];
if ( !strncmp( ValueForKey( &entities[i], "classname" ), "info_player_", 12 ) ) { if ( !strncmp( ValueForKey( &entities[i], "classname" ), "info_player_", 12 ) ) {
vec[2] += spawn_ref; vec[2] -= spawn_ref;
} }
sprintf( str, "%f %f %f", vec[ 0 ], vec[ 1 ], vec[ 2 ] ); sprintf( str, "%f %f %f", vec[ 0 ], vec[ 1 ], vec[ 2 ] );
SetKeyValue( &entities[ i ], "origin", str ); SetKeyValue( &entities[ i ], "origin", str );

View File

@ -1999,6 +1999,9 @@ Q_EXTERN qboolean warnImage Q_ASSIGN( qtrue );
/* ydnar: sinusoid samples */ /* ydnar: sinusoid samples */
Q_EXTERN float jitters[ MAX_JITTERS ]; Q_EXTERN float jitters[ MAX_JITTERS ];
/*can't code*/
Q_EXTERN qboolean doingBSP Q_ASSIGN( qfalse );
/* commandline arguments */ /* commandline arguments */
Q_EXTERN qboolean nocmdline Q_ASSIGN( qfalse ); Q_EXTERN qboolean nocmdline Q_ASSIGN( qfalse );

View File

@ -56,14 +56,19 @@ int EmitShader( const char *shader, int *contentFlags, int *surfaceFlags ){
/* try to find an existing shader */ /* try to find an existing shader */
for ( i = 0; i < numBSPShaders; i++ ) for ( i = 0; i < numBSPShaders; i++ )
{ {
/* ydnar: handle custom surface/content flags */ /* ydnar: handle custom surface/content flags */
if ( surfaceFlags != NULL && bspShaders[ i ].surfaceFlags != *surfaceFlags ) { if ( surfaceFlags != NULL && bspShaders[ i ].surfaceFlags != *surfaceFlags ) {
continue; continue;
} }
if ( contentFlags != NULL && bspShaders[ i ].contentFlags != *contentFlags ) { if ( contentFlags != NULL && bspShaders[ i ].contentFlags != *contentFlags ) {
continue; continue;
} }
if ( !doingBSP ){
si = ShaderInfoForShader( shader );
if ( si->remapShader && si->remapShader[ 0 ] ) {
shader = si->remapShader;
}
}
/* compare name */ /* compare name */
if ( !Q_stricmp( shader, bspShaders[ i ].shader ) ) { if ( !Q_stricmp( shader, bspShaders[ i ].shader ) ) {
return i; return i;