]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Q3map2:
authorGarux <garux@mail.ru>
Wed, 2 Aug 2017 06:15:41 +0000 (09:15 +0300)
committerGarux <garux@mail.ru>
Wed, 2 Aug 2017 06:15:41 +0000 (09:15 +0300)
* _setmaxstdio(2048) for windows
* game_qfusion update

Radiant:

misc...
* wrap long command lines in build menu -> customize
* map info dialog: + Total patches, Ingame entities, Group entities, Ingame group entities counts
* fix: map info dialog -> sort by count works
* fix of: minimize main wnd, close, start = cam, cons, texbro null size

radiant/build.cpp
radiant/mainframe.cpp
radiant/map.cpp
tools/quake3/q3map2/game_qfusion.h
tools/quake3/q3map2/main.c

index baa39568a68851be40f521accb150fd0d0d9a91b..915ce0fc53858dd2dcde68b7d65568ef3ff4e0f7 100644 (file)
@@ -924,6 +924,9 @@ GtkWindow* BuildMenuDialog_construct( ModalDialog& modal, ProjectList& projectLi
 
                                        GtkCellRenderer* renderer = gtk_cell_renderer_text_new();
                                        object_set_boolean_property( G_OBJECT( renderer ), "editable", TRUE );
+                                       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 );
                                        g_signal_connect( renderer, "edited", G_CALLBACK( commands_cell_edited ), store );
 
                                        GtkTreeViewColumn* column = gtk_tree_view_column_new_with_attributes( "", renderer, "text", 0, 0 );
