X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=radiant%2Fbrushmanip.cpp;h=fc3054e1516d6e308656587e729fadb3b523143f;hb=0f91bcf305ef8707b4a96a764c09aeb3cb6beba3;hp=0e190e6c9c8f83db72e1258b6ec8d51b962ffe92;hpb=1ede3dc63143af40210a3e9c1c601028359fac11;p=xonotic%2Fnetradiant.git diff --git a/radiant/brushmanip.cpp b/radiant/brushmanip.cpp index 0e190e6c..fc3054e1 100644 --- a/radiant/brushmanip.cpp +++ b/radiant/brushmanip.cpp @@ -570,6 +570,7 @@ void Scene_BrushFitTexture_Component_Selected( scene::Graph& graph, float s_repe } TextureProjection g_defaultTextureProjection; + const TextureProjection& TextureTransform_getDefault(){ TexDef_Construct_Default( g_defaultTextureProjection ); return g_defaultTextureProjection; @@ -617,6 +618,7 @@ public: BrushSelectByShaderWalker( const char* name ) : m_name( name ){ } + bool pre( const scene::Path& path, scene::Instance& instance ) const { if ( path.top().get().visible() ) { Brush* brush = Node_getBrush( path.top() ); @@ -741,6 +743,7 @@ const char* m_shader; public: filter_face_shader( const char* shader ) : m_shader( shader ){ } + bool filter( const Face& face ) const { return shader_equal( face.GetShader(), m_shader ); } @@ -752,6 +755,7 @@ const char* m_prefix; public: filter_face_shader_prefix( const char* prefix ) : m_prefix( prefix ){ } + bool filter( const Face& face ) const { return shader_equal_n( face.GetShader(), m_prefix, strlen( m_prefix ) ); } @@ -763,6 +767,7 @@ int m_flags; public: filter_face_flags( int flags ) : m_flags( flags ){ } + bool filter( const Face& face ) const { return ( face.getShader().shaderFlags() & m_flags ) != 0; } @@ -774,6 +779,7 @@ int m_contents; public: filter_face_contents( int contents ) : m_contents( contents ){ } + bool filter( const Face& face ) const { return ( face.getShader().m_flags.m_contentFlags & m_contents ) != 0; } @@ -787,6 +793,7 @@ FaceFilter* m_filter; public: filter_brush_any_face( FaceFilter* filter ) : m_filter( filter ){ } + bool filter( const Brush& brush ) const { bool filtered = false; Brush_forEachFace(brush, [&](Face &face) { @@ -1128,9 +1135,11 @@ public: BrushMakeSided( std::size_t count ) : m_count( count ){ } + void set(){ Scene_BrushConstructPrefab( GlobalSceneGraph(), eBrushPrism, m_count, TextureBrowser_GetSelectedShader( GlobalTextureBrowser() ) ); } + typedef MemberCaller SetCaller; }; @@ -1163,9 +1172,11 @@ public: BrushPrefab( EBrushPrefab type ) : m_type( type ){ } + void set(){ DoSides( m_type, axis_for_viewtype( GetViewAxis() ) ); } + typedef MemberCaller SetCaller; }; @@ -1176,9 +1187,13 @@ BrushPrefab g_brushrock( eBrushRock ); void FlipClip(); + void SplitClip(); + void Clip(); + void OnClipMode( bool enable ); + bool ClipMode(); @@ -1202,7 +1217,7 @@ void FlipClipper(){ Callback g_texture_lock_status_changed; -BoolExportCaller g_texdef_movelock_caller( g_brush_texturelock_enabled ); +ConstReferenceCaller &), PropertyImpl::Export> g_texdef_movelock_caller( g_brush_texturelock_enabled ); ToggleItem g_texdef_movelock_item( g_texdef_movelock_caller ); void Texdef_ToggleMoveLock(){ @@ -1212,9 +1227,6 @@ void Texdef_ToggleMoveLock(){ } - - - void Brush_registerCommands(){ GlobalToggles_insert( "TogTexLock", makeCallbackF(Texdef_ToggleMoveLock), ToggleItem::AddCallbackCaller( g_texdef_movelock_item ), Accelerator( 'T', (GdkModifierType)GDK_SHIFT_MASK ) ); @@ -1250,7 +1262,8 @@ void Brush_constructMenu( ui::Menu menu ){ if ( g_Layout_enableDetachableMenus.m_value ) { menu_tearoff( menu_in_menu ); } - create_menu_item_with_mnemonic( menu_in_menu, "Make _Hollow", "CSGHollow" ); + create_menu_item_with_mnemonic( menu_in_menu, "Make _Hollow", "CSGMakeHollow" ); + create_menu_item_with_mnemonic( menu_in_menu, "Make _Room", "CSGMakeRoom" ); create_menu_item_with_mnemonic( menu_in_menu, "CSG _Subtract", "CSGSubtract" ); create_menu_item_with_mnemonic( menu_in_menu, "CSG _Merge", "CSGMerge" ); }