コード例 #1
0
// Ensures that the list of active animations on the main thread and the impl thread
// are kept in sync.
void CCLayerAnimationController::pushAnimationUpdatesTo(CCLayerAnimationController* controllerImpl)
{
    if (m_forceSync) {
        replaceImplThreadAnimations(controllerImpl);
        m_forceSync = false;
    } else {
        pushNewAnimationsToImplThread(controllerImpl);
        removeAnimationsCompletedOnMainThread(controllerImpl);
        pushPropertiesToImplThread(controllerImpl);
    }
}
コード例 #2
0
// Ensures that the list of active animations on the main thread and the impl thread
// are kept in sync.
void CCLayerAnimationController::pushAnimationUpdatesTo(CCLayerAnimationController* controllerImpl)
{
    if (!controllerImpl->m_hasSynchronizedWithMainThread) {
        replaceImplThreadAnimations(controllerImpl);
        controllerImpl->m_hasSynchronizedWithMainThread = true;
    } else {
        purgeAnimationsMarkedForDeletion();
        pushNewAnimationsToImplThread(controllerImpl);

        // Remove finished impl side animations only after pushing,
        // and only after the animations are deleted on the main thread
        // this insures we will never push an animation twice.
        removeAnimationsCompletedOnMainThread(controllerImpl);

        pushPropertiesToImplThread(controllerImpl);
    }
}