1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-24 15:26:15 +00:00

support for 2D shadow casters

Added support for 2D shadow casters.

*DANGER* Shaders in CanvasItem CHANGED, if you are using shader in a
CanvasItem and pull this, you will lose them. Shaders now work through a
2D material system similar to 3D. If you don't want to lose the 2D
shader code, save the shader as a .shd, then create a material in
CanvasItem and re-assign the shader.
This commit is contained in:
Juan Linietsky
2015-03-02 00:54:10 -03:00
parent 0e732637d0
commit a1f715a4da
43 changed files with 2586 additions and 271 deletions

View File

@@ -1857,8 +1857,33 @@ void PropertyEditor::set_item_text(TreeItem *p_item, int p_type, const String& p
} else {
p_item->set_text(1,"<"+res->get_type()+">");
};
if (has_icon(res->get_type(),"EditorIcons")) {
p_item->set_icon(1,get_icon(res->get_type(),"EditorIcons"));
} else {
Dictionary d = p_item->get_metadata(0);
int hint=d.has("hint")?d["hint"].operator int():-1;
String hint_text=d.has("hint_text")?d["hint_text"]:"";
if (hint==PROPERTY_HINT_RESOURCE_TYPE) {
if (has_icon(hint_text,"EditorIcons")) {
p_item->set_icon(1,get_icon(hint_text,"EditorIcons"));
} else {
p_item->set_icon(1,get_icon("Object","EditorIcons"));
}
}
}
}
} break;
default: {};
}
@@ -2529,7 +2554,10 @@ void PropertyEditor::update_tree() {
item->set_editable( 1, !read_only );
item->add_button(1,get_icon("EditResource","EditorIcons"));
String type;
if (p.hint==PROPERTY_HINT_RESOURCE_TYPE)
type=p.hint_string;
bool notnil=false;
if (obj->get( p.name ).get_type() == Variant::NIL || obj->get( p.name ).operator RefPtr().is_null()) {
item->set_text(1,"<null>");
@@ -2553,12 +2581,18 @@ void PropertyEditor::update_tree() {
};
notnil=true;
if (has_icon(res->get_type(),"EditorIcons")) {
type=res->get_type();
}
}
if (p.hint==PROPERTY_HINT_RESOURCE_TYPE) {
if (type!=String()) {
if (type.find(",")!=-1)
type=type.get_slice(",",0);
//printf("prop %s , type %s\n",p.name.ascii().get_data(),p.hint_string.ascii().get_data());
if (has_icon(p.hint_string,"EditorIcons"))
item->set_icon( 0, get_icon(p.hint_string,"EditorIcons") );
if (has_icon(type,"EditorIcons"))
item->set_icon( 0, get_icon(type,"EditorIcons") );
else
item->set_icon( 0, get_icon("Object","EditorIcons") );
}