summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/gles2/shader_compiler_gles2.cpp1
-rw-r--r--drivers/gles2/shaders/material.glsl5
-rw-r--r--drivers/windows/dir_access_windows.cpp12
-rw-r--r--scene/gui/tree.cpp3
-rw-r--r--servers/visual/rasterizer.cpp2
-rw-r--r--servers/visual/shader_language.cpp1
-rw-r--r--tools/collada/collada.cpp6
-rw-r--r--tools/doc/doc_data.cpp5
-rw-r--r--tools/editor/io_plugins/editor_import_collada.cpp21
-rw-r--r--tools/editor/scenes_dock.cpp5
10 files changed, 35 insertions, 26 deletions
diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp
index 5457a869af..50b63e1aa0 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 870004fd10..44337e1197 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 aefec59ce0..df6cc6c5e2 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 9084983a4c..a39c61ecac 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 64247c1f2a..5e81bc960a 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 49420b51c0..ca219b13a4 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 f2e3a0e813..7f4f92e82d 100644
--- a/tools/collada/collada.cpp
+++ b/tools/collada/collada.cpp
@@ -444,9 +444,9 @@ Vector<String> Collada::_read_string_array(XMLParser& parser) {
// parse String data
String str = parser.get_node_data();
array=str.split_spaces();
- for(int i=0;i<array.size();i++) {
- print_line(itos(i)+": "+array[i]);
- }
+ //for(int i=0;i<array.size();i++) {
+ // print_line(itos(i)+": "+array[i]);
+ //}
}
else
if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END)
diff --git a/tools/doc/doc_data.cpp b/tools/doc/doc_data.cpp
index 319c1ad8b7..0bd21219bf 100644
--- a/tools/doc/doc_data.cpp
+++ b/tools/doc/doc_data.cpp
@@ -997,8 +997,8 @@ Error DocData::save(const String& p_path) {
_write_string(f,1,"</constants>");
- _write_string(f,1,"<theme_items>");
if (c.theme_properties.size()) {
+ _write_string(f,1,"<theme_items>");
for(int i=0;i<c.theme_properties.size();i++) {
@@ -1007,9 +1007,10 @@ Error DocData::save(const String& p_path) {
_write_string(f,2,"</theme_item>");
}
+ _write_string(f,1,"</theme_items>");
}
- _write_string(f,0,"</theme_items>");
+ _write_string(f,0,"</class>");
}
diff --git a/tools/editor/io_plugins/editor_import_collada.cpp b/tools/editor/io_plugins/editor_import_collada.cpp
index 405f8a01e8..e86356ebe9 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<int>&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;i<collada.state.animation_clips.size();i++) {
@@ -1743,7 +1742,7 @@ void ColladaImport::create_animations(bool p_make_tracks_in_all_bones) {
for(int i=0;i<collada.state.animation_tracks.size();i++) {
Collada::AnimationTrack &at = collada.state.animation_tracks[i];
- print_line("CHANNEL: "+at.target+" PARAM: "+at.param);
+ //print_line("CHANNEL: "+at.target+" PARAM: "+at.param);
if (!node_map.has(at.target)) {
print_line("Coudlnt find node: "+at.target);
continue;
@@ -1762,7 +1761,7 @@ void ColladaImport::create_animations(bool p_make_tracks_in_all_bones) {
}
create_animation(-1,p_make_tracks_in_all_bones);
- print_line("clipcount: "+itos(collada.state.animation_clips.size()));
+ //print_line("clipcount: "+itos(collada.state.animation_clips.size()));
for(int i=0;i<collada.state.animation_clips.size();i++)
create_animation(i,p_make_tracks_in_all_bones);
@@ -1774,10 +1773,10 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones
if (p_clip==-1) {
- print_line("default");
+ //print_line("default");
animation->set_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 34422b4d50..3f7c82d988 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);