Merge pull request #613 from jdolan/master

Mixed bag of fixes
This commit is contained in:
Jay Dolan 2018-03-19 07:56:53 -04:00 committed by GitHub
commit 2d91146b80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 80 additions and 34 deletions

View file

@ -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)"

View file

@ -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;

View file

@ -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
@ -300,6 +309,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(){
@ -353,10 +366,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 );
@ -451,12 +464,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(){
@ -474,6 +487,9 @@ void BuildDialog(){
*/
void SetTexMods(){
texdef_t *pt;
GtkSpinButton *spin;
GtkAdjustment *adjust;
texturewin = Texturewin();
l_pIncrement = Get_SI_Inc();
@ -486,23 +502,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[0] );
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;
}
@ -1118,7 +1159,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 ) ) ;
@ -1138,7 +1179,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 ) ) ;
@ -1158,7 +1199,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 ) ) ;

View file

@ -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 );