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 in a more consistent and predictable fashion. 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. - Previously, subresources would be duplicated as many times as being referenced throughout the main resource. - Now, each subresource is only duplicated once and from that point, a referenced to that single copy is used. That's the enhanced behavior that `duplicate_for_local_scene()` already featured. - 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
e6f813d
commit 6426637
Showing
3 changed files
with
55 additions
and
69 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
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