diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp index 5457a869af9..50b63e1aa0e 100644 --- a/drivers/gles2/shader_compiler_gles2.cpp +++ b/drivers/gles2/shader_compiler_gles2.cpp @@ -678,6 +678,7 @@ ShaderCompilerGLES2::ShaderCompilerGLES2() { mode_replace_table[1]["TANGENT"]="tangent"; mode_replace_table[1]["BINORMAL"]="binormal"; mode_replace_table[1]["NORMALMAP"]="normalmap"; + mode_replace_table[1]["NORMALMAP_DEPTH"]="normaldepth"; mode_replace_table[1]["VAR1"]="var1_interp"; mode_replace_table[1]["VAR2"]="var2_interp"; mode_replace_table[1]["UV"]="uv"; diff --git a/drivers/gles2/shaders/material.glsl b/drivers/gles2/shaders/material.glsl index 870004fd106..44337e11974 100644 --- a/drivers/gles2/shaders/material.glsl +++ b/drivers/gles2/shaders/material.glsl @@ -824,6 +824,8 @@ void main() { vec3 normalmap = vec3(0.0); #endif + float normaldepth=1.0; + #if defined(ENABLE_DISCARD) @@ -839,7 +841,8 @@ FRAGMENT_SHADER_CODE #if defined(ENABLE_NORMALMAP) - normal = normalize( tangent_interp * normalmap.x + binormal_interp * normalmap.y + normal_interp * normalmap.z ) * side; + normal = normalize( mix(normal_interp,tangent_interp * normalmap.x + binormal_interp * normalmap.y + normal_interp * normalmap.z,normaldepth) ) * side; + #endif #if defined(ENABLE_DISCARD) diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index aefec59ce0f..df6cc6c5e2e 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -189,10 +189,10 @@ Error DirAccessWindows::change_dir(String p_dir) { current_dir=real_current_dir_name; // TODO, utf8 parser current_dir=current_dir.replace("\\","/"); - } else { + } //else { SetCurrentDirectoryW(prev_dir.c_str()); - } + //} return worked?OK:ERR_INVALID_PARAMETER; } else { @@ -210,10 +210,10 @@ Error DirAccessWindows::change_dir(String p_dir) { current_dir=real_current_dir_name; // TODO, utf8 parser current_dir=current_dir.replace("\\","/"); - } else { + }// else { SetCurrentDirectoryA(prev_dir.ascii().get_data()); - } + //} return worked?OK:ERR_INVALID_PARAMETER; @@ -352,7 +352,7 @@ bool DirAccessWindows::dir_exists(String p_dir) { DWORD fileAttr; fileAttr = GetFileAttributesExW(p_dir.c_str(), GetFileExInfoStandard, &fileInfo); - if (0xFFFFFFFF == fileAttr) + if (0 == fileAttr) return false; return (fileAttr&FILE_ATTRIBUTE_DIRECTORY); @@ -361,7 +361,7 @@ bool DirAccessWindows::dir_exists(String p_dir) { DWORD fileAttr; fileAttr = GetFileAttributesExA(p_dir.ascii().get_data(), GetFileExInfoStandard, &fileInfo); - if (0xFFFFFFFF == fileAttr) + if (0 == fileAttr) return false; return (fileAttr&FILE_ATTRIBUTE_DIRECTORY); diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 9084983a4c0..a39c61ecacd 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -1438,8 +1438,7 @@ int Tree::propagate_mouse_event(const Point2i &p_pos,int x_ofs,int y_ofs,bool p_ if (p_button==BUTTON_LEFT) { /* process selection */ - if (p_doubleclick && (!c.editable || c.mode==TreeItem::CELL_MODE_CUSTOM || c.mode==TreeItem::CELL_MODE_ICON)) { - + if (p_doubleclick && (!c.editable || c.mode==TreeItem::CELL_MODE_CUSTOM || c.mode==TreeItem::CELL_MODE_ICON || c.mode==TreeItem::CELL_MODE_CHECK)) { emit_signal("item_activated"); return -1; diff --git a/servers/visual/rasterizer.cpp b/servers/visual/rasterizer.cpp index 64247c1f2af..5e81bc960a9 100644 --- a/servers/visual/rasterizer.cpp +++ b/servers/visual/rasterizer.cpp @@ -102,6 +102,8 @@ RID Rasterizer::_create_shader(const FixedMaterialShaderKey& p_key) { } else { scode+="NORMALMAP=tex( fmp_normal_tex,"+uv_str+").xyz * vec3(2.0,2.0,1.0) - vec3(1.0,1.0,0.0);\n"; } + scode+="NORMALMAP_DEPTH=fmp_normal;\n"; + code+=scode; } diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 49420b51c05..ca219b13a49 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -1043,6 +1043,7 @@ const ShaderLanguage::BuiltinsDef ShaderLanguage::fragment_builtins_defs[]={ { "TANGENT", TYPE_VEC3}, { "BINORMAL", TYPE_VEC3}, { "NORMALMAP", TYPE_VEC3}, + { "NORMALMAP_DEPTH", TYPE_FLOAT}, { "UV", TYPE_VEC2}, { "UV2", TYPE_VEC2}, { "COLOR", TYPE_VEC4}, diff --git a/tools/collada/collada.cpp b/tools/collada/collada.cpp index f2e3a0e8133..7f4f92e82d8 100644 --- a/tools/collada/collada.cpp +++ b/tools/collada/collada.cpp @@ -444,9 +444,9 @@ Vector Collada::_read_string_array(XMLParser& parser) { // parse String data String str = parser.get_node_data(); array=str.split_spaces(); - for(int i=0;i"); - _write_string(f,1,""); if (c.theme_properties.size()) { + _write_string(f,1,""); for(int i=0;i"); } + _write_string(f,1,""); } - _write_string(f,0,""); + _write_string(f,0,""); } diff --git a/tools/editor/io_plugins/editor_import_collada.cpp b/tools/editor/io_plugins/editor_import_collada.cpp index 405f8a01e84..e86356ebe9d 100644 --- a/tools/editor/io_plugins/editor_import_collada.cpp +++ b/tools/editor/io_plugins/editor_import_collada.cpp @@ -1675,11 +1675,11 @@ void ColladaImport::_fix_param_animation_tracks() { source=skin.base; } else if (collada.state.morph_controller_data_map.has(source)) { - print_line("has morph"); + const Collada::MorphControllerData& morph = collada.state.morph_controller_data_map[source]; if (morph.targets.has("MORPH_WEIGHT") && morph.targets.has("MORPH_TARGET")) { - print_line("weight and target"); + String weights = morph.targets["MORPH_WEIGHT"]; String targets = morph.targets["MORPH_TARGET"]; @@ -1688,7 +1688,7 @@ void ColladaImport::_fix_param_animation_tracks() { if (morph.sources.has(targets) && morph.sources.has(weights)) { const Collada::MorphControllerData::Source &weight_src=morph.sources[weights]; const Collada::MorphControllerData::Source &target_src=morph.sources[targets]; - print_line("sources OK"); + ERR_FAIL_COND(weight_src.array.size() != target_src.sarray.size()); @@ -1697,7 +1697,6 @@ void ColladaImport::_fix_param_animation_tracks() { String track_name = weights+"("+itos(i)+")"; String mesh_name = target_src.sarray[i]; if (collada.state.mesh_name_map.has(mesh_name) && collada.state.referenced_tracks.has(track_name)) { - print_line("refe tracks"); const Vector&rt = collada.state.referenced_tracks[track_name]; @@ -1730,7 +1729,7 @@ void ColladaImport::_fix_param_animation_tracks() { void ColladaImport::create_animations(bool p_make_tracks_in_all_bones) { - print_line("-=-=-=-=-PRE CA"); + _fix_param_animation_tracks(); for(int i=0;iset_name("default"); } else { - print_line("clip name: "+collada.state.animation_clips[p_clip].name); + //print_line("clip name: "+collada.state.animation_clips[p_clip].name); animation->set_name(collada.state.animation_clips[p_clip].name); } @@ -1849,7 +1848,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones base_snapshots.push_back(f); f+=snapshot_interval; } - print_line("anim len: "+rtos(anim_length)); + //print_line("anim len: "+rtos(anim_length)); animation->set_length(anim_length); bool tracks_found=false; @@ -1874,7 +1873,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones Collada::Node *cn = collada.state.scene_map[E->get()]; if (cn->ignore_anim) { - print_line("warning, ignoring animation on node: "+path); + //print_line("warning, ignoring animation on node: "+path); continue; } diff --git a/tools/editor/scenes_dock.cpp b/tools/editor/scenes_dock.cpp index 34422b4d50a..3f7c82d9883 100644 --- a/tools/editor/scenes_dock.cpp +++ b/tools/editor/scenes_dock.cpp @@ -200,9 +200,11 @@ void ScenesDock::_instance_pressed() { } void ScenesDock::_open_pressed(){ + TreeItem *sel = tree->get_selected(); - if (!sel) + if (!sel) { return; + } String path = sel->get_metadata(0); if (ResourceLoader::get_resource_type(path)=="PackedScene") { @@ -300,6 +302,7 @@ ScenesDock::ScenesDock(EditorNode *p_editor) { tree->set_v_size_flags(SIZE_EXPAND_FILL); tree->connect("item_edited",this,"_favorite_toggled"); + tree->connect("item_activated",this,"_open_pressed"); timer = memnew( Timer ); timer->set_one_shot(true);