forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Thanks to a refactor, `Resource::duplicate_for_local_scene()` and `Resource::duplicate()` are now both users of the same, parametrized, implementation - `Resource::duplicate()` now honors with/without subresources modes better. Among other changes, packed arrays, arrays and dictionaries are copied if, and only if, subresource duplication is requested. Given the lack of separate control for both, that gives a more predictable outcome. Separate control would be not possible anyway because duplicating deep resources may need to duplicate the arrays or dictionaries where it's involved regardless user will. The behavior afte this change is as follows: - With subresources: - Previously, only resources found as direct property values of the one to copy would be, recursively, duplicated. - Now, in addition, arrays and dictionaries are walked so the copy is truly deep. - The behavior with respect to packed arrays, arrays and dictionaries stays: recursive duplication. - Without subresources: - Previously, the first level of resources found as direct property values would be duplicated unconditionally. Packed arrays, arrays and dictionaries were non-recursively duplicated. - Now, no subresource found at any level in any form, will be duplicated, but the original reference kept instead. Packed arrays, arrays and dictionaries are referenced, not duplicated at all.
- Loading branch information
1 parent
6969065
commit bb1967f
Showing
2 changed files
with
42 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters