New direct shortcuts for resizing brush (Issue 319)

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1528 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud 2010-07-08 23:42:48 +00:00
parent 272cc59395
commit e6ced5f6a0
5 changed files with 97 additions and 10 deletions

View File

@ -37,7 +37,6 @@
#define BETA1 98 ///< Version number for gfx2.cfg (3/4)
#define BETA2 0 ///< Version number for gfx2.cfg (4/4)
#define MAX_VIDEO_MODES 100 ///< Maximum number of video modes Grafx2 can propose.
#define NB_SHORTCUTS 183 ///< Number of actions that can have a key combination associated to it.
#define NB_ZOOM_FACTORS 15 ///< Number of zoom levels available in the magnifier.
#define MENU_WIDTH 254 ///< Width of the menu (not counting the palette)
#define MENU_HEIGHT 44 ///< Height of the menu.
@ -394,6 +393,10 @@ enum SPECIAL_ACTIONS
SPECIAL_GET_BRUSH_COLORS,
SPECIAL_RECOLORIZE_BRUSH,
SPECIAL_ROTATE_ANY_ANGLE,
SPECIAL_BRUSH_DOUBLE,
SPECIAL_BRUSH_DOUBLE_WIDTH,
SPECIAL_BRUSH_DOUBLE_HEIGHT,
SPECIAL_BRUSH_HALVE,
SPECIAL_LOAD_BRUSH,
SPECIAL_SAVE_BRUSH,
SPECIAL_INVERT_SIEVE,

View File

@ -884,6 +884,46 @@ void Main_handler(void)
Display_cursor();
action++;
break;
case SPECIAL_BRUSH_DOUBLE:
if (Paintbrush_shape==PAINTBRUSH_SHAPE_COLOR_BRUSH
|| Paintbrush_shape==PAINTBRUSH_SHAPE_MONO_BRUSH)
{
Hide_cursor();
Stretch_brush(1,1,Brush_width*2,Brush_height*2);
Display_cursor();
}
action++;
break;
case SPECIAL_BRUSH_DOUBLE_WIDTH:
if (Paintbrush_shape==PAINTBRUSH_SHAPE_COLOR_BRUSH
|| Paintbrush_shape==PAINTBRUSH_SHAPE_MONO_BRUSH)
{
Hide_cursor();
Stretch_brush(1,1,Brush_width*2,Brush_height);
Display_cursor();
}
action++;
break;
case SPECIAL_BRUSH_DOUBLE_HEIGHT:
if (Paintbrush_shape==PAINTBRUSH_SHAPE_COLOR_BRUSH
|| Paintbrush_shape==PAINTBRUSH_SHAPE_MONO_BRUSH)
{
Hide_cursor();
Stretch_brush(1,1,Brush_width,Brush_height*2);
Display_cursor();
}
action++;
break;
case SPECIAL_BRUSH_HALVE:
if (Paintbrush_shape==PAINTBRUSH_SHAPE_COLOR_BRUSH
|| Paintbrush_shape==PAINTBRUSH_SHAPE_MONO_BRUSH)
{
Hide_cursor();
Stretch_brush(1,1,Brush_width/2,Brush_height/2);
Display_cursor();
}
action++;
break;
case SPECIAL_OUTLINE : // Outline brush
Hide_cursor();
Outline_brush();

View File

@ -204,6 +204,10 @@ static const T_Help_table helptable_help[] =
HELP_LINK ("Distort brush: %s", SPECIAL_DISTORT)
HELP_LINK ("Outline brush: %s", SPECIAL_OUTLINE)
HELP_LINK ("Nibble brush: %s", SPECIAL_NIBBLE)
HELP_LINK ("Double brush size: %s", SPECIAL_BRUSH_DOUBLE)
HELP_LINK ("Halve brush size: %s", SPECIAL_BRUSH_HALVE)
HELP_LINK ("Double brush width: %s", SPECIAL_BRUSH_DOUBLE_WIDTH)
HELP_LINK ("Double brush height: %s", SPECIAL_BRUSH_DOUBLE_HEIGHT)
HELP_LINK ("Get brush colors: %s", SPECIAL_GET_BRUSH_COLORS)
HELP_LINK ("Recolorize brush: %s", SPECIAL_RECOLORIZE_BRUSH)
HELP_LINK ("Rotate brush: %s", SPECIAL_ROTATE_ANY_ANGLE)
@ -1249,15 +1253,17 @@ static const T_Help_table helptable_brush_fx[] =
HELP_TEXT ("point at coordinates inferior to the ones of")
HELP_TEXT ("the first point, the brush will be inverted.")
HELP_TEXT ("Meanwhile, you can press the following keys")
HELP_TEXT ("whose effects are: 'D' : double the")
HELP_TEXT ("brush in X and Y 'H' : reduce the")
HELP_TEXT ("brush by half in X and Y 'X' : double")
HELP_TEXT ("the brush in X 'Shift+X': reduce the brush")
HELP_TEXT ("by half in X 'Y' : double the brush")
HELP_TEXT ("in Y 'Shift+Y': reduce the brush by half")
HELP_TEXT ("in Y 'N' : restore the normal size of")
HELP_TEXT ("the brush (can be useful")
HELP_TEXT ("because it's the only way for cancelling)")
HELP_TEXT ("whose effects are:")
HELP_TEXT (" 'D' : Double the brush")
HELP_TEXT (" 'H' : Reduce the brush by half")
HELP_TEXT (" 'X' : Double the brush in X")
HELP_TEXT (" 'Shift+X': Reduce the brush by half in X")
HELP_TEXT (" 'Y' : Double the brush in Y")
HELP_TEXT (" 'Shift+Y': Reduce the brush by half in Y")
HELP_TEXT (" 'N' : Restore the normal size of the")
HELP_TEXT (" brush (can be useful because")
HELP_TEXT (" it's the only way for")
HELP_TEXT (" cancelling)")
HELP_TEXT ("")
HELP_LINK ("- Distort: (Key:%s)",SPECIAL_DISTORT)
HELP_TEXT ("Triggers an interactive operation")

View File

@ -1493,6 +1493,38 @@ T_Key_config ConfigKey[NB_SHORTCUTS] = {
true,
0, // No shortcut
0},
{183,
"Double brush size",
"Resizes the current user brush",
"by doubling width and height.",
"",
true,
SDLK_h|MOD_SHIFT, // Shift+H
0},
{184,
"Double brush width",
"Resizes the current user brush",
"by doubling its width.",
"",
true,
SDLK_x|MOD_SHIFT, // Shift+X
0},
{185,
"Double brush height",
"Resizes the current user brush",
"by doubling its height.",
"",
true,
SDLK_y|MOD_SHIFT, // Shift+Y
0},
{186,
"Halve brush size",
"Resizes the current user brush",
"by halving its width and height",
"",
true,
SDLK_h, // H
0},
};
word Ordering[NB_SHORTCUTS]=
@ -1680,4 +1712,8 @@ word Ordering[NB_SHORTCUTS]=
0x100+BUTTON_LAYER_MENU,
0x200+BUTTON_BRUSH_EFFECTS,
SPECIAL_REPEAT_SCRIPT,
SPECIAL_BRUSH_DOUBLE,
SPECIAL_BRUSH_DOUBLE_WIDTH,
SPECIAL_BRUSH_DOUBLE_HEIGHT,
SPECIAL_BRUSH_HALVE,
};

View File

@ -33,6 +33,8 @@
#endif
#include <SDL.h>
#define NB_SHORTCUTS 187 ///< Number of actions that can have a key combination associated to it.
/*** Types definitions and structs ***/
typedef struct