]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
Add flip buttons to the patch texture dialog
authorMattia Basaglia <mattia.basaglia@gmail.com>
Sun, 19 Jul 2015 07:36:05 +0000 (09:36 +0200)
committerMattia Basaglia <mattia.basaglia@gmail.com>
Sun, 19 Jul 2015 07:36:05 +0000 (09:36 +0200)
radiant/patchdialog.cpp
radiant/patchmanip.h

index db3c4ebb9d7192c2011fae73f51c2456e6e4885b..6bacd9f8b6c4ec5c28bb8c23b646d929ffb5c43c 100644 (file)
@@ -391,6 +391,14 @@ static void OnBtnPatchreset( GtkWidget *widget, gpointer data ){
        Patch_ResetTexture();
 }
 
+static void OnBtnPatchFlipX( GtkWidget *widget, gpointer data ){
+       Patch_FlipTextureX();
+}
+
+static void OnBtnPatchFlipY( GtkWidget *widget, gpointer data ){
+       Patch_FlipTextureY();
+}
+
 struct PatchRotateTexture
 {
        float m_angle;
@@ -815,7 +823,7 @@ GtkWindow* PatchInspector::BuildDialog(){
                                                g_signal_connect( G_OBJECT( entry ), "key_press_event", G_CALLBACK( OnDialogKey ), 0 );
                                        }
                                        {
-                                               GtkTable* table = GTK_TABLE( gtk_table_new( 5, 3, FALSE ) );
+                                               GtkTable* table = GTK_TABLE( gtk_table_new( 5, 4, FALSE ) );
                                                gtk_widget_show( GTK_WIDGET( table ) );
                                                gtk_box_pack_start( GTK_BOX( vbox2 ), GTK_WIDGET( table ), TRUE, TRUE, 0 );
                                                gtk_table_set_row_spacings( table, 5 );
@@ -823,7 +831,7 @@ GtkWindow* PatchInspector::BuildDialog(){
                                                {
                                                        GtkLabel* label = GTK_LABEL( gtk_label_new( "Horizontal Shift Step" ) );
                                                        gtk_widget_show( GTK_WIDGET( label ) );
-                                                       gtk_table_attach( table, GTK_WIDGET( label ), 2, 3, 0, 1,
+                                                       gtk_table_attach( table, GTK_WIDGET( label ), 2, 4, 0, 1,
                                                                                          (GtkAttachOptions)( GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
@@ -831,7 +839,7 @@ GtkWindow* PatchInspector::BuildDialog(){
                                                {
                                                        GtkLabel* label = GTK_LABEL( gtk_label_new( "Vertical Shift Step" ) );
                                                        gtk_widget_show( GTK_WIDGET( label ) );
-                                                       gtk_table_attach( table, GTK_WIDGET( label ), 2, 3, 1, 2,
+                                                       gtk_table_attach( table, GTK_WIDGET( label ), 2, 4, 1, 2,
                                                                                          (GtkAttachOptions)( GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
@@ -844,6 +852,15 @@ GtkWindow* PatchInspector::BuildDialog(){
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                }
+                                               {
+                                                       GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Flip" ) );
+                                                       gtk_widget_show( GTK_WIDGET( button ) );
+                                                       gtk_table_attach( table, GTK_WIDGET( button ), 3, 4, 2, 3,
+                                                                                         (GtkAttachOptions)( GTK_FILL ),
+                                                                                         (GtkAttachOptions)( 0 ), 0, 0 );
+                                                       g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchFlipX ), 0 );
+                                                       gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 );
+                                               }
                                                {
                                                        GtkLabel* label = GTK_LABEL( gtk_label_new( "Vertical Stretch Step" ) );
                                                        gtk_widget_show( GTK_WIDGET( label ) );
@@ -852,10 +869,19 @@ GtkWindow* PatchInspector::BuildDialog(){
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
                                                }
+                                               {
+                                                       GtkButton* button = GTK_BUTTON( gtk_button_new_with_label( "Flip" ) );
+                                                       gtk_widget_show( GTK_WIDGET( button ) );
+                                                       gtk_table_attach( table, GTK_WIDGET( button ), 3, 4, 3, 4,
+                                                                                         (GtkAttachOptions)( GTK_FILL ),
+                                                                                         (GtkAttachOptions)( 0 ), 0, 0 );
+                                                       g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( OnBtnPatchFlipY ), 0 );
+                                                       gtk_widget_set_usize( GTK_WIDGET( button ), 60, -1 );
+                                               }
                                                {
                                                        GtkLabel* label = GTK_LABEL( gtk_label_new( "Rotate Step" ) );
                                                        gtk_widget_show( GTK_WIDGET( label ) );
-                                                       gtk_table_attach( table, GTK_WIDGET( label ), 2, 3, 4, 5,
+                                                       gtk_table_attach( table, GTK_WIDGET( label ), 2, 4, 4, 5,
                                                                                          (GtkAttachOptions)( GTK_FILL ),
                                                                                          (GtkAttachOptions)( 0 ), 0, 0 );
                                                        gtk_misc_set_alignment( GTK_MISC( label ), 0, 0.5 );
index c6646898e3c0b85ac69b5ffc6fab4bfa8589f7ea..d6d8764cb65389f41ea4337a29a9568800d35d8a 100644 (file)
@@ -55,6 +55,8 @@ void Patch_NaturalTexture();
 void Patch_CapTexture();
 void Patch_ResetTexture();
 void Patch_FitTexture();
+void Patch_FlipTextureX();
+void Patch_FlipTextureY();
 
 class PatchCreator;
 extern PatchCreator* g_patchCreator;