]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Q3map2:
authorGarux <garux@mail.ru>
Tue, 1 Aug 2017 10:32:31 +0000 (13:32 +0300)
committerGarux <garux@mail.ru>
Tue, 1 Aug 2017 10:32:31 +0000 (13:32 +0300)
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

radiant/renderstate.cpp
tools/quake3/q3map2/bsp.c
tools/quake3/q3map2/bspfile_abstract.c
tools/quake3/q3map2/light.c
tools/quake3/q3map2/main.c
tools/quake3/q3map2/q3map2.h
tools/quake3/q3map2/writebsp.c

index 0c274918c92096777ab57af1f3dbaa1f766efd10..ce7ff97485c6e3aad8f6c9a886a45fcecbec5bcc 100644 (file)
@@ -2363,6 +2363,7 @@ void OpenGLShader::construct( const char* name ){
                                BlendFunc blendFunc = m_shader->getBlendFunc();
                                state.m_blend_src = convertBlendFactor( blendFunc.m_src );
                                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 ) {
                                        state.m_state |= RENDER_DEPTHWRITE;
                                }
index a65b27f5efd16fa529274280baa703d98fa9ee70..98d399c932e34c1a8ac5d010687c280d84acfebe 100644 (file)
@@ -707,6 +707,7 @@ int BSPMain( int argc, char **argv ){
        /* note it */
        Sys_Printf( "--- BSP ---\n" );
 
+       doingBSP = qtrue;
        SetDrawSurfacesBuffer();
        mapDrawSurfs = safe_malloc( sizeof( mapDrawSurface_t ) * MAX_MAP_DRAW_SURFS );
        memset( mapDrawSurfs, 0, sizeof( mapDrawSurface_t ) * MAX_MAP_DRAW_SURFS );
index c5df215e45564206f90ed5c2a65b157ae3be43d1..d09afc95ef485eacb11f1b669a0b27bb7acf6537 100644 (file)
@@ -177,11 +177,12 @@ void SwapBSPFile( void ){
        /* shaders (don't swap the name) */
        for ( i = 0; i < numBSPShaders ; i++ )
        {
+       if ( doingBSP ){
                si = ShaderInfoForShader( bspShaders[ i ].shader );
                if ( si->remapShader && si->remapShader[ 0 ] ) {
                        strcpy( bspShaders[ i ].shader, si->remapShader );
                }
-
+       }
                bspShaders[ i ].contentFlags = LittleLong( bspShaders[ i ].contentFlags );
                bspShaders[ i ].surfaceFlags = LittleLong( bspShaders[ i ].surfaceFlags );
        }
index f4c8188927ac385f897369aa25e2343e875533e6..cdd9819fab8de5969e0c5bb35437336af00f5459 100644 (file)
@@ -2791,12 +2791,11 @@ int LightMain( int argc, char **argv ){
                                lightAngleHL = ( atoi( argv[ i + 1 ] ) != 0 );
                                if ( lightAngleHL ) {
                                        Sys_Printf( "Enabling half lambert light angle attenuation\n" );
-                                       i++;
                                }
                                else{
                                        Sys_Printf( "Disabling half lambert light angle attenuation\n" );
-                                       i++;
                                }
+                               i++;
                        }
                }
                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" );
                        }
                        else{
-                               Sys_Printf( "Enabling ordered dir mapping\n" );
+                               Sys_Printf( "Enabling ordered dirtmapping\n" );
                        }
                        i++;
                }
index fe7eee412447ba39f9036839375e800708dce2ef..ae12f52d75f5368a5eccf09f55191a752a1de673 100644 (file)
@@ -1291,13 +1291,13 @@ int ScaleBSPMain( int argc, char **argv ){
                GetVectorForKey( &entities[ i ], "origin", vec );
                if ( ( vec[ 0 ] || vec[ 1 ] || vec[ 2 ] ) ) {
                        if ( !strncmp( ValueForKey( &entities[i], "classname" ), "info_player_", 12 ) ) {
-//                             vec[2] += spawn_ref;
+                               vec[2] += spawn_ref;
                        }
                        vec[0] *= scale[0];
                        vec[1] *= scale[1];
                        vec[2] *= scale[2];
                        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 ] );
                        SetKeyValue( &entities[ i ], "origin", str );
index bd7c030ebfda67935dae006550713e62525fb070..5221bb4f4234cb01c7230206496ca277f4e47492 100644 (file)
@@ -1999,6 +1999,9 @@ Q_EXTERN qboolean warnImage Q_ASSIGN( qtrue );
 /* ydnar: sinusoid samples */
 Q_EXTERN float jitters[ MAX_JITTERS ];
 
+/*can't code*/
+Q_EXTERN qboolean doingBSP Q_ASSIGN( qfalse );
+
 
 /* commandline arguments */
 Q_EXTERN qboolean                      nocmdline Q_ASSIGN( qfalse );
index 24692449f10318718589dddf213555c5cddc4b37..6b4ea592020e0f3d3934a4a469b2e8d9357df8bf 100644 (file)
@@ -56,14 +56,19 @@ int EmitShader( const char *shader, int *contentFlags, int *surfaceFlags ){
        /* try to find an existing shader */
        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 ) {
                        continue;
                }
                if ( contentFlags != NULL && bspShaders[ i ].contentFlags != *contentFlags ) {
                        continue;
                }
-
+               if ( !doingBSP ){
+                       si = ShaderInfoForShader( shader );
+                       if ( si->remapShader && si->remapShader[ 0 ] ) {
+                               shader = si->remapShader;
+                       }
+               }
                /* compare name */
                if ( !Q_stricmp( shader, bspShaders[ i ].shader ) ) {
                        return i;