Entity* entity = Node_getEntity( node );
if ( entity != 0 ) {
- m_writer.writeToken( "//" );
- m_writer.writeToken( "entity" );
- m_writer.writeUnsigned( g_count_entities++ );
- m_writer.nextLine();
+ if( entity->isContainer() && Node_getTraversable( node )->empty() && !string_equal( entity->getKeyValue( "classname" ), "worldspawn" ) ){
+ globalErrorStream() << "discarding empty group entity: # = " << g_count_entities << "; classname = " << entity->getKeyValue( "classname" ) << "\n";
+ return false;
+ }
+ if ( m_writeComments ) {
+ m_writer.writeToken( "//" );
+ m_writer.writeToken( "entity" );
+ m_writer.writeUnsigned( g_count_entities++ );
+ m_writer.nextLine();
+ }
m_writer.writeToken( "{" );
m_writer.nextLine();
return toolbar;
}
-GtkWidget* create_main_statusbar( GtkWidget *pStatusLabel[c_count_status] ){
- GtkTable* table = GTK_TABLE( gtk_table_new( 1, c_count_status, FALSE ) );
- gtk_widget_show( GTK_WIDGET( table ) );
+ui::Widget create_main_statusbar( ui::Widget pStatusLabel[c_count_status] ){
+ auto table = ui::Table( 1, c_count_status, FALSE );
+ table.show();
{
- GtkLabel* label = GTK_LABEL( gtk_label_new( "Label" ) );
+ auto label = ui::Label( "Label" );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
gtk_misc_set_padding( GTK_MISC( label ), 4, 2 );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_table_attach_defaults( table, GTK_WIDGET( label ), 0, 1, 0, 1 );
- pStatusLabel[c_command_status] = GTK_WIDGET( label );
+ label.show();
+ table.attach(label, {0, 1, 0, 1});
+ pStatusLabel[c_command_status] = ui::Widget(label );
}
- for ( int i = 1; i < c_count_status; ++i )
+ for (unsigned int i = 1; (int) i < c_count_status; ++i)
{
- GtkFrame* frame = GTK_FRAME( gtk_frame_new( 0 ) );
- gtk_widget_show( GTK_WIDGET( frame ) );
- gtk_table_attach_defaults( table, GTK_WIDGET( frame ), i, i + 1, 0, 1 );
+ auto frame = ui::Frame();
+ frame.show();
+ table.attach(frame, {i, i + 1, 0, 1});
gtk_frame_set_shadow_type( frame, GTK_SHADOW_IN );
- GtkLabel* label = GTK_LABEL( gtk_label_new( "Label" ) );
+ auto label = ui::Label( "Label" );
- gtk_label_set_ellipsize( label, PANGO_ELLIPSIZE_END );
+ if( i == c_texture_status )
+ gtk_label_set_ellipsize( label, PANGO_ELLIPSIZE_START );
+ else
+ gtk_label_set_ellipsize( label, PANGO_ELLIPSIZE_END );
+
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
gtk_misc_set_padding( GTK_MISC( label ), 4, 2 );
- gtk_widget_show( GTK_WIDGET( label ) );
- gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( label ) );
- pStatusLabel[i] = GTK_WIDGET( label );
+ label.show();
+ frame.add(label);
+ pStatusLabel[i] = ui::Widget(label );
}
- return GTK_WIDGET( table );
+ return ui::Widget(table );
}
#if 0
BrushFindIndexWalker( const scene::Node& node, std::size_t& count )
: m_node( &node ), m_count( count ){
}
- bool pre( const scene::Path& path, scene::Instance& instance ) const {
- if ( Node_isPrimitive( path.top() ) ) {
- if ( m_node == path.top().get_pointer() ) {
+
+ bool pre( scene::Node& node ) const {
+ if ( Node_isPrimitive( node ) ) {
+ if ( m_node == &node ) {
m_node = 0;
}
if ( m_node ) {
EntityFindIndexWalker( const scene::Node& node, std::size_t& count )
: m_node( &node ), m_count( count ){
}
- bool pre( const scene::Path& path, scene::Instance& instance ) const {
- if ( Node_isEntity( path.top() ) ) {
- if ( m_node == path.top().get_pointer() ) {
+
+ bool pre( scene::Node& node ) const {
+ if ( Node_isEntity( node ) ) {
+ if ( m_node == &node ) {
m_node = 0;
}
if ( m_node ) {