Merge pull request #309 from Pan7/gtk3

Fix for a crash
This commit is contained in:
Timothee "TTimo" Besset 2015-10-03 11:49:12 -05:00
commit 8a00dd8067
12 changed files with 441 additions and 285 deletions

View File

@ -627,17 +627,13 @@ GtkWidget* create_SurfaceInspector( void ){
GtkWidget *label;
GtkWidget *viewport9;
GtkWidget *viewport2;
GtkWidget *viewport4;
GtkWidget *viewport7;
GtkWidget *viewport5;
GtkWidget *viewport;
GtkWidget *table1;
GtkWidget *table4;
GtkWidget *table5;
GtkWidget *vbox7;
GtkWidget *content_area;
GtkWidget *hbox1, *hbox2;
@ -649,20 +645,22 @@ GtkWidget* create_SurfaceInspector( void ){
SetWinPos_from_Prefs( SurfaceInspector );
vbox7 = gtk_box_new( GTK_ORIENTATION_VERTICAL, 0 );
gtk_container_add( GTK_CONTAINER( SurfaceInspector ), vbox7 );
gtk_widget_show( vbox7 );
content_area = gtk_box_new( GTK_ORIENTATION_VERTICAL, 0 );
gtk_container_add( GTK_CONTAINER( SurfaceInspector ), content_area );
gtk_widget_show( content_area );
viewport9 = gtk_frame_new( NULL );
gtk_box_pack_start( GTK_BOX( vbox7 ), viewport9, FALSE, FALSE, 0 );
gtk_container_set_border_width( GTK_CONTAINER( viewport9 ), 2 );
gtk_frame_set_shadow_type( GTK_FRAME( viewport9 ), GTK_SHADOW_ETCHED_IN );
gtk_widget_show( viewport9 );
viewport = gtk_frame_new( NULL );
gtk_frame_set_shadow_type( GTK_FRAME( viewport ), GTK_SHADOW_ETCHED_IN );
gtk_box_pack_start( GTK_BOX( content_area ), viewport, FALSE, FALSE, 0 );
gtk_container_set_border_width( GTK_CONTAINER( viewport ), 2 );
gtk_widget_set_hexpand( viewport, TRUE );
gtk_widget_set_vexpand( viewport, FALSE );
gtk_widget_show( viewport );
hbox1 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 0 );
gtk_widget_show( hbox1 );
gtk_container_add( GTK_CONTAINER( viewport9 ), hbox1 );
gtk_container_add( GTK_CONTAINER( viewport ), hbox1 );
gtk_container_set_border_width( GTK_CONTAINER( hbox1 ), 4 );
gtk_widget_show( hbox1 );
label = gtk_label_new( _( "Texture: " ) );
gtk_box_pack_start( GTK_BOX( hbox1 ), label, FALSE, FALSE, 0 );
@ -677,17 +675,19 @@ GtkWidget* create_SurfaceInspector( void ){
gtk_entry_set_max_length( GTK_ENTRY( texture_combo_entry ), 128 );
gtk_widget_show( texture_combo_entry );
viewport2 = gtk_frame_new( NULL );
gtk_box_pack_start( GTK_BOX( vbox7 ), viewport2, TRUE, TRUE, 0 );
gtk_container_set_border_width( GTK_CONTAINER( viewport2 ), 2 );
gtk_frame_set_shadow_type( GTK_FRAME( viewport2 ), GTK_SHADOW_ETCHED_IN );
gtk_widget_show( viewport2 );
viewport = gtk_frame_new( NULL );
gtk_frame_set_shadow_type( GTK_FRAME( viewport ), GTK_SHADOW_ETCHED_IN );
gtk_box_pack_start( GTK_BOX( content_area ), viewport, FALSE, TRUE, 0 );
gtk_container_set_border_width( GTK_CONTAINER( viewport ), 2 );
gtk_widget_set_hexpand( viewport, TRUE );
gtk_widget_set_vexpand( viewport, TRUE );
gtk_widget_show( viewport );
table1 = gtk_grid_new();
gtk_widget_set_hexpand( table1, TRUE );
gtk_widget_set_vexpand( table1, TRUE );
gtk_grid_set_column_spacing( GTK_GRID( table1 ), 5 );
gtk_container_add( GTK_CONTAINER( viewport2 ), table1 );
gtk_container_add( GTK_CONTAINER( viewport ), table1 );
gtk_container_set_border_width( GTK_CONTAINER( table1 ), 5 );
gtk_widget_show( table1 );
@ -824,58 +824,66 @@ GtkWidget* create_SurfaceInspector( void ){
g_object_set( rotate_step_spinbutton, "xalign", 1.0, NULL );
viewport7 = gtk_frame_new( NULL );
gtk_box_pack_start( GTK_BOX( vbox7 ), viewport7, TRUE, TRUE, 0 );
gtk_container_set_border_width( GTK_CONTAINER( viewport7 ), 2 );
gtk_frame_set_shadow_type( GTK_FRAME( viewport7 ), GTK_SHADOW_ETCHED_IN );
gtk_widget_show( viewport7 );
viewport = gtk_frame_new( NULL );
gtk_frame_set_shadow_type( GTK_FRAME( viewport ), GTK_SHADOW_ETCHED_IN );
gtk_box_pack_start( GTK_BOX( content_area ), viewport, FALSE, TRUE, 0 );
gtk_container_set_border_width( GTK_CONTAINER( viewport ), 2 );
gtk_widget_set_hexpand( viewport, TRUE );
gtk_widget_set_vexpand( viewport, FALSE );
gtk_widget_show( viewport );
hbox2 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 0 );
gtk_container_add( GTK_CONTAINER( viewport7 ), hbox2 );
gtk_container_add( GTK_CONTAINER( viewport ), hbox2 );
gtk_container_set_border_width( GTK_CONTAINER( hbox2 ), 4 );
gtk_widget_set_hexpand( hbox2, FALSE );
gtk_widget_set_vexpand( hbox2, FALSE );
gtk_widget_show( hbox2 );
viewport4 = gtk_frame_new( NULL ); //only need this for layout
gtk_container_add( GTK_CONTAINER( hbox2 ), viewport4 );
gtk_container_set_border_width( GTK_CONTAINER( viewport4 ), 6 );
gtk_frame_set_shadow_type( GTK_FRAME( viewport4 ), GTK_SHADOW_NONE );
gtk_widget_show( viewport4 );
viewport = gtk_frame_new( NULL ); //only need this for layout
gtk_frame_set_shadow_type( GTK_FRAME( viewport ), GTK_SHADOW_NONE );
gtk_container_add( GTK_CONTAINER( hbox2 ), viewport );
gtk_container_set_border_width( GTK_CONTAINER( viewport ), 6 );
gtk_widget_set_hexpand( viewport, FALSE );
gtk_widget_set_vexpand( viewport, FALSE );
gtk_widget_show( viewport );
table4 = gtk_grid_new(); //only need this for layout
gtk_container_add( GTK_CONTAINER( viewport4 ), table4 );
gtk_container_add( GTK_CONTAINER( viewport ), table4 );
gtk_container_set_border_width( GTK_CONTAINER( table4 ), 5 );
gtk_grid_set_column_spacing( GTK_GRID( table4 ), 2 );
gtk_widget_show( table4 );
label = gtk_label_new( "" ); //only need this for layout
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_grid_attach( GTK_GRID( table4 ), label, 0, 0, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
axial_button = gtk_button_new_with_mnemonic( _( "Axial" ) );
gtk_grid_attach( GTK_GRID( table4 ), axial_button, 0, 1, 1, 1 );
gtk_widget_show( axial_button );
viewport5 = gtk_frame_new( NULL );
gtk_box_pack_start( GTK_BOX( hbox2 ), viewport5, FALSE, FALSE, 0 );
gtk_container_set_border_width( GTK_CONTAINER( viewport5 ), 6 );
gtk_frame_set_shadow_type( GTK_FRAME( viewport5 ), GTK_SHADOW_ETCHED_OUT );
gtk_widget_show( viewport5 );
viewport = gtk_frame_new( NULL );
gtk_frame_set_shadow_type( GTK_FRAME( viewport ), GTK_SHADOW_ETCHED_OUT );
gtk_box_pack_start( GTK_BOX( hbox2 ), viewport, FALSE, FALSE, 0 );
gtk_container_set_border_width( GTK_CONTAINER( viewport ), 6 );
gtk_widget_set_hexpand( viewport, FALSE );
gtk_widget_set_vexpand( viewport, FALSE );
gtk_widget_show( viewport );
table5 = gtk_grid_new();
gtk_container_add( GTK_CONTAINER( viewport5 ), table5 );
gtk_container_add( GTK_CONTAINER( viewport ), table5 );
gtk_container_set_border_width( GTK_CONTAINER( table5 ), 5 );
gtk_grid_set_column_spacing( GTK_GRID( table5 ), 2 );
gtk_widget_show( table5 );
label = gtk_label_new( _( "Height" ) );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_grid_attach( GTK_GRID( table5 ), label, 1, 0, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( _( "Width" ) );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_grid_attach( GTK_GRID( table5 ), label, 2, 0, 1, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
fit_button = gtk_button_new_with_mnemonic( _( "Fit" ) );

View File

@ -543,16 +543,16 @@ GtkWidget* create_SurfaceInspector( void ){
GtkWidget *label;
GtkAdjustment *adjustment;
GtkSizeGroup *size_group;
GtkWidget *table1;
GtkWidget *table2;
GtkWidget *frame1;
GtkWidget *frame2;
GtkWidget *vbox1;
GtkWidget *hbox1;
SurfaceInspector = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_container_set_border_width( GTK_CONTAINER( SurfaceInspector ), 4 );
gtk_window_set_title( GTK_WINDOW( SurfaceInspector ), "Surface Inspector" );
@ -560,234 +560,262 @@ GtkWidget* create_SurfaceInspector( void ){
SetWinPos_from_Prefs( SurfaceInspector );
vbox1 = gtk_box_new( GTK_ORIENTATION_VERTICAL, 5 );
gtk_widget_show( vbox1 );
gtk_container_add( GTK_CONTAINER( SurfaceInspector ), vbox1 );
gtk_widget_show( vbox1 );
hbox1 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 5 );
gtk_widget_show( hbox1 );
gtk_container_add( GTK_CONTAINER( vbox1 ), hbox1 );
gtk_container_set_border_width( GTK_CONTAINER( hbox1 ), 4 );
gtk_widget_show( hbox1 );
label = gtk_label_new( "Texture: " );
gtk_widget_show( label );
gtk_box_pack_start( GTK_BOX( hbox1 ), label, FALSE, FALSE, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 1, 0.5 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
texture_combo = gtk_combo_box_text_new();
//gtk_combo_disable_activate( GTK_COMBO_BOX( GTK_COMBO_BOX_TEXT( texture_combo ) );
gtk_box_pack_start( GTK_BOX( hbox1 ), texture_combo, TRUE, TRUE, 0 );
gtk_widget_show( texture_combo );
g_object_set_data( G_OBJECT( gtk_combo_box_get_popup_accessible( GTK_COMBO_BOX( GTK_COMBO_BOX_TEXT(texture_combo ) ) ) ),
"KeepMeAround", texture_combo );
//gtk_combo_disable_activate( GTK_COMBO_BOX( GTK_COMBO_BOX_TEXT( texture_combo ) );
gtk_widget_show( texture_combo );
gtk_box_pack_start( GTK_BOX( hbox1 ), texture_combo, TRUE, TRUE, 0 );
texture_combo_entry = gtk_bin_get_child( GTK_BIN( texture_combo ) );
gtk_widget_show( texture_combo_entry );
gtk_entry_set_max_length( GTK_ENTRY( texture_combo_entry ), 1024 );
gtk_widget_show( texture_combo_entry );
frame1 = gtk_frame_new( "Surface" );
gtk_widget_show( frame1 );
gtk_container_add( GTK_CONTAINER( vbox1 ), frame1 );
gtk_widget_show( frame1 );
table1 = gtk_table_new( 7, 3, FALSE );
gtk_widget_show( table1 );
gtk_table_set_col_spacings( GTK_TABLE( table1 ), 5 );
gtk_table_set_row_spacings( GTK_TABLE( table1 ), 5 );
gtk_container_set_border_width( GTK_CONTAINER( table1 ), 5 );
gtk_container_add( GTK_CONTAINER( frame1 ), table1 );
gtk_widget_show( table1 );
label = gtk_label_new( "Step" );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table1 ), label, 2, 3, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( "Value" );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table1 ), label, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_misc_set_alignment( GTK_MISC( label ), 0.5, 1 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( "Horizontal shift: " );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table1 ), label, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( "Vertical shift: " );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table1 ), label, 0, 1, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( "Horizontal scale: " );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table1 ), label, 0, 1, 3, 4,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( "Vertical scale: " );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table1 ), label, 0, 1, 4, 5,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( "Rotate: " );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table1 ), label, 0, 1, 5, 6,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( GTK_FILL ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
// Value Spins
adjustment = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 );
hshift_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 2 );
gtk_widget_show( hshift_value_spinbutton );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hshift_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( hshift_value_spinbutton ), TRUE );
gtk_table_attach( GTK_TABLE( table1 ), hshift_value_spinbutton, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hshift_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( hshift_value_spinbutton ), TRUE );
gtk_widget_show( hshift_value_spinbutton );
g_object_set( hshift_value_spinbutton, "xalign", 1.0, NULL );
adjustment = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 );
vshift_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 2 );
gtk_widget_show( vshift_value_spinbutton );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vshift_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( vshift_value_spinbutton ), TRUE );
gtk_table_attach( GTK_TABLE( table1 ), vshift_value_spinbutton, 1, 2, 2, 3,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vshift_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( vshift_value_spinbutton ), TRUE );
gtk_widget_show( vshift_value_spinbutton );
g_object_set( vshift_value_spinbutton, "xalign", 1.0, NULL );
adjustment = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 );
hscale_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 4 );
gtk_widget_show( hscale_value_spinbutton );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hscale_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( hscale_value_spinbutton ), TRUE );
gtk_table_attach( GTK_TABLE( table1 ), hscale_value_spinbutton, 1, 2, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hscale_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( hscale_value_spinbutton ), TRUE );
gtk_widget_show( hscale_value_spinbutton );
g_object_set( hscale_value_spinbutton, "xalign", 1.0, NULL );
adjustment = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 );
vscale_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 4 );
gtk_widget_show( vscale_value_spinbutton );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vscale_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_table_attach( GTK_TABLE( table1 ), vscale_value_spinbutton, 1, 2, 4, 5,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vscale_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_widget_show( vscale_value_spinbutton );
g_object_set( vscale_value_spinbutton, "xalign", 1.0, NULL );
adjustment = gtk_adjustment_new( 0.0, -360.0, 360.0, 1.0, 10.0, 0.0 );
rotate_value_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 2 );
gtk_widget_show( rotate_value_spinbutton );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( rotate_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( rotate_value_spinbutton ), TRUE );
gtk_table_attach( GTK_TABLE( table1 ), rotate_value_spinbutton, 1, 2, 5, 6,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( rotate_value_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( rotate_value_spinbutton ), TRUE );
gtk_widget_show( rotate_value_spinbutton );
g_object_set( rotate_value_spinbutton, "xalign", 1.0, NULL );
// Step Spins
adjustment = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 );
hshift_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 2 );
gtk_widget_show( hshift_step_spinbutton );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hshift_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_table_attach( GTK_TABLE( table1 ), hshift_step_spinbutton, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hshift_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_widget_show( hshift_step_spinbutton );
g_object_set( hshift_step_spinbutton, "xalign", 1.0, NULL );
adjustment = gtk_adjustment_new( 0.0, -8192.0, 8192.0, 2.0, 8.0, 0.0 );
vshift_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 2 );
gtk_widget_show( vshift_step_spinbutton );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vshift_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_table_attach( GTK_TABLE( table1 ), vshift_step_spinbutton, 2, 3, 2, 3,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vshift_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_widget_show( vshift_step_spinbutton );
g_object_set( vshift_step_spinbutton, "xalign", 1.0, NULL );
adjustment = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 );
hscale_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 4 );
gtk_widget_show( hscale_step_spinbutton );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hscale_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_table_attach( GTK_TABLE( table1 ), hscale_step_spinbutton, 2, 3, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( hscale_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_widget_show( hscale_step_spinbutton );
g_object_set( hscale_step_spinbutton, "xalign", 1.0, NULL );
adjustment = gtk_adjustment_new( 0.0, -1024.0, 1024.0, 1.0, 4.0, 0.0 );
vscale_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 4 );
gtk_widget_show( vscale_step_spinbutton );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vscale_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_table_attach( GTK_TABLE( table1 ), vscale_step_spinbutton, 2, 3, 4, 5,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( vscale_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_widget_show( vscale_step_spinbutton );
g_object_set( vscale_step_spinbutton, "xalign", 1.0, NULL );
adjustment = gtk_adjustment_new( 0.0, -360.0, 360.0, 1.0, 10.0, 0.0 );
rotate_step_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 2 );
gtk_widget_show( rotate_step_spinbutton );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( rotate_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_table_attach( GTK_TABLE( table1 ), rotate_step_spinbutton, 2, 3, 5, 6,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( rotate_step_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_widget_show( rotate_step_spinbutton );
g_object_set( rotate_step_spinbutton, "xalign", 1.0, NULL );
match_grid_button = gtk_button_new_with_mnemonic( "Match Grid" );
gtk_widget_show( match_grid_button );
gtk_table_attach( GTK_TABLE( table1 ), match_grid_button, 2, 3, 6, 7,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( match_grid_button );
frame2 = gtk_frame_new( "Tools" );
gtk_widget_show( frame2 );
gtk_container_add( GTK_CONTAINER( vbox1 ), frame2 );
gtk_widget_show( frame2 );
table2 = gtk_table_new( 2, 4, TRUE );
gtk_widget_show( table2 );
gtk_table_set_col_spacings( GTK_TABLE( table2), 5 );
gtk_table_set_row_spacings( GTK_TABLE( table2 ), 0 );
gtk_container_set_border_width( GTK_CONTAINER( table2 ), 5 );
gtk_container_add( GTK_CONTAINER( frame2 ), table2 );
gtk_widget_show( table2 );
label = gtk_label_new( "Height" );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table2 ), label, 3, 4, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( "Width" );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table2 ), label, 2, 3, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( "Brush" );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table2 ), label, 0, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
adjustment = gtk_adjustment_new( 1, 1, 32, 1, 10, 0 );
fit_height_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 0 );
gtk_widget_show( fit_height_spinbutton );
gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( fit_height_spinbutton ), TRUE );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( fit_height_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_table_attach( GTK_TABLE( table2 ), fit_height_spinbutton, 3, 4, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( fit_height_spinbutton ), TRUE );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( fit_height_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_widget_show( fit_height_spinbutton );
g_object_set( fit_height_spinbutton, "xalign", 1.0, NULL );
adjustment = gtk_adjustment_new( 1, 1, 32, 1, 10, 0 );
fit_width_spinbutton = gtk_spin_button_new( GTK_ADJUSTMENT( adjustment ), 1, 0 );
gtk_widget_show( fit_width_spinbutton );
gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( fit_width_spinbutton ), TRUE );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( fit_width_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_table_attach( GTK_TABLE( table2 ), fit_width_spinbutton, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( fit_width_spinbutton ), TRUE );
gtk_spin_button_set_update_policy( GTK_SPIN_BUTTON( fit_width_spinbutton ), GTK_UPDATE_IF_VALID );
gtk_widget_show( fit_width_spinbutton );
g_object_set( fit_width_spinbutton, "xalign", 1.0, NULL );
fit_button = gtk_button_new_with_mnemonic( "Fit" );
gtk_widget_show( fit_button );
gtk_table_attach( GTK_TABLE( table2 ), fit_button, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( fit_button );
axial_button = gtk_button_new_with_mnemonic( "Axial" );
gtk_widget_show( axial_button );
gtk_table_attach( GTK_TABLE( table2 ), axial_button, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( axial_button );
size_group = gtk_size_group_new( GTK_SIZE_GROUP_BOTH );
gtk_size_group_add_widget( size_group, axial_button );
gtk_size_group_add_widget( size_group, fit_button );
g_object_unref( size_group );
// Add the SURF_ and CONTENTS_ flags frame
create_SurfaceFlagsFrame( vbox1 );

View File

@ -304,28 +304,28 @@ GtkWidget* create_SurfaceFlagsFrame( GtkWidget* surfacedialog_widget ){
char buffer[16];
frame1 = gtk_frame_new( _( "Flags" ) );
gtk_widget_show( frame1 );
gtk_container_add( GTK_CONTAINER( surfacedialog_widget ), frame1 );
gtk_widget_show( frame1 );
vbox1 = gtk_box_new( GTK_ORIENTATION_VERTICAL, 0 );
gtk_widget_show( vbox1 );
gtk_container_add( GTK_CONTAINER( frame1 ), vbox1 );
gtk_widget_show( vbox1 );
notebook1 = gtk_notebook_new();
gtk_widget_show( notebook1 );
gtk_box_pack_start( GTK_BOX( vbox1 ), notebook1, TRUE, TRUE, 0 );
gtk_notebook_set_show_tabs( GTK_NOTEBOOK( notebook1 ), TRUE );
gtk_container_set_border_width( GTK_CONTAINER( notebook1 ), 5 );
gtk_widget_show( notebook1 );
vbox2 = gtk_box_new( GTK_ORIENTATION_VERTICAL, 5 );
gtk_widget_show( vbox2 );
gtk_container_add( GTK_CONTAINER( notebook1 ), vbox2 );
gtk_widget_show( vbox2 );
table4 = gtk_table_new( 8, 4, TRUE );
gtk_widget_show( table4 );
gtk_table_set_col_spacings( GTK_TABLE( table4 ), 5 );
gtk_table_set_row_spacings( GTK_TABLE( table4 ), 5 );
gtk_box_pack_start( GTK_BOX( vbox2 ), table4, TRUE, TRUE, 0 );
gtk_widget_show( table4 );
y = -1;
for ( i = 0; i < MAX_BUTTONS; i++ ) {
@ -345,20 +345,21 @@ GtkWidget* create_SurfaceFlagsFrame( GtkWidget* surfacedialog_widget ){
}
hbox2 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 0 );
gtk_widget_show( hbox2 );
gtk_box_pack_start( GTK_BOX( vbox2 ), hbox2, FALSE, FALSE, 0 );
gtk_widget_show( hbox2 );
hbox3 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 0 );
gtk_widget_show( hbox3 );
gtk_box_pack_start( GTK_BOX( hbox2 ), hbox3, TRUE, TRUE, 0 );
gtk_widget_show( hbox3 );
vbox4 = gtk_box_new( GTK_ORIENTATION_VERTICAL, 0 );
gtk_widget_show( vbox4 );
gtk_box_pack_start( GTK_BOX( hbox3 ), vbox4, TRUE, TRUE, 0 );
gtk_widget_show( vbox4 );
value_label = gtk_label_new( " Value: " );
gtk_widget_show( value_label );
value_label = gtk_label_new( "Value: " );
gtk_box_pack_start( GTK_BOX( hbox3 ), value_label, FALSE, FALSE, 0 );
gtk_widget_set_halign( value_label, GTK_ALIGN_START );
gtk_widget_show( value_label );
value_entry = gtk_entry_new();
g_signal_connect( value_entry, "changed",
@ -368,22 +369,23 @@ GtkWidget* create_SurfaceFlagsFrame( GtkWidget* surfacedialog_widget ){
G_CALLBACK( on_value_entry_insert_text ),
NULL );
gtk_entry_set_max_length( (GtkEntry *)value_entry, 11 );
gtk_widget_show( value_entry );
gtk_box_pack_start( GTK_BOX( hbox3 ), value_entry, TRUE, TRUE, 0 );
gtk_widget_show( value_entry );
g_object_set( value_entry, "xalign", 1.0, NULL );
vbox3 = gtk_box_new( GTK_ORIENTATION_VERTICAL, 0 );
gtk_widget_show( vbox3 );
gtk_box_pack_start( GTK_BOX( hbox3 ), vbox3, TRUE, TRUE, 0 );
gtk_widget_show( vbox3 );
label5 = gtk_label_new( "Surface Flags" );
gtk_widget_show( label5 );
gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ), gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ), 0 ), label5 );
gtk_widget_show( label5 );
table3 = gtk_table_new( 8, 4, TRUE );
gtk_widget_show( table3 );
gtk_table_set_col_spacings( GTK_TABLE( table3 ), 5 );
gtk_table_set_row_spacings( GTK_TABLE( table3 ), 5 );
gtk_container_add( GTK_CONTAINER( notebook1 ), table3 );
gtk_widget_show( table3 );
y = -1;
for ( i = 0; i < MAX_BUTTONS; i++ ) {
@ -395,14 +397,15 @@ GtkWidget* create_SurfaceFlagsFrame( GtkWidget* surfacedialog_widget ){
buttonLabel = g_FuncTable.m_pfnReadProjectKey( buffer );
content_buttons[i] = gtk_toggle_button_new_with_label( buttonLabel );
g_signal_connect( content_buttons[i], "toggled", G_CALLBACK( on_content_button_toggled ), GINT_TO_POINTER( 1 << i ) );
gtk_widget_show( content_buttons[i] );
gtk_table_attach( GTK_TABLE( table3 ), content_buttons[i], 0 + x, 1 + x, ( 0 + y ), ( 1 + y ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ), 0, 0 );
gtk_widget_show( content_buttons[i] );
}
label6 = gtk_label_new( "Content Flags" );
gtk_widget_show( label6 );
gtk_notebook_set_tab_label( GTK_NOTEBOOK( notebook1 ), gtk_notebook_get_nth_page( GTK_NOTEBOOK( notebook1 ), 1 ), label6 );
return frame1;

View File

@ -62,18 +62,21 @@ void CSG_MakeHollowMode( int mode ){
split = *f;
VectorScale( f->plane.normal, g_qeglobals.d_gridsize, move );
for ( i = 0 ; i < 3 ; i++ )
VectorSubtract( split.planepts[i], move, split.planepts[i] );
if( mode == CSG_HOLLOW_MODE_TOUCH ) {
VectorAdd( f->planepts[i], move, f->planepts[i] );
} else {
VectorSubtract( split.planepts[i], move, split.planepts[i] );
}
Brush_SplitBrushByFace( b, &split, &front, &back );
if ( back ) {
Brush_Free( back );
}
if ( front ) {
if( mode == CSG_HOLLOW_MODE_TOUCH ) {
Brush_Move( front, move, true );
}
Brush_AddToList( front, &selected_brushes );
}
if( mode == CSG_HOLLOW_MODE_TOUCH ) {
*f = split;
}
}
Brush_Free( b );
}

View File

@ -2912,11 +2912,11 @@ int DoTextureLayout( float *fx, float *fy ){
gtk_widget_show( label );
x = gtk_entry_new();
gtk_grid_attach( GTK_GRID( table ), label, 1, 0, 1, 1 );
gtk_grid_attach( GTK_GRID( table ), x, 1, 0, 1, 1 );
gtk_widget_show( x );
y = gtk_entry_new();
gtk_grid_attach( GTK_GRID( table ), label, 1, 1, 1, 1 );
gtk_grid_attach( GTK_GRID( table ), y, 1, 1, 1, 1 );
gtk_widget_show( y );

View File

@ -981,14 +981,14 @@ void QE_ExpandBspString( char *bspaction, GPtrArray *out_array, char *mapname ){
// initialise the first step
out = new char[BIG_PATH_MAX];
*out = 0;
g_ptr_array_add( out_array, out );
in = ValueForKey( g_qeglobals.d_project_entity, bspaction );
while ( *in )
{
if ( in[0] == '!' ) {
Q_strncpyz( out, rsh, sizeof( out ) );
out += strlen( rsh );
strncat( out, rsh, BIG_PATH_MAX );
in++;
continue;
}
@ -998,36 +998,39 @@ void QE_ExpandBspString( char *bspaction, GPtrArray *out_array, char *mapname ){
if ( g_PrefsDlg.m_bWatchBSP ) {
// -connect global option (the only global option so far anyway)
strcpy( tmp, " -connect 127.0.0.1:39000 " );
Q_strncpyz( out, tmp, sizeof( out ) );
out += strlen( tmp );
strncat( out, tmp, BIG_PATH_MAX );
}
in++;
continue;
}
if ( in[0] == '$' ) {
// $ expansion
Q_strncpyz( out, src, sizeof( out ) );
out += strlen( src );
strncat( out, src, BIG_PATH_MAX );
in++;
continue;
}
if ( in[0] == '@' ) {
*out++ = '"';
strncat( out, "\"", BIG_PATH_MAX );
in++;
continue;
}
if ( in[0] == '&' ) {
if ( in[1] == '&' ) {
// start a new step
*out = 0;
in = in + 2;
out = new char[BIG_PATH_MAX];
*out = 0;
g_ptr_array_add( out_array, out );
}
}
*out++ = *in++;
size_t len = strlen( out );
if( ( len + 1 ) < BIG_PATH_MAX )
{
out[len++] = *in;
out[len] = '\0';
}
in++;
}
*out = 0;
}
void FindReplace( CString& strContents, const char* pTag, const char* pValue ){
@ -1149,7 +1152,7 @@ void RunBsp( char *command ){
if ( g_PrefsDlg.m_bWatchBSP ) {
// grab the file name for engine running
char *bspname = new char[1024];
ExtractFileName( currentmap, bspname, sizeof( bspname ) );
ExtractFileName( currentmap, bspname, 1024 );
StripExtension( bspname );
g_pParentWnd->GetWatchBSP()->DoMonitoringLoop( sys, bspname );
} else {

View File

@ -2717,18 +2717,24 @@ void MainFrame::Create(){
m_pTexWnd = new TexWnd();
{
GtkWidget* frame = create_framed_texwnd( m_pTexWnd );
gint pos = 0;
GtkWidget* texDirList = create_texdirlist_widget( &pos );
if( g_PrefsDlg.m_bShowTexDirList )
{
gint pos = 0;
GtkWidget* texDirList = create_texdirlist_widget( &pos );
GtkWidget* texSplit = gtk_paned_new( GTK_ORIENTATION_HORIZONTAL );
GtkWidget* texSplit = gtk_paned_new( GTK_ORIENTATION_HORIZONTAL );
gtk_paned_pack2( GTK_PANED( vsplit2 ), texSplit, TRUE, FALSE );
gtk_paned_add1( GTK_PANED( texSplit ), texDirList );
gtk_paned_add2( GTK_PANED( texSplit ), frame );
gtk_paned_pack2( GTK_PANED( vsplit2 ), texSplit, TRUE, FALSE );
gtk_paned_add1( GTK_PANED( texSplit ), texDirList );
gtk_paned_add2( GTK_PANED( texSplit ), frame );
gtk_paned_set_position( GTK_PANED( texSplit ), pos );
gtk_paned_set_position( GTK_PANED( texSplit ), pos );
gtk_widget_show( texSplit );
gtk_widget_show( texSplit );
} else
{
gtk_paned_pack2( GTK_PANED( vsplit2 ), frame, TRUE, TRUE );
}
}
// console
@ -4681,6 +4687,7 @@ void MainFrame::OnPrefs() {
bool bPluginToolbar = g_PrefsDlg.m_bPluginToolbar;
bool bDetachableMenus = g_PrefsDlg.m_bDetachableMenus;
bool bFloatingZ = g_PrefsDlg.m_bFloatingZ;
bool bShowTexDirList = g_PrefsDlg.m_bShowTexDirList;
g_PrefsDlg.LoadPrefs();
@ -4692,7 +4699,8 @@ void MainFrame::OnPrefs() {
(g_PrefsDlg.m_bLatchedPluginToolbar != bPluginToolbar ) ||
(g_PrefsDlg.m_nLatchedShader != nShader ) ||
(g_PrefsDlg.m_nLatchedTextureQuality != nTextureQuality ) ||
(g_PrefsDlg.m_bLatchedFloatingZ != bFloatingZ)) {
(g_PrefsDlg.m_bLatchedFloatingZ != bFloatingZ ) ||
(g_PrefsDlg.m_bShowTexDirList != bShowTexDirList)) {
gtk_MessageBoxNew(m_pWidget, "You must restart Radiant for the "
"changes to take effect.", "Restart Radiant",
MB_OK | MB_ICONINFORMATION);

View File

@ -307,27 +307,29 @@ void PatchDialog::BuildDialog(){
vbox = gtk_box_new( GTK_ORIENTATION_VERTICAL, 5 );
gtk_widget_show( vbox );
gtk_container_add( GTK_CONTAINER( dlg ), vbox );
gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
gtk_widget_show( vbox );
hbox = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 5 );
gtk_widget_show( hbox );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, TRUE, TRUE, 0 );
gtk_widget_show( hbox );
frame = gtk_frame_new( _( "Details" ) );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( hbox ), frame, TRUE, TRUE, 0 );
gtk_widget_show( frame );
vbox2 = gtk_box_new( GTK_ORIENTATION_VERTICAL, 5 );
gtk_widget_show( vbox2 );
gtk_container_add( GTK_CONTAINER( frame ), vbox2 );
gtk_container_set_border_width( GTK_CONTAINER( vbox2 ), 5 );
gtk_widget_set_vexpand( vbox2, FALSE );
gtk_widget_show( vbox2 );
table = gtk_grid_new();
gtk_box_pack_start( GTK_BOX( vbox2 ), table, TRUE, TRUE, 0 );
gtk_box_pack_start( GTK_BOX( vbox2 ), table, FALSE, TRUE, 0 );
gtk_grid_set_row_spacing( GTK_GRID( table ), 5 );
gtk_grid_set_column_spacing( GTK_GRID( table ), 5 );
gtk_widget_set_hexpand( table, TRUE );
gtk_widget_show( table );
row_label = label = gtk_label_new( _( "Row:" ) );
@ -382,26 +384,31 @@ void PatchDialog::BuildDialog(){
label = gtk_label_new( _( "X:" ) );
gtk_grid_attach( GTK_GRID( table ), label, 0, 0, 1, 1 );
gtk_widget_set_tooltip_text( label, _( "X-Axis" ) );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( _( "Y:" ) );
gtk_grid_attach( GTK_GRID( table ), label, 0, 1, 1, 1 );
gtk_widget_set_tooltip_text( label, _( "Y-Axis" ) );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( _( "Z:" ) );
gtk_grid_attach( GTK_GRID( table ), label, 0, 2, 1, 1 );
gtk_widget_set_tooltip_text( label, _( "Z-Axis" ) );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( _( "S:" ) );
gtk_grid_attach( GTK_GRID( table ), label, 0, 3, 1, 1 );
gtk_widget_set_tooltip_text( label, _( "S-coordinates correspond to the \"x\" coordinates on the texture itself" ) );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( _( "T:" ) );
gtk_grid_attach( GTK_GRID( table ), label, 0, 4, 1, 1 );
gtk_widget_set_tooltip_text( label, _( "T-coordinates correspond to the \"y\" coordinates on the texture itself. The measurements are in game units." ) );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
adj = gtk_adjustment_new( 0, -INT_MAX, INT_MAX, 1, 10, 0 );
@ -455,29 +462,32 @@ void PatchDialog::BuildDialog(){
AddDialogData( spin, &m_fT, DLG_SPIN_FLOAT );
frame = gtk_frame_new( _( "Texturing" ) );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( hbox ), frame, TRUE, TRUE, 0 );
gtk_widget_show( frame );
vbox2 = gtk_box_new( GTK_ORIENTATION_VERTICAL, 5 );
gtk_container_add( GTK_CONTAINER( frame ), vbox2 );
gtk_container_set_border_width( GTK_CONTAINER( vbox2 ), 5 );
gtk_widget_set_vexpand( vbox2, FALSE );
gtk_widget_show( vbox2 );
label = gtk_label_new( _( "Name:" ) );
gtk_box_pack_start( GTK_BOX( vbox2 ), label, TRUE, TRUE, 0 );
gtk_box_pack_start( GTK_BOX( vbox2 ), label, FALSE, TRUE, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
entry = gtk_entry_new();
gtk_editable_set_editable( GTK_EDITABLE( entry ), FALSE );
gtk_widget_show( entry );
gtk_box_pack_start( GTK_BOX( vbox2 ), entry, TRUE, TRUE, 0 );
gtk_box_pack_start( GTK_BOX( vbox2 ), entry, FALSE, TRUE, 0 );
gtk_widget_set_hexpand( entry, TRUE );
AddDialogData( entry, &m_strName, DLG_ENTRY_TEXT );
table = gtk_grid_new();
gtk_box_pack_start( GTK_BOX( vbox2 ), table, TRUE, TRUE, 0 );
gtk_box_pack_start( GTK_BOX( vbox2 ), table, FALSE, TRUE, 0 );
gtk_grid_set_row_spacing( GTK_GRID( table ), 5 );
gtk_grid_set_column_spacing( GTK_GRID( table ), 5 );
gtk_widget_set_hexpand( table, TRUE );
gtk_widget_show( table );
label = gtk_label_new( _( "Value" ) );
@ -623,27 +633,28 @@ void PatchDialog::BuildDialog(){
g_object_set( spin, "xalign", 1.0, NULL );
hbox2 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 5 );
gtk_box_pack_start( GTK_BOX( vbox2 ), hbox2, FALSE, FALSE, 0 );
gtk_widget_set_hexpand( hbox2, TRUE );
gtk_widget_show( hbox2 );
gtk_box_pack_start( GTK_BOX( vbox2 ), hbox2, TRUE, FALSE, 0 );
cap_button = button = gtk_button_new_with_label( _( "CAP" ) );
gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox2 ), button, TRUE, FALSE, 0 );
gtk_widget_show( button );
g_signal_connect( button, "clicked", G_CALLBACK( OnBtnPatchdetails ), NULL );
set_button = button = gtk_button_new_with_label( _( "Set..." ) );
gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox2 ), button, TRUE, FALSE, 0 );
gtk_widget_show( button );
g_signal_connect( button, "clicked", G_CALLBACK( OnBtnPatchreset ), NULL );
nat_button = button = gtk_button_new_with_label( _( "Natural" ) );
gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox2 ), button, TRUE, FALSE, 0 );
gtk_widget_show( button );
g_signal_connect( button, "clicked", G_CALLBACK( OnBtnPatchnatural ), NULL );
fit_button = button = gtk_button_new_with_label( _( "Fit" ) );
gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox2 ), button, TRUE, FALSE, 0 );
gtk_widget_show( button );
g_signal_connect( button, "clicked", G_CALLBACK( OnBtnPatchfit ), NULL );
size_group = gtk_size_group_new( GTK_SIZE_GROUP_BOTH );
@ -654,20 +665,20 @@ void PatchDialog::BuildDialog(){
g_object_unref( size_group );
hbox = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 5 );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, FALSE, FALSE, 0 );
gtk_widget_set_hexpand( hbox, TRUE );
gtk_widget_set_vexpand( hbox, FALSE );
gtk_widget_show( hbox );
gtk_box_pack_start( GTK_BOX( vbox ), hbox, TRUE, FALSE, 0 );
button = gtk_button_new_with_label( _( "Done" ) );
gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_widget_show( button );
g_signal_connect( button, "clicked", G_CALLBACK( OnDone ), NULL );
gtk_widget_set_size_request( button, 60, -1 );
button = gtk_button_new_with_label( _( "Apply" ) );
gtk_widget_show( button );
gtk_box_pack_end( GTK_BOX( hbox ), button, FALSE, FALSE, 0 );
gtk_widget_show( button );
g_signal_connect( button, "clicked", G_CALLBACK( OnApply ), NULL );
gtk_widget_set_size_request( button, 60, -1 );
}
// sync the dialog our internal data structures
@ -711,10 +722,11 @@ void PatchDialog::GetPatchInfo(){
m_bListenChanged = true;
gtk_widget_set_sensitive( GTK_WIDGET( m_pWidget ), TRUE );
//should use gtk_dialog_get_content_area instead of gtk_bin_get_child but m_pWidget is not a gtkdialog yet
gtk_widget_set_sensitive( GTK_WIDGET( gtk_bin_get_child( GTK_BIN( m_pWidget ) ) ), TRUE );
}
else{
gtk_widget_set_sensitive( GTK_WIDGET( m_pWidget ), FALSE );
gtk_widget_set_sensitive( GTK_WIDGET( gtk_bin_get_child( GTK_BIN( m_pWidget ) ) ), FALSE );
Sys_FPrintf( SYS_WRN, "WARNING: No patch selected.\n" );
}

