bobToolz: load all group entities, was hardcoded list of them
fix crash in DEntity::SelectBrushes after DEntity::LoadSelectedBrushes (which may load brushes from other entities) generalize loading options; fix ignored loadPatches option; use only visible brushes in Find Duplicates
This commit is contained in:
@@ -109,7 +109,7 @@ void DMap::BuildInRadiant( bool bAllowDestruction ){
|
||||
entity->BuildInRadiant( bAllowDestruction );
|
||||
}
|
||||
|
||||
void DMap::LoadAll( bool bLoadPatches ){
|
||||
void DMap::LoadAll( const LoadOptions options ){
|
||||
ClearEntities();
|
||||
|
||||
GlobalSelectionSystem().setSelectedAll( false );
|
||||
@@ -117,19 +117,18 @@ void DMap::LoadAll( bool bLoadPatches ){
|
||||
class load_entities_t : public scene::Traversable::Walker
|
||||
{
|
||||
DMap* m_map;
|
||||
bool m_bLoadPatches;
|
||||
const LoadOptions m_options;
|
||||
public:
|
||||
load_entities_t( DMap* map, bool bLoadPatches )
|
||||
: m_map( map ), m_bLoadPatches( bLoadPatches ){
|
||||
load_entities_t( DMap* map, const LoadOptions options )
|
||||
: m_map( map ), m_options( options ){
|
||||
}
|
||||
bool pre( scene::Node& node ) const {
|
||||
if ( Node_isEntity( node ) ) {
|
||||
DEntity* loadEntity = m_map->AddEntity( "", 0 );
|
||||
loadEntity->LoadFromEntity( node, m_bLoadPatches );
|
||||
if ( Node_isEntity( node ) && !( m_options.loadVisibleOnly && !node.visible() ) ) {
|
||||
m_map->AddEntity( "", 0 )->LoadFromEntity( node, m_options );
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} load_entities( this, bLoadPatches );
|
||||
} load_entities( this, options );
|
||||
|
||||
Node_getTraversable( GlobalSceneGraph().root() )->traverse( load_entities );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user