summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/animation.cpp5
-rw-r--r--scene/resources/default_theme/default_theme.cpp6
-rw-r--r--scene/resources/dynamic_font.cpp4
-rw-r--r--scene/resources/dynamic_font_stb.cpp2
-rw-r--r--scene/resources/font.cpp6
-rw-r--r--scene/resources/packed_scene.cpp20
-rw-r--r--scene/resources/scene_format_text.cpp22
-rw-r--r--scene/resources/scene_format_text.h2
-rw-r--r--scene/resources/shader_graph.cpp2
-rw-r--r--scene/resources/style_box.cpp4
-rw-r--r--scene/resources/surface_tool.cpp8
-rw-r--r--scene/resources/texture.cpp3
-rw-r--r--scene/resources/theme.cpp10
-rw-r--r--scene/resources/tile_set.cpp19
-rw-r--r--scene/resources/tile_set.h7
15 files changed, 75 insertions, 45 deletions
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp
index 1fbb149bf3..5b9baa6a67 100644
--- a/scene/resources/animation.cpp
+++ b/scene/resources/animation.cpp
@@ -2005,11 +2005,6 @@ void Animation::_transform_track_optimize(int p_idx,float p_alowed_linear_err,fl
prev_erased=false;
norm=Vector3();
}
-
-
-
- // print_line(itos(i)+" could be eliminated: "+rtos(tr));
- //}
}
diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp
index 3c6e65bf41..50c6a6c725 100644
--- a/scene/resources/default_theme/default_theme.cpp
+++ b/scene/resources/default_theme/default_theme.cpp
@@ -125,7 +125,7 @@ static Ref<Texture> make_icon(T p_src) {
static Ref<Shader> make_shader(const char*vertex_code,const char*fragment_code,const char*lighting_code) {
Ref<Shader> shader = (memnew( Shader(Shader::MODE_CANVAS_ITEM) ));
-// shader->set_code(vertex_code, fragment_code, lighting_code);
+ //shader->set_code(vertex_code, fragment_code, lighting_code);
return shader;
}
@@ -934,12 +934,12 @@ void fill_default_theme(Ref<Theme>& t, const Ref<Font> & default_font, const Ref
t->set_stylebox("focus","VButtonArray", focus );
- // ReferenceFrame
+ // ReferenceRect
Ref<StyleBoxTexture> ttnc = make_stylebox( full_panel_bg_png,8,8,8,8);
ttnc->set_draw_center(false);
- t->set_stylebox("border","ReferenceFrame", make_stylebox( reference_border_png,4,4,4,4) );
+ t->set_stylebox("border","ReferenceRect", make_stylebox( reference_border_png,4,4,4,4) );
t->set_stylebox("panelnc","Panel", ttnc );
t->set_stylebox("panelf","Panel", tc_sb );
diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp
index 3aadbdbe19..63a7829d26 100644
--- a/scene/resources/dynamic_font.cpp
+++ b/scene/resources/dynamic_font.cpp
@@ -511,7 +511,7 @@ void DynamicFontAtSize::_update_char(CharType p_char) {
break;
}
-// print_line("CHAR: "+String::chr(p_char)+" TEX INDEX: "+itos(tex_index)+" X: "+itos(tex_x)+" Y: "+itos(tex_y));
+ //print_line("CHAR: "+String::chr(p_char)+" TEX INDEX: "+itos(tex_index)+" X: "+itos(tex_x)+" Y: "+itos(tex_y));
if (tex_index==-1) {
//could not find texture to fit, create one
@@ -961,7 +961,7 @@ bool ResourceFormatLoaderDynamicFont::handles_type(const String& p_type) const {
String ResourceFormatLoaderDynamicFont::get_resource_type(const String &p_path) const {
- String el = p_path.extension().to_lower();
+ String el = p_path.get_extension().to_lower();
if (el=="ttf" || el=="otf")
return "DynamicFontData";
return "";
diff --git a/scene/resources/dynamic_font_stb.cpp b/scene/resources/dynamic_font_stb.cpp
index a25667d85a..cbbca49f0f 100644
--- a/scene/resources/dynamic_font_stb.cpp
+++ b/scene/resources/dynamic_font_stb.cpp
@@ -260,7 +260,7 @@ void DynamicFontAtSize::_update_char(CharType p_char) {
break;
}
-// print_line("CHAR: "+String::chr(p_char)+" TEX INDEX: "+itos(tex_index)+" X: "+itos(tex_x)+" Y: "+itos(tex_y));
+ //print_line("CHAR: "+String::chr(p_char)+" TEX INDEX: "+itos(tex_index)+" X: "+itos(tex_x)+" Y: "+itos(tex_y));
if (tex_index==-1) {
//could not find texture to fit, create one
diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp
index 3373478336..b1d0611f48 100644
--- a/scene/resources/font.cpp
+++ b/scene/resources/font.cpp
@@ -252,8 +252,10 @@ Error BitmapFont::create_from_fnt(const String& p_string) {
if (keys.has("face"))
set_name(keys["face"]);
- //if (keys.has("size"))
- // font->set_height(keys["size"].to_int());
+ /*
+ if (keys.has("size"))
+ font->set_height(keys["size"].to_int());
+ */
} else if (type=="common") {
diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp
index 625cc6a596..5cefca348b 100644
--- a/scene/resources/packed_scene.cpp
+++ b/scene/resources/packed_scene.cpp
@@ -529,9 +529,11 @@ Error SceneState::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<S
bool isdefault = ((E->get().usage & PROPERTY_USAGE_STORE_IF_NONZERO) && value.is_zero()) || ((E->get().usage & PROPERTY_USAGE_STORE_IF_NONONE) && value.is_one());
-// if (nd.instance<0 && ((E->get().usage & PROPERTY_USAGE_STORE_IF_NONZERO) && value.is_zero()) || ((E->get().usage & PROPERTY_USAGE_STORE_IF_NONONE) && value.is_one())) {
-// continue;
-// }
+ /*
+ if (nd.instance<0 && ((E->get().usage & PROPERTY_USAGE_STORE_IF_NONZERO) && value.is_zero()) || ((E->get().usage & PROPERTY_USAGE_STORE_IF_NONONE) && value.is_one())) {
+ continue;
+ }
+ */
@@ -614,8 +616,10 @@ Error SceneState::_parse_node(Node *p_owner,Node *p_node,int p_parent_idx, Map<S
if (!gi.persistent)
continue;
-// if (instance_state_node>=0 && instance_state->is_node_in_group(instance_state_node,gi.name))
-// continue; //group was instanced, don't add here
+ /*
+ if (instance_state_node>=0 && instance_state->is_node_in_group(instance_state_node,gi.name))
+ continue; //group was instanced, don't add here
+ */
bool skip=false;
for (List<PackState>::Element *F=pack_state_stack.front();F;F=F->next()) {
@@ -1166,7 +1170,7 @@ void SceneState::set_bundled_scene(const Dictionary& d) {
ERR_FAIL_COND( !d.has("nodes"));
ERR_FAIL_COND( !d.has("conn_count"));
ERR_FAIL_COND( !d.has("conns"));
-// ERR_FAIL_COND( !d.has("path"));
+ //ERR_FAIL_COND( !d.has("path"));
int version=1;
if (d.has("version"))
@@ -1277,7 +1281,7 @@ void SceneState::set_bundled_scene(const Dictionary& d) {
editable_instances[i]=ei[i];
}
-// path=d["path"];
+ //path=d["path"];
}
@@ -1362,7 +1366,7 @@ Dictionary SceneState::get_bundled_scene() const {
d["version"]=PACK_VERSION;
-// d["path"]=path;
+ //d["path"]=path;
return d;
diff --git a/scene/resources/scene_format_text.cpp b/scene/resources/scene_format_text.cpp
index fa56f63465..a913687e7f 100644
--- a/scene/resources/scene_format_text.cpp
+++ b/scene/resources/scene_format_text.cpp
@@ -397,7 +397,7 @@ Error ResourceInteractiveLoaderText::poll() {
int type=-1;
int name=-1;
int instance=-1;
-// int base_scene=-1;
+ //int base_scene=-1;
if (next_tag.fields.has("name")) {
name=packed_scene->get_state()->add_name(next_tag.fields["name"]);
@@ -950,7 +950,7 @@ Ref<ResourceInteractiveLoader> ResourceFormatLoaderText::load_interactive(const
Ref<ResourceInteractiveLoaderText> ria = memnew( ResourceInteractiveLoaderText );
ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path);
ria->res_path=ria->local_path;
-// ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) );
+ //ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) );
ria->open(f);
return ria;
@@ -984,7 +984,7 @@ String ResourceFormatLoaderText::get_resource_type(const String &p_path) const{
- String ext=p_path.extension().to_lower();
+ String ext=p_path.get_extension().to_lower();
if (ext=="tscn")
return "PackedScene";
else if (ext!="tres")
@@ -1001,7 +1001,7 @@ String ResourceFormatLoaderText::get_resource_type(const String &p_path) const{
Ref<ResourceInteractiveLoaderText> ria = memnew( ResourceInteractiveLoaderText );
ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path);
ria->res_path=ria->local_path;
-// ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) );
+ //ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) );
String r = ria->recognize(f);
return r;
}
@@ -1018,7 +1018,7 @@ void ResourceFormatLoaderText::get_dependencies(const String& p_path,List<String
Ref<ResourceInteractiveLoaderText> ria = memnew( ResourceInteractiveLoaderText );
ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path);
ria->res_path=ria->local_path;
-// ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) );
+ //ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) );
ria->get_dependencies(f,p_dependencies,p_add_types);
@@ -1035,7 +1035,7 @@ Error ResourceFormatLoaderText::rename_dependencies(const String &p_path,const M
Ref<ResourceInteractiveLoaderText> ria = memnew( ResourceInteractiveLoaderText );
ria->local_path=GlobalConfig::get_singleton()->localize_path(p_path);
ria->res_path=ria->local_path;
-// ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) );
+ //ria->set_local_path( GlobalConfig::get_singleton()->localize_path(p_path) );
return ria->rename_dependencies(f,p_path,p_map);
}
@@ -1208,10 +1208,12 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re
if (packed_scene.is_null())
title+="type=\""+p_resource->get_class()+"\" ";
int load_steps=saved_resources.size()+external_resources.size();
- //if (packed_scene.is_valid()) {
- // load_steps+=packed_scene->get_node_count();
- //}
+ /*
+ if (packed_scene.is_valid()) {
+ load_steps+=packed_scene->get_node_count();
+ }
//no, better to not use load steps from nodes, no point to that
+ */
if (load_steps>1) {
title+="load_steps="+itos(load_steps)+" ";
@@ -1299,7 +1301,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path,const RES& p_re
List<PropertyInfo> property_list;
res->get_property_list(&property_list);
-// property_list.sort();
+ //property_list.sort();
for(List<PropertyInfo>::Element *PE = property_list.front();PE;PE=PE->next()) {
diff --git a/scene/resources/scene_format_text.h b/scene/resources/scene_format_text.h
index 58660fa639..ce18f6a702 100644
--- a/scene/resources/scene_format_text.h
+++ b/scene/resources/scene_format_text.h
@@ -58,7 +58,7 @@ class ResourceInteractiveLoaderText : public ResourceInteractiveLoader {
bool ignore_resource_parsing;
-// Map<String,String> remaps;
+ //Map<String,String> remaps;
Map<int,ExtResource> ext_resources;
diff --git a/scene/resources/shader_graph.cpp b/scene/resources/shader_graph.cpp
index 37b019e369..10f852f17c 100644
--- a/scene/resources/shader_graph.cpp
+++ b/scene/resources/shader_graph.cpp
@@ -192,7 +192,7 @@ void ShaderGraph::_bind_methods() {
ClassDB::bind_method(_MD("xform_const_node_get_value","shader_type","id"),&ShaderGraph::xform_const_node_get_value);
-// void get_node_list(ShaderType p_which,List<int> *p_node_list) const;
+ //void get_node_list(ShaderType p_which,List<int> *p_node_list) const;
ClassDB::bind_method(_MD("texture_node_set_filter_size","shader_type","id","filter_size"),&ShaderGraph::texture_node_set_filter_size);
ClassDB::bind_method(_MD("texture_node_get_filter_size","shader_type","id"),&ShaderGraph::texture_node_get_filter_size);
diff --git a/scene/resources/style_box.cpp b/scene/resources/style_box.cpp
index 066062f302..e5e32ba4e9 100644
--- a/scene/resources/style_box.cpp
+++ b/scene/resources/style_box.cpp
@@ -75,8 +75,8 @@ void StyleBox::_bind_methods() {
ClassDB::bind_method(_MD("set_default_margin","margin","offset"),&StyleBox::set_default_margin);
ClassDB::bind_method(_MD("get_default_margin","margin"),&StyleBox::get_default_margin);
-// ClassDB::bind_method(_MD("set_default_margin"),&StyleBox::set_default_margin);
-// ClassDB::bind_method(_MD("get_default_margin"),&StyleBox::get_default_margin);
+ //ClassDB::bind_method(_MD("set_default_margin"),&StyleBox::set_default_margin);
+ //ClassDB::bind_method(_MD("get_default_margin"),&StyleBox::get_default_margin);
ClassDB::bind_method(_MD("get_margin","margin"),&StyleBox::get_margin);
ClassDB::bind_method(_MD("get_minimum_size"),&StyleBox::get_minimum_size);
diff --git a/scene/resources/surface_tool.cpp b/scene/resources/surface_tool.cpp
index cc13c0ff11..27cc7e131b 100644
--- a/scene/resources/surface_tool.cpp
+++ b/scene/resources/surface_tool.cpp
@@ -650,9 +650,11 @@ void SurfaceTool::append_from(const Ref<Mesh>& p_existing, int p_surface,const T
for(List<int>::Element *E=nindices.front();E;E=E->next()) {
int dst_index = E->get()+vfrom;
- //if (dst_index <0 || dst_index>=vertex_array.size()) {
- // print_line("invalid index!");
- //}
+ /*
+ if (dst_index <0 || dst_index>=vertex_array.size()) {
+ print_line("invalid index!");
+ }
+ */
index_array.push_back(dst_index);
}
if (index_array.size()%3)
diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp
index 462341a751..a1ad5d8237 100644
--- a/scene/resources/texture.cpp
+++ b/scene/resources/texture.cpp
@@ -66,7 +66,6 @@ void Texture::_bind_methods() {
ClassDB::bind_method(_MD("get_width"),&Texture::get_width);
ClassDB::bind_method(_MD("get_height"),&Texture::get_height);
ClassDB::bind_method(_MD("get_size"),&Texture::get_size);
- ClassDB::bind_method(_MD("get_rid"),&Texture::get_rid);
ClassDB::bind_method(_MD("has_alpha"),&Texture::has_alpha);
ClassDB::bind_method(_MD("set_flags","flags"),&Texture::set_flags);
ClassDB::bind_method(_MD("get_flags"),&Texture::get_flags);
@@ -1050,7 +1049,7 @@ void CubeMap::_bind_methods() {
ClassDB::bind_method(_MD("get_width"),&CubeMap::get_width);
ClassDB::bind_method(_MD("get_height"),&CubeMap::get_height);
- ClassDB::bind_method(_MD("get_rid"),&CubeMap::get_rid);
+ //ClassDB::bind_method(_MD("get_rid"),&CubeMap::get_rid);
ClassDB::bind_method(_MD("set_flags","flags"),&CubeMap::set_flags);
ClassDB::bind_method(_MD("get_flags"),&CubeMap::get_flags);
diff --git a/scene/resources/theme.cpp b/scene/resources/theme.cpp
index 2e3afbf057..d950407f54 100644
--- a/scene/resources/theme.cpp
+++ b/scene/resources/theme.cpp
@@ -267,7 +267,7 @@ void Theme::set_default_font( const Ref<Font>& p_font ) {
void Theme::set_icon(const StringName& p_name,const StringName& p_type,const Ref<Texture>& p_icon) {
-// ERR_FAIL_COND(p_icon.is_null());
+ //ERR_FAIL_COND(p_icon.is_null());
bool new_value=!icon_map.has(p_type) || !icon_map[p_type].has(p_name);
@@ -367,7 +367,7 @@ void Theme::get_shader_list(const StringName &p_type, List<StringName> *p_list)
void Theme::set_stylebox(const StringName& p_name,const StringName& p_type,const Ref<StyleBox>& p_style) {
-// ERR_FAIL_COND(p_style.is_null());
+ //ERR_FAIL_COND(p_style.is_null());
bool new_value=!style_map.has(p_type) || !style_map[p_type].has(p_name);
@@ -430,7 +430,7 @@ void Theme::get_stylebox_types(List<StringName> *p_list) const {
void Theme::set_font(const StringName& p_name,const StringName& p_type,const Ref<Font>& p_font) {
-// ERR_FAIL_COND(p_font.is_null());
+ //ERR_FAIL_COND(p_font.is_null());
bool new_value=!font_map.has(p_type) || !font_map[p_type].has(p_name);
@@ -999,7 +999,7 @@ RES ResourceFormatLoaderTheme::load(const String &p_path, const String& p_origin
ERR_FAIL_V(RES());
}
-// int margin = params[i+ccodes+1].to_int();
+ //int margin = params[i+ccodes+1].to_int();
//sbflat->set_margin_size(Margin(i),margin);
}
} else if (params.size()!=ccodes+1) {
@@ -1147,7 +1147,7 @@ bool ResourceFormatLoaderTheme::handles_type(const String& p_type) const {
String ResourceFormatLoaderTheme::get_resource_type(const String &p_path) const {
- if (p_path.extension().to_lower()=="theme")
+ if (p_path.get_extension().to_lower()=="theme")
return "Theme";
return "";
}
diff --git a/scene/resources/tile_set.cpp b/scene/resources/tile_set.cpp
index 1811dee384..c97682f504 100644
--- a/scene/resources/tile_set.cpp
+++ b/scene/resources/tile_set.cpp
@@ -48,6 +48,8 @@ bool TileSet::_set(const StringName& p_name, const Variant& p_value) {
tile_set_texture_offset(id,p_value);
else if (what=="material")
tile_set_material(id,p_value);
+ else if (what=="modulate")
+ tile_set_modulate(id,p_value);
else if (what=="shape_offset")
tile_set_shape_offset(id,p_value);
else if (what=="region")
@@ -91,6 +93,8 @@ bool TileSet::_get(const StringName& p_name,Variant &r_ret) const{
r_ret=tile_get_texture_offset(id);
else if (what=="material")
r_ret=tile_get_material(id);
+ else if (what=="modulate")
+ r_ret=tile_get_modulate(id);
else if (what=="shape_offset")
r_ret=tile_get_shape_offset(id);
else if (what=="region")
@@ -124,6 +128,7 @@ void TileSet::_get_property_list( List<PropertyInfo> *p_list) const{
p_list->push_back(PropertyInfo(Variant::OBJECT,pre+"texture",PROPERTY_HINT_RESOURCE_TYPE,"Texture"));
p_list->push_back(PropertyInfo(Variant::VECTOR2,pre+"tex_offset"));
p_list->push_back(PropertyInfo(Variant::OBJECT,pre+"material",PROPERTY_HINT_RESOURCE_TYPE,"CanvasItemMaterial"));
+ p_list->push_back(PropertyInfo(Variant::COLOR,pre+"modulate"));
p_list->push_back(PropertyInfo(Variant::RECT2,pre+"region"));
p_list->push_back(PropertyInfo(Variant::VECTOR2,pre+"occluder_offset"));
p_list->push_back(PropertyInfo(Variant::OBJECT,pre+"occluder",PROPERTY_HINT_RESOURCE_TYPE,"OccluderPolygon2D"));
@@ -175,6 +180,20 @@ Ref<CanvasItemMaterial> TileSet::tile_get_material(int p_id) const{
}
+void TileSet::tile_set_modulate(int p_id,const Color &p_modulate) {
+
+ ERR_FAIL_COND(!tile_map.has(p_id));
+ tile_map[p_id].modulate=p_modulate;
+ emit_changed();
+
+}
+
+Color TileSet::tile_get_modulate(int p_id) const{
+
+ ERR_FAIL_COND_V(!tile_map.has(p_id),Color(1,1,1));
+ return tile_map[p_id].modulate;
+}
+
void TileSet::tile_set_texture_offset(int p_id,const Vector2 &p_offset) {
ERR_FAIL_COND(!tile_map.has(p_id));
diff --git a/scene/resources/tile_set.h b/scene/resources/tile_set.h
index ce40e5ebe3..b80889fc6f 100644
--- a/scene/resources/tile_set.h
+++ b/scene/resources/tile_set.h
@@ -52,6 +52,10 @@ class TileSet : public Resource {
Vector2 navigation_polygon_offset;
Ref<NavigationPolygon> navigation_polygon;
Ref<CanvasItemMaterial> material;
+ Color modulate;
+
+ // Default modulate for back-compat
+ explicit Data() : modulate(1,1,1) {}
};
Map<int,Data> tile_map;
@@ -94,6 +98,9 @@ public:
void tile_set_material(int p_id,const Ref<CanvasItemMaterial> &p_material);
Ref<CanvasItemMaterial> tile_get_material(int p_id) const;
+ void tile_set_modulate(int p_id,const Color &p_color);
+ Color tile_get_modulate(int p_id) const;
+
void tile_set_occluder_offset(int p_id,const Vector2& p_offset);
Vector2 tile_get_occluder_offset(int p_id) const;