View File

@ -105,6 +105,9 @@
#define CHASEMOUSE_KEY "ChaseMouse"
#define MOUSEWHEELZOOM_KEY "MousewheelZoom"
#define ENTITYSHOW_KEY "EntityShow"
#define FIXEDTEXSIZE_KEY "UseFixedTextureSize"
#define FIXEDTEXSIZEWIDTH_KEY "FixedTextureSizeWidth"
#define FIXEDTEXSIZEHEIGHT_KEY "FixedTextureSizeHeight"
#define TEXTURESCALE_KEY "TextureScale"
#define TEXTURESCROLLBAR_KEY "TextureScrollbar"
#define DISPLAYLISTS_KEY "UseDisplayLists"
@ -119,6 +122,7 @@
#define SHADERTEST_KEY "ShaderTest"
#define GLLIGHTING_KEY "UseGLLighting"
#define LOADSHADERS_KEY "LoadShaders"
#define SHOWTEXDIRLIST_KEY "ShowTextureDirectoryList"
#define NOSTIPPLE_KEY "NoStipple"
#define UNDOLEVELS_KEY "UndoLevels"
#define VERTEXMODE_KEY "VertexSplit"
@ -634,6 +638,9 @@ PrefsDlg::PrefsDlg (){
m_bSelectCurves = TRUE;
m_bSelectModels = TRUE;
m_nEntityShowState = ENTITY_SKINNED_BOXED;
m_bFixedTextureSize = TRUE;
m_nFixedTextureSizeWidth = 64;
m_nFixedTextureSizeHeight = 64;
m_nTextureScale = 2;
m_bSwitchClip = FALSE;
m_bSelectWholeEntities = TRUE;
@ -1580,6 +1587,7 @@ void PrefsDlg::BuildDialog(){
// Main Preferences dialog
GtkWidget *dialog, *mainvbox, *hbox, *sc_win, *preflabel;
GtkWidget *startup_label, *tcomp_label, *startup_combo, *tcomp_combo;
GtkWidget *ftw_label, *fth_label;
// Widgets on notebook pages
GtkWidget *check, *label, *scale, *hbox2, *combo,
*table, *spin, *entry, *pixmap,
@ -1695,6 +1703,11 @@ void PrefsDlg::BuildDialog(){
gtk_tree_store_append( store, &tab, &group );
gtk_tree_store_set( store, &tab, 0, _( "Texture Settings" ), 1, (gpointer)PTAB_TEXTURE, -1 );
}
{
GtkTreeIter tab;
gtk_tree_store_append( store, &tab, &group );
gtk_tree_store_set( store, &tab, 0, _( "Texture Directory List" ), 1, (gpointer)PTAB_TEXTURE_DIR, -1 );
}
}
{
@ -2113,6 +2126,43 @@ void PrefsDlg::BuildDialog(){
AddDialogData( combo, &m_nLatchedShader, DLG_COMBO_BOX_INT );
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 );
AddDialogData( check, &m_bFixedTextureSize, DLG_CHECK_BOOL );
hbox2 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 5 );
gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, FALSE, 0 );
gtk_widget_show( hbox2 );
ftw_label = label = gtk_label_new( _( "Fixed Texture Wdith" ) );
gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, FALSE, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 1, 1, 1024, 1, 10, 0 ) ), 1, 0 );
gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE );
g_object_set( spin, "xalign", 1.0, NULL );
gtk_box_pack_start( GTK_BOX( hbox2 ), spin, FALSE, FALSE, 0 );
gtk_widget_show( spin );
AddDialogData( spin, &m_nFixedTextureSizeWidth, DLG_SPIN_INT );
hbox2 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 5 );
gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, FALSE, 0 );
gtk_widget_show( hbox2 );
fth_label = label = gtk_label_new( _( "Fixed Texture Height" ) );
gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, FALSE, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 1, 1, 1024, 1, 10, 0 ) ), 1, 0 );
gtk_spin_button_set_numeric( GTK_SPIN_BUTTON( spin ), TRUE );
g_object_set( spin, "xalign", 1.0, NULL );
gtk_box_pack_start( GTK_BOX( hbox2 ), spin, FALSE, FALSE, 0 );
gtk_widget_show( spin );
AddDialogData( spin, &m_nFixedTextureSizeHeight, DLG_SPIN_INT );
size_group = gtk_size_group_new( GTK_SIZE_GROUP_HORIZONTAL );
gtk_size_group_add_widget( size_group, tcomp_label );
gtk_size_group_add_widget( size_group, startup_label );
@ -2123,9 +2173,36 @@ void PrefsDlg::BuildDialog(){
gtk_size_group_add_widget( size_group, startup_combo );
g_object_unref( size_group );
size_group = gtk_size_group_new( GTK_SIZE_GROUP_HORIZONTAL );
gtk_size_group_add_widget( size_group, ftw_label );
gtk_size_group_add_widget( size_group, fth_label );
g_object_unref( size_group );
// Add the page to the notebook
gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel );
/******** Texture dir list group *********/
preflabel = gtk_label_new( _( "Texture directory list" ) );
gtk_widget_show( preflabel );
pageframe = gtk_frame_new( _( "Texture directory list" ) );
gtk_container_set_border_width( GTK_CONTAINER( pageframe ), 5 );
gtk_widget_show( pageframe );
vbox = gtk_box_new( GTK_ORIENTATION_VERTICAL, 5 );
gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
gtk_container_add( GTK_CONTAINER( pageframe ), vbox );
gtk_widget_show( vbox );
check = gtk_check_button_new_with_label( _( "Show Texture Directory List" ) );
gtk_box_pack_start( GTK_BOX( vbox ), check, FALSE, FALSE, 0 );
gtk_widget_show( check );
AddDialogData( check, &m_bShowTexDirList, DLG_CHECK_BOOL );
// Add the page to the notebook
gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), pageframe, preflabel );
/******** Layout group *********/
preflabel = gtk_label_new( _( "Layout" ) );
gtk_widget_show( preflabel );
@ -2988,6 +3065,13 @@ 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 );
mLocalPrefs.GetPref( SHOWTEXDIRLIST_KEY, &m_bShowTexDirList, TRUE );
mLocalPrefs.GetPref( NOCLAMP_KEY, &m_bNoClamp, FALSE );
mLocalPrefs.GetPref( SNAP_KEY, &m_bSnap, TRUE );
mLocalPrefs.GetPref( USERINI_KEY, &m_strUserPath, "" );