index 68fb2b618f3c2711f994ec7e3a8ce27ede4ec322..b93e1e268d54b34c50209a2971720d6090d50210 100644 (file)
@@ -3074,12 +3074,14 @@ void MainFrame::Create(){
 
        EverySecondTimer_enable();
 
-       if ( g_layout_globals.nState & GDK_WINDOW_STATE_MAXIMIZED ) {
+       if ( g_layout_globals.nState & GDK_WINDOW_STATE_MAXIMIZED ||
+               g_layout_globals.nState & GDK_WINDOW_STATE_ICONIFIED ) {
                gtk_window_maximize( window );
        }
        if ( g_layout_globals.nState & GDK_WINDOW_STATE_FULLSCREEN ) {
                gtk_window_fullscreen( window );
        }
+
        if ( !FloatingGroupDialog() ) {
                gtk_paned_set_position( GTK_PANED( m_vSplit ), g_layout_globals.nXYHeight );
 
index 4e25a4cd7cb2d29320fcb08d79b7784979690442..e4c6e26aa0a902b6aa629714045afe28c9723dd0 100644 (file)
@@ -86,6 +86,7 @@ MapModules& ReferenceAPI_getMapModules();
 #include "autosave.h"
 #include "brushmodule.h"
 #include "brush.h"
+#include "patch.h"
 
 class NameObserver
 {
@@ -760,13 +761,57 @@ void Scene_EntityBreakdown( EntityBreakdown& entitymap ){
        GlobalSceneGraph().traverse( EntityBreakdownWalker( entitymap ) );
 }
 
+class CountStuffWalker : public scene::Graph::Walker
+{
+int& m_patches;
+int& m_ents_ingame;
+int& m_groupents;
+int& m_groupents_ingame;
+public:
+CountStuffWalker( int& patches, int& ents_ingame, int& groupents, int& groupents_ingame )
+       : m_patches( patches ), m_ents_ingame( ents_ingame ), m_groupents( groupents ), m_groupents_ingame( groupents_ingame ){
+}
+bool pre( const scene::Path& path, scene::Instance& instance ) const {
+       Patch* patch = Node_getPatch( path.top() );
+       if( patch != 0 ){
+               ++m_patches;
+       }
+       Entity* entity = Node_getEntity( path.top() );
+       if ( entity != 0 ){
+               if( entity->isContainer() ){
+                       ++m_groupents;
+                       if( !string_equal_nocase( "func_group", entity->getKeyValue( "classname" ) ) &&
+                               !string_equal_nocase( "_decal", entity->getKeyValue( "classname" ) ) ){
+                               ++m_groupents_ingame;
+                               ++m_ents_ingame;
+                       }
+                       return true;
+               }
+               if( !string_equal_nocase_n( "light", entity->getKeyValue( "classname" ), 5 ) &&
+                       !string_equal_nocase( "misc_model", entity->getKeyValue( "classname" ) ) ){
+                       ++m_ents_ingame;
+               }
+       }
+       return true;
+}
+};
+
+void Scene_CountStuff( int& patches, int& ents_ingame, int& groupents, int& groupents_ingame ){
+       GlobalSceneGraph().traverse( CountStuffWalker( patches, ents_ingame, groupents, groupents_ingame ) );
+}
 
 WindowPosition g_posMapInfoWnd( c_default_window_pos );
 
 void DoMapInfo(){
        ModalDialog dialog;
-       GtkEntry* brushes_entry;
-       GtkEntry* entities_entry;
+
+       GtkWidget* w_brushes;
+       GtkWidget* w_patches;
+       GtkWidget* w_ents;
+       GtkWidget* w_ents_ingame;
+       GtkWidget* w_groupents;
+       GtkWidget* w_groupents_ingame;
+
        GtkListStore* EntityBreakdownWalker;
 
        GtkWindow* window = create_dialog_window( MainFrame_getWindow(), "Map Info", G_CALLBACK( dialog_delete_callback ), &dialog );
@@ -779,48 +824,114 @@ void DoMapInfo(){
 
                {
                        GtkHBox* hbox = create_dialog_hbox( 4 );
-                       gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), FALSE, TRUE, 0 );
+                       gtk_box_pack_start( GTK_BOX( vbox ), GTK_WIDGET( hbox ), FALSE, FALSE, 0 );
 
                        {
-                               GtkTable* 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 );
-
                                {
-                                       GtkEntry* entry = GTK_ENTRY( gtk_entry_new() );
-                                       gtk_widget_show( GTK_WIDGET( entry ) );
-                                       gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 0, 1,
-                                                                         (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
+                                       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 );
-                                       gtk_entry_set_editable( entry, FALSE );
-
-                                       brushes_entry = entry;
+                                       gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
                                }
                                {
-                                       GtkEntry* entry = GTK_ENTRY( gtk_entry_new() );
-                                       gtk_widget_show( GTK_WIDGET( entry ) );
-                                       gtk_table_attach( table, GTK_WIDGET( entry ), 1, 2, 1, 2,
-                                                                         (GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
-                                                                         (GtkAttachOptions) ( 0 ), 0, 0 );
-                                       gtk_entry_set_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 );
+                                       w_brushes = label;
                                }
                                {
-                                       GtkWidget* label = gtk_label_new( "Total Brushes" );
+                                       GtkWidget* label = gtk_label_new( "Total Patches:" );
                                        gtk_widget_show( label );
-                                       gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
+                                       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.5 );
+                                       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, 3, 4, 0, 1,
+                                                                         (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
+                                                                         (GtkAttachOptions) ( 0 ), 3, 0 );
+                                       gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
+                                       w_patches = label;
                                }
                                {
-                                       GtkWidget* label = gtk_label_new( "Total Entities" );
+                                       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 );
-                                       gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
+                                       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 );
+                                       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 );
+                                       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, 3, 4, 1, 2,
+                                                                         (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
+                                                                         (GtkAttachOptions) ( 0 ), 3, 0 );
+                                       gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
+                                       w_ents_ingame = label;
+                               }
+                               {
+                                       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 );
+                                       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, 2, 3,
+                                                                         (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
+                                                                         (GtkAttachOptions) ( 0 ), 3, 0 );
+                                       gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
+                                       w_groupents = label;
+                               }
+                               {
+                                       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 );
+                                       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, 3, 4, 2, 3,
+                                                                         (GtkAttachOptions) ( GTK_FILL | GTK_EXPAND ),
+                                                                         (GtkAttachOptions) ( 0 ), 3, 0 );
+                                       gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.5 );
+                                       w_groupents_ingame = label;
                                }
