]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Radiant:
authorGarux <garux@mail.ru>
Tue, 1 Aug 2017 11:28:28 +0000 (14:28 +0300)
committerGarux <garux@mail.ru>
Tue, 1 Aug 2017 11:28:28 +0000 (14:28 +0300)
misc...
* texbro: disable alpha transparency by def; isn't good in half of cases
* find/replace: tooltip helper note about search mode
* Entity: arrowheads, showing direction of connection-lines in addition to color-code; New algorithm: are visible in all orthogonal projections
* tweak: do not render 'misc_model' & 'light' entity names
* filters: patches: +filter ones with surfaceparm playerclip
* translucent filter also works for shaders with qer_alphafunc
* filter areaportal, if single face matches (allows case with other faces, using 'skip')
* filter translucent, if single face matches
* filter liquids by surfaceparm {water, lava, slime} in addition to textures/liquids path

include/ishaders.h
plugins/entity/light.cpp
plugins/entity/miscmodel.cpp
plugins/entity/targetable.h
plugins/shaders/shaders.cpp
radiant/brushmanip.cpp
radiant/findtexturedialog.cpp
radiant/patchmanip.cpp
radiant/texwindow.cpp
setup/data/tools/global.xlink

index ac447090cbd99fb9cde9aeade1cf8d833113e375..cfd6e0fc7eb97d0092b00fd1598751fc0e2406c9 100644 (file)
@@ -31,14 +31,13 @@ enum
        QER_NOCARVE = 1 << 1,
        QER_NODRAW = 1 << 2,
        QER_NONSOLID = 1 << 3,
-       QER_WATER = 1 << 4,
-       QER_LAVA = 1 << 5,
-       QER_FOG = 1 << 6,
-       QER_ALPHATEST = 1 << 7,
-       QER_CULL = 1 << 8,
-       QER_AREAPORTAL = 1 << 9,
-       QER_CLIP = 1 << 10,
-       QER_BOTCLIP = 1 << 11,
+       QER_LIQUID = 1 << 4,
+       QER_FOG = 1 << 5,
+       QER_ALPHATEST = 1 << 6,
+       QER_CULL = 1 << 7,
+       QER_AREAPORTAL = 1 << 8,
+       QER_CLIP = 1 << 9,
+       QER_BOTCLIP = 1 << 10,
 };
 
 struct qtexture_t;
