diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/2d/tile_map.cpp | 6 | ||||
-rw-r--r-- | scene/2d/tile_map.h | 2 | ||||
-rw-r--r-- | scene/3d/light_3d.cpp | 1 | ||||
-rw-r--r-- | scene/3d/voxelizer.cpp | 18 | ||||
-rw-r--r-- | scene/main/node.cpp | 4 | ||||
-rw-r--r-- | scene/main/node.h | 3 | ||||
-rw-r--r-- | scene/main/scene_tree.cpp | 2 | ||||
-rw-r--r-- | scene/main/viewport.cpp | 30 | ||||
-rw-r--r-- | scene/main/viewport.h | 1 | ||||
-rw-r--r-- | scene/register_scene_types.cpp | 16 | ||||
-rw-r--r-- | scene/resources/dynamic_font.cpp | 2 | ||||
-rw-r--r-- | scene/resources/dynamic_font.h | 2 | ||||
-rw-r--r-- | scene/resources/font.cpp | 2 | ||||
-rw-r--r-- | scene/resources/font.h | 2 | ||||
-rw-r--r-- | scene/resources/resource_format_text.cpp | 47 | ||||
-rw-r--r-- | scene/resources/resource_format_text.h | 6 | ||||
-rw-r--r-- | scene/resources/shader.cpp | 2 | ||||
-rw-r--r-- | scene/resources/shader.h | 2 | ||||
-rw-r--r-- | scene/resources/texture.cpp | 4 | ||||
-rw-r--r-- | scene/resources/texture.h | 4 |
20 files changed, 88 insertions, 68 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 1cf12e4421..14a4d24b44 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -1691,14 +1691,14 @@ bool TileMap::is_centered_textures_enabled() const { return centered_textures; } -Array TileMap::get_used_cells() const { +TypedArray<Vector2i> TileMap::get_used_cells() const { - Array a; + TypedArray<Vector2i> a; a.resize(tile_map.size()); int i = 0; for (Map<PosKey, Cell>::Element *E = tile_map.front(); E; E = E->next()) { - Vector2 p(E->key().x, E->key().y); + Vector2i p(E->key().x, E->key().y); a[i++] = p; } diff --git a/scene/2d/tile_map.h b/scene/2d/tile_map.h index d9490aae13..cc44bc147b 100644 --- a/scene/2d/tile_map.h +++ b/scene/2d/tile_map.h @@ -328,7 +328,7 @@ public: void set_centered_textures(bool p_enable); bool is_centered_textures_enabled() const; - Array get_used_cells() const; + TypedArray<Vector2i> get_used_cells() const; Array get_used_cells_by_id(int p_id) const; Rect2 get_used_rect(); // Not const because of cache diff --git a/scene/3d/light_3d.cpp b/scene/3d/light_3d.cpp index 9928246d2b..c048f60ebd 100644 --- a/scene/3d/light_3d.cpp +++ b/scene/3d/light_3d.cpp @@ -301,6 +301,7 @@ void Light3D::_bind_methods() { BIND_ENUM_CONSTANT(PARAM_INDIRECT_ENERGY); BIND_ENUM_CONSTANT(PARAM_SPECULAR); BIND_ENUM_CONSTANT(PARAM_RANGE); + BIND_ENUM_CONSTANT(PARAM_SIZE); BIND_ENUM_CONSTANT(PARAM_ATTENUATION); BIND_ENUM_CONSTANT(PARAM_SPOT_ANGLE); BIND_ENUM_CONSTANT(PARAM_SPOT_ATTENUATION); diff --git a/scene/3d/voxelizer.cpp b/scene/3d/voxelizer.cpp index 203c3cd812..f30c58be55 100644 --- a/scene/3d/voxelizer.cpp +++ b/scene/3d/voxelizer.cpp @@ -592,22 +592,16 @@ void Voxelizer::plot_mesh(const Transform &p_xform, Ref<Mesh> &p_mesh, const Vec Vector<Vector3> vertices = a[Mesh::ARRAY_VERTEX]; const Vector3 *vr = vertices.ptr(); Vector<Vector2> uv = a[Mesh::ARRAY_TEX_UV]; - const Vector2 *uvr; + const Vector2 *uvr = nullptr; Vector<Vector3> normals = a[Mesh::ARRAY_NORMAL]; - const Vector3 *nr; + const Vector3 *nr = nullptr; Vector<int> index = a[Mesh::ARRAY_INDEX]; - bool read_uv = false; - bool read_normals = false; - if (uv.size()) { - uvr = uv.ptr(); - read_uv = true; } if (normals.size()) { - read_normals = true; nr = normals.ptr(); } @@ -626,13 +620,13 @@ void Voxelizer::plot_mesh(const Transform &p_xform, Ref<Mesh> &p_mesh, const Vec vtxs[k] = p_xform.xform(vr[ir[j * 3 + k]]); } - if (read_uv) { + if (uvr) { for (int k = 0; k < 3; k++) { uvs[k] = uvr[ir[j * 3 + k]]; } } - if (read_normals) { + if (nr) { for (int k = 0; k < 3; k++) { normal[k] = nr[ir[j * 3 + k]]; } @@ -659,13 +653,13 @@ void Voxelizer::plot_mesh(const Transform &p_xform, Ref<Mesh> &p_mesh, const Vec vtxs[k] = p_xform.xform(vr[j * 3 + k]); } - if (read_uv) { + if (uvr) { for (int k = 0; k < 3; k++) { uvs[k] = uvr[j * 3 + k]; } } - if (read_normals) { + if (nr) { for (int k = 0; k < 3; k++) { normal[k] = nr[j * 3 + k]; } diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 50f3bf834f..4c02a15531 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -2693,9 +2693,9 @@ void Node::queue_delete() { } } -Array Node::_get_children() const { +TypedArray<Node> Node::_get_children() const { - Array arr; + TypedArray<Node> arr; int cc = get_child_count(); arr.resize(cc); for (int i = 0; i < cc; i++) diff --git a/scene/main/node.h b/scene/main/node.h index 5de07d506e..1c1b7bbd7a 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -37,6 +37,7 @@ #include "core/object.h" #include "core/project_settings.h" #include "core/script_language.h" +#include "core/typed_array.h" #include "scene/main/scene_tree.h" class Viewport; @@ -182,7 +183,7 @@ private: void _duplicate_and_reown(Node *p_new_parent, const Map<Node *, Node *> &p_reown_map) const; Node *_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap = nullptr) const; - Array _get_children() const; + TypedArray<Node> _get_children() const; Array _get_groups() const; Variant _rpc_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error); diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 0418b20e9c..f30a899d69 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -1422,7 +1422,7 @@ SceneTree::SceneTree() { current_scene = nullptr; int msaa_mode = GLOBAL_DEF("rendering/quality/screen_filters/msaa", 0); - ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/screen_filters/msaa", PropertyInfo(Variant::INT, "rendering/quality/screen_filters/msaa", PROPERTY_HINT_ENUM, "Disabled,2x,4x,8x,16x,AndroidVR 2x,AndroidVR 4x")); + ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/screen_filters/msaa", PropertyInfo(Variant::INT, "rendering/quality/screen_filters/msaa", PROPERTY_HINT_ENUM, "Disabled,2x,4x,8x,16x")); root->set_msaa(Viewport::MSAA(msaa_mode)); int ssaa_mode = GLOBAL_DEF("rendering/quality/screen_filters/screen_space_aa", 0); diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index 72b1a877c1..51dd22db81 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -3495,6 +3495,17 @@ void Viewport::_bind_methods() { BIND_ENUM_CONSTANT(SHADOW_ATLAS_QUADRANT_SUBDIV_1024); BIND_ENUM_CONSTANT(SHADOW_ATLAS_QUADRANT_SUBDIV_MAX); + BIND_ENUM_CONSTANT(MSAA_DISABLED); + BIND_ENUM_CONSTANT(MSAA_2X); + BIND_ENUM_CONSTANT(MSAA_4X); + BIND_ENUM_CONSTANT(MSAA_8X); + BIND_ENUM_CONSTANT(MSAA_16X); + BIND_ENUM_CONSTANT(MSAA_MAX); + + BIND_ENUM_CONSTANT(SCREEN_SPACE_AA_DISABLED); + BIND_ENUM_CONSTANT(SCREEN_SPACE_AA_FXAA); + BIND_ENUM_CONSTANT(SCREEN_SPACE_AA_MAX); + BIND_ENUM_CONSTANT(RENDER_INFO_OBJECTS_IN_FRAME); BIND_ENUM_CONSTANT(RENDER_INFO_VERTICES_IN_FRAME); BIND_ENUM_CONSTANT(RENDER_INFO_MATERIAL_CHANGES_IN_FRAME); @@ -3505,9 +3516,10 @@ void Viewport::_bind_methods() { BIND_ENUM_CONSTANT(DEBUG_DRAW_DISABLED); BIND_ENUM_CONSTANT(DEBUG_DRAW_UNSHADED); + BIND_ENUM_CONSTANT(DEBUG_DRAW_LIGHTING); BIND_ENUM_CONSTANT(DEBUG_DRAW_OVERDRAW); BIND_ENUM_CONSTANT(DEBUG_DRAW_WIREFRAME); - + BIND_ENUM_CONSTANT(DEBUG_DRAW_NORMAL_BUFFER); BIND_ENUM_CONSTANT(DEBUG_DRAW_GI_PROBE_ALBEDO); BIND_ENUM_CONSTANT(DEBUG_DRAW_GI_PROBE_LIGHTING); BIND_ENUM_CONSTANT(DEBUG_DRAW_GI_PROBE_EMISSION); @@ -3519,18 +3531,12 @@ void Viewport::_bind_methods() { BIND_ENUM_CONSTANT(DEBUG_DRAW_PSSM_SPLITS); BIND_ENUM_CONSTANT(DEBUG_DRAW_DECAL_ATLAS); - BIND_ENUM_CONSTANT(MSAA_DISABLED); - BIND_ENUM_CONSTANT(MSAA_2X); - BIND_ENUM_CONSTANT(MSAA_4X); - BIND_ENUM_CONSTANT(MSAA_8X); - BIND_ENUM_CONSTANT(MSAA_16X); - BIND_ENUM_CONSTANT(DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST); BIND_ENUM_CONSTANT(DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR); BIND_ENUM_CONSTANT(DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS); BIND_ENUM_CONSTANT(DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS); - BIND_ENUM_CONSTANT(DEFAULT_CANVAS_ITEM_TEXTURE_FILTER_MAX); + BIND_ENUM_CONSTANT(DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_DISABLED); BIND_ENUM_CONSTANT(DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_ENABLED); BIND_ENUM_CONSTANT(DEFAULT_CANVAS_ITEM_TEXTURE_REPEAT_MIRROR); @@ -3746,15 +3752,15 @@ void SubViewport::_bind_methods() { ADD_PROPERTY(PropertyInfo(Variant::INT, "render_target_clear_mode", PROPERTY_HINT_ENUM, "Always,Never,Next Frame"), "set_clear_mode", "get_clear_mode"); ADD_PROPERTY(PropertyInfo(Variant::INT, "render_target_update_mode", PROPERTY_HINT_ENUM, "Disabled,Once,When Visible,Always"), "set_update_mode", "get_update_mode"); + BIND_ENUM_CONSTANT(CLEAR_MODE_ALWAYS); + BIND_ENUM_CONSTANT(CLEAR_MODE_NEVER); + BIND_ENUM_CONSTANT(CLEAR_MODE_ONLY_NEXT_FRAME); + BIND_ENUM_CONSTANT(UPDATE_DISABLED); BIND_ENUM_CONSTANT(UPDATE_ONCE); BIND_ENUM_CONSTANT(UPDATE_WHEN_VISIBLE); BIND_ENUM_CONSTANT(UPDATE_WHEN_PARENT_VISIBLE); BIND_ENUM_CONSTANT(UPDATE_ALWAYS); - - BIND_ENUM_CONSTANT(CLEAR_MODE_ALWAYS); - BIND_ENUM_CONSTANT(CLEAR_MODE_NEVER); - BIND_ENUM_CONSTANT(CLEAR_MODE_ONLY_NEXT_FRAME); } SubViewport::SubViewport() { diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 0cbc957307..7e2df9fe42 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -116,7 +116,6 @@ public: }; enum RenderInfo { - RENDER_INFO_OBJECTS_IN_FRAME, RENDER_INFO_VERTICES_IN_FRAME, RENDER_INFO_MATERIAL_CHANGES_IN_FRAME, diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp index 264295325f..dc3ef5b508 100644 --- a/scene/register_scene_types.cpp +++ b/scene/register_scene_types.cpp @@ -757,8 +757,16 @@ void register_scene_types() { ClassDB::add_compatibility_class("AnimationTreePlayer", "AnimationTree"); // Renamed in 4.0. + // Keep alphabetical ordering to easily locate classes and avoid duplicates. ClassDB::add_compatibility_class("AnimatedSprite", "AnimatedSprite2D"); ClassDB::add_compatibility_class("Area", "Area3D"); + ClassDB::add_compatibility_class("ARVRCamera", "XRCamera3D"); + ClassDB::add_compatibility_class("ARVRController", "XRController3D"); + ClassDB::add_compatibility_class("ARVRAnchor", "XRAnchor3D"); + ClassDB::add_compatibility_class("ARVRInterface", "XRInterface"); + ClassDB::add_compatibility_class("ARVROrigin", "XROrigin3D"); + ClassDB::add_compatibility_class("ARVRPositionalTracker", "XRPositionalTracker"); + ClassDB::add_compatibility_class("ARVRServer", "XRServer"); ClassDB::add_compatibility_class("BoneAttachment", "BoneAttachment3D"); ClassDB::add_compatibility_class("BoxShape", "BoxShape3D"); ClassDB::add_compatibility_class("BulletPhysicsDirectBodyState", "BulletPhysicsDirectBodyState3D"); @@ -806,6 +814,7 @@ void register_scene_types() { ClassDB::add_compatibility_class("Navigation2DServer", "NavigationServer2D"); ClassDB::add_compatibility_class("NavigationServer", "NavigationServer3D"); ClassDB::add_compatibility_class("OmniLight", "OmniLight3D"); + ClassDB::add_compatibility_class("PanoramaSky", "Sky"); ClassDB::add_compatibility_class("Particles", "GPUParticles3D"); ClassDB::add_compatibility_class("Particles2D", "GPUParticles2D"); ClassDB::add_compatibility_class("Path", "Path3D"); @@ -827,6 +836,7 @@ void register_scene_types() { ClassDB::add_compatibility_class("PhysicsShapeQueryResult", "PhysicsShapeQueryResult3D"); ClassDB::add_compatibility_class("PinJoint", "PinJoint3D"); ClassDB::add_compatibility_class("PlaneShape", "WorldMarginShape3D"); + ClassDB::add_compatibility_class("ProceduralSky", "Sky"); ClassDB::add_compatibility_class("ProximityGroup", "ProximityGroup3D"); ClassDB::add_compatibility_class("RayCast", "RayCast3D"); ClassDB::add_compatibility_class("RayShape", "RayShape3D"); @@ -857,12 +867,6 @@ void register_scene_types() { ClassDB::add_compatibility_class("VisualShaderNodeScalarOp", "VisualShaderNodeFloatOp"); ClassDB::add_compatibility_class("VisualShaderNodeScalarUniform", "VisualShaderNodeFloatUniform"); ClassDB::add_compatibility_class("World", "World3D"); - ClassDB::add_compatibility_class("ProceduralSky", "Sky"); - ClassDB::add_compatibility_class("PanoramaSky", "Sky"); - ClassDB::add_compatibility_class("ARVRCamera", "XRCamera3D"); - ClassDB::add_compatibility_class("ARVROrigin", "XROrigin3D"); - ClassDB::add_compatibility_class("ARVRController", "XRController3D"); - ClassDB::add_compatibility_class("ARVRAnchor", "XRAnchor3D"); #endif diff --git a/scene/resources/dynamic_font.cpp b/scene/resources/dynamic_font.cpp index a613b01376..eea4d12d0e 100644 --- a/scene/resources/dynamic_font.cpp +++ b/scene/resources/dynamic_font.cpp @@ -1064,7 +1064,7 @@ void DynamicFont::update_oversampling() { ///////////////////////// -RES ResourceFormatLoaderDynamicFont::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress) { +RES ResourceFormatLoaderDynamicFont::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, bool p_no_cache) { if (r_error) *r_error = ERR_FILE_CANT_OPEN; diff --git a/scene/resources/dynamic_font.h b/scene/resources/dynamic_font.h index 9e628fc35a..ef4b9dd9d0 100644 --- a/scene/resources/dynamic_font.h +++ b/scene/resources/dynamic_font.h @@ -302,7 +302,7 @@ VARIANT_ENUM_CAST(DynamicFont::SpacingType); class ResourceFormatLoaderDynamicFont : public ResourceFormatLoader { public: - virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr); + virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr, bool p_no_cache = false); virtual void get_recognized_extensions(List<String> *p_extensions) const; virtual bool handles_type(const String &p_type) const; virtual String get_resource_type(const String &p_path) const; diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index 192eefbf6a..267816f267 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -646,7 +646,7 @@ BitmapFont::~BitmapFont() { //////////// -RES ResourceFormatLoaderBMFont::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress) { +RES ResourceFormatLoaderBMFont::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, bool p_no_cache) { if (r_error) *r_error = ERR_FILE_CANT_OPEN; diff --git a/scene/resources/font.h b/scene/resources/font.h index ce75f27e2a..c233344529 100644 --- a/scene/resources/font.h +++ b/scene/resources/font.h @@ -200,7 +200,7 @@ public: class ResourceFormatLoaderBMFont : public ResourceFormatLoader { public: - virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr); + virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr, bool p_no_cache = false); virtual void get_recognized_extensions(List<String> *p_extensions) const; virtual bool handles_type(const String &p_type) const; virtual String get_resource_type(const String &p_path) const; diff --git a/scene/resources/resource_format_text.cpp b/scene/resources/resource_format_text.cpp index 5068bb548f..41146036f6 100644 --- a/scene/resources/resource_format_text.cpp +++ b/scene/resources/resource_format_text.cpp @@ -120,18 +120,23 @@ Error ResourceLoaderText::_parse_sub_resource(VariantParser::Stream *p_stream, R int index = token.value; - String path = local_path + "::" + itos(index); + if (use_nocache) { + r_res = int_resources[index]; + } else { - if (!ignore_resource_parsing) { + String path = local_path + "::" + itos(index); - if (!ResourceCache::has(path)) { - r_err_str = "Can't load cached sub-resource: " + path; - return ERR_PARSE_ERROR; - } + if (!ignore_resource_parsing) { - r_res = RES(ResourceCache::get(path)); - } else { - r_res = RES(); + if (!ResourceCache::has(path)) { + r_err_str = "Can't load cached sub-resource: " + path; + return ERR_PARSE_ERROR; + } + + r_res = RES(ResourceCache::get(path)); + } else { + r_res = RES(); + } } VariantParser::get_token(p_stream, token, line, r_err_str); @@ -535,7 +540,7 @@ Error ResourceLoaderText::load() { Ref<Resource> res; - if (!ResourceCache::has(path)) { //only if it doesn't exist + if (use_nocache || !ResourceCache::has(path)) { //only if it doesn't exist Object *obj = ClassDB::instance(type); if (!obj) { @@ -556,8 +561,10 @@ Error ResourceLoaderText::load() { } res = Ref<Resource>(r); - resource_cache.push_back(res); - res->set_path(path); + int_resources[id] = res; + if (!use_nocache) { + res->set_path(path); + } } resource_current++; @@ -643,10 +650,12 @@ Error ResourceLoaderText::load() { _printerr(); } else { error = OK; - if (!ResourceCache::has(res_path)) { - resource->set_path(res_path); + if (!use_nocache) { + if (!ResourceCache::has(res_path)) { + resource->set_path(res_path); + } + resource->set_as_translation_remapped(translation_remapped); } - resource->set_as_translation_remapped(translation_remapped); } return error; } @@ -691,7 +700,7 @@ Error ResourceLoaderText::load() { error = OK; //get it here resource = packed_scene; - if (!ResourceCache::has(res_path)) { + if (!use_nocache && !ResourceCache::has(res_path)) { packed_scene->set_path(res_path); } @@ -725,6 +734,9 @@ void ResourceLoaderText::set_translation_remapped(bool p_remapped) { } ResourceLoaderText::ResourceLoaderText() { + + use_nocache = false; + resources_total = 0; resource_current = 0; use_sub_threads = false; @@ -1285,7 +1297,7 @@ String ResourceLoaderText::recognize(FileAccess *p_f) { ///////////////////// -RES ResourceFormatLoaderText::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress) { +RES ResourceFormatLoaderText::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, bool p_no_cache) { if (r_error) *r_error = ERR_CANT_OPEN; @@ -1298,6 +1310,7 @@ RES ResourceFormatLoaderText::load(const String &p_path, const String &p_origina ResourceLoaderText loader; String path = p_original_path != "" ? p_original_path : p_path; + loader.use_nocache = p_no_cache; loader.use_sub_threads = p_use_sub_threads; loader.local_path = ProjectSettings::get_singleton()->localize_path(path); loader.progress = r_progress; diff --git a/scene/resources/resource_format_text.h b/scene/resources/resource_format_text.h index fbbd2e3346..b9a6db5f36 100644 --- a/scene/resources/resource_format_text.h +++ b/scene/resources/resource_format_text.h @@ -62,6 +62,7 @@ class ResourceLoaderText { //Map<String,String> remaps; Map<int, ExtResource> ext_resources; + Map<int, RES> int_resources; int resources_total; int resource_current; @@ -69,6 +70,8 @@ class ResourceLoaderText { VariantParser::Tag next_tag; + bool use_nocache; + bool use_sub_threads; float *progress; @@ -106,7 +109,6 @@ class ResourceLoaderText { friend class ResourceFormatLoaderText; - List<RES> resource_cache; Error error; RES resource; @@ -134,7 +136,7 @@ public: class ResourceFormatLoaderText : public ResourceFormatLoader { public: static ResourceFormatLoaderText *singleton; - virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr); + virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr, bool p_no_cache = false); virtual void get_recognized_extensions_for_type(const String &p_type, List<String> *p_extensions) const; virtual void get_recognized_extensions(List<String> *p_extensions) const; virtual bool handles_type(const String &p_type) const; diff --git a/scene/resources/shader.cpp b/scene/resources/shader.cpp index a62e7ded16..1ac2f7c3c9 100644 --- a/scene/resources/shader.cpp +++ b/scene/resources/shader.cpp @@ -176,7 +176,7 @@ Shader::~Shader() { } //////////// -RES ResourceFormatLoaderShader::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress) { +RES ResourceFormatLoaderShader::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, bool p_no_cache) { if (r_error) *r_error = ERR_FILE_CANT_OPEN; diff --git a/scene/resources/shader.h b/scene/resources/shader.h index cf0cec362c..75c38bd561 100644 --- a/scene/resources/shader.h +++ b/scene/resources/shader.h @@ -102,7 +102,7 @@ VARIANT_ENUM_CAST(Shader::Mode); class ResourceFormatLoaderShader : public ResourceFormatLoader { public: - virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr); + virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr, bool p_no_cache = false); virtual void get_recognized_extensions(List<String> *p_extensions) const; virtual bool handles_type(const String &p_type) const; virtual String get_resource_type(const String &p_path) const; diff --git a/scene/resources/texture.cpp b/scene/resources/texture.cpp index 749dff24f2..f431a2ad48 100644 --- a/scene/resources/texture.cpp +++ b/scene/resources/texture.cpp @@ -796,7 +796,7 @@ StreamTexture::~StreamTexture() { } } -RES ResourceFormatLoaderStreamTexture::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress) { +RES ResourceFormatLoaderStreamTexture::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, bool p_no_cache) { Ref<StreamTexture> st; st.instance(); @@ -2024,7 +2024,7 @@ TextureLayered::~TextureLayered() { } } -RES ResourceFormatLoaderTextureLayered::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress) { +RES ResourceFormatLoaderTextureLayered::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, bool p_no_cache) { if (r_error) { *r_error = ERR_CANT_OPEN; diff --git a/scene/resources/texture.h b/scene/resources/texture.h index 18f70baa07..f4f00c2ca0 100644 --- a/scene/resources/texture.h +++ b/scene/resources/texture.h @@ -213,7 +213,7 @@ public: class ResourceFormatLoaderStreamTexture : public ResourceFormatLoader { public: - virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr); + virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr, bool p_no_cache = false); virtual void get_recognized_extensions(List<String> *p_extensions) const; virtual bool handles_type(const String &p_type) const; virtual String get_resource_type(const String &p_path) const; @@ -421,7 +421,7 @@ public: COMPRESSION_UNCOMPRESSED }; - virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr); + virtual RES load(const String &p_path, const String &p_original_path = "", Error *r_error = nullptr, bool p_use_sub_threads = false, float *r_progress = nullptr, bool p_no_cache = false); virtual void get_recognized_extensions(List<String> *p_extensions) const; virtual bool handles_type(const String &p_type) const; virtual String get_resource_type(const String &p_path) const; |