Merged
Conversation
This reverts commit f2e749f.
Contributor
Author
|
I can't say I'm 100% happy with the solution, but in case of swap (if I fix just capacity issue) I get crash I can't figure out how to fix. If I turn ASAN on, it doesn't happen, but crashes without ASAN all the time. |
AGulev
commented
Nov 18, 2025
| return dmGameObject::UPDATE_RESULT_OK; | ||
| } | ||
|
|
||
| dmGameObject::UpdateResult CompSpineModelPostUpdate(const dmGameObject::ComponentsPostUpdateParams& params) |
Contributor
Author
There was a problem hiding this comment.
Bones creation moved into PostUpdate - this is the main fix
AGulev
commented
Nov 18, 2025
| -- bones don't exist immidiatly after model replace, because we have to wait to remove old bones | ||
| timer.delay(0, false, function() | ||
| update_debug_spine_bones(self, self.spine_a_url) | ||
| end) |
Contributor
Author
There was a problem hiding this comment.
This is the main inconvenience here, you can't immediately use bones after scenes swap
JCash
approved these changes
Nov 18, 2025
| component->m_BoneNameToNodeInstanceIndex.SetCapacity((skeleton->bonesCount+1)/2, skeleton->bonesCount); | ||
| if (component->m_BoneNameToNodeInstanceIndex.Capacity() < skeleton->bonesCount) | ||
| { | ||
| component->m_BoneNameToNodeInstanceIndex.SetCapacity((skeleton->bonesCount+1)/2, skeleton->bonesCount); |
Contributor
There was a problem hiding this comment.
We nowadays have a new function dmHashTable::OffsetCapacity(grow) to make it easier to use, and keep a reasonable split between the table and bucket sizes.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #246