}
static void OnBtnPatchdetails( GtkWidget *widget, gpointer data ){
- UndoableCommand command( "patchCapTexture" );
-
- Scene_PatchCapTexture_Selected( GlobalSceneGraph() );
+ Patch_CapTexture();
}
static void OnBtnPatchfit( GtkWidget *widget, gpointer data ){
- UndoableCommand command( "patchFitTexture" );
-
- Scene_PatchTileTexture_Selected( GlobalSceneGraph(), 1, 1 );
+ Patch_FitTexture();
}
static void OnBtnPatchnatural( GtkWidget *widget, gpointer data ){
- UndoableCommand command( "patchNaturalTexture" );
-
- Scene_PatchNaturalTexture_Selected( GlobalSceneGraph() );
+ Patch_NaturalTexture();
}
static void OnBtnPatchreset( GtkWidget *widget, gpointer data ){
- float fx, fy;
- if ( DoTextureLayout( &fx, &fy ) == eIDOK ) {
- UndoableCommand command( "patchTileTexture" );
- Scene_PatchTileTexture_Selected( GlobalSceneGraph(), fx, fy );
- }
+ Patch_ResetTexture();
}
struct PatchRotateTexture
Scene_PatchNaturalTexture_Selected( GlobalSceneGraph() );
}
+void Patch_CapTexture(){
+ UndoableCommand command( "patchCapTexture" );
+ Scene_PatchCapTexture_Selected( GlobalSceneGraph() );
+}
+
+void Patch_ResetTexture(){
+ float fx, fy;
+ if ( DoTextureLayout( &fx, &fy ) == eIDOK ) {
+ UndoableCommand command( "patchTileTexture" );
+ Scene_PatchTileTexture_Selected( GlobalSceneGraph(), fx, fy );
+ }
+}
+void Patch_FitTexture(){
+ UndoableCommand command( "patchFitTexture" );
+
+ Scene_PatchTileTexture_Selected( GlobalSceneGraph(), 1, 1 );
+}
#include "ifilter.h"
void Patch_registerCommands(){
GlobalCommands_insert( "InvertCurveTextureX", FreeCaller<Patch_FlipTextureX>(), Accelerator( 'I', (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
GlobalCommands_insert( "InvertCurveTextureY", FreeCaller<Patch_FlipTextureY>(), Accelerator( 'I', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "IncPatchColumn", FreeCaller<Patch_InsertInsertColumn>(), Accelerator( GDK_KP_Add, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "IncPatchRow", FreeCaller<Patch_InsertInsertRow>(), Accelerator( GDK_KP_Add, (GdkModifierType)GDK_CONTROL_MASK ) );
- GlobalCommands_insert( "DecPatchColumn", FreeCaller<Patch_DeleteLastColumn>(), Accelerator( GDK_KP_Subtract, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
- GlobalCommands_insert( "DecPatchRow", FreeCaller<Patch_DeleteLastRow>(), Accelerator( GDK_KP_Subtract, (GdkModifierType)GDK_CONTROL_MASK ) );
GlobalCommands_insert( "NaturalizePatch", FreeCaller<Patch_NaturalTexture>(), Accelerator( 'N', (GdkModifierType)GDK_CONTROL_MASK ) );
GlobalCommands_insert( "PatchCylinder", FreeCaller<Patch_Cylinder>() );
GlobalCommands_insert( "PatchDenseCylinder", FreeCaller<Patch_DenseCylinder>() );
GlobalCommands_insert( "PatchCone", FreeCaller<Patch_Cone>() );
GlobalCommands_insert( "PatchSphere", FreeCaller<Patch_Sphere>() );
GlobalCommands_insert( "SimplePatchMesh", FreeCaller<Patch_Plane>(), Accelerator( 'P', (GdkModifierType)GDK_SHIFT_MASK ) );
- GlobalCommands_insert( "PatchInsertInsertColumn", FreeCaller<Patch_InsertInsertColumn>() );
+ GlobalCommands_insert( "PatchInsertInsertColumn", FreeCaller<Patch_InsertInsertColumn>(), Accelerator( GDK_KP_Add, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
GlobalCommands_insert( "PatchInsertAddColumn", FreeCaller<Patch_InsertAddColumn>() );
- GlobalCommands_insert( "PatchInsertInsertRow", FreeCaller<Patch_InsertInsertRow>() );
+ GlobalCommands_insert( "PatchInsertInsertRow", FreeCaller<Patch_InsertInsertRow>(), Accelerator( GDK_KP_Add, (GdkModifierType)GDK_CONTROL_MASK ) );
GlobalCommands_insert( "PatchInsertAddRow", FreeCaller<Patch_InsertAddRow>() );
GlobalCommands_insert( "PatchDeleteFirstColumn", FreeCaller<Patch_DeleteFirstColumn>() );
- GlobalCommands_insert( "PatchDeleteLastColumn", FreeCaller<Patch_DeleteLastColumn>() );
- GlobalCommands_insert( "PatchDeleteFirstRow", FreeCaller<Patch_DeleteFirstRow>() );
+ GlobalCommands_insert( "PatchDeleteLastColumn", FreeCaller<Patch_DeleteLastColumn>(), Accelerator( GDK_KP_Subtract, (GdkModifierType)( GDK_SHIFT_MASK | GDK_CONTROL_MASK ) ) );
+ GlobalCommands_insert( "PatchDeleteFirstRow", FreeCaller<Patch_DeleteFirstRow>(), Accelerator( GDK_KP_Subtract, (GdkModifierType)GDK_CONTROL_MASK ) );
GlobalCommands_insert( "PatchDeleteLastRow", FreeCaller<Patch_DeleteLastRow>() );
GlobalCommands_insert( "InvertCurve", FreeCaller<Patch_Invert>(), Accelerator( 'I', (GdkModifierType)GDK_CONTROL_MASK ) );
GlobalCommands_insert( "RedisperseRows", FreeCaller<Patch_RedisperseRows>(), Accelerator( 'E', (GdkModifierType)GDK_CONTROL_MASK ) );
create_menu_item_with_mnemonic( menu_in_menu, "Set", "MakeOverlayPatch" );
create_menu_item_with_mnemonic( menu_in_menu, "Clear", "ClearPatchOverlays" );
}
+ menu_separator( menu );
+ {
+ GtkMenu* menu_in_menu = create_sub_menu_with_mnemonic( menu, "Texture" );
+ if ( g_Layout_enableDetachableMenus.m_value ) {
+ menu_tearoff( menu_in_menu );
+ }
+ create_menu_item_with_mnemonic( menu_in_menu, "Flip Horizontally", "InvertCurveTextureX" );
+ create_menu_item_with_mnemonic( menu_in_menu, "Flip Vertically", "InvertCurveTextureY" );
+ create_menu_item_with_mnemonic( menu_in_menu, "Naturalize", "NaturalizePatch" );
+ }
}