diff options
-rw-r--r-- | drivers/gles2/shaders/stdlib.glsl | 28 | ||||
-rw-r--r-- | editor/plugins/visual_shader_editor_plugin.cpp | 4 | ||||
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 1 | ||||
-rw-r--r-- | modules/mono/glue/Managed/Files/Color.cs | 27 | ||||
-rw-r--r-- | scene/gui/rich_text_label.cpp | 6 |
5 files changed, 36 insertions, 30 deletions
diff --git a/drivers/gles2/shaders/stdlib.glsl b/drivers/gles2/shaders/stdlib.glsl index ca37611433..96421fcb4a 100644 --- a/drivers/gles2/shaders/stdlib.glsl +++ b/drivers/gles2/shaders/stdlib.glsl @@ -36,7 +36,7 @@ highp vec4 texel2DFetch(highp sampler2D tex, ivec2 size, ivec2 coord) { return texture2DLod(tex, vec2(x_coord, y_coord), 0.0); } -#ifdef SINH_USED +#if defined(SINH_USED) highp float sinh(highp float x) { return 0.5 * (exp(x) - exp(-x)); @@ -56,7 +56,7 @@ highp vec4 sinh(highp vec4 x) { #endif -#ifdef COSH_USED +#if defined(COSH_USED) highp float cosh(highp float x) { return 0.5 * (exp(x) + exp(-x)); @@ -76,7 +76,7 @@ highp vec4 cosh(highp vec4 x) { #endif -#ifdef TANH_USED +#if defined(TANH_USED) highp float tanh(highp float x) { highp float exp2x = exp(2.0 * x); @@ -106,7 +106,7 @@ highp vec4 tanh(highp vec4 x) { #endif -#ifdef ASINH_USED +#if defined(ASINH_USED) highp float asinh(highp float x) { return sign(x) * log(abs(x) + sqrt(1.0 + x * x)); @@ -126,7 +126,7 @@ highp vec4 asinh(highp vec4 x) { #endif -#ifdef ACOSH_USED +#if defined(ACOSH_USED) highp float acosh(highp float x) { return log(x + sqrt(x * x - 1.0)); @@ -146,7 +146,7 @@ highp vec4 acosh(highp vec4 x) { #endif -#ifdef ATANH_USED +#if defined(ATANH_USED) highp float atanh(highp float x) { return 0.5 * log((1.0 + x) / (1.0 - x)); @@ -166,7 +166,7 @@ highp vec4 atanh(highp vec4 x) { #endif -#ifdef ROUND_USED +#if defined(ROUND_USED) highp float round(highp float x) { return floor(x + 0.5); @@ -186,7 +186,7 @@ highp vec4 round(highp vec4 x) { #endif -#ifdef ROUND_EVEN_USED +#if defined(ROUND_EVEN_USED) highp float roundEven(highp float x) { highp float t = x + 0.5; @@ -216,7 +216,7 @@ highp vec4 roundEven(highp vec4 x) { #endif -#ifdef IS_INF_USED +#if defined(IS_INF_USED) bool isinf(highp float x) { return (2 * x == x) && (x != 0); @@ -236,7 +236,7 @@ bvec4 isinf(highp vec4 x) { #endif -#ifdef IS_NAN_USED +#if defined(IS_NAN_USED) bool isnan(highp float x) { return x != x; @@ -256,7 +256,7 @@ bvec4 isnan(highp vec4 x) { #endif -#ifdef TRUNC_USED +#if defined(TRUNC_USED) highp float trunc(highp float x) { return x < 0 ? -floor(-x) : floor(x); @@ -276,7 +276,7 @@ highp vec4 trunc(highp vec4 x) { #endif -#ifdef DETERMINANT_USED +#if defined(DETERMINANT_USED) highp float determinant(highp mat2 m) { return m[0].x * m[1].y - m[1].x * m[0].y; @@ -301,7 +301,7 @@ highp float determinant(highp mat4 m) { #ifndef USE_GLES_OVER_GL -#ifdef TRANSPOSE_USED +#if defined(TRANSPOSE_USED) highp mat2 transpose(highp mat2 m) { return mat2( @@ -326,7 +326,7 @@ highp mat4 transpose(highp mat4 m) { vec4(m[0].w, m[1].w, m[2].w, m[3].w)); } -#ifdef OUTER_PRODUCT_USED +#if defined(OUTER_PRODUCT_USED) highp mat2 outerProduct(highp vec2 c, highp vec2 r) { return mat2(c * r.x, c * r.y); diff --git a/editor/plugins/visual_shader_editor_plugin.cpp b/editor/plugins/visual_shader_editor_plugin.cpp index 4376e3e68f..4f7b9f9815 100644 --- a/editor/plugins/visual_shader_editor_plugin.cpp +++ b/editor/plugins/visual_shader_editor_plugin.cpp @@ -604,6 +604,10 @@ void VisualShaderEditor::_update_graph() { } } + if (!is_group) { + hb->add_spacer(); + } + if (valid_right) { if (is_group) { Button *remove_btn = memnew(Button); diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index f006d50a83..357e9c9615 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -3487,6 +3487,7 @@ void GDScriptParser::_parse_class(ClassNode *p_class) { } break; case GDScriptTokenizer::TK_PR_CLASS_NAME: { + _mark_line_as_safe(tokenizer->get_token_line()); if (p_class->owner) { _set_error("'class_name' is only valid for the main class namespace."); return; diff --git a/modules/mono/glue/Managed/Files/Color.cs b/modules/mono/glue/Managed/Files/Color.cs index 84ff19fc54..da57a7f9ae 100644 --- a/modules/mono/glue/Managed/Files/Color.cs +++ b/modules/mono/glue/Managed/Files/Color.cs @@ -375,7 +375,7 @@ namespace Godot return c; } - public string ToHtml(bool include_alpha = true) + public string ToHtml(bool includeAlpha = true) { var txt = string.Empty; @@ -383,7 +383,7 @@ namespace Godot txt += ToHex32(g); txt += ToHex32(b); - if (include_alpha) + if (includeAlpha) txt = ToHex32(a) + txt; return txt; @@ -465,13 +465,13 @@ namespace Godot for (int i = 0; i < 2; i++) { - char[] c = { (char)0, (char)0 }; + char c; int lv = v & 0xF; if (lv < 10) - c[0] = (char)('0' + lv); + c = (char)('0' + lv); else - c[0] = (char)('a' + lv - 10); + c = (char)('a' + lv - 10); v >>= 4; ret = c + ret; @@ -490,12 +490,17 @@ namespace Godot bool alpha; - if (color.Length == 8) - alpha = true; - else if (color.Length == 6) - alpha = false; - else - return false; + switch (color.Length) + { + case 8: + alpha = true; + break; + case 6: + alpha = false; + break; + default: + return false; + } if (alpha) { diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp index d6c0981ebc..8223ea6d1e 100644 --- a/scene/gui/rich_text_label.cpp +++ b/scene/gui/rich_text_label.cpp @@ -821,11 +821,7 @@ void RichTextLabel::_notification(int p_what) { } break; case NOTIFICATION_THEME_CHANGED: { - if (is_inside_tree() && use_bbcode) { - parse_bbcode(bbcode); - //first_invalid_line=0; //invalidate ALL - //update(); - } + update(); } break; case NOTIFICATION_DRAW: { |