index 2d0bf78ef9063e80db255adb24202b3a54bb25fc..3793824af0dea5d0fd85e468e2111dbf6e715c66 100644 (file)
@@ -1145,7 +1145,7 @@ void renderSolid( Renderer& renderer, const VolumeTest& volume, const Matrix4& l
 }
 void renderWireframe( Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected ) const {
        renderSolid( renderer, volume, localToWorld, selected );
-       if ( g_showNames ) {
+       if ( g_showNames && !string_equal( m_named.name(), "light" ) ) {
                renderer.addRenderable( m_renderName, localToWorld );
        }
 }
index e6197d099e43e323fecc08594e6b3bc4cac4d927..758152c40bfc11be74ca4594db2acb2256579d5e 100644 (file)
@@ -199,7 +199,7 @@ void renderSolid( Renderer& renderer, const VolumeTest& volume, const Matrix4& l
 }
 void renderWireframe( Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected ) const {
        renderSolid( renderer, volume, localToWorld, selected );
-       if ( g_showNames ) {
+       if ( g_showNames  && !string_equal( m_named.name(), "misc_model" ) ) {
                renderer.addRenderable( m_renderName, localToWorld );
        }
 }
index 6de382cfabd63b90558e1ffea7016a30d676f233..52a394250abf11be2818681c92816f047717a9a6 100644 (file)
@@ -184,9 +184,57 @@ TargetLinesPushBack( RenderablePointVector& targetLines, const Vector3& worldPos
        m_targetLines( targetLines ), m_worldPosition( worldPosition ), m_volume( volume ){
 }
 void operator()( const Vector3& worldPosition ) const {
-       if ( m_volume.TestLine( segment_for_startend( m_worldPosition, worldPosition ) ) ) {
+       Vector3 dir( worldPosition - m_worldPosition );//end - start
+       double len = vector3_length( dir );
+       if ( len != 0 && m_volume.TestLine( segment_for_startend( m_worldPosition, worldPosition ) ) ) {
                m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( m_worldPosition ) ) );
                m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( worldPosition ) ) );
+
+               Vector3 mid( ( worldPosition + m_worldPosition ) * 0.5f );
+               //vector3_normalise( dir );
+               dir /= len;
+               Vector3 hack( 0.57735, 0.57735, 0.57735 );
+               int maxI = 0;
+               float max = 0;
+               for ( int i = 0; i < 3 ; ++i ){
+                       if ( dir[i] < 0 ){
+                               hack[i] *= -1;
+                       }
+                       if ( fabs( dir[i] ) > max ){
+                               maxI = i;
+                       }
+               }
+               hack[maxI] *= -1;
+
+               Vector3 ort( vector3_cross( dir, hack ) );
+               //vector3_normalise( ort );
+               Vector3 wing1( mid - dir*12 + ort*6 );
+               Vector3 wing2( wing1 - ort*12 );
+
+               if( len <= 512 || len > 768 ){
+                       m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( mid ) ) );
+                       m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( wing1 ) ) );
+                       m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( mid ) ) );
+                       m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( wing2 ) ) );
+               }
+               if( len > 512 ){
+                       Vector3 wing1_delta( mid - wing1 );
+                       Vector3 wing2_delta( mid - wing2 );
+                       Vector3 point( m_worldPosition + dir*256 );
+                       wing1 = point - wing1_delta;
+                       wing2 = point - wing2_delta;
+                       m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( point ) ) );
+                       m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( wing1 ) ) );
+                       m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( point ) ) );
+                       m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( wing2 ) ) );
+                       point =  worldPosition - dir*256;
+                       wing1 = point - wing1_delta;
+                       wing2 = point - wing2_delta;
+                       m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( point ) ) );
+                       m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( wing1 ) ) );
+                       m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( point ) ) );
+                       m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( wing2 ) ) );
+               }
        }
 }
 };
