From e68c8ba24edebc83b86c2fa06f1e74d47737261c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 7 Jul 2019 13:43:42 +1000 Subject: Cleanup: rename gpencil chess -> checker Match existing texture name. --- .../draw/engines/gpencil/gpencil_draw_utils.c | 6 +++--- .../engines/gpencil/shaders/gpencil_fill_frag.glsl | 14 +++++++------- .../gpu/shaders/gpu_shader_gpencil_fill_frag.glsl | 20 ++++++++++---------- source/blender/makesdna/DNA_material_types.h | 2 +- source/blender/makesrna/intern/rna_material.c | 6 +++--- 5 files changed, 24 insertions(+), 24 deletions(-) (limited to 'source') diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index daa087c47a1..181d2efbabb 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -57,7 +57,7 @@ #define SOLID 0 #define GRADIENT 1 #define RADIAL 2 -#define CHESS 3 +#define CHECKER 3 #define TEXTURE 4 #define PATTERN 5 @@ -387,8 +387,8 @@ static DRWShadingGroup *gpencil_shgroup_fill_create(GPENCIL_Data *vedata, stl->shgroups[id].fill_style = RADIAL; } break; - case GP_STYLE_FILL_STYLE_CHESSBOARD: - stl->shgroups[id].fill_style = CHESS; + case GP_STYLE_FILL_STYLE_CHECKER: + stl->shgroups[id].fill_style = CHECKER; break; case GP_STYLE_FILL_STYLE_TEXTURE: if (gp_style->flag & GP_STYLE_FILL_PATTERN) { diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl index 87bf116ff89..64bb70f2a3f 100644 --- a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl +++ b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl @@ -30,7 +30,7 @@ uniform vec4 wire_color; #define SOLID 0 #define GRADIENT 1 #define RADIAL 2 -#define CHESS 3 +#define CHECKER 3 #define TEXTURE 4 #define PATTERN 5 @@ -103,7 +103,7 @@ void main() texture_read_as_srgb( myTexture, myTexturePremultiplied, clamp(rot_tex * texture_scale, 0.0, 1.0)); vec4 text_color = vec4(tmp_color[0], tmp_color[1], tmp_color[2], tmp_color[3] * texture_opacity); - vec4 chesscolor; + vec4 checker_color; /* wireframe with x-ray discard */ if ((viewport_xray == 1) && (shading_type[0] == OB_WIRE)) { @@ -152,18 +152,18 @@ void main() texture_flip, fragColor); } - /* chessboard */ - if (fill_type == CHESS) { + /* Checkerboard */ + if (fill_type == CHECKER) { vec2 pos = rot / pattern_gridsize; if ((fract(pos.x) < 0.5 && fract(pos.y) < 0.5) || (fract(pos.x) > 0.5 && fract(pos.y) > 0.5)) { - chesscolor = (texture_flip == 0) ? finalColor : color2; + checker_color = (texture_flip == 0) ? finalColor : color2; } else { - chesscolor = (texture_flip == 0) ? color2 : finalColor; + checker_color = (texture_flip == 0) ? color2 : finalColor; } /* mix with texture */ - fragColor = (texture_mix == 1) ? mix(chesscolor, text_color, mix_factor) : chesscolor; + fragColor = (texture_mix == 1) ? mix(checker_color, text_color, mix_factor) : checker_color; fragColor.a *= layer_opacity; } /* texture */ diff --git a/source/blender/gpu/shaders/gpu_shader_gpencil_fill_frag.glsl b/source/blender/gpu/shaders/gpu_shader_gpencil_fill_frag.glsl index 946fc752e17..56c9a2bd339 100644 --- a/source/blender/gpu/shaders/gpu_shader_gpencil_fill_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_gpencil_fill_frag.glsl @@ -22,7 +22,7 @@ uniform sampler2D myTexture; #define SOLID 0 #define GRADIENT 1 #define RADIAL 2 -#define CHESS 3 +#define CHECKER 3 #define TEXTURE 4 in vec2 texCoord_interp; @@ -104,7 +104,7 @@ void main() vec2 rot_tex = (matrot_tex * (texCoord_interp - t_center)) + t_center + t_offset; vec4 tmp_color = texture2D(myTexture, rot_tex * t_scale); vec4 text_color = vec4(tmp_color[0], tmp_color[1], tmp_color[2], tmp_color[3] * t_opacity); - vec4 chesscolor; + vec4 checker_color; /* solid fill */ if (fill_type == SOLID) { @@ -144,32 +144,32 @@ void main() } set_color(color, color2, text_color, mix_factor, intensity, t_mix, t_flip, fragColor); } - /* chessboard */ - if (fill_type == CHESS) { + /* Checkerboard */ + if (fill_type == CHECKER) { vec2 pos = rot / g_boxsize; if ((fract(pos.x) < 0.5 && fract(pos.y) < 0.5) || (fract(pos.x) > 0.5 && fract(pos.y) > 0.5)) { if (t_flip == 0) { - chesscolor = color; + checker_color = color; } else { - chesscolor = color2; + checker_color = color2; } } else { if (t_flip == 0) { - chesscolor = color2; + checker_color = color2; } else { - chesscolor = color; + checker_color = color; } } /* mix with texture */ if (t_mix == 1) { - fragColor = mix(chesscolor, text_color, mix_factor); + fragColor = mix(checker_color, text_color, mix_factor); } else { - fragColor = chesscolor; + fragColor = checker_color; } } /* texture */ diff --git a/source/blender/makesdna/DNA_material_types.h b/source/blender/makesdna/DNA_material_types.h index d65a4896758..42308f54d7a 100644 --- a/source/blender/makesdna/DNA_material_types.h +++ b/source/blender/makesdna/DNA_material_types.h @@ -338,7 +338,7 @@ enum { enum { GP_STYLE_FILL_STYLE_SOLID = 0, GP_STYLE_FILL_STYLE_GRADIENT, - GP_STYLE_FILL_STYLE_CHESSBOARD, + GP_STYLE_FILL_STYLE_CHECKER, GP_STYLE_FILL_STYLE_TEXTURE, }; diff --git a/source/blender/makesrna/intern/rna_material.c b/source/blender/makesrna/intern/rna_material.c index 3ff2e884d92..28989d1dd5f 100644 --- a/source/blender/makesrna/intern/rna_material.c +++ b/source/blender/makesrna/intern/rna_material.c @@ -433,11 +433,11 @@ static void rna_def_material_greasepencil(BlenderRNA *brna) static EnumPropertyItem fill_style_items[] = { {GP_STYLE_FILL_STYLE_SOLID, "SOLID", 0, "Solid", "Fill area with solid color"}, {GP_STYLE_FILL_STYLE_GRADIENT, "GRADIENT", 0, "Gradient", "Fill area with gradient color"}, - {GP_STYLE_FILL_STYLE_CHESSBOARD, - "CHESSBOARD", + {GP_STYLE_FILL_STYLE_CHECKER, + "CHECKER", 0, "Checker Board", - "Fill area with chessboard pattern"}, + "Fill area with checkerboard pattern"}, {GP_STYLE_FILL_STYLE_TEXTURE, "TEXTURE", 0, "Texture", "Fill area with image texture"}, {0, NULL, 0, NULL, NULL}, }; -- cgit v1.2.3