mirror of
https://github.com/godotengine/godot.git
synced 2024-11-10 14:12:51 +00:00
Fixes
-=-=- -Fixed normalmap depth parameter -Fixes to DirAccess on Windows -Double click on resource dock will open them -Fixes to doc generator (should make github wiki on class list more up to date)
This commit is contained in:
parent
94e35ef316
commit
cd218b8c09
@ -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";
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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},
|
||||
|
@ -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)
|
||||
|
@ -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>");
|
||||
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user