diff options
-rw-r--r-- | core/io/marshalls.cpp | 7 | ||||
-rw-r--r-- | core/script_debugger_remote.cpp | 2 | ||||
-rw-r--r-- | drivers/gles3/rasterizer_scene_gles3.cpp | 10 | ||||
-rw-r--r-- | editor/editor_run.cpp | 4 | ||||
-rw-r--r-- | editor/editor_settings.cpp | 5 | ||||
-rw-r--r-- | main/main.cpp | 11 | ||||
-rw-r--r-- | scene/main/viewport.cpp | 4 | ||||
-rw-r--r-- | servers/visual/shader_language.cpp | 8 |
8 files changed, 39 insertions, 12 deletions
diff --git a/core/io/marshalls.cpp b/core/io/marshalls.cpp index c5d59f786d..e701a89c78 100644 --- a/core/io/marshalls.cpp +++ b/core/io/marshalls.cpp @@ -807,11 +807,16 @@ static void _encode_string(const String &p_string, uint8_t *&buf, int &r_len) { encode_uint32(utf8.length(), buf); buf += 4; copymem(buf, utf8.get_data(), utf8.length()); + buf += utf8.length(); } r_len += 4 + utf8.length(); - while (r_len % 4) + while (r_len % 4) { r_len++; //pad + if (buf) { + buf++; + } + } } Error encode_variant(const Variant &p_variant, uint8_t *r_buffer, int &r_len, bool p_object_as_id) { diff --git a/core/script_debugger_remote.cpp b/core/script_debugger_remote.cpp index 25f0044cc6..9e4f4380c9 100644 --- a/core/script_debugger_remote.cpp +++ b/core/script_debugger_remote.cpp @@ -142,8 +142,6 @@ void ScriptDebuggerRemote::debug(ScriptLanguage *p_script, bool p_can_continue) ERR_FAIL(); } - OS::get_singleton()->enable_for_stealing_focus(ProjectSettings::get_singleton()->get("editor_pid")); - packet_peer_stream->put_var("debug_enter"); packet_peer_stream->put_var(2); packet_peer_stream->put_var(p_can_continue); diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp index 6e8303563f..52c7327baf 100644 --- a/drivers/gles3/rasterizer_scene_gles3.cpp +++ b/drivers/gles3/rasterizer_scene_gles3.cpp @@ -2309,6 +2309,16 @@ void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::G e->sort_key |= SORT_KEY_VERTEX_LIT_FLAG; } + + if (!shadow && has_alpha && p_material->shader->spatial.depth_draw_mode == RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) { + //depth prepass for alpha + RenderList::Element *eo = render_list.add_element(); + + eo->instance = e->instance; + eo->geometry = e->geometry; + eo->material = e->material; + eo->sort_key = e->sort_key; + } } void RasterizerSceneGLES3::_draw_sky(RasterizerStorageGLES3::Sky *p_sky, const CameraMatrix &p_projection, const Transform &p_transform, bool p_vflip, float p_scale, float p_energy) { diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp index e1ef20255b..08f119aff8 100644 --- a/editor/editor_run.cpp +++ b/editor/editor_run.cpp @@ -54,8 +54,8 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li args.push_back(remote_host + ":" + String::num(remote_port)); } - args.push_back("-epid"); - args.push_back(String::num(OS::get_singleton()->get_process_id())); + args.push_back("-allow_focus_steal_pid"); + args.push_back(itos(OS::get_singleton()->get_process_id())); if (debug_collisions) { args.push_back("-debugcol"); diff --git a/editor/editor_settings.cpp b/editor/editor_settings.cpp index 65eb341b9f..46135e80ae 100644 --- a/editor/editor_settings.cpp +++ b/editor/editor_settings.cpp @@ -724,11 +724,10 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) { set("filesystem/import/pvrtc_texture_tool", ""); #ifdef WINDOWS_ENABLED - hints["filesystem/import/pvrtc_texture_tool"] = PropertyInfo(Variant::STRING, "import/pvrtc_texture_tool", PROPERTY_HINT_GLOBAL_FILE, "*.exe"); + hints["filesystem/import/pvrtc_texture_tool"] = PropertyInfo(Variant::STRING, "filesystem/import/pvrtc_texture_tool", PROPERTY_HINT_GLOBAL_FILE, "*.exe"); #else - hints["import/pvrtc_texture_tool"] = PropertyInfo(Variant::STRING, "import/pvrtc_texture_tool", PROPERTY_HINT_GLOBAL_FILE, ""); + hints["filesystem/import/pvrtc_texture_tool"] = PropertyInfo(Variant::STRING, "filesystem/import/pvrtc_texture_tool", PROPERTY_HINT_GLOBAL_FILE, ""); #endif - // TODO: Rename to "filesystem/import/pvrtc_fast_conversion" to match other names? set("filesystem/import/pvrtc_fast_conversion", false); set("run/auto_save/save_before_running", true); diff --git a/main/main.cpp b/main/main.cpp index 5d4c26ea89..562388af88 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -111,6 +111,8 @@ static int init_screen = -1; static bool use_vsync = true; static bool editor = false; +static OS::ProcessID allow_focus_steal_pid = 0; + static String unescape_cmdline(const String &p_str) { return p_str.replace("%20", " "); @@ -547,11 +549,10 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph } else { goto error; } - } else if (I->get() == "-epid") { + } else if (I->get() == "-allow_focus_steal_pid") { if (I->next()) { - int editor_pid = I->next()->get().to_int(); - ProjectSettings::get_singleton()->set("editor_pid", editor_pid); + allow_focus_steal_pid = I->next()->get().to_int64(); N = I->next()->next(); } else { goto error; @@ -1001,6 +1002,10 @@ Error Main::setup2() { #endif + if (allow_focus_steal_pid) { + OS::get_singleton()->enable_for_stealing_focus(allow_focus_steal_pid); + } + MAIN_PRINT("Main: Load Scripts, Modules, Drivers"); register_module_types(); diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 7148cda5c4..e19e069282 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1456,6 +1456,10 @@ void Viewport::_gui_show_tooltip() { gui.tooltip_popup = NULL; } + if (!gui.tooltip) { + return; + } + Control *rp = gui.tooltip->get_root_parent_control(); if (!rp) return; diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index f8350ce0f8..3e0a1a6f45 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -1931,7 +1931,8 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p } if (!fail) { - p_func->return_cache = pfunc->return_type; + if (r_ret_type) + *r_ret_type = pfunc->return_type; return true; } } @@ -3150,6 +3151,11 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Dat assign->op = OP_ASSIGN; p_block->statements.push_back(assign); tk = _get_token(); + + if (!_validate_operator(assign)) { + _set_error("Invalid assignment of '" + get_datatype_name(n->get_datatype()) + "' to '" + get_datatype_name(type) + "'"); + return ERR_PARSE_ERROR; + } } if (tk.type == TK_COMMA) { |