Exemple #1
0
        public int Exec(float tick    = 0,
                        Matrix matrix = null, ColorTransform colorTransform = null)
        {
            bool needsToUpdate = false;

            if (matrix != null)
            {
                needsToUpdate |= m_execMatrix.SetWithComparing(matrix);
            }
            if (colorTransform != null)
            {
                needsToUpdate |=
                    m_execColorTransform.SetWithComparing(colorTransform);
            }
            DateTime startTime = default(DateTime);

            if (m_parent == null)
            {
                m_fastForwardCurrent = m_fastForward;
                if (m_fastForwardCurrent)
                {
                    tick      = m_tick;
                    startTime = DateTime.Now;
                }
            }

            int renderingCount = 0;

            for (;;)
            {
                renderingCount = ExecInternal(tick);
                needsToUpdate |= m_needsUpdate;
                if (needsToUpdate)
                {
                    Update(matrix, colorTransform);
                }
                if (isLWFAttached)
                {
                    m_rootMovie.UpdateAttachedLWF();
                }
                if (needsToUpdate)
                {
                    m_rootMovie.PostUpdate();
                }
                if (m_fastForwardCurrent && m_fastForward && m_parent == null)
                {
                    var diff = DateTime.Now - startTime;
                    if (diff.TotalMilliseconds >= m_fastForwardTimeout)
                    {
                        break;
                    }
                }
                else
                {
                    break;
                }
            }

            return(renderingCount);
        }