+
                        }
                        {
                                GtkVBox* vbox2 = create_dialog_vbox( 4 );
@@ -833,17 +944,17 @@ void DoMapInfo(){
                        }
                }
                {
-                       GtkWidget* label = gtk_label_new( "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, 0.5 );
+                       gtk_misc_set_alignment( GTK_MISC( label ), 0.5, 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 );
 
                        {
-                               GtkListStore* store = gtk_list_store_new( 2, G_TYPE_STRING, G_TYPE_STRING );
+                               GtkListStore* store = 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 );
@@ -879,21 +990,46 @@ void DoMapInfo(){
 
                for ( EntityBreakdown::iterator i = entitymap.begin(); i != entitymap.end(); ++i )
                {
-                       char tmp[16];
-                       sprintf( tmp, "%u", Unsigned( ( *i ).second ) );
                        GtkTreeIter iter;
                        gtk_list_store_append( GTK_LIST_STORE( EntityBreakdownWalker ), &iter );
-                       gtk_list_store_set( GTK_LIST_STORE( EntityBreakdownWalker ), &iter, 0, ( *i ).first.c_str(), 1, tmp, -1 );
+                       gtk_list_store_set( GTK_LIST_STORE( EntityBreakdownWalker ), &iter, 0, ( *i ).first.c_str(), 1, Unsigned( ( *i ).second ), -1 );
                }
        }
 
        g_object_unref( G_OBJECT( EntityBreakdownWalker ) );
 
-       char tmp[16];
-       sprintf( tmp, "%u", Unsigned( g_brushCount.get() ) );
-       gtk_entry_set_text( GTK_ENTRY( brushes_entry ), tmp );
-       sprintf( tmp, "%u", Unsigned( g_entityCount.get() ) );
-       gtk_entry_set_text( GTK_ENTRY( entities_entry ), 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 );
 
@@ -2104,7 +2240,7 @@ void DoFind(){
 }
 
 void Map_constructPreferences( PreferencesPage& page ){
-       page.appendCheckBox( "", "Load last map on open", g_bLoadLastMap );
+       page.appendCheckBox( "", "Load last map at startup", g_bLoadLastMap );
 }
 
 
index 3df7e141068d7516dd4ad09f7357117dd17eb412..5cd5b0386648ffc7c493778cfddf107399b2fad4 100644 (file)
 
 {
        "qfusion",          /* -game x */
-       "baseq3",           /* default base game data dir */
-       ".q3a",             /* unix home sub-dir */
-       "quake",            /* magic path word */
+       "base",             /* default base game data dir */
+       ".qfusion",         /* unix home sub-dir */
+       "qfusion",          /* magic path word */
        "scripts",          /* shader directory */
-       2048,               /* max lightmapped surface verts */
-       2048,               /* max surface verts */
-       12288,              /* max surface indexes */
-       qtrue,              /* flares */
+       65535,              /* max lightmapped surface verts */
+       65535,              /* max surface verts */
+       393210,             /* max surface indexes */
+       qfalse,             /* flares */
        "flareshader",      /* default flare shader */
        qfalse,             /* wolf lighting model? */
        512,                /* lightmap width/height */
        1.0f,               /* lightmap gamma */
-       qfalse,             /* lightmap sRGB */
-       qfalse,             /* texture sRGB */
-       qfalse,             /* color sRGB */
+       qtrue,              /* lightmap sRGB */
+       qtrue,              /* texture sRGB */
+       qtrue,              /* color sRGB */
        0.0f,               /* lightmap exposure */
        1.0f,               /* lightmap compensate */
        1.0f,               /* lightgrid scale */
        qtrue,              /* light angle attenuation uses half-lambert curve */
        qtrue,              /* disable shader lightstyles hack */
        qtrue,              /* keep light entities on bsp */
-       8,                  /* default patchMeta subdivisions tolerance */
+       4,                  /* default patchMeta subdivisions tolerance */
        qtrue,              /* patch casting enabled */
        qtrue,              /* compile deluxemaps */
        0,                  /* deluxemaps default mode */
-       256,                /* minimap size */
+       512,                /* minimap size */
        1.0f,               /* minimap sharpener */
-       0.0f,               /* minimap border */
+       1.0f / 66.0f,       /* minimap border */
        qtrue,              /* minimap keep aspect */
-       MINIMAP_MODE_WHITE, /* minimap mode */
+       MINIMAP_MODE_GRAY,  /* minimap mode */
        "../minimaps/%s.tga", /* minimap name format */
        "FBSP",             /* bsp file prefix */
        1,                  /* bsp file version */
index fe097bef79dfa9374c8009f42a7c29dcac16b150..753e50703f5267b67a09002ff7b6ecbce4a90441 100644 (file)
@@ -3699,6 +3699,9 @@ int main( int argc, char **argv ){
        int i, r;
        double start, end;
 
+#ifdef WIN32
+       _setmaxstdio(2048);
+#endif
 
        /* we want consistent 'randomness' */
        srand( 0 );