]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Merge commit '804c20949d43175179489ecbb1305752cfa17217' into garux-merge
authorThomas Debesse <dev@illwieckz.net>
Tue, 26 May 2020 15:26:39 +0000 (17:26 +0200)
committerThomas Debesse <dev@illwieckz.net>
Tue, 26 May 2020 15:26:39 +0000 (17:26 +0200)
1  2 
radiant/build.cpp
radiant/mainframe.cpp
radiant/map.cpp
tools/quake3/q3map2/main.c

index 3a524a76465f7fa727d966f19eab7f445b7a820f,915ce0fc53858dd2dcde68b7d65568ef3ff4e0f7..ffee739fd4fcb586cb32e8274c55403f7701c86e
@@@ -878,38 -908,42 +878,41 @@@ ui::Window BuildMenuDialog_construct( M
                        }
                }
                {
 -                      GtkFrame* frame = create_dialog_frame( "Commandline" );
 -                      gtk_table_attach( table1, GTK_WIDGET( frame ), 0, 1, 1, 2,
 -                                                        (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
 -                                                        (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
 +                      auto frame = create_dialog_frame( "Commandline" );
 +            table1.attach(frame, {0, 1, 1, 2});
                        {
 -                              GtkScrolledWindow* scr = create_scrolled_window( GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC, 4 );
 -                              gtk_container_add( GTK_CONTAINER( frame ), GTK_WIDGET( scr ) );
 +                              auto scr = create_scrolled_window( ui::Policy::NEVER, ui::Policy::AUTOMATIC, 4 );
 +                              frame.add(scr);
  
                                {
 -                                      GtkListStore* store = gtk_list_store_new( 1, G_TYPE_STRING );
 +                                      auto store = ui::ListStore::from(gtk_list_store_new( 1, G_TYPE_STRING ));
  
 -                                      GtkWidget* view = gtk_tree_view_new_with_model( GTK_TREE_MODEL( store ) );
 -                                      gtk_tree_view_set_headers_visible( GTK_TREE_VIEW( view ), FALSE );
 +                                      auto view = ui::TreeView(ui::TreeModel::from( store._handle ));
 +                                      gtk_tree_view_set_headers_visible(view, FALSE );
  
 -                                      GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
 +                                      auto renderer = ui::CellRendererText(ui::New);
                                        object_set_boolean_property( G_OBJECT( renderer ), "editable", TRUE );
 -                                      g_signal_connect( renderer, "edited", G_CALLBACK( commands_cell_edited ), store );
+                                       g_object_set( G_OBJECT( renderer ), "wrap-mode", PANGO_WRAP_WORD, NULL );
+                                       //g_object_set( G_OBJECT( renderer ), "ellipsize", PANGO_ELLIPSIZE_MIDDLE, NULL );
+                                       object_set_int_property( G_OBJECT( renderer ), "wrap-width", 640 );
 +                                      renderer.connect( "edited", G_CALLBACK( commands_cell_edited ), store );
  
 -                                      GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 0, 0 );
 -                                      gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
 +                                      auto column = ui::TreeViewColumn( "", renderer, {{"text", 0}} );
 +                                      gtk_tree_view_append_column(view, column );
  
 -                                      GtkTreeSelection* selection = gtk_tree_view_get_selection( GTK_TREE_VIEW( view ) );
 +                                      auto selection = gtk_tree_view_get_selection(view );
                                        gtk_tree_selection_set_mode( selection, GTK_SELECTION_BROWSE );
  
 -                                      gtk_widget_show( view );
 +                                      view.show();
  
 -                                      gtk_container_add( GTK_CONTAINER( scr ), view );
 +                                      scr.add(view);
  
 -                                      g_object_unref( G_OBJECT( store ) );
 +                                      store.unref();
  
 -                                      g_signal_connect( G_OBJECT( view ), "key_press_event", G_CALLBACK( commands_key_press ), store );
 +                                      view.connect( "key_press_event", G_CALLBACK( commands_key_press ), store );
  
 -                                      g_signal_connect( G_OBJECT( gtk_tree_view_get_selection( GTK_TREE_VIEW( buildView ) ) ), "changed", G_CALLBACK( project_selection_changed ), store );
 +                                      auto sel = ui::TreeSelection::from(gtk_tree_view_get_selection(buildView ));
 +                                      sel.connect( "changed", G_CALLBACK( project_selection_changed ), store );
                                }
                        }
                }
Simple merge
diff --cc radiant/map.cpp
index b545c32be11581aa945abfa88ffaa66dfca3adc5,e4c6e26aa0a902b6aa629714045afe28c9723dd0..fa19512d7f29680c2ec02ed4de455e203af7e14c
@@@ -86,9 -86,8 +86,10 @@@ MapModules& ReferenceAPI_getMapModules(
  #include "autosave.h"
  #include "brushmodule.h"
  #include "brush.h"
+ #include "patch.h"
  
 +bool g_writeMapComments = true;
 +
  class NameObserver
  {
  UniqueNames& m_names;
@@@ -799,85 -804,165 +838,140 @@@ WindowPosition g_posMapInfoWnd( c_defau
  
  void DoMapInfo(){
        ModalDialog dialog;
-       ui::Entry brushes_entry{ui::null};
-       ui::Entry entities_entry{ui::null};
++      ui::Widget w_brushes{ui::null};
++      ui::Widget w_patches{ui::null};
++      ui::Widget w_ents{ui::null};
++      ui::Widget w_ents_ingame{ui::null};
++      ui::Widget w_groupents{ui::null};
++      ui::Widget w_groupents_ingame{ui::null};
 -      GtkWidget* w_brushes;
 -      GtkWidget* w_patches;
 -      GtkWidget* w_ents;
 -      GtkWidget* w_ents_ingame;
 -      GtkWidget* w_groupents;
 -      GtkWidget* w_groupents_ingame;
 -
 -      GtkListStore* EntityBreakdownWalker;
 +      ui::ListStore EntityBreakdownWalker{ui::null};
  
 -      GtkWindow* window = create_dialog_window( MainFrame_getWindow(), "Map Info", G_CALLBACK( dialog_delete_callback ), &dialog );
 +      ui::Window window = MainFrame_getWindow().create_dialog_window("Map Info", G_CALLBACK(dialog_delete_callback ), &dialog );
  
        window_set_position( window, g_posMapInfoWnd );
  
        {
 -              GtkVBox* vbox = create_dialog_vbox( 4, 4 );
 -              gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( vbox ) );
 +              auto vbox = create_dialog_vbox( 4, 4 );
 +              window.add(vbox);
  
                {
 -                      GtkHBox* hbox = create_dialog_hbox( 4 );
 -                      gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), FALSE, FALSE, 0 );
 +                      auto hbox = create_dialog_hbox( 4 );
-                       vbox.pack_start( hbox, FALSE, TRUE, 0 );
++                      vbox.pack_start( hbox, FALSE, FALSE, 0 );
  
                        {
-                               auto table = create_dialog_table( 2, 2, 4, 4 );
 -                              GtkTable* table = create_dialog_table( 3, 4, 4, 4 );
 -                              gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
++                              auto table = create_dialog_table( 3, 4, 4, 4 );
 +                              hbox.pack_start( table, TRUE, TRUE, 0 );
 +
                                {
-                                       auto entry = ui::Entry(ui::New);
-                                       entry.show();
-                     table.attach(entry, {1, 2, 0, 1}, {GTK_EXPAND | GTK_FILL, 0});
-                                       gtk_editable_set_editable( GTK_EDITABLE(entry), FALSE );
-                                       brushes_entry = entry;
 -                                      GtkWidget* label = gtk_label_new( "Total Brushes:" );
 -                                      gtk_widget_show( label );
 -                                      gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
 -                                                                        (GtkAttachOptions) ( GTK_FILL ),
 -                                                                        (GtkAttachOptions) ( 0 ), 0, 0 );
++                                      auto label = ui::Label( "Total Brushes:" );
++                                      label.show();
++                    table.attach(label, {0, 1, 0, 1}, {GTK_FILL, 0});
+                                       gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
                                }
                                {
-                                       auto entry = ui::Entry(ui::New);
-                                       entry.show();
-                     table.attach(entry, {1, 2, 1, 2}, {GTK_EXPAND | GTK_FILL, 0});
-                                       gtk_editable_set_editable( GTK_EDITABLE(entry), FALSE );
-                                       entities_entry = entry;
 -                                      GtkWidget* label = gtk_label_new( "" );
 -                                      gtk_widget_show( label );
 -                                      gtk_table_attach( GTK_TABLE( table ), label, 1, 2, 0, 1,
 -                                                                        (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
 -                                                                        (GtkAttachOptions) ( 0 ), 3, 0 );
 -                                      gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
++                                      auto label = ui::Label( "" );
++                                      label.show();
++                    table.attach(label, {1, 2, 0, 1}, {GTK_FILL | GTK_EXPAND, 0}, {3, 0});
+                                       w_brushes = label;
                                }
                                {
-                                       ui::Widget label = ui::Label( "Total Brushes" );
 -                                      GtkWidget* label = gtk_label_new( "Total Patches:" );
 -                                      gtk_widget_show( label );
 -                                      gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 0, 1,
 -                                                                        (GtkAttachOptions) ( GTK_FILL ),
 -                                                                        (GtkAttachOptions) ( 0 ), 0, 0 );
 -                                      gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
++                                      auto label = ui::Label( "Total Patches" );
 +                                      label.show();
-                     table.attach(label, {0, 1, 0, 1}, {GTK_FILL, 0});
++                    table.attach(label, {2, 3, 0, 1}, {GTK_FILL, 0});
 +                                      gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                }
                                {
-                                       ui::Widget label = ui::Label( "Total Entities" );
 -                                      GtkWidget* label = gtk_label_new( "" );
 -                                      gtk_widget_show( label );
 -                                      gtk_table_attach( GTK_TABLE( table ), label, 3, 4, 0, 1,
 -                                                                        (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
 -                                                                        (GtkAttachOptions) ( 0 ), 3, 0 );
 -                                      gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
++                                      auto label = ui::Label( "" );
 +                                      label.show();
-                     table.attach(label, {0, 1, 1, 2}, {GTK_FILL, 0});
++                    table.attach(label, {3, 4, 0, 1}, {GTK_FILL, 0}, {3, 0});
 +                                      gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
+                                       w_patches = label;
+                               }
+                               {
 -                                      GtkWidget* label = gtk_label_new( "Total Entities:" );
 -                                      gtk_widget_show( label );
 -                                      gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
 -                                                                        (GtkAttachOptions) ( GTK_FILL ),
 -                                                                        (GtkAttachOptions) ( 0 ), 0, 0 );
++                                      auto label = ui::Label( "Total Entities:" );
++                                      label.show();
++                                      table.attach(label, {0, 1, 1, 2}, {GTK_FILL, 0});
+                                       gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
+                               }
+                               {
 -                                      GtkWidget* label = gtk_label_new( "" );
 -                                      gtk_widget_show( label );
 -                                      gtk_table_attach( GTK_TABLE( table ), label, 1, 2, 1, 2,
 -                                                                        (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
 -                                                                        (GtkAttachOptions) ( 0 ), 3, 0 );
++                                      auto label = ui::Label( "" );
++                                      label.show();
++                                      table.attach(label, {1, 2, 1, 2}, {GTK_FILL | GTK_EXPAND, 0}, {3, 0});
+                                       gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
+                                       w_ents = label;
                                }
 -                                      GtkWidget* label = gtk_label_new( "Ingame Entities:" );
 -                                      gtk_widget_show( label );
 -                                      gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 1, 2,
 -                                                                        (GtkAttachOptions) ( GTK_FILL ),
 -                                                                        (GtkAttachOptions) ( 0 ), 0, 0 );
+                               {
 -                                      GtkWidget* label = gtk_label_new( "" );
 -                                      gtk_widget_show( label );
 -                                      gtk_table_attach( GTK_TABLE( table ), label, 3, 4, 1, 2,
 -                                                                        (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
 -                                                                        (GtkAttachOptions) ( 0 ), 3, 0 );
++                                      auto label = ui::Label( "Ingame Entities:" );
++                                      label.show();
++                                      table.attach(label, {2, 3, 1, 2}, {GTK_FILL, 0});
+                                       gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
+                               }
+                               {
 -                                      GtkWidget* label = gtk_label_new( "Group Entities:" );
 -                                      gtk_widget_show( label );
 -                                      gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 2, 3,
 -                                                                        (GtkAttachOptions) ( GTK_FILL ),
 -                                                                        (GtkAttachOptions) ( 0 ), 0, 0 );
++                                      auto label = ui::Label( "" );
++                                      label.show();
++                                      table.attach(label, {3, 4, 1, 2}, {GTK_FILL | GTK_EXPAND, 0 }, {3, 0});
+                                       gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
+                                       w_ents_ingame = label;
+                               }
+                               {
 -                                      GtkWidget* label = gtk_label_new( "" );
 -                                      gtk_widget_show( label );
 -                                      gtk_table_attach( GTK_TABLE( table ), label, 1, 2, 2, 3,
 -                                                                        (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
 -                                                                        (GtkAttachOptions) ( 0 ), 3, 0 );
++                                      auto label = ui::Label( "Group Entities:" );
++                                      label.show();
++                                      table.attach(label, {0, 1, 2, 3}, {GTK_FILL, 0});
+                                       gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
+                               }
+                               {
 -                                      GtkWidget* label = gtk_label_new( "Ingame Group Entities:" );
 -                                      gtk_widget_show( label );
 -                                      gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 2, 3,
 -                                                                        (GtkAttachOptions) ( GTK_FILL ),
 -                                                                        (GtkAttachOptions) ( 0 ), 0, 0 );
++                                      auto label = ui::Label( "" );
++                                      label.show();
++                                      table.attach(label, {1, 2, 2, 3}, {GTK_FILL | GTK_EXPAND, 0}, {3, 0});
+                                       gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
+                                       w_groupents = label;
+                               }
+                               {
 -                                      GtkWidget* label = gtk_label_new( "" );
 -                                      gtk_widget_show( label );
 -                                      gtk_table_attach( GTK_TABLE( table ), label, 3, 4, 2, 3,
 -                                                                        (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
 -                                                                        (GtkAttachOptions) ( 0 ), 3, 0 );
++                                      auto label = ui::Label( "Ingame Group Entities:" );
++                                      label.show();
++                                      table.attach(label, {2, 3, 2, 3}, {GTK_FILL, 0});
+                                       gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
+                               }
+                               {
++                                      auto label = ui::Label( "" );
++                                      label.show();
++                                      table.attach(label, {3, 4, 2, 3}, {GTK_FILL | GTK_EXPAND, 0}, {3, 0});
+                                       gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
+                                       w_groupents_ingame = label;
+                               }
                        }
                        {
 -                              GtkVBox* vbox2 = create_dialog_vbox( 4 );
 -                              gtk_box_pack_start( GTK_BOX( hbox ), GTK_WIDGET( vbox2 ), FALSE, FALSE, 0 );
 +                              auto vbox2 = create_dialog_vbox( 4 );
 +                              hbox.pack_start( vbox2, FALSE, FALSE, 0 );
  
                                {
 -                                      GtkButton* button = create_dialog_button( "Close", G_CALLBACK( dialog_button_ok ), &dialog );
 -                                      gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( button ), FALSE, FALSE, 0 );
 +                                      auto button = create_dialog_button( "Close", G_CALLBACK( dialog_button_ok ), &dialog );
 +                                      vbox2.pack_start( button, FALSE, FALSE, 0 );
                                }
                        }
                }
                {
-                       ui::Widget label = ui::Label( "Entity breakdown" );
 -                      GtkWidget* label = gtk_label_new( "*** Entity breakdown ***" );
 -                      gtk_widget_show( label );
 -                      gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( label ), FALSE, TRUE, 0 );
 -                      gtk_misc_set_alignment( GTK_MISC( label ), 0.5, 0.5 );
++                      ui::Widget label = ui::Label( "*** Entity breakdown ***" );
 +                      label.show();
 +                      vbox.pack_start( label, FALSE, TRUE, 0 );
 +                      gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                }
                {
 -                      GtkScrolledWindow* scr = create_scrolled_window( GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC, 4 );
 -                      gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( scr ), TRUE, TRUE, 0 );
 +                      auto scr = create_scrolled_window( ui::Policy::NEVER, ui::Policy::AUTOMATIC, 4 );
 +                      vbox.pack_start( scr, TRUE, TRUE, 0 );
  
                        {
-                               auto store = ui::ListStore::from(gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_STRING ));
 -                              GtkListStore* store = gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_UINT );
++                              auto store = ui::ListStore::from(gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_UINT ));
  
 -                              GtkWidget* view = gtk_tree_view_new_with_model( GTK_TREE_MODEL( store ) );
 -                              gtk_tree_view_set_headers_clickable( GTK_TREE_VIEW( view ), TRUE );
 +                              auto view = ui::TreeView(ui::TreeModel::from(store._handle));
 +                              gtk_tree_view_set_headers_clickable(view, TRUE );
  
                                {
 -                                      GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
 -                                      GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "Entity", renderer, "text", 0, 0 );
 -                                      gtk_tree_view_append_column( GTK_TREE_VIEW( view ), column );
 +                                      auto renderer = ui::CellRendererText(ui::New);
 +                                      auto column = ui::TreeViewColumn( "Entity", renderer, {{"text", 0}} );
 +                                      gtk_tree_view_append_column(view, column );
                                        gtk_tree_view_column_set_sort_column_id( column, 0 );
                                }
  
                }
        }
  
 -      g_object_unref( G_OBJECT( EntityBreakdownWalker ) );
 +      EntityBreakdownWalker.unref();
  