@@ -253,7 +301,7 @@ RenderableTargetingEntity( TargetingEntity& targets )
 }
 void compile( const VolumeTest& volume, const Vector3& world_position ) const {
        m_target_lines.clear();
-       m_target_lines.reserve( m_targets.size() * 2 );
+       m_target_lines.reserve( m_targets.size() * 14 );
        TargetingEntity_forEach( m_targets, TargetLinesPushBack( m_target_lines, world_position, volume ) );
 }
 void render( Renderer& renderer, const VolumeTest& volume, const Vector3& world_position ) const {
index 44cc0baf200d5c1ddeb96690d285e45ceabbec37..eda91d4f2812a8aafd519d34407522b94c95f0d5 100644 (file)
@@ -633,7 +633,7 @@ bool ShaderTemplate::parseDoom3( Tokeniser& tokeniser ){
                                m_nFlags |= QER_NONSOLID;
                        }
                        else if ( string_equal_nocase( token, "liquid" ) ) {
-                               m_nFlags |= QER_WATER;
+                               m_nFlags |= QER_LIQUID;
                        }
                        else if ( string_equal_nocase( token, "areaportal" ) ) {
                                m_nFlags |= QER_AREAPORTAL;
@@ -1266,11 +1266,10 @@ bool ShaderTemplate::parseQuake3( Tokeniser& tokeniser ){
                                else if ( string_equal_nocase( surfaceparm, "nonsolid" ) ) {
                                        m_nFlags |= QER_NONSOLID;
                                }
-                               else if ( string_equal_nocase( surfaceparm, "water" ) ) {
-                                       m_nFlags |= QER_WATER;
-                               }
-                               else if ( string_equal_nocase( surfaceparm, "lava" ) ) {
-                                       m_nFlags |= QER_LAVA;
+                               else if ( string_equal_nocase( surfaceparm, "water" ) ||
+                                                       string_equal_nocase( surfaceparm, "lava" ) ||
+                                                       string_equal_nocase( surfaceparm, "slime") ){
+                                       m_nFlags |= QER_LIQUID;
                                }
                                else if ( string_equal_nocase( surfaceparm, "areaportal" ) ) {
                                        m_nFlags |= QER_AREAPORTAL;
index 11db0ba99fdfb8838fb0a759376c48e4dd438462..1185894729f5a4f89ead1ffd9dca8b67b88a221d 100644 (file)
@@ -979,9 +979,12 @@ filter_brush_all_faces g_filter_brush_caulk( &g_filter_face_caulk );
 filter_face_shader_prefix g_filter_face_caulk_ja( "textures/system/caulk" );
 filter_brush_all_faces g_filter_brush_caulk_ja( &g_filter_face_caulk_ja );
 
-filter_face_shader_prefix g_filter_face_liquids( "textures/liquids/" );
+filter_face_flags g_filter_face_liquids( QER_LIQUID );
 filter_brush_any_face g_filter_brush_liquids( &g_filter_face_liquids );
 
+filter_face_shader_prefix g_filter_face_liquidsdir( "textures/liquids/" );
+filter_brush_any_face g_filter_brush_liquidsdir( &g_filter_face_liquidsdir );
+
 filter_face_shader g_filter_face_hint( "textures/common/hint" );
 filter_brush_any_face g_filter_brush_hint( &g_filter_face_hint );
 
@@ -995,7 +998,7 @@ filter_face_shader g_filter_face_hint_ja( "textures/system/hint" );
 filter_brush_any_face g_filter_brush_hint_ja( &g_filter_face_hint_ja );
 
 filter_face_shader g_filter_face_areaportal( "textures/common/areaportal" );
-filter_brush_all_faces g_filter_brush_areaportal( &g_filter_face_areaportal );
+filter_brush_any_face g_filter_brush_areaportal( &g_filter_face_areaportal );
 
 filter_face_shader g_filter_face_visportal( "textures/editor/visportal" );
 filter_brush_any_face g_filter_brush_visportal( &g_filter_face_visportal );
@@ -1006,8 +1009,8 @@ filter_brush_all_faces g_filter_brush_clusterportal( &g_filter_face_clusterporta
 filter_face_shader g_filter_face_lightgrid( "textures/common/lightgrid" );
 filter_brush_all_faces g_filter_brush_lightgrid( &g_filter_face_lightgrid );
 
-filter_face_flags g_filter_face_translucent( QER_TRANS );
-filter_brush_all_faces g_filter_brush_translucent( &g_filter_face_translucent );
+filter_face_flags g_filter_face_translucent( QER_TRANS | QER_ALPHATEST );
+filter_brush_any_face g_filter_brush_translucent( &g_filter_face_translucent );
 
 filter_face_contents g_filter_face_detail( BRUSH_DETAIL_MASK );
 filter_brush_all_faces g_filter_brush_detail( &g_filter_face_detail );
@@ -1028,6 +1031,7 @@ void BrushFilters_construct(){
        add_face_filter( g_filter_face_caulk, EXCLUDE_CAULK );
        add_face_filter( g_filter_face_caulk_ja, EXCLUDE_CAULK );
        add_brush_filter( g_filter_brush_liquids, EXCLUDE_LIQUIDS );
+       add_brush_filter( g_filter_brush_liquidsdir, EXCLUDE_LIQUIDS );
        add_brush_filter( g_filter_brush_hint, EXCLUDE_HINTSSKIPS );
        add_brush_filter( g_filter_brush_hintlocal, EXCLUDE_HINTSSKIPS );
        add_brush_filter( g_filter_brush_hint_q2, EXCLUDE_HINTSSKIPS );
index 37379c57834cf4cc06c3822c3ba2bf7e03bbc31c..8452a7604c588aa852d432a84bc7fe1cdcd52ff8 100644 (file)
@@ -169,7 +169,8 @@ GtkWindow* FindTextureDialog::BuildDialog(){
                                          (GtkAttachOptions) ( 0 ), 0, 0 );
        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
 
-       label = gtk_label_new( "Replace:" );
+       label = gtk_label_new( "Replace:*" );
+       gtk_widget_set_tooltip_text( label, "Empty = search mode" );
        gtk_widget_show( label );
        gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
                                          (GtkAttachOptions) ( GTK_FILL ),
@@ -187,6 +188,7 @@ GtkWindow* FindTextureDialog::BuildDialog(){
        GlobalTextureEntryCompletion::instance().connect( GTK_ENTRY( entry ) );
 
        entry = gtk_entry_new();
+       gtk_widget_set_tooltip_text( entry, "Empty = search mode" );
        gtk_widget_show( entry );
        gtk_table_attach( GTK_TABLE( table ), entry, 1, 2, 1, 2,
                                          (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
index b941e2ae5649919a7a1d56606489ed0f97d68efd..8d7d5f99cb85bbcf0721fe44f39eba66b7fa3b8c 100644 (file)
@@ -774,13 +774,15 @@ bool filter( const Patch& patch ) const {
 
 
 filter_patch_all g_filter_patch_all;
-filter_patch_shader g_filter_patch_clip( "textures/common/clip" );
+filter_patch_flags g_filter_patch_clip( QER_CLIP );
+filter_patch_shader g_filter_patch_commonclip( "textures/common/clip" );
 filter_patch_shader g_filter_patch_weapclip( "textures/common/weapclip" );
-filter_patch_flags g_filter_patch_translucent( QER_TRANS );
+filter_patch_flags g_filter_patch_translucent( QER_TRANS | QER_ALPHATEST );
 
 void PatchFilters_construct(){
        add_patch_filter( g_filter_patch_all, EXCLUDE_CURVES );
        add_patch_filter( g_filter_patch_clip, EXCLUDE_CLIP );
+       add_patch_filter( g_filter_patch_commonclip, EXCLUDE_CLIP );
        add_patch_filter( g_filter_patch_weapclip, EXCLUDE_CLIP );
        add_patch_filter( g_filter_patch_translucent, EXCLUDE_TRANSLUCENT );
 }
index ea928af8d91576b5283a42d2c7e6432340da5c4a..60e9c101f65dd5984cf690cfe96ddfa0023cfbdf 100644 (file)
@@ -134,7 +134,7 @@ namespace
 bool g_TextureBrowser_shaderlistOnly = false;
 bool g_TextureBrowser_fixedSize = true;
 bool g_TextureBrowser_filterNotex = false;
-bool g_TextureBrowser_enableAlpha = true;
+bool g_TextureBrowser_enableAlpha = false;
 }
 
 class DeferredAdjustment
index 1e16121fba4661c1efa092774f9d94c998ea9966..17fa8456bf348d04063b15be446e8b8b8d763e0c 100644 (file)
@@ -8,7 +8,7 @@
 <item name="Mouse Shortcuts" url="docs/Mouse Shortcuts.txt"/>
 <item name="Additional map compiler features" url="docs/Additional_map_compiler_features.htm"/>
 <item name="Additional map editor features" url="docs/Additional_map_editor_features.htm"/>
-<item name="Complete list of command line parameters" url="docs/Complete_list_of_command_line_parameters.htm"/>
+<item name="Complete list of Q3map2 command line parameters" url="docs/Complete_list_of_command_line_parameters.htm"/>
 <item name="Complete list of entity keys" url="docs/Complete_list_of_entity_keys.htm"/>
 <item name="Complete list of shader keywords" url="docs/Complete_list_of_shader_keywords.htm"/>
 <item name="Q3Map2 - FS20 - R5 readme" url="docs/fsr_readme.txt"/>