View File

@ -509,7 +509,7 @@ enum {SHADER_NONE = 0, SHADER_COMMON, SHADER_ALL};
// Gef: updated preferences dialog
/*! Preference notebook page numbers */
enum {PTAB_FRONT = 0, PTAB_GAME_SETTINGS, PTAB_2D, PTAB_CAMERA, PTAB_TEXTURE, PTAB_LAYOUT, PTAB_MOUSE,
enum {PTAB_FRONT = 0, PTAB_GAME_SETTINGS, PTAB_2D, PTAB_CAMERA, PTAB_TEXTURE, PTAB_TEXTURE_DIR, PTAB_LAYOUT, PTAB_MOUSE,
PTAB_EDITING, PTAB_STARTUP, PTAB_PATHS, PTAB_BRUSH, PTAB_MISC, PTAB_BSPMONITOR} pref_tabs;
GtkWidget *notebook;
@ -645,6 +645,9 @@ int m_nCubicScale;
bool m_bSelectCurves;
bool m_bSelectModels;
int m_nEntityShowState;
bool m_bFixedTextureSize;
int m_nFixedTextureSizeWidth;
int m_nFixedTextureSizeHeight;
int m_nTextureScale;
bool m_bNormalizeColors;
bool m_bSwitchClip;
@ -723,6 +726,8 @@ int m_nLatchedTextureQuality;
// texture compression format
int m_nTextureCompressionFormat;
bool m_bShowTexDirList;
int m_nLightRadiuses;
bool m_bQ3Map2Texturing;

View File

@ -503,6 +503,8 @@ void SurfaceDlg::InitDefaultIncrement( texdef_t *tex ){
void SurfaceDlg::BuildDialog() {
GtkWidget *dlg, *vbox, *hbox2, *frame, *table, *label;
GtkWidget *button, *entry, *spin;
GtkWidget *axial_button, *cap_button, *set_button, *nat_button, *fit_button;
GtkSizeGroup *button_group;
dlg = m_pWidget;
@ -516,350 +518,345 @@ void SurfaceDlg::BuildDialog() {
// replaced by only the vbox:
vbox = gtk_box_new( GTK_ORIENTATION_VERTICAL, 5 );
gtk_widget_show( vbox );
gtk_container_add( GTK_CONTAINER( dlg ), vbox );
gtk_container_set_border_width( GTK_CONTAINER( vbox ), 5 );
gtk_widget_show( vbox );
hbox2 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 5 );
gtk_widget_show( hbox2 );
gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, TRUE, 0 );
gtk_widget_show( hbox2 );
label = gtk_label_new( _( "Texture" ) );
gtk_widget_show( label );
gtk_box_pack_start( GTK_BOX( hbox2 ), label, FALSE, TRUE, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
entry = gtk_entry_new();
g_signal_connect( entry, "key_press_event", G_CALLBACK( OnTextureKey ), NULL );
gtk_widget_show( entry );
gtk_box_pack_start( GTK_BOX( hbox2 ), entry, TRUE, TRUE, 0 );
gtk_widget_show( entry );
g_signal_connect( entry, "key_press_event", G_CALLBACK( OnTextureKey ), NULL );
g_object_set_data( G_OBJECT( m_pWidget ), "texture", entry );
// table = gtk_table_new (5, 4, FALSE);
table = gtk_table_new( 6, 4, FALSE );
gtk_widget_show( table );
gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
gtk_box_pack_start( GTK_BOX( vbox ), table, FALSE, TRUE, 0 );
gtk_widget_show( table );
label = gtk_label_new( _( "Horizontal shift" ) );
gtk_widget_show( label );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 0 );
g_object_set_data( G_OBJECT( dlg ), "hshift", spin );
g_signal_connect( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ), "value_changed",
G_CALLBACK( OnUpdate ), NULL );
gtk_widget_show( spin );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_size_request( spin, 60, -2 );
gtk_widget_show( spin );
g_object_set_data( G_OBJECT( dlg ), "hshift", spin );
g_signal_connect( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ), "value_changed",
G_CALLBACK( OnUpdate ), NULL );
label = gtk_label_new( _( "Step" ) );
gtk_widget_show( label );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
entry = gtk_entry_new();
g_object_set_data( G_OBJECT( dlg ), "hshift_inc", entry );
g_signal_connect( entry, "changed",
G_CALLBACK( OnIncrementChanged ), NULL );
gtk_widget_show( entry );
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 0, 1,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_size_request( entry, 50, -2 );
gtk_widget_show( entry );
g_object_set_data( G_OBJECT( dlg ), "hshift_inc", entry );
g_signal_connect( entry, "changed",
G_CALLBACK( OnIncrementChanged ), NULL );
label = gtk_label_new( _( "Vertical shift" ) );
gtk_widget_show( label );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -8192, 8192, 2, 8, 0 ) ), 0, 0 );
g_object_set_data( G_OBJECT( dlg ), "vshift", spin );
g_signal_connect( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ), "value_changed",
G_CALLBACK( OnUpdate ), NULL );
gtk_widget_show( spin );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_size_request( spin, 60, -2 );
gtk_widget_show( spin );
g_object_set_data( G_OBJECT( dlg ), "vshift", spin );
g_signal_connect( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ), "value_changed",
G_CALLBACK( OnUpdate ), NULL );
label = gtk_label_new( _( "Step" ) );
gtk_widget_show( label );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
entry = gtk_entry_new();
g_object_set_data( G_OBJECT( dlg ), "vshift_inc", entry );
g_signal_connect( entry, "changed",
G_CALLBACK( OnIncrementChanged ), NULL );
gtk_widget_show( entry );
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 1, 2,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_size_request( entry, 50, -2 );
gtk_widget_show( entry );
g_object_set_data( G_OBJECT( dlg ), "vshift_inc", entry );
g_signal_connect( entry, "changed",
G_CALLBACK( OnIncrementChanged ), NULL );
label = gtk_label_new( _( "Horizontal stretch" ) );
gtk_widget_show( label );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -1000, 1000, 1, 10, 0 ) ), 0, 0 );
g_object_set_data( G_OBJECT( dlg ), "hscale", spin );
g_signal_connect( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ), "value_changed",
G_CALLBACK( OnUpdate ), NULL );
gtk_widget_show( spin );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_size_request( spin, 60, -2 );
gtk_widget_show( spin );
g_object_set_data( G_OBJECT( dlg ), "hscale", spin );
g_signal_connect( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ), "value_changed",
G_CALLBACK( OnUpdate ), NULL );
label = gtk_label_new( _( "Step" ) );
gtk_widget_show( label );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 2, 3 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
entry = gtk_entry_new();
g_object_set_data( G_OBJECT( dlg ), "hscale_inc", entry );
g_signal_connect( entry, "changed",
G_CALLBACK( OnIncrementChanged ), NULL );
gtk_widget_show( entry );
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 2, 3 );
gtk_widget_set_size_request( entry, 50, -2 );
gtk_widget_show( entry );
g_object_set_data( G_OBJECT( dlg ), "hscale_inc", entry );
g_signal_connect( entry, "changed",
G_CALLBACK( OnIncrementChanged ), NULL );
label = gtk_label_new( _( "Vertical stretch" ) );
gtk_widget_show( label );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 3, 4,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -1000, 1000, 1, 10, 0 ) ), 0, 0 );
g_object_set_data( G_OBJECT( dlg ), "vscale", spin );
g_signal_connect( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ), "value_changed",
G_CALLBACK( OnUpdate ), NULL );
gtk_widget_show( spin );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 3, 4,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_size_request( spin, 60, -2 );
gtk_widget_show( spin );
g_object_set_data( G_OBJECT( dlg ), "vscale", spin );
g_signal_connect( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ), "value_changed",
G_CALLBACK( OnUpdate ), NULL );
label = gtk_label_new( _( "Step" ) );
gtk_widget_show( label );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 3, 4,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
entry = gtk_entry_new();
g_object_set_data( G_OBJECT( dlg ), "vscale_inc", entry );
g_signal_connect( entry, "changed",
G_CALLBACK( OnIncrementChanged ), NULL );
gtk_widget_show( entry );
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 3, 4,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_size_request( entry, 50, -2 );
gtk_widget_show( entry );
g_object_set_data( G_OBJECT( dlg ), "vscale_inc", entry );
g_signal_connect( entry, "changed",
G_CALLBACK( OnIncrementChanged ), NULL );
label = gtk_label_new( _( "Rotate" ) );
gtk_widget_show( label );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 4, 5,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 0, -360, 360, 1, 10, 0 ) ), 1, 0 );
g_object_set_data( G_OBJECT( dlg ), "rotate", spin );
g_signal_connect( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ), "value_changed",
G_CALLBACK( OnUpdate ), NULL );
gtk_widget_show( spin );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), TRUE );
gtk_table_attach( GTK_TABLE( table ), spin, 1, 2, 4, 5,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_size_request( spin, 60, -2 );
gtk_spin_button_set_wrap( GTK_SPIN_BUTTON( spin ), TRUE );
gtk_widget_show( spin );
g_object_set_data( G_OBJECT( dlg ), "rotate", spin );
g_signal_connect( gtk_spin_button_get_adjustment( GTK_SPIN_BUTTON( spin ) ), "value_changed",
G_CALLBACK( OnUpdate ), NULL );
label = gtk_label_new( _( "Step" ) );
gtk_widget_show( label );
gtk_misc_set_alignment( GTK_MISC( label ), 0, 0 );
gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 4, 5,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
entry = gtk_entry_new();
g_object_set_data( G_OBJECT( dlg ), "rotate_inc", entry );
g_signal_connect( entry, "changed",
G_CALLBACK( OnIncrementChanged ), NULL );
gtk_widget_show( entry );
gtk_table_attach( GTK_TABLE( table ), entry, 3, 4, 4, 5,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_size_request( entry, 50, -2 );
gtk_widget_show( entry );
g_object_set_data( G_OBJECT( dlg ), "rotate_inc", entry );
g_signal_connect( entry, "changed",
G_CALLBACK( OnIncrementChanged ), NULL );
// match grid button
button = gtk_button_new_with_label( _( "Match Grid" ) );
gtk_widget_show( button );
gtk_table_attach( GTK_TABLE( table ), button, 2, 4, 5, 6,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( button );
g_signal_connect( button, "clicked",
G_CALLBACK( OnBtnMatchGrid ), NULL );
frame = gtk_frame_new( _( "Texturing" ) );
gtk_widget_show( frame );
gtk_box_pack_start( GTK_BOX( vbox ), frame, FALSE, TRUE, 0 );
gtk_widget_show( frame );
table = gtk_table_new( 4, 4, FALSE );
gtk_widget_show( table );
gtk_container_add( GTK_CONTAINER( frame ), table );
gtk_table_set_row_spacings( GTK_TABLE( table ), 5 );
gtk_table_set_col_spacings( GTK_TABLE( table ), 5 );
gtk_container_add( GTK_CONTAINER( frame ), table );
gtk_container_set_border_width( GTK_CONTAINER( table ), 5 );
gtk_widget_show( table );
label = gtk_label_new( "Brush" );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( "Patch" );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table ), label, 0, 1, 2, 3,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( "Width" );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table ), label, 2, 3, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
label = gtk_label_new( _( "Height" ) );
gtk_widget_show( label );
gtk_table_attach( GTK_TABLE( table ), label, 3, 4, 0, 1,
(GtkAttachOptions) ( GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_halign( label, GTK_ALIGN_START );
gtk_widget_show( label );
button = gtk_button_new_with_label( _( "Axial" ) );
gtk_widget_show( button );
axial_button = button = gtk_button_new_with_label( _( "Axial" ) );
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( button );
g_signal_connect( button, "clicked",
G_CALLBACK( OnBtnAxial ), NULL );
gtk_widget_set_size_request( button, 60, -2 );
button = gtk_button_new_with_label( _( "Fit" ) );
gtk_widget_show( button );
fit_button = button = gtk_button_new_with_label( _( "Fit" ) );
gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( button );
g_signal_connect( button, "clicked",
G_CALLBACK( OnBtnFaceFit ), NULL );
gtk_widget_set_size_request( button, 60, -2 );
button = gtk_button_new_with_label( _( "CAP" ) );
gtk_widget_show( button );
button_group = gtk_size_group_new( GTK_SIZE_GROUP_BOTH );
gtk_size_group_add_widget( button_group, axial_button );
gtk_size_group_add_widget( button_group, fit_button );
g_object_unref( button_group );
cap_button = button = gtk_button_new_with_label( _( "CAP" ) );
gtk_table_attach( GTK_TABLE( table ), button, 0, 1, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( button );
g_signal_connect( button, "clicked",
G_CALLBACK( OnBtnPatchdetails ), NULL );
gtk_widget_set_size_request( button, 60, -2 );
button = gtk_button_new_with_label( _( "Set..." ) );
gtk_widget_show( button );
set_button = button = gtk_button_new_with_label( _( "Set..." ) );
gtk_table_attach( GTK_TABLE( table ), button, 1, 2, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( button );
g_signal_connect( button, "clicked",
G_CALLBACK( OnBtnPatchreset ), NULL );
gtk_widget_set_size_request( button, 60, -2 );
button = gtk_button_new_with_label( _( "Natural" ) );
gtk_widget_show( button );
nat_button = button = gtk_button_new_with_label( _( "Natural" ) );
gtk_table_attach( GTK_TABLE( table ), button, 2, 3, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( button );
g_signal_connect( button, "clicked",
G_CALLBACK( OnBtnPatchnatural ), NULL );
gtk_widget_set_size_request( button, 60, -2 );
button = gtk_button_new_with_label( _( "Fit" ) );
gtk_widget_show( button );
fit_button = button = gtk_button_new_with_label( _( "Fit" ) );
gtk_table_attach( GTK_TABLE( table ), button, 3, 4, 3, 4,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_show( button );
g_signal_connect( button, "clicked",
G_CALLBACK( OnBtnPatchFit ), NULL );
gtk_widget_set_size_request( button, 60, -2 );
button_group = gtk_size_group_new( GTK_SIZE_GROUP_BOTH );
gtk_size_group_add_widget( button_group, cap_button );
gtk_size_group_add_widget( button_group, set_button );
gtk_size_group_add_widget( button_group, nat_button );
gtk_size_group_add_widget( button_group, fit_button );
g_object_unref( button_group );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 1, 1, 32, 1, 10, 0 ) ), 1, 0 );
gtk_widget_show( spin );
gtk_table_attach( GTK_TABLE( table ), spin, 2, 3, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_size_request( spin, 60, -2 );
gtk_widget_show( spin );
AddDialogData( spin, &m_nWidth, DLG_SPIN_INT );
spin = gtk_spin_button_new( GTK_ADJUSTMENT( gtk_adjustment_new( 1, 1, 32, 1, 10, 0 ) ), 1, 0 );
gtk_widget_show( spin );
gtk_table_attach( GTK_TABLE( table ), spin, 3, 4, 1, 2,
(GtkAttachOptions) ( GTK_EXPAND | GTK_FILL ),
(GtkAttachOptions) ( 0 ), 0, 0 );
gtk_widget_set_size_request( spin, 60, -2 );
gtk_widget_show( spin );
AddDialogData( spin, &m_nHeight, DLG_SPIN_INT );
hbox2 = gtk_box_new( GTK_ORIENTATION_HORIZONTAL, 5 );
gtk_widget_show( hbox2 );
gtk_box_pack_start( GTK_BOX( vbox ), hbox2, FALSE, TRUE, 0 );
gtk_widget_show( hbox2 );
button = gtk_button_new_with_label( _( "Done" ) );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 );
gtk_widget_show( button );
g_signal_connect( button, "clicked",
G_CALLBACK( OnDone ), NULL );
gtk_widget_set_size_request( button, 60, -2 );
button = gtk_button_new_with_label( _( "Apply" ) );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 );
gtk_widget_show( button );
g_signal_connect( button, "clicked",
G_CALLBACK( OnApply ), NULL );
gtk_widget_set_size_request( button, 60, -2 );
button = gtk_button_new_with_label( _( "Cancel" ) );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 );
gtk_widget_show( button );
g_signal_connect( button, "clicked",
G_CALLBACK( OnCancel ), NULL );
gtk_widget_set_size_request( button, 60, -2 );
// that's a bit of trashy stuff from Textool-v2 branch
#ifdef _DEBUG
// FIXME: testing only, scaling in BP mode
button = gtk_button_new_with_label( _( "Test" ) );
gtk_widget_show( button );
gtk_box_pack_start( GTK_BOX( hbox2 ), button, FALSE, FALSE, 0 );
gtk_widget_show( button );
g_signal_connect( button, "clicked",
G_CALLBACK( OnTest ), NULL );
gtk_widget_set_size_request( button, 60, -2 );
#endif
// Initialize

View File

@ -1613,9 +1613,14 @@ void Texture_Draw( int width, int height ){
break;
}
nWidth = (int)( q->width * ( (float)g_PrefsDlg.m_nTextureScale / 100 ) );
nHeight = (int)( q->height * ( (float)g_PrefsDlg.m_nTextureScale / 100 ) );
if( g_PrefsDlg.m_bFixedTextureSize && g_PrefsDlg.m_nFixedTextureSizeWidth > 0 && g_PrefsDlg.m_nFixedTextureSizeHeight > 0 )
{
nWidth = g_PrefsDlg.m_nFixedTextureSizeWidth;
nHeight = g_PrefsDlg.m_nFixedTextureSizeHeight;
} else {
nWidth = (int)( q->width * ( (float)g_PrefsDlg.m_nTextureScale / 100 ) );
nHeight = (int)( q->height * ( (float)g_PrefsDlg.m_nTextureScale / 100 ) );
}
if ( y != last_y ) {
last_y = y;
last_height = 0;