-       char tmp[16];
-       sprintf( tmp, "%u", Unsigned( g_brushCount.get() ) );
-       brushes_entry.text(tmp);
-       sprintf( tmp, "%u", Unsigned( g_entityCount.get() ) );
-       entities_entry.text(tmp);
+       int n_patches = 0;
+       int n_ents_ingame = 0;
+       int n_groupents = 0;
+       int n_groupents_ingame = 0;
+       Scene_CountStuff( n_patches, n_ents_ingame, n_groupents, n_groupents_ingame );
+       //globalOutputStream() << n_patches << n_ents_ingame << n_groupents << n_groupents_ingame << "\n";
+       char *markup;
+       markup = g_markup_printf_escaped( "<span style=\"italic\"><b>%u</b></span>  ", Unsigned( g_brushCount.get() ) );
+       gtk_label_set_markup( GTK_LABEL( w_brushes ), markup );
+       g_free( markup );
+       markup = g_markup_printf_escaped( "<span style=\"italic\"><b>%i</b></span>  ", n_patches );
+       gtk_label_set_markup( GTK_LABEL( w_patches ), markup );
+       g_free( markup );
+       markup = g_markup_printf_escaped( "<span style=\"italic\"><b>%u</b></span>  ", Unsigned( g_entityCount.get() ) );
+       gtk_label_set_markup( GTK_LABEL( w_ents ), markup );
+       g_free( markup );
+       markup = g_markup_printf_escaped( "<span style=\"italic\"><b>%i</b></span>  ", n_ents_ingame );
+       gtk_label_set_markup( GTK_LABEL( w_ents_ingame ), markup );
+       g_free( markup );
+       markup = g_markup_printf_escaped( "<span style=\"italic\"><b>%i</b></span>  ", n_groupents );
+       gtk_label_set_markup( GTK_LABEL( w_groupents ), markup );
+       g_free( markup );
+       markup = g_markup_printf_escaped( "<span style=\"italic\"><b>%i</b></span>  ", n_groupents_ingame );
+       gtk_label_set_markup( GTK_LABEL( w_groupents_ingame ), markup );
+       g_free( markup );
 +
        modal_dialog_show( window, dialog );
  
        // save before exit
index 139a242a0ca5fafde3bec1f9aa298b009c04e352,753e50703f5267b67a09002ff7b6ecbce4a90441..4e1cd3e88f25708409a09d1a7666516eed1acc5f
@@@ -2082,8 -3698,10 +2082,11 @@@ skipEXrefile
  int main( int argc, char **argv ){
        int i, r;
        double start, end;
 +      extern qboolean werror;
  
+ #ifdef WIN32
+       _setmaxstdio(2048);
+ #endif
  
        /* we want consistent 'randomness' */
        srand( 0 );