From 10c8947901d8cffcf1ab1bb7b0ed33a0d8b44e9a Mon Sep 17 00:00:00 2001 From: Jay Dolan Date: Fri, 16 Mar 2018 13:34:14 -0400 Subject: [PATCH 01/10] Nudge Apple Makefile version to 1.6.6. --- apple/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apple/Makefile b/apple/Makefile index 7660c174..eeb6dfc3 100644 --- a/apple/Makefile +++ b/apple/Makefile @@ -8,7 +8,7 @@ BINDIR = $(RESOURCES)/install CONFDIR = $(RESOURCES)/etc DATADIR = $(RESOURCES)/share LIBDIR = $(RESOURCES)/lib -VERSION = 1.6.5 +VERSION = 1.6.6 DMG = $(TARGET)/GtkRadiant-$(VERSION).dmg VOLUME_NAME = "GtkRadiant $(VERSION)" From f1e2b7862bb48ca4bdbbf542c901ffcde9179bbd Mon Sep 17 00:00:00 2001 From: Jay Dolan Date: Fri, 16 Mar 2018 13:34:47 -0400 Subject: [PATCH 02/10] #TTimo/GtkRadiant/issues/608 Populate the texture name if only one texture is used in faces list. --- plugins/surface_idtech2/surfacedialog.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/surface_idtech2/surfacedialog.cpp b/plugins/surface_idtech2/surfacedialog.cpp index cf7c2de1..8c3f53b6 100644 --- a/plugins/surface_idtech2/surfacedialog.cpp +++ b/plugins/surface_idtech2/surfacedialog.cpp @@ -300,6 +300,10 @@ static void PopulateTextureComboList(){ } g_list_free( items ); + // If the texture name is not conflicting for the faces list, select the newly added item + if ( !is_TextureName_conflicting ) { + gtk_combo_box_set_active( GTK_COMBO_BOX( texture_combo ), 0); + } } static void GetTexdefInfo_from_Radiant(){ From d7f0d04051b9b96be6660503a0f9240897303e60 Mon Sep 17 00:00:00 2001 From: Jay Dolan Date: Fri, 16 Mar 2018 13:36:51 -0400 Subject: [PATCH 03/10] Fix "Wdith" typeo in preferences dialog. --- radiant/preferences.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/radiant/preferences.cpp b/radiant/preferences.cpp index 73f6bdc4..416f82e3 100644 --- a/radiant/preferences.cpp +++ b/radiant/preferences.cpp @@ -2099,7 +2099,7 @@ void PrefsDlg::BuildDialog(){ gtk_combo_box_text_append_text( GTK_COMBO_BOX_TEXT( combo ), (const char *)lst->data ); } g_list_free( combo_list ); - + check = gtk_check_button_new_with_label( _( "Use Fixed Texture Size" ) ); gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 ); gtk_widget_show( check ); @@ -2109,7 +2109,7 @@ void PrefsDlg::BuildDialog(){ gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, FALSE, 0 ); gtk_widget_show( hbox2 ); - ftw_label = label = gtk_label_new( _( "Fixed Texture Wdith" ) ); + ftw_label = label = gtk_label_new( _( "Fixed Texture Width" ) ); gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, FALSE, 0 ); gtk_misc_set_alignment( GTK_MISC( label ), 0.0, 0.0 ); gtk_widget_show( label ); @@ -2658,7 +2658,7 @@ void PrefsDlg::BuildDialog(){ gtk_widget_show( check ); g_object_set_data( G_OBJECT( dialog ), "check_caulkbrush", check ); AddDialogData( check, &m_bCaulkNewBrushes, DLG_CHECK_BOOL ); - + // Add the page to the notebook page_index = gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel ); assert( page_index == PTAB_BRUSH ); @@ -3042,7 +3042,7 @@ void PrefsDlg::LoadPrefs(){ mLocalPrefs.GetPref( LOADSHADERS_KEY, &m_nLatchedShader, 0 ); m_nShader = m_nLatchedShader; - + mLocalPrefs.GetPref( FIXEDTEXSIZE_KEY, &m_bFixedTextureSize, FALSE ); mLocalPrefs.GetPref( FIXEDTEXSIZEWIDTH_KEY, &m_nFixedTextureSizeWidth, 64 ); mLocalPrefs.GetPref( FIXEDTEXSIZEHEIGHT_KEY, &m_nFixedTextureSizeHeight, 64 ); From 2daf5a71ebb5162ab1bb0883c41ce6395d003b96 Mon Sep 17 00:00:00 2001 From: Jay Dolan Date: Fri, 16 Mar 2018 14:26:08 -0400 Subject: [PATCH 04/10] Fix debug copy-pasta. --- plugins/surface_idtech2/surfacedialog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/surface_idtech2/surfacedialog.cpp b/plugins/surface_idtech2/surfacedialog.cpp index 8c3f53b6..987a6fe4 100644 --- a/plugins/surface_idtech2/surfacedialog.cpp +++ b/plugins/surface_idtech2/surfacedialog.cpp @@ -1122,7 +1122,7 @@ static void on_hscale_step_spinbutton_value_changed( GtkSpinButton *spinbutton, l_pIncrement = Get_SI_Inc(); #ifdef DBG_SI - Sys_Printf( "OnIncrementChanged HShift\n" ); + Sys_Printf( "OnIncrementChanged HScale\n" ); #endif val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( hscale_step_spinbutton ) ) ; @@ -1142,7 +1142,7 @@ static void on_vscale_step_spinbutton_value_changed( GtkSpinButton *spinbutton, l_pIncrement = Get_SI_Inc(); #ifdef DBG_SI - Sys_Printf( "OnIncrementChanged HShift\n" ); + Sys_Printf( "OnIncrementChanged VScale\n" ); #endif val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( vscale_step_spinbutton ) ) ; @@ -1162,7 +1162,7 @@ static void on_rotate_step_spinbutton_value_changed( GtkSpinButton *spinbutton, l_pIncrement = Get_SI_Inc(); #ifdef DBG_SI - Sys_Printf( "OnIncrementChanged HShift\n" ); + Sys_Printf( "OnIncrementChanged Rotate\n" ); #endif val = gtk_spin_button_get_value( GTK_SPIN_BUTTON( rotate_step_spinbutton ) ) ; From a2082a31bcbac6a59030dcf7b605582c7bcb905d Mon Sep 17 00:00:00 2001 From: Jay Dolan Date: Fri, 16 Mar 2018 14:26:37 -0400 Subject: [PATCH 05/10] Provide better defaults for increments. --- plugins/surface_idtech2/surfacedialog.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/surface_idtech2/surfacedialog.cpp b/plugins/surface_idtech2/surfacedialog.cpp index 987a6fe4..c85e1bc6 100644 --- a/plugins/surface_idtech2/surfacedialog.cpp +++ b/plugins/surface_idtech2/surfacedialog.cpp @@ -455,12 +455,12 @@ void HideDlg(){ // set default values for increments (shift scale and rot) // this is called by the prefs code if can't find the values void InitDefaultIncrement( texdef_t *tex ){ - tex->SetName( "foo" ); + tex->SetName( "" ); tex->shift[0] = 8; tex->shift[1] = 8; - tex->scale[0] = 0.25; - tex->scale[1] = 0.25; - tex->rotate = 10; + tex->scale[0] = 0.125; + tex->scale[1] = 0.125; + tex->rotate = 5; } void BuildDialog(){ From 90967079d7e928e90dbaec5f8463aa774d1664ad Mon Sep 17 00:00:00 2001 From: Jay Dolan Date: Fri, 16 Mar 2018 14:57:32 -0400 Subject: [PATCH 06/10] Fix copypasta bug in idtech2 surface in spector scale increments --- plugins/surface_idtech2/surfacedialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/surface_idtech2/surfacedialog.cpp b/plugins/surface_idtech2/surfacedialog.cpp index c85e1bc6..4bf89eaf 100644 --- a/plugins/surface_idtech2/surfacedialog.cpp +++ b/plugins/surface_idtech2/surfacedialog.cpp @@ -499,7 +499,7 @@ void SetTexMods(){ gtk_spin_button_set_increments( GTK_SPIN_BUTTON( hshift_value_spinbutton ), l_pIncrement->shift[0], l_pIncrement->shift[0] ); gtk_spin_button_set_increments( GTK_SPIN_BUTTON( vshift_value_spinbutton ), l_pIncrement->shift[1], l_pIncrement->shift[1] ); gtk_spin_button_set_increments( GTK_SPIN_BUTTON( hscale_value_spinbutton ), l_pIncrement->scale[0], l_pIncrement->scale[0] ); - gtk_spin_button_set_increments( GTK_SPIN_BUTTON( vscale_value_spinbutton ), l_pIncrement->scale[1], l_pIncrement->scale[0] ); + gtk_spin_button_set_increments( GTK_SPIN_BUTTON( vscale_value_spinbutton ), l_pIncrement->scale[1], l_pIncrement->scale[1] ); gtk_spin_button_set_increments( GTK_SPIN_BUTTON( rotate_value_spinbutton ), l_pIncrement->rotate, l_pIncrement->rotate ); gtk_spin_button_set_value( GTK_SPIN_BUTTON( hshift_step_spinbutton ), l_pIncrement->shift[0] ); From 36bd918baf2746491b516f73a30d2e336521e7f1 Mon Sep 17 00:00:00 2001 From: Jay Dolan Date: Fri, 16 Mar 2018 15:11:22 -0400 Subject: [PATCH 07/10] Copy the Q3 surface inspector's increments setup, and improve it to set increments on the step spinners. --- plugins/surface_idtech2/surfacedialog.cpp | 48 ++++++++++++++++++----- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/plugins/surface_idtech2/surfacedialog.cpp b/plugins/surface_idtech2/surfacedialog.cpp index 4bf89eaf..3ffe3a6c 100644 --- a/plugins/surface_idtech2/surfacedialog.cpp +++ b/plugins/surface_idtech2/surfacedialog.cpp @@ -478,6 +478,9 @@ void BuildDialog(){ */ void SetTexMods(){ + texdef_t *pt; + GtkSpinButton *spin; + GtkAdjustment *adjust; texturewin = Texturewin(); l_pIncrement = Get_SI_Inc(); @@ -490,23 +493,48 @@ void SetTexMods(){ return; } + pt = &texturewin->texdef; + g_bListenChanged = FALSE; if ( strncmp( texturewin->texdef.GetName(), "textures/", 9 ) != 0 ) { texdef_SI_values.SetName( SHADER_NOT_FOUND ); } - gtk_spin_button_set_increments( GTK_SPIN_BUTTON( hshift_value_spinbutton ), l_pIncrement->shift[0], l_pIncrement->shift[0] ); - gtk_spin_button_set_increments( GTK_SPIN_BUTTON( vshift_value_spinbutton ), l_pIncrement->shift[1], l_pIncrement->shift[1] ); - gtk_spin_button_set_increments( GTK_SPIN_BUTTON( hscale_value_spinbutton ), l_pIncrement->scale[0], l_pIncrement->scale[0] ); - gtk_spin_button_set_increments( GTK_SPIN_BUTTON( vscale_value_spinbutton ), l_pIncrement->scale[1], l_pIncrement->scale[1] ); - gtk_spin_button_set_increments( GTK_SPIN_BUTTON( rotate_value_spinbutton ), l_pIncrement->rotate, l_pIncrement->rotate ); + spin = GTK_SPIN_BUTTON( hshift_value_spinbutton ); + adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); + gtk_adjustment_set_step_increment( adjust, l_pIncrement->shift[0] ); + spin = GTK_SPIN_BUTTON( hshift_step_spinbutton ); + gtk_spin_button_set_value( spin, l_pIncrement->shift[0] ); + gtk_spin_button_set_increments( spin, l_pIncrement->shift[0], l_pIncrement->shift[0] ); - gtk_spin_button_set_value( GTK_SPIN_BUTTON( hshift_step_spinbutton ), l_pIncrement->shift[0] ); - gtk_spin_button_set_value( GTK_SPIN_BUTTON( vshift_step_spinbutton ), l_pIncrement->shift[1] ); - gtk_spin_button_set_value( GTK_SPIN_BUTTON( hscale_step_spinbutton ), l_pIncrement->scale[0] ); - gtk_spin_button_set_value( GTK_SPIN_BUTTON( vscale_step_spinbutton ), l_pIncrement->scale[1] ); - gtk_spin_button_set_value( GTK_SPIN_BUTTON( rotate_step_spinbutton ), l_pIncrement->rotate ); + spin = GTK_SPIN_BUTTON( vshift_value_spinbutton ); + adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); + gtk_adjustment_set_step_increment( adjust, l_pIncrement->shift[1] ); + spin = GTK_SPIN_BUTTON( vshift_step_spinbutton ); + gtk_spin_button_set_value( spin, l_pIncrement->shift[1] ); + gtk_spin_button_set_increments( spin, l_pIncrement->shift[1], l_pIncrement->shift[1] ); + + spin = GTK_SPIN_BUTTON( hscale_value_spinbutton ); + adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); + gtk_adjustment_set_step_increment( adjust, l_pIncrement->scale[0] ); + spin = GTK_SPIN_BUTTON( hscale_step_spinbutton ); + gtk_spin_button_set_value( spin, l_pIncrement->scale[0] ); + gtk_spin_button_set_increments( spin, l_pIncrement->scale[0], l_pIncrement->scale[0] ); + + spin = GTK_SPIN_BUTTON( vscale_value_spinbutton ); + adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); + gtk_adjustment_set_step_increment( adjust, l_pIncrement->scale[1] ); + spin = GTK_SPIN_BUTTON( vscale_step_spinbutton ); + gtk_spin_button_set_value( spin, l_pIncrement->scale[1] ); + gtk_spin_button_set_increments( spin, l_pIncrement->scale[1], l_pIncrement->scale[1] ); + + spin = GTK_SPIN_BUTTON( rotate_value_spinbutton ); + adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); + gtk_adjustment_set_step_increment( adjust, l_pIncrement->rotate ); + spin = GTK_SPIN_BUTTON( rotate_step_spinbutton ); + gtk_spin_button_set_value( spin, l_pIncrement->rotate ); + gtk_spin_button_set_increments( spin, l_pIncrement->rotate, l_pIncrement->rotate ); g_bListenChanged = TRUE; } From 3b8e83fb804f5c2d0635f8e220a63e2a8949aee6 Mon Sep 17 00:00:00 2001 From: Jay Dolan Date: Fri, 16 Mar 2018 15:12:03 -0400 Subject: [PATCH 08/10] Set increments on the surface inspector step spinners. This makes these far more useful. --- plugins/surface/surfacedialog.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/plugins/surface/surfacedialog.cpp b/plugins/surface/surfacedialog.cpp index 7c839e27..0bbb44bb 100644 --- a/plugins/surface/surfacedialog.cpp +++ b/plugins/surface/surfacedialog.cpp @@ -566,32 +566,37 @@ void SetTexMods(){ spin = GTK_SPIN_BUTTON( hshift_value_spinbutton ); adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); gtk_adjustment_set_step_increment( adjust, l_pIncrement->shift[0] ); - spin = GTK_SPIN_BUTTON( hshift_step_spinbutton ); - gtk_spin_button_set_value( spin, l_pIncrement->shift[0] ); + spin = GTK_SPIN_BUTTON( hshift_step_spinbutton ); + gtk_spin_button_set_value( spin, l_pIncrement->shift[0] ); + gtk_spin_button_set_increments( spin, l_pIncrement->shift[0], l_pIncrement->shift[0] ); spin = GTK_SPIN_BUTTON( vshift_value_spinbutton ); adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); gtk_adjustment_set_step_increment( adjust, l_pIncrement->shift[1] ); - spin = GTK_SPIN_BUTTON( vshift_step_spinbutton ); - gtk_spin_button_set_value( spin, l_pIncrement->shift[1] ); + spin = GTK_SPIN_BUTTON( vshift_step_spinbutton ); + gtk_spin_button_set_value( spin, l_pIncrement->shift[1] ); + gtk_spin_button_set_increments( spin, l_pIncrement->shift[1], l_pIncrement->shift[1] ); spin = GTK_SPIN_BUTTON( hscale_value_spinbutton ); adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); gtk_adjustment_set_step_increment( adjust, l_pIncrement->scale[0] ); - spin = GTK_SPIN_BUTTON( hscale_step_spinbutton ); - gtk_spin_button_set_value( spin, l_pIncrement->scale[0] ); + spin = GTK_SPIN_BUTTON( hscale_step_spinbutton ); + gtk_spin_button_set_value( spin, l_pIncrement->scale[0] ); + gtk_spin_button_set_increments( spin, l_pIncrement->scale[0], l_pIncrement->scale[0] ); spin = GTK_SPIN_BUTTON( vscale_value_spinbutton ); adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); gtk_adjustment_set_step_increment( adjust, l_pIncrement->scale[1] ); - spin = GTK_SPIN_BUTTON( vscale_step_spinbutton ); - gtk_spin_button_set_value( spin, l_pIncrement->scale[1] ); + spin = GTK_SPIN_BUTTON( vscale_step_spinbutton ); + gtk_spin_button_set_value( spin, l_pIncrement->scale[1] ); + gtk_spin_button_set_increments( spin, l_pIncrement->scale[1], l_pIncrement->scale[1] ); spin = GTK_SPIN_BUTTON( rotate_value_spinbutton ); adjust = gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ); gtk_adjustment_set_step_increment( adjust, l_pIncrement->rotate ); - spin = GTK_SPIN_BUTTON( rotate_step_spinbutton ); - gtk_spin_button_set_value( spin, l_pIncrement->rotate ); + spin = GTK_SPIN_BUTTON( rotate_step_spinbutton ); + gtk_spin_button_set_value( spin, l_pIncrement->rotate ); + gtk_spin_button_set_increments( spin, l_pIncrement->rotate, l_pIncrement->rotate ); g_bListenChanged = true; From 54f4d2b1f5490c6f6c241b1a38f2a903e13b5579 Mon Sep 17 00:00:00 2001 From: Jay Dolan Date: Fri, 16 Mar 2018 15:12:30 -0400 Subject: [PATCH 09/10] Use the configured texture scale as default for SnapToGrid. --- plugins/surface_idtech2/surfacedialog.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/surface_idtech2/surfacedialog.cpp b/plugins/surface_idtech2/surfacedialog.cpp index 3ffe3a6c..f4fe12f8 100644 --- a/plugins/surface_idtech2/surfacedialog.cpp +++ b/plugins/surface_idtech2/surfacedialog.cpp @@ -357,10 +357,10 @@ void DoSnapTToGrid( float hscale, float vscale ){ l_pIncrement = Get_SI_Inc(); if ( hscale == 0.0f ) { - hscale = 0.25f; + hscale = l_pIncrement->scale[0]; } if ( vscale == 0.0f ) { - vscale = 0.25f; + vscale = l_pIncrement->scale[1]; } #ifdef _DEBUG Sys_Printf( "DoSnapToGrid: grid %g hscale %g vscale %g\n", GridSize(), hscale, vscale ); From 0f6034a0afeb3258ad0ddb18823474119d9c59f9 Mon Sep 17 00:00:00 2001 From: Jay Dolan Date: Sun, 18 Mar 2018 15:11:17 -0400 Subject: [PATCH 10/10] Hurr empty the texture dropdown like the Q3 surface inspector does. --- plugins/surface_idtech2/surfacedialog.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/surface_idtech2/surfacedialog.cpp b/plugins/surface_idtech2/surfacedialog.cpp index f4fe12f8..2f4aabd4 100644 --- a/plugins/surface_idtech2/surfacedialog.cpp +++ b/plugins/surface_idtech2/surfacedialog.cpp @@ -261,6 +261,15 @@ static void PopulateTextureComboList(){ blank[0] = 0; + //clear combo box +#if GTK_CHECK_VERSION( 3, 0, 0 ) + gtk_combo_box_text_remove_all( GTK_COMBO_BOX_TEXT( texture_combo ) ); +#else + GtkListStore *store; + store = GTK_LIST_STORE( gtk_combo_box_get_model( GTK_COMBO_BOX( texture_combo ) ) ); + gtk_list_store_clear( store ); +#endif + if ( texdef_face_list_empty() ) { items = g_list_append( items, (gpointer) blank ); // For Texture Entry, activate only on entry change