UI: Changes to Paint Cursors

Changes to cursors that can be used for painting and sculpting.

Differential Revision: https://developer.blender.org/D5951

Reviewed by Brecht Van Lommel
This commit is contained in:
Harley Acheson 2019-09-30 16:38:40 -07:00
parent 60a827a2a9
commit 4101d3e400
6 changed files with 72 additions and 71 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

@ -1363,7 +1363,7 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
}
/* Use special paint crosshair cursor in all paint modes*/
wmWindow *win = CTX_wm_window(C);
WM_cursor_set(win, WM_CURSOR_CROSSA);
WM_cursor_set(win, WM_CURSOR_PAINT);
if ((mode == PAINT_MODE_SCULPT) && ss && !is_multires &&
!(brush->falloff_shape & BRUSH_AIRBRUSH)) {

@ -41,7 +41,7 @@
#include "rna_internal.h" /* own include */
/* confusingm 2 enums mixed up here */
/* confusing 2 enums mixed up here */
const EnumPropertyItem rna_enum_window_cursor_items[] = {
{WM_CURSOR_DEFAULT, "DEFAULT", 0, "Default", ""},
{WM_CURSOR_NONE, "NONE", 0, "None", ""},
@ -54,7 +54,8 @@ const EnumPropertyItem rna_enum_window_cursor_items[] = {
{WM_CURSOR_KNIFE, "KNIFE", 0, "Knife", ""},
{WM_CURSOR_TEXT_EDIT, "TEXT", 0, "Text", ""},
{WM_CURSOR_PAINT_BRUSH, "PAINT_BRUSH", 0, "Paint Brush", ""},
{WM_CURSOR_CROSSA, "PAINT_CROSS", 0, "Paint Cross", ""},
{WM_CURSOR_PAINT, "PAINT_CROSS", 0, "Paint Cross", ""},
{WM_CURSOR_DOT, "DOT", 0, "Dot Cursor", ""},
{WM_CURSOR_ERASER, "ERASER", 0, "Eraser", ""},
{WM_CURSOR_HAND, "HAND", 0, "Hand", ""},
{WM_CURSOR_EW_SCROLL, "SCROLL_X", 0, "Scroll-X", ""},

@ -107,9 +107,9 @@ static GHOST_TStandardCursor convert_to_ghost_standard_cursor(WMCursorType curs)
return GHOST_kStandardCursorUpArrow;
case WM_CURSOR_S_ARROW:
return GHOST_kStandardCursorDownArrow;
case WM_CURSOR_CROSSA:
case WM_CURSOR_PAINT:
return GHOST_kStandardCursorCrosshairA;
case WM_CURSOR_CROSSB:
case WM_CURSOR_DOT:
return GHOST_kStandardCursorCrosshairB;
case WM_CURSOR_CROSSC:
return GHOST_kStandardCursorCrosshairC;
@ -752,54 +752,54 @@ void wm_init_cursor_data(void)
BlenderCursor[WM_CURSOR_CROSS] = &CrossCursor;
END_CURSOR_BLOCK;
/****************** Crosshair Cursor A ************************/
/****************** Painting Cursor ************************/
BEGIN_CURSOR_BLOCK;
static char crossa_sbm[] = {
0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x1e, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00,
0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
static char paint_sbm[] = {
0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x8f, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00,
};
static char crossa_smsk[] = {
0x80, 0x00, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0x80,
0x00, 0x1e, 0x3c, 0x3f, 0x7e, 0x1e, 0x3c, 0x80, 0x00, 0xc0, 0x01,
0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0x80, 0x00, 0x00, 0x00,
static char paint_smsk[] = {
0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0x00, 0x00, 0x00,
0x00, 0x8f, 0x78, 0xcf, 0x79, 0x8f, 0x78, 0x00, 0x00, 0x00, 0x00,
0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0xc0, 0x01, 0x00, 0x00,
};
static char crossa_lbm[] = {
static char paint_lbm[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01,
0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80,
0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00,
0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xfe, 0x0f, 0xf0, 0x7f, 0xfe, 0x0f, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80,
0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xfe, 0x80, 0x01, 0x7f, 0xfe, 0x80, 0x01, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00,
0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00,
0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static char crossa_lmsk[] = {
static char paint_lmsk[] = {
0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03,
0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0,
0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00,
0xc0, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x0f, 0xf0, 0x7f,
0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xfe, 0x0f, 0xf0, 0x7f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0,
0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00,
0x03, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x80, 0x01, 0x7f,
0xff, 0xc1, 0x83, 0xff, 0xff, 0xc1, 0x83, 0xff, 0xfe, 0x80, 0x01, 0x7f, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00,
0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00,
0x00, 0xc0, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00,
};
static BCursor CrossCursorA = {
static BCursor PaintCursor = {
/* small */
crossa_sbm,
crossa_smsk,
paint_sbm,
paint_smsk,
16,
16,
7,
7,
/* big */
crossa_lbm,
crossa_lmsk,
paint_lbm,
paint_lmsk,
32,
32,
15,
@ -808,69 +808,69 @@ void wm_init_cursor_data(void)
false,
};
BlenderCursor[WM_CURSOR_CROSSA] = &CrossCursorA;
BlenderCursor[WM_CURSOR_PAINT] = &PaintCursor;
END_CURSOR_BLOCK;
/********************** Diagonal Cross Cursor B ***********************/
/********************** Dot Cursor ***********************/
BEGIN_CURSOR_BLOCK;
static char crossb_sbm[] = {
0x00, 0x00, 0x02, 0x40, 0x04, 0x20, 0x08, 0x10, 0x10, 0x08, 0x20,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x04,
0x10, 0x08, 0x08, 0x10, 0x04, 0x20, 0x02, 0x40, 0x00, 0x00,
static char dot_sbm[] = {
0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x8f, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00,
};
static char crossb_smsk[] = {
0x03, 0xc0, 0x07, 0xe0, 0x0e, 0x70, 0x1c, 0x38, 0x38, 0x1c, 0x70,
0x0e, 0x60, 0x06, 0x00, 0x00, 0x00, 0x00, 0x60, 0x06, 0x70, 0x0e,
0x38, 0x1c, 0x1c, 0x38, 0x0e, 0x70, 0x07, 0xe0, 0x03, 0xc0,
static char dot_smsk[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x80, 0x00, 0xc0, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static char crossb_lbm[] = {
0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x20, 0x08, 0x00, 0x00,
0x10, 0x10, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00, 0x04, 0x40, 0x00, 0x00, 0x02, 0x80, 0x00,
0x00, 0x01, 0x00, 0x01, 0x80, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x04, 0x20, 0x00, 0x00,
0x08, 0x10, 0x00, 0x00, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
static char dot_lbm[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x10, 0x08, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x04, 0x20, 0x00, 0x00, 0x02,
0x40, 0x00, 0x00, 0x01, 0x80, 0x00, 0x80, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x02, 0x20,
0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x10, 0x04, 0x00, 0x00, 0x20,
0x02, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00,
0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static char crossb_lmsk[] = {
0x07, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0xf8, 0x3e, 0x00, 0x00,
0x7c, 0x7c, 0x00, 0x00, 0x3e, 0xf8, 0x00, 0x00, 0x1f, 0xf0, 0x01, 0x80, 0x0f, 0xe0, 0x03,
0xc0, 0x07, 0xc0, 0x07, 0xe0, 0x03, 0x80, 0x0f, 0xf0, 0x01, 0x00, 0x1f, 0xf8, 0x00, 0x00,
0x3e, 0x7c, 0x00, 0x00, 0x3c, 0x3c, 0x00, 0x00, 0x38, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x1c,
0x00, 0x00, 0x3c, 0x3c, 0x00, 0x00, 0x3e, 0x7c, 0x00, 0x00, 0x1f, 0xf8, 0x00, 0x80, 0x0f,
0xf0, 0x01, 0xc0, 0x07, 0xe0, 0x03, 0xe0, 0x03, 0xc0, 0x07, 0xf0, 0x01, 0x80, 0x0f, 0xf8,
0x00, 0x00, 0x1f, 0x7c, 0x00, 0x00, 0x3e, 0x3e, 0x00, 0x00, 0x7c, 0x1f, 0x00, 0x00, 0xf8,
0x0f, 0x00, 0x00, 0xf0, 0x07, 0x00, 0x00, 0xe0,
static char dot_lmsk[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x00,
0x00, 0xe0, 0x01, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
static BCursor CrossCursorB = {
static BCursor DotCursor = {
/* small */
crossb_sbm,
crossb_smsk,
dot_sbm,
dot_smsk,
16,
16,
7,
7,
/* big */
crossb_lbm,
crossb_lmsk,
dot_lbm,
dot_lmsk,
32,
32,
15,
15,
14,
14,
/* don't invert color */
false,
};
BlenderCursor[WM_CURSOR_CROSSB] = &CrossCursorB;
BlenderCursor[WM_CURSOR_DOT] = &DotCursor;
END_CURSOR_BLOCK;
/************* Minimal Cross Cursor C ***************/
/************* Minimal Crosshair Cursor ***************/
BEGIN_CURSOR_BLOCK;
static char crossc_sbm[] = {
0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,

@ -37,8 +37,8 @@ typedef enum WMCursorType {
WM_CURSOR_HAND,
WM_CURSOR_CROSS,
WM_CURSOR_CROSSA,
WM_CURSOR_CROSSB,
WM_CURSOR_PAINT,
WM_CURSOR_DOT,
WM_CURSOR_CROSSC,
WM_CURSOR_KNIFE,