mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-09 00:30:12 +08:00
Fix insert operation.
Handle case where move is unnecessary.
This commit is contained in:
parent
f65ca667b3
commit
ca0372c415
@ -169,8 +169,10 @@ void spSkeleton_updateCache (const spSkeleton* self) {
|
||||
if (updatable == transformConstraint->bone || updatable == transformConstraint->target) {
|
||||
int insertIndex = ii + 1;
|
||||
int moveCount = (capacity-2) - insertIndex;
|
||||
memmove(internal->updateCache + (insertIndex+1), internal->updateCache + insertIndex, moveCount * sizeof(void*));
|
||||
memmove(internal->updateCacheType + (insertIndex+1), internal->updateCacheType + insertIndex, moveCount * sizeof(_spUpdateType));
|
||||
if (moveCount > 0) {
|
||||
memmove(internal->updateCache + (insertIndex + 1), internal->updateCache + insertIndex, moveCount * sizeof(void*));
|
||||
memmove(internal->updateCacheType + (insertIndex + 1), internal->updateCacheType + insertIndex, moveCount * sizeof(_spUpdateType));
|
||||
}
|
||||
internal->updateCacheCount++;
|
||||
internal->updateCache[insertIndex] = transformConstraint;
|
||||
internal->updateCacheType[insertIndex] = SP_UPDATE_TRANSFORM_CONSTRAINT;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user