Exemplo n.º 1
0
 public static void CalcColor(Color dst, Color c, ColorTransform t)
 {
     dst.red   = c.red * t.multi.red + t.add.red;
     dst.green = c.green * t.multi.green + t.add.green;
     dst.blue  = c.blue * t.multi.blue + t.add.blue;
     dst.alpha = c.alpha * t.multi.alpha + t.add.alpha;
 }
Exemplo n.º 2
0
 public static ColorTransform CalcColorTransform(LWF lwf,
                                                 ColorTransform dst, ColorTransform src0, int src1Id)
 {
     if (src1Id == 0)
     {
         dst.Set(src0);
     }
     else if ((src1Id & (int)Constant.COLORTRANSFORM_FLAG) == 0)
     {
         AlphaTransform alphaTransform =
             lwf.data.alphaTransforms[src1Id];
         dst.multi.red   = src0.multi.red;
         dst.multi.green = src0.multi.green;
         dst.multi.blue  = src0.multi.blue;
         dst.multi.alpha = src0.multi.alpha * alphaTransform.alpha;
         dst.add.Set(src0.add);
     }
     else
     {
         int            colorTransformId = src1Id & ~(int)Constant.COLORTRANSFORM_FLAG;
         ColorTransform src1             = lwf.data.colorTransforms[colorTransformId];
         CalcColorTransform(dst, src0, src1);
     }
     return(dst);
 }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
        public static void CalcColorTransform(LWF lwf,
                                              ColorTransform dst, ColorTransform src0, int src1Id)
        {
            ColorTransform src1 = null;

            if (src1Id == 0)
            {
                dst.Set(src0);
            }
            else if ((src1Id & (int)Constant.COLORTRANSFORM_FLAG) == 0)
            {
                AlphaTransform alphaTransform =
                    lwf.data.alphaTransforms[src1Id];
                dst.multi.red   = src0.multi.red;
                dst.multi.green = src0.multi.green;
                dst.multi.blue  = src0.multi.blue;
                dst.multi.alpha = src0.multi.alpha * alphaTransform.alpha;
#if LWF_USE_ADDITIONALCOLOR
                dst.add.Set(src0.add);
#endif
            }
            else
            {
                int colorTransformId = src1Id & ~(int)Constant.COLORTRANSFORM_FLAG;
                src1 = lwf.data.colorTransforms[colorTransformId];
                CalcColorTransform(dst, src0, src1);
            }
        }
Exemplo n.º 5
0
 public override void Update(Matrix m, ColorTransform c)
 {
     base.Update(m, c);
     if (m_renderer != null)
     {
         m_renderer.Update(m_matrix, m_colorTransform);
     }
 }
Exemplo n.º 6
0
 public void SetColorTransformMovie(
     string instanceName, float vr, float vg, float vb, float va)
 {
     SetMovieLoadCommand(instanceName, (m) => {
         ColorTransform c = new ColorTransform(vr, vg, vb, va);
         m.SetColorTransform(c);
     });
 }
Exemplo n.º 7
0
        public Movie(LWF lwf, Movie parent, int objId, int instId, int matrixId = 0,
                     int colorTransformId       = 0, bool attached = false,
                     MovieEventHandlers handler = null, string n   = null)
            : base(lwf, parent,
                   attached ? Type.ATTACHEDMOVIE : Type.MOVIE, objId, instId)
        {
            m_data             = lwf.data.movies[objId];
            m_matrixId         = matrixId;
            m_colorTransformId = colorTransformId;
            m_totalFrames      = m_data.frames;

            if (!String.IsNullOrEmpty(n))
            {
                m_name = n;
            }
            m_instanceHead               = null;
            m_instanceTail               = null;
            m_currentFrameInternal       = -1;
            m_execedFrame                = -1;
            m_animationPlayedFrame       = -1;
            m_lastControlOffset          = -1;
            m_lastControls               = -1;
            m_lastHasButton              = false;
            m_lastControlAnimationOffset = -1;
            m_skipped               = false;
            m_postLoaded            = false;
            m_active                = true;
            m_visible               = true;
            m_playing               = true;
            m_jumped                = false;
            m_overriding            = false;
            m_attachMovieExeced     = false;
            m_attachMoviePostExeced = false;
            m_movieExecCount        = -1;
            m_postExecCount         = -1;

            m_property = new Property(lwf);

            m_matrix0         = new Matrix();
            m_matrix1         = new Matrix();
            m_colorTransform0 = new ColorTransform();
            m_colorTransform1 = new ColorTransform();

            m_displayList = new Object[m_data.depths];

            PlayAnimation(ClipEvent.LOAD);

            m_eventHandlers = new EventHandlerDictionary();
            m_handler       = new MovieEventHandlers();
            m_handler.Add(lwf.GetMovieEventHandlers(this));
            m_handler.Add(handler);
            if (!m_handler.Empty())
            {
                m_handler.Call(EventType.LOAD, this);
            }

            lwf.ExecMovieCommand();
        }
Exemplo n.º 8
0
        public override void Update(Matrix m, ColorTransform c)
        {
            int n = m_displayList.Length;

            for (int i = 0; i < n; ++i)
            {
                m_displayList[i].Update(m, c);
            }
        }
Exemplo n.º 9
0
        public override void Update(Matrix m, ColorTransform c)
        {
            base.Update(m, c);

            if (m_handler != null && m_handler.update != null)
            {
                m_handler.update(this);
            }
        }
Exemplo n.º 10
0
        public override void Update(Matrix m, ColorTransform c)
        {
            base.Update(m, c);

            if (m_handler != null)
            {
                m_handler.Call(EventType.UPDATE, this);
            }
        }
Exemplo n.º 11
0
 public Object(LWF lwf, Movie parent, Type type, int objId)
 {
     m_lwf = lwf;
     m_parent = parent;
     m_type = type;
     m_objectId = objId;
     m_matrix = new Matrix();
     m_colorTransform = new ColorTransform();
     m_execCount = 0;
 }
Exemplo n.º 12
0
 public Object(LWF lwf, Movie parent, Type type, int objId)
 {
     m_lwf            = lwf;
     m_parent         = parent;
     m_type           = type;
     m_objectId       = objId;
     m_matrix         = new Matrix();
     m_colorTransform = new ColorTransform();
     m_execCount      = 0;
 }
Exemplo n.º 13
0
        public LWF(Data lwfData, IRendererFactory r)
#endif
        {
            m_data = lwfData;

            interactive     = m_data.buttonConditions.Length > 0;
            m_frameRate     = m_data.header.frameRate;
            m_execLimit     = 3;
            m_frameSkip     = true;
            m_tick          = 1.0f / m_frameRate;
            m_roundOffTick  = m_tick * ROUND_OFF_TICK_RATE;
            m_attachVisible = true;
            m_interceptByNotAllowOrDenyButtons = true;
            m_intercepted             = false;
            scaleByStage              = 1.0f;
            m_needsUpdate             = false;
            m_needsUpdateForAttachLWF = false;
            m_pointX     = Single.MinValue;
            m_pointY     = Single.MinValue;
            m_pressing   = false;
            m_instanceId = ++m_instanceOffset;
            m_alive      = true;
#if LWF_USE_LUA
            m_luaState         = l;
            m_instanceIdString = instanceId.ToString();
            InitLua();
#endif

            if (!interactive && m_data.frames.Length == 1)
            {
                DisableExec();
            }

            m_property  = new Property(this);
            m_instances = new IObject[m_data.instanceNames.Length];
            InitEvent();
            m_movieCommands             = new MovieCommands();
            m_programObjectConstructors =
                new ProgramObjectConstructor[m_data.programObjects.Length];
            m_textDictionary = new TextDictionary();

            m_matrix                 = new Matrix();
            m_matrixIdentity         = new Matrix();
            m_execMatrix             = new Matrix();
            m_colorTransform         = new ColorTransform();
            m_colorTransformIdentity = new ColorTransform();
            m_execColorTransform     = new ColorTransform();
            m_blendModes             = new BlendModes();
            m_maskModes              = new MaskModes();

            Init();

            SetRendererFactory(r);
        }
Exemplo n.º 14
0
 public static void CopyColorTransform(
     ColorTransform dst, ColorTransform src)
 {
     if (src == null)
     {
         dst.Clear();
     }
     else
     {
         dst.Set(src);
     }
 }
Exemplo n.º 15
0
 public static ColorTransform CalcColorTransform(ColorTransform dst,
                                                 ColorTransform src0, ColorTransform src1)
 {
     dst.multi.red   = src0.multi.red * src1.multi.red;
     dst.multi.green = src0.multi.green * src1.multi.green;
     dst.multi.blue  = src0.multi.blue * src1.multi.blue;
     dst.multi.alpha = src0.multi.alpha * src1.multi.alpha;
     dst.add.red     = src0.add.red * src1.multi.red + src1.add.red;
     dst.add.green   = src0.add.green * src1.multi.green + src1.add.green;
     dst.add.blue    = src0.add.blue * src1.multi.blue + src1.add.blue;
     dst.add.alpha   = src0.add.alpha * src1.multi.alpha + src1.add.alpha;
     return(dst);
 }
Exemplo n.º 16
0
        public void Update(
            Matrix matrix = null, ColorTransform colorTransform = null)
        {
            ++m_updateCount;
            Matrix         m = CalcMatrix(matrix);
            ColorTransform c = CalcColorTransform(colorTransform);

            m_renderingIndex          = 0;
            m_renderingIndexOffsetted = 0;
            m_rootMovie.Update(m, c);
            m_renderingCount = m_renderingIndex;
            m_propertyDirty  = false;
        }
Exemplo n.º 17
0
 public static ColorTransform CopyColorTransform(
     ColorTransform dst, ColorTransform src)
 {
     if (src == null)
     {
         dst.Clear();
     }
     else
     {
         dst.Set(src);
     }
     return(dst);
 }
Exemplo n.º 18
0
        public static void CalcColorTransform(ColorTransform dst,
		ColorTransform src0, ColorTransform src1)
        {
            dst.multi.red   = src0.multi.red   * src1.multi.red;
            dst.multi.green = src0.multi.green * src1.multi.green;
            dst.multi.blue  = src0.multi.blue  * src1.multi.blue;
            dst.multi.alpha = src0.multi.alpha * src1.multi.alpha;
            #if LWF_USE_ADDITIONALCOLOR
            dst.add.red   = src0.add.red   * src1.multi.red   + src1.add.red;
            dst.add.green = src0.add.green * src1.multi.green + src1.add.green;
            dst.add.blue  = src0.add.blue  * src1.multi.blue  + src1.add.blue;
            dst.add.alpha = src0.add.alpha * src1.multi.alpha + src1.add.alpha;
            #endif
        }
Exemplo n.º 19
0
        public static void CalcColor(Color dst, Color c, ColorTransform t)
        {
#if LWF_USE_ADDITIONALCOLOR
            dst.red   = c.red * t.multi.red + t.add.red;
            dst.green = c.green * t.multi.green + t.add.green;
            dst.blue  = c.blue * t.multi.blue + t.add.blue;
            dst.alpha = c.alpha * t.multi.alpha + t.add.alpha;
#else
            dst.red   = c.red * t.multi.red;
            dst.green = c.green * t.multi.green;
            dst.blue  = c.blue * t.multi.blue;
            dst.alpha = c.alpha * t.multi.alpha;
#endif
        }
Exemplo n.º 20
0
 public static void CalcColor(Color dst, Color c, ColorTransform t)
 {
     #if LWF_USE_ADDITIONALCOLOR
     dst.red   = c.red   * t.multi.red   + t.add.red;
     dst.green = c.green * t.multi.green + t.add.green;
     dst.blue  = c.blue  * t.multi.blue  + t.add.blue;
     dst.alpha = c.alpha * t.multi.alpha + t.add.alpha;
     #else
     dst.red   = c.red   * t.multi.red;
     dst.green = c.green * t.multi.green;
     dst.blue  = c.blue  * t.multi.blue;
     dst.alpha = c.alpha * t.multi.alpha;
     #endif
 }
Exemplo n.º 21
0
        public static void CalcColorTransform(ColorTransform dst,
                                              ColorTransform src0, ColorTransform src1)
        {
            dst.multi.red   = src0.multi.red * src1.multi.red;
            dst.multi.green = src0.multi.green * src1.multi.green;
            dst.multi.blue  = src0.multi.blue * src1.multi.blue;
            dst.multi.alpha = src0.multi.alpha * src1.multi.alpha;
#if LWF_USE_ADDITIONALCOLOR
            dst.add.red   = src0.add.red * src1.multi.red + src1.add.red;
            dst.add.green = src0.add.green * src1.multi.green + src1.add.green;
            dst.add.blue  = src0.add.blue * src1.multi.blue + src1.add.blue;
            dst.add.alpha = src0.add.alpha * src1.multi.alpha + src1.add.alpha;
#endif
        }
Exemplo n.º 22
0
    void DrawInfo(ObjectContainer container, LWF.Object obj)
    {
        LWF.Matrix m = obj.matrix;
        EditorGUILayout.LabelField("Matrix", string.Format(
                                       "(sx:{0}, sy:{1}, k0:{2}, k1:{3}, tx:{4}, ty:{5}) ri:{6} rc:{7}",
                                       m.scaleX, m.scaleY, m.skew0, m.skew1, m.translateX, m.translateY,
                                       container.renderingIndex, container.renderingCount));

        LWF.ColorTransform c = obj.colorTransform;
        EditorGUILayout.LabelField("ColorTransform",
                                   string.Format("multi:(r:{0},g:{1},b:{2},a:{3}) " +
                                                 "add:(r:{4},g:{5},b:{6},a:{7})",
                                                 c.multi.red, c.multi.green, c.multi.blue, c.multi.alpha,
                                                 c.add.red, c.add.green, c.add.blue, c.add.alpha));
    }
Exemplo n.º 23
0
	public Object(LWF lwf, Movie parent, Type type, int objId)
	{
		m_lwf = lwf;
		m_parent = parent;
		m_type = type;
		m_objectId = objId;
		m_matrixId = -1;
		m_colorTransformId = -1;
		m_matrixIdChanged = true;
		m_colorTransformIdChanged = true;
		m_matrix = new Matrix(0, 0, 0, 0, 0, 0);
		m_colorTransform = new ColorTransform(0, 0, 0, 0);
		m_execCount = 0;
		m_updated = false;
	}
Exemplo n.º 24
0
 public virtual void Update(Matrix m, ColorTransform c)
 {
     m_updated = true;
     if (m != null)
     {
         Utility.CalcMatrix(m_lwf, m_matrix, m, m_dataMatrixId);
         m_matrixIdChanged = false;
     }
     if (c != null)
     {
         Utility.CopyColorTransform(m_colorTransform, c);
         m_colorTransformIdChanged = false;
     }
     m_lwf.RenderObject();
 }
Exemplo n.º 25
0
 public Object(LWF lwf, Movie parent, Type type, int objId)
 {
     m_lwf                     = lwf;
     m_parent                  = parent;
     m_type                    = type;
     m_objectId                = objId;
     m_matrixId                = -1;
     m_colorTransformId        = -1;
     m_matrixIdChanged         = true;
     m_colorTransformIdChanged = true;
     m_matrix                  = new Matrix(0, 0, 0, 0, 0, 0);
     m_colorTransform          = new ColorTransform(0, 0, 0, 0);
     m_execCount               = 0;
     m_updated                 = false;
 }
Exemplo n.º 26
0
        public static float GetBlue(Movie movie)
        {
            int colorTransformId = movie.colorTransformId;

            if ((colorTransformId & (int)Constant.COLORTRANSFORM_FLAG) == 0)
            {
                return(1);
            }
            else
            {
                colorTransformId &= ~(int)Constant.COLORTRANSFORM_FLAG;
                ColorTransform colorTransform =
                    movie.lwf.data.colorTransforms[colorTransformId];
                return(colorTransform.multi.blue);
            }
        }
Exemplo n.º 27
0
        public static float GetAlpha(Movie movie)
        {
            int colorTransformId = movie.colorTransformId;

            if ((colorTransformId & (int)Constant.COLORTRANSFORM_FLAG) == 0)
            {
                AlphaTransform alphaTransform =
                    movie.lwf.data.alphaTransforms[colorTransformId];
                return(alphaTransform.alpha);
            }
            else
            {
                colorTransformId &= ~(int)Constant.COLORTRANSFORM_FLAG;
                ColorTransform colorTransform =
                    movie.lwf.data.colorTransforms[colorTransformId];
                return(colorTransform.multi.alpha);
            }
        }
Exemplo n.º 28
0
        public static void GetColorTransform(Movie movie)
        {
            int            colorTransformId = movie.colorTransformId;
            ColorTransform colorTransform;

            if ((colorTransformId & (int)Constant.COLORTRANSFORM_FLAG) == 0)
            {
                AlphaTransform alphaTransform =
                    movie.lwf.data.alphaTransforms[colorTransformId];
                colorTransform = new ColorTransform(1, 1, 1, alphaTransform.alpha);
            }
            else
            {
                colorTransformId &= ~(int)Constant.COLORTRANSFORM_FLAG;
                colorTransform    = movie.lwf.data.colorTransforms[colorTransformId];
            }

            movie.SetColorTransform(colorTransform);
        }
Exemplo n.º 29
0
        public Movie(LWF lwf, Movie parent, int objId,
                     int instId, int matrixId = 0, int colorTransformId           = 0,
                     bool attached            = false, MovieEventHandlers handler = null)
            : base(lwf, parent,
                   attached ? Type.ATTACHEDMOVIE : Type.MOVIE, objId, instId)
        {
            m_data                 = lwf.data.movies[objId];
            m_matrixId             = matrixId;
            m_colorTransformId     = colorTransformId;
            m_totalFrames          = m_data.frames;
            m_instanceHead         = null;
            m_instanceTail         = null;
            m_currentFrameInternal = -1;
            m_execedFrame          = -1;
            m_animationPlayedFrame = -1;
            m_postLoaded           = false;
            m_active               = true;
            m_visible              = true;
            m_playing              = true;
            m_jumped               = false;
            m_overriding           = false;

            m_property = new Property(lwf);

            m_matrix0         = new Matrix();
            m_matrix1         = new Matrix();
            m_colorTransform0 = new ColorTransform();
            m_colorTransform1 = new ColorTransform();

            m_displayList = new Object[m_data.depths];

            PlayAnimation(ClipEvent.LOAD);

            m_handler = (handler != null ?
                         handler : lwf.GetMovieEventHandlers(this));
            if (m_handler != null)
            {
                m_handler.Call(EventType.LOAD, this);
            }

            lwf.ExecMovieCommand();
        }
Exemplo n.º 30
0
        public static ColorTransform CalcColorTransform(LWF lwf,
		ColorTransform dst, ColorTransform src0, int src1Id)
        {
            if (src1Id == 0) {
            dst.Set(src0);
            } else if ((src1Id & (int)Constant.COLORTRANSFORM_FLAG) == 0) {
            AlphaTransform alphaTransform =
                lwf.data.alphaTransforms[src1Id];
            dst.multi.red   = src0.multi.red;
            dst.multi.green = src0.multi.green;
            dst.multi.blue  = src0.multi.blue;
            dst.multi.alpha = src0.multi.alpha * alphaTransform.alpha;
            #if LWF_USE_ADDITIONALCOLOR
            dst.add.Set(src0.add);
            #endif
            } else {
            int colorTransformId = src1Id & ~(int)Constant.COLORTRANSFORM_FLAG;
            ColorTransform src1 = lwf.data.colorTransforms[colorTransformId];
            CalcColorTransform(dst, src0, src1);
            }
            return dst;
        }
Exemplo n.º 31
0
        public LWF(Data lwfData, IRendererFactory rendererFactory = null)
        {
            m_data = lwfData;

            interactive     = lwfData.buttonConditions.Length > 0;
            m_frameRate     = @data.header.frameRate;
            m_execLimit     = 3;
            m_tick          = 1.0f / m_frameRate;
            m_roundOffTick  = m_tick * ROUND_OFF_TICK_RATE;
            m_attachVisible = true;
            m_interceptByNotAllowOrDenyButtons = true;
            m_intercepted = false;
            scaleByStage  = 1.0f;
            m_pointX      = Single.MinValue;
            m_pointY      = Single.MinValue;
            m_pressing    = false;

            if (!interactive && m_data.frames.Length == 1)
            {
                DisableExec();
            }

            m_property  = new Property(this);
            m_instances = new IObject[m_data.instanceNames.Length];
            InitEvent();
            m_movieCommands             = new MovieCommands();
            m_programObjectConstructors =
                new ProgramObjectConstructor[m_data.programObjects.Length];

            m_matrix                 = new Matrix();
            m_matrixIdentity         = new Matrix();
            m_colorTransform         = new ColorTransform();
            m_colorTransformIdentity = new ColorTransform();

            Init();

            SetRendererFactory(rendererFactory);
        }
Exemplo n.º 32
0
        private ColorTransform CalcColorTransform(ColorTransform colorTransform)
        {
            ColorTransform c;
            Property       p = m_property;

            if (p.hasColorTransform)
            {
                if (colorTransform != null)
                {
                    c = m_colorTransform;
                    Utility.CalcColorTransform(c, colorTransform, p.colorTransform);
                }
                else
                {
                    c = p.colorTransform;
                }
            }
            else
            {
                c = colorTransform;
            }
            return(c);
        }
Exemplo n.º 33
0
        private void UpdateObject(Object obj, Matrix m, ColorTransform c,
                                  bool matrixChanged, bool colorTransformChanged)
        {
            Matrix objm;

            if (obj.IsMovie() && ((Movie)obj).m_property.hasMatrix)
            {
                objm = m;
            }
            else if (matrixChanged || !obj.updated || obj.matrixIdChanged)
            {
                objm = Utility.CalcMatrix(m_lwf, m_matrix1, m, obj.matrixId);
            }
            else
            {
                objm = null;
            }

            ColorTransform objc;

            if (obj.IsMovie() && ((Movie)obj).m_property.hasColorTransform)
            {
                objc = c;
            }
            else if (colorTransformChanged ||
                     !obj.updated || obj.colorTransformIdChanged)
            {
                objc = Utility.CalcColorTransform(
                    m_lwf, m_colorTransform1, c, obj.colorTransformId);
            }
            else
            {
                objc = null;
            }

            obj.Update(objm, objc);
        }
Exemplo n.º 34
0
        public override void Update(Matrix m, ColorTransform c)
        {
            if (!m_active)
            return;

            if (this.totalFrames == 0) {
                m_active = true;
            }

            bool matrixChanged;
            bool colorTransformChanged;

            if (m_overriding) {
            matrixChanged = true;
            colorTransformChanged = true;
            } else {
            matrixChanged = m_matrix.SetWithComparing(m);
            colorTransformChanged = m_colorTransform.SetWithComparing(c);
            }

            if (m_property.hasMatrix) {
            matrixChanged = true;
            m = Utility.CalcMatrix(m_matrix0, m_matrix, m_property.matrix);
            } else {
            m = m_matrix;
            }

            if (m_property.hasColorTransform) {
            colorTransformChanged = true;
            c = Utility.CalcColorTransform(
                m_colorTransform0, m_colorTransform, m_property.colorTransform);
            } else {
            c = m_colorTransform;
            }

            if (m_attachedLWFs != null) {
            m_needsUpdateAttachedLWFs = false;
            m_needsUpdateAttachedLWFs |=
                m_matrixForAttachedLWFs.SetWithComparing(m);
            m_needsUpdateAttachedLWFs |=
                m_colorTransformForAttachedLWFs.SetWithComparing(c);
            }

            for (int dlDepth = 0; dlDepth < m_data.depths; ++dlDepth) {
            Object obj = m_displayList[dlDepth];
            if (obj != null)
                UpdateObject(obj, m, c, matrixChanged, colorTransformChanged);
            }

            if (m_bitmapClips != null) {
            foreach (BitmapClip bitmapClip in m_bitmapClips.Values)
                if (bitmapClip != null)
                    bitmapClip.Update(m, c);
            }

            if (m_attachedMovies != null) {
            foreach (Movie movie in m_attachedMovieList.Values)
                if (movie != null)
                    UpdateObject(movie,
                        m, c, matrixChanged, colorTransformChanged);
            }
        }
Exemplo n.º 35
0
        public Movie(LWF lwf, Movie parent, int objId, int instId, int matrixId = 0,
			int colorTransformId = 0, bool attached = false,
			MovieEventHandlers handler = null, string n = null)
            : base(lwf, parent,
			attached ? Type.ATTACHEDMOVIE : Type.MOVIE, objId, instId)
        {
            m_data = lwf.data.movies[objId];
            m_matrixId = matrixId;
            m_colorTransformId = colorTransformId;
            m_totalFrames = m_data.frames;

            if (!String.IsNullOrEmpty(n))
            m_name = n;
            m_instanceHead = null;
            m_instanceTail = null;
            m_currentFrameInternal = -1;
            m_execedFrame = -1;
            m_animationPlayedFrame = -1;
            m_lastControlOffset = -1;
            m_lastControls = -1;
            m_lastHasButton = false;
            m_lastControlAnimationOffset = -1;
            m_skipped = false;
            m_postLoaded = false;
            m_active = true;
            m_visible = true;
            m_playing = true;
            m_jumped = false;
            m_overriding = false;
            m_attachMovieExeced = false;
            m_attachMoviePostExeced = false;
            m_movieExecCount = -1;
            m_postExecCount = -1;
            m_blendMode = (int)Constant.BLEND_MODE_NORMAL;
            m_requestedCalculateBounds = false;
            m_calculateBoundsCallback = null;

            m_property = new Property(lwf);

            m_matrix0 = new Matrix();
            m_matrix1 = new Matrix();
            m_matrixForAttachedLWFs = new Matrix();
            m_colorTransform0 = new ColorTransform();
            m_colorTransform1 = new ColorTransform();
            m_colorTransformForAttachedLWFs = new ColorTransform();

            m_displayList = new Object[m_data.depths];

            m_eventHandlers = new EventHandlers();
            m_handler = new MovieEventHandlers();
            m_handler.Add(lwf.GetMovieEventHandlers(this));
            m_handler.Add(handler);

            #if LWF_USE_LUA
            m_isRoot = objId == lwf.data.header.rootMovieId;
            if (m_isRoot) {
            if (parent == null)
                lwf.CallFunctionLua("Init", this);
            lwf.GetFunctionsLua(objId, out m_rootLoadFunc,
                out m_rootPostLoadFunc, out m_rootUnloadFunc,
                    out m_rootEnterFrameFunc, true);
            }
            lwf.GetFunctionsLua(objId, out m_loadFunc, out m_postLoadFunc,
            out m_unloadFunc, out m_enterFrameFunc, false);

            if (m_isRoot && !String.IsNullOrEmpty(m_rootLoadFunc))
            lwf.CallFunctionLua(m_rootLoadFunc, this);
            if (m_loadFunc != String.Empty)
            lwf.CallFunctionLua(m_loadFunc, this);
            #endif

            PlayAnimation(ClipEvent.LOAD);
            if (!m_handler.Empty())
            m_handler.Call(EventType.LOAD, this);

            lwf.ExecMovieCommand();
        }
Exemplo n.º 36
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;
	}
Exemplo n.º 37
0
        public override void Update(Matrix m, ColorTransform c)
        {
            base.Update(m, c);

            if (m_handler != null && m_handler.update != null)
            m_handler.update(this);
        }
Exemplo n.º 38
0
        public int ForceExecWithoutProgress(
		Matrix matrix = null, ColorTransform colorTransform = null)
        {
            return Exec(-1, matrix, colorTransform);
        }
Exemplo n.º 39
0
 private ColorTransform CalcColorTransform(ColorTransform colorTransform)
 {
     ColorTransform c;
     Property p = m_property;
     if (p.hasColorTransform) {
     if (colorTransform != null) {
         c = Utility.CalcColorTransform(
             m_colorTransform, colorTransform, p.colorTransform);
     } else {
         c = p.colorTransform;
     }
     } else {
     c = colorTransform == null ?
         m_colorTransformIdentity : colorTransform;
     }
     return c;
 }
Exemplo n.º 40
0
        public static void CopyColorTransform(
		ColorTransform dst, ColorTransform src)
        {
            if (src == null)
            dst.Clear();
            else
            dst.Set(src);
        }
Exemplo n.º 41
0
        public int Exec(float tick = 0,
		Matrix matrix = null, ColorTransform colorTransform = null)
        {
            bool execed = false;
            float currentProgress = m_progress;
            m_thisTick = tick;

            if (m_execDisabled && tweens == null) {
            if (!m_executedForExecDisabled) {
                ++m_execCount;
                m_rootMovie.Exec();
                m_rootMovie.PostExec(true);
                m_executedForExecDisabled = true;
                execed = true;
            }
            } else {
            bool progressing = true;
            if (tick == 0) {
                m_progress = m_tick;
            } else if (tick < 0) {
                m_progress = m_tick;
                progressing = false;
            } else {
                if (m_time == 0) {
                    m_time += (double)m_tick;
                    m_progress += m_tick;
                } else {
                    m_time += (double)tick;
                    m_progress += tick;
                }
            }

            if (m_execHandlers != null)
                m_execHandlers.ForEach(h => h(this));

            int execLimit = m_execLimit;
            while (m_progress >= m_tick - m_roundOffTick) {
                if (--execLimit < 0) {
                    m_progress = 0;
                    break;
                }
                m_progress -= m_tick;
                ++m_execCount;
                m_rootMovie.Exec();
                m_rootMovie.PostExec(progressing);
                execed = true;
            }

            if (m_progress < m_roundOffTick)
                m_progress = 0;

            m_buttonHead = null;
            if (interactive && m_rootMovie.hasButton)
                m_rootMovie.LinkButton();
            }

            if (execed || isLWFAttached ||
                isPropertyDirty || matrix != null || colorTransform != null)
            Update(matrix, colorTransform);

            if (!m_execDisabled) {
            if (tick < 0)
                m_progress = currentProgress;
            }

            return m_renderingCount;
        }
Exemplo n.º 42
0
        public override void Update(Matrix m, ColorTransform c)
        {
            base.Update(m, c);

            if (m_handler != null)
            m_handler.Call(EventType.UPDATE, this);
        }
Exemplo n.º 43
0
        public Movie(LWF lwf, Movie parent, int objId,
			int instId, int matrixId = 0, int colorTransformId = 0,
			bool attached = false, MovieEventHandlers handler = null)
            : base(lwf, parent,
			attached ? Type.ATTACHEDMOVIE : Type.MOVIE, objId, instId)
        {
            m_data = lwf.data.movies[objId];
            m_matrixId = matrixId;
            m_colorTransformId = colorTransformId;
            m_totalFrames = m_data.frames;
            m_instanceHead = null;
            m_instanceTail = null;
            m_currentFrameInternal = -1;
            m_execedFrame = -1;
            m_animationPlayedFrame = -1;
            m_lastControlOffset = -1;
            m_lastControls = -1;
            m_lastHasButton = false;
            m_lastControlAnimationOffset = -1;
            m_skipped = false;
            m_postLoaded = false;
            m_active = true;
            m_visible = true;
            m_playing = true;
            m_jumped = false;
            m_overriding = false;
            m_attachMovieExeced = false;
            m_attachMoviePostExeced = false;
            m_movieExecCount = -1;
            m_postExecCount = -1;

            m_property = new Property(lwf);

            m_matrix0 = new Matrix();
            m_matrix1 = new Matrix();
            m_colorTransform0 = new ColorTransform();
            m_colorTransform1 = new ColorTransform();

            m_displayList = new Object[m_data.depths];

            PlayAnimation(ClipEvent.LOAD);

            m_eventHandlers = new EventHandlerDictionary();
            m_handler.Add(lwf.GetMovieEventHandlers(this));
            m_handler.Add(handler);
            if (m_handler != null)
            m_handler.Call(EventType.LOAD, this);

            lwf.ExecMovieCommand();
        }
Exemplo n.º 44
0
	public override void Update(Matrix m, ColorTransform c)
	{
		base.Update(m, c);
		if (m_renderer != null)
			m_renderer.Update(m_matrix, m_colorTransform);
	}
Exemplo n.º 45
0
	public virtual void Update(Matrix m, ColorTransform c)
	{
		m_updated = true;
		if (m != null) {
			Utility.CalcMatrix(m_lwf, m_matrix, m, m_dataMatrixId);
			m_matrixIdChanged = false;
		}
		if (c != null) {
			Utility.CopyColorTransform(m_colorTransform, c);
			m_colorTransformIdChanged = false;
		}
		m_lwf.RenderObject();
	}
Exemplo n.º 46
0
        public Data(byte[] bytes)
        {
            if (bytes.Length < (int)Format.Constant.HEADER_SIZE)
            return;

            Stream s = new MemoryStream(bytes);
            BinaryReader br = new BinaryReader(s);

            header = new Format.Header(br);
            if (!Check())
            return;

            byte[] stringByteData = br.ReadBytes((int)header.stringBytes.length);
            byte[] animationByteData =
            br.ReadBytes((int)header.animationBytes.length);

            translates = new Translate[header.translate.length];
            for (int i = 0; i < translates.Length; ++i)
            translates[i] = new Translate(br);
            matrices = new Matrix[header.matrix.length];
            for (int i = 0; i < matrices.Length; ++i)
            matrices[i] = new Matrix(br);
            colors = new Color[header.color.length];
            for (int i = 0; i < colors.Length; ++i)
            colors[i] = new Color(br);
            alphaTransforms = new AlphaTransform[header.alphaTransform.length];
            for (int i = 0; i < alphaTransforms.Length; ++i)
            alphaTransforms[i] = new AlphaTransform(br);
            colorTransforms = new ColorTransform[header.colorTransform.length];
            for (int i = 0; i < colorTransforms.Length; ++i)
            colorTransforms[i] = new ColorTransform(br);
            objects = new Format.Object[header.objectData.length];
            for (int i = 0; i < objects.Length; ++i)
            objects[i] = new Format.Object(br);
            textures = new Format.Texture[header.texture.length];
            for (int i = 0; i < textures.Length; ++i)
            textures[i] = new Format.Texture(br);
            textureFragments =
            new Format.TextureFragment[header.textureFragment.length];
            for (int i = 0; i < textureFragments.Length; ++i)
            textureFragments[i] = new Format.TextureFragment(br);
            bitmaps = new Format.Bitmap[header.bitmap.length];
            for (int i = 0; i < bitmaps.Length; ++i)
            bitmaps[i] = new Format.Bitmap(br);
            bitmapExs = new Format.BitmapEx[header.bitmapEx.length];
            for (int i = 0; i < bitmapExs.Length; ++i)
            bitmapExs[i] = new Format.BitmapEx(br);
            fonts = new Format.Font[header.font.length];
            for (int i = 0; i < fonts.Length; ++i)
            fonts[i] = new Format.Font(br);
            textProperties = new Format.TextProperty[header.textProperty.length];
            for (int i = 0; i < textProperties.Length; ++i)
            textProperties[i] = new Format.TextProperty(br);
            texts = new Format.Text[header.text.length];
            for (int i = 0; i < texts.Length; ++i)
            texts[i] = new Format.Text(br);
            particleDatas = new Format.ParticleData[header.particleData.length];
            for (int i = 0; i < particleDatas.Length; ++i)
            particleDatas[i] = new Format.ParticleData(br);
            particles = new Format.Particle[header.particle.length];
            for (int i = 0; i < particles.Length; ++i)
            particles[i] = new Format.Particle(br);
            programObjects =
            new Format.ProgramObject[header.programObject.length];
            for (int i = 0; i < programObjects.Length; ++i)
            programObjects[i] = new Format.ProgramObject(br);
            graphicObjects =
            new Format.GraphicObject[header.graphicObject.length];
            for (int i = 0; i < graphicObjects.Length; ++i)
            graphicObjects[i] = new Format.GraphicObject(br);
            graphics = new Format.Graphic[header.graphic.length];
            for (int i = 0; i < graphics.Length; ++i)
            graphics[i] = new Format.Graphic(br);
            Format.Animation[] animationData =
            new Format.Animation[header.animation.length];
            for (int i = 0; i < animationData.Length; ++i)
            animationData[i] = new Format.Animation(br);
            buttonConditions =
            new Format.ButtonCondition[header.buttonCondition.length];
            for (int i = 0; i < buttonConditions.Length; ++i)
            buttonConditions[i] = new Format.ButtonCondition(br);
            buttons = new Format.Button[header.button.length];
            for (int i = 0; i < buttons.Length; ++i)
            buttons[i] = new Format.Button(br);
            labels = new Format.Label[header.label.length];
            for (int i = 0; i < labels.Length; ++i)
            labels[i] = new Format.Label(br);
            instanceNames = new Format.InstanceName[header.instanceName.length];
            for (int i = 0; i < instanceNames.Length; ++i)
            instanceNames[i] = new Format.InstanceName(br);
            events = new Format.Event[header.eventData.length];
            for (int i = 0; i < events.Length; ++i)
            events[i] = new Format.Event(br);
            places = new Format.Place[header.place.length];
            for (int i = 0; i < places.Length; ++i)
            places[i] = new Format.Place(br);
            controlMoveMs = new Format.ControlMoveM[header.controlMoveM.length];
            for (int i = 0; i < controlMoveMs.Length; ++i)
            controlMoveMs[i] = new Format.ControlMoveM(br);
            controlMoveCs = new Format.ControlMoveC[header.controlMoveC.length];
            for (int i = 0; i < controlMoveCs.Length; ++i)
            controlMoveCs[i] = new Format.ControlMoveC(br);
            controlMoveMCs =
            new Format.ControlMoveMC[header.controlMoveMC.length];
            for (int i = 0; i < controlMoveMCs.Length; ++i)
            controlMoveMCs[i] = new Format.ControlMoveMC(br);
            controls = new Format.Control[header.control.length];
            for (int i = 0; i < controls.Length; ++i)
            controls[i] = new Format.Control(br);
            frames = new Format.Frame[header.frame.length];
            for (int i = 0; i < frames.Length; ++i)
            frames[i] = new Format.Frame(br);
            movieClipEvents =
            new Format.MovieClipEvent[header.movieClipEvent.length];
            for (int i = 0; i < movieClipEvents.Length; ++i)
            movieClipEvents[i] = new Format.MovieClipEvent(br);
            movies = new Format.Movie[header.movie.length];
            for (int i = 0; i < movies.Length; ++i)
            movies[i] = new Format.Movie(br);
            movieLinkages = new Format.MovieLinkage[header.movieLinkage.length];
            for (int i = 0; i < movieLinkages.Length; ++i)
            movieLinkages[i] = new Format.MovieLinkage(br);
            Format.String[] stringData =
            new Format.String[header.stringData.length];
            for (int i = 0; i < stringData.Length; ++i)
            stringData[i] = new Format.String(br);

            animations = new int[animationData.Length][];
            for (int i = 0; i < animationData.Length; ++i) {
            animations[i] = ReadAnimation(animationByteData,
                (int)animationData[i].animationOffset,
                (int)animationData[i].animationLength);
            }

            strings = new string[stringData.Length];
            for (int i = 0; i < stringData.Length; ++i) {
            strings[i] = System.Text.Encoding.UTF8.GetString(stringByteData,
                (int)stringData[i].stringOffset,
                (int)stringData[i].stringLength);
            }

            stringMap = new Dictionary<string, int>();
            for (int i = 0; i < strings.Length; ++i)
            stringMap[strings[i]] = i;

            instanceNameMap = new Dictionary<int, int>();
            for (int i = 0; i < instanceNames.Length; ++i)
            instanceNameMap[instanceNames[i].stringId] = i;

            eventMap = new Dictionary<int, int>();
            for (int i = 0; i < events.Length; ++i)
            eventMap[events[i].stringId] = i;

            movieLinkageMap = new Dictionary<int, int>();
            movieLinkageNameMap = new Dictionary<int, int>();
            for (int i = 0; i < movieLinkages.Length; ++i) {
            movieLinkageMap[movieLinkages[i].stringId] = i;
            movieLinkageNameMap[movieLinkages[i].movieId] =
                movieLinkages[i].stringId;
            }

            programObjectMap = new Dictionary<int, int>();
            for (int i = 0; i < programObjects.Length; ++i)
            programObjectMap[programObjects[i].stringId] = i;

            labelMap = new Dictionary<int, int>[movies.Length];
            for (int i = 0; i < movies.Length; ++i) {
            Format.Movie m = movies[i];
            int o = m.labelOffset;
            Dictionary<int, int> map = new Dictionary<int, int>();
            for (int j = 0; j < m.labels; ++j) {
                Format.Label l = labels[o + j];
                map[l.stringId] = l.frameNo;
            }
            labelMap[i] = map;
            }

            for (int i = 0; i < textures.Length; ++i)
            textures[i].SetFilename(this);

            bitmapMap = new Dictionary<string, int>();
            var bitmapList = new List<Format.Bitmap>(bitmaps);
            for (int i = 0; i < textureFragments.Length; ++i) {
            textureFragments[i].SetFilename(this);
            bitmapMap[textureFragments[i].filename] = bitmapList.Count;
            bitmapList.Add(
                new Format.Bitmap{matrixId = 0, textureFragmentId = i});
            }
            bitmaps = bitmapList.ToArray();
        }
Exemplo n.º 47
0
        private void UpdateObject(Object obj, Matrix m, ColorTransform c,
		bool matrixChanged, bool colorTransformChanged)
        {
            Matrix objm;
            if (obj.IsMovie() && ((Movie)obj).m_property.hasMatrix)
            objm = m;
            else if (matrixChanged || !obj.updated || obj.matrixIdChanged)
            objm = Utility.CalcMatrix(m_lwf, m_matrix1, m, obj.matrixId);
            else
            objm = null;

            ColorTransform objc;
            if (obj.IsMovie() && ((Movie)obj).m_property.hasColorTransform)
            objc = c;
            else if (colorTransformChanged ||
                !obj.updated || obj.colorTransformIdChanged)
            objc = Utility.CalcColorTransform(
                m_lwf, m_colorTransform1, c, obj.colorTransformId);
            else
            objc = null;

            obj.Update(objm, objc);
        }
Exemplo n.º 48
0
        public static void GetColorTransform(Movie movie)
        {
            int colorTransformId = movie.colorTransformId;
            ColorTransform colorTransform;
            if ((colorTransformId & (int)Constant.COLORTRANSFORM_FLAG) == 0) {
            AlphaTransform alphaTransform =
                movie.lwf.data.alphaTransforms[colorTransformId];
            colorTransform = new ColorTransform(1, 1, 1, alphaTransform.alpha);
            } else {
            colorTransformId &= ~(int)Constant.COLORTRANSFORM_FLAG;
            colorTransform = movie.lwf.data.colorTransforms[colorTransformId];
            }

            movie.SetColorTransform(colorTransform);
        }
Exemplo n.º 49
0
        public LWF(Data lwfData, IRendererFactory r)
        {
            m_data = lwfData;

            interactive = m_data.buttonConditions.Length > 0;
            m_frameRate = m_data.header.frameRate;
            m_execLimit = 3;
            m_tick = 1.0f / m_frameRate;
            m_roundOffTick = m_tick * ROUND_OFF_TICK_RATE;
            m_attachVisible = true;
            m_interceptByNotAllowOrDenyButtons = true;
            m_intercepted = false;
            scaleByStage = 1.0f;
            m_pointX = Single.MinValue;
            m_pointY = Single.MinValue;
            m_pressing = false;
            m_instanceId = ++m_instanceOffset;
            m_alive = true;

            if (!interactive && m_data.frames.Length == 1)
            DisableExec();

            m_property = new Property(this);
            m_instances = new IObject[m_data.instanceNames.Length];
            InitEvent();
            m_movieCommands = new MovieCommands();
            m_programObjectConstructors =
            new ProgramObjectConstructor[m_data.programObjects.Length];
            m_textDictionary = new TextDictionary();

            m_matrix = new Matrix();
            m_matrixIdentity = new Matrix();
            m_colorTransform = new ColorTransform();
            m_colorTransformIdentity = new ColorTransform();

            Init();

            SetRendererFactory(r);
        }
Exemplo n.º 50
0
	public Movie SetColorTransform(ColorTransform c)
	{
		m_property.SetColorTransform(c);
		return this;
	}
Exemplo n.º 51
0
        public int ForceExec(
		Matrix matrix = null, ColorTransform colorTransform = null)
        {
            return Exec(0, matrix, colorTransform);
        }
Exemplo n.º 52
0
 public void SetColorTransform(LWF.ColorTransform c)
 {
     AddLoadCallback((o) => { lwf.property.SetColorTransform(c); });
 }
Exemplo n.º 53
0
        public void Update(
		Matrix matrix = null, ColorTransform colorTransform = null)
        {
            ++m_updateCount;
            Matrix m = CalcMatrix(matrix);
            ColorTransform c = CalcColorTransform(colorTransform);
            m_renderingIndex = 0;
            m_renderingIndexOffsetted = 0;
            m_rootMovie.Update(m, c);
            m_renderingCount = m_renderingIndex;
            m_propertyDirty = false;
        }
Exemplo n.º 54
0
        public override void Update(Matrix m, ColorTransform c)
        {
            if (!m_active)
            return;

            bool matrixChanged;
            bool colorTransformChanged;

            if (m_overriding) {
            matrixChanged = true;
            colorTransformChanged = true;
            } else {
            matrixChanged = m_matrix.SetWithComparing(m);
            colorTransformChanged = m_colorTransform.SetWithComparing(c);
            }

            if (m_handler != null)
            m_handler.Call(EventType.UPDATE, this);

            if (m_property.hasMatrix) {
            matrixChanged = true;
            m = Utility.CalcMatrix(m_matrix0, m_matrix, m_property.matrix);
            } else {
            m = m_matrix;
            }

            if (m_property.hasColorTransform) {
            colorTransformChanged = true;
            c = Utility.CalcColorTransform(
                m_colorTransform0, m_colorTransform, m_property.colorTransform);
            } else {
            c = m_colorTransform;
            }

            for (int dlDepth = 0; dlDepth < m_data.depths; ++dlDepth) {
            Object obj = m_displayList[dlDepth];
            if (obj != null)
                UpdateObject(obj, m, c, matrixChanged, colorTransformChanged);
            }

            if (m_attachedMovies != null || m_attachedLWFs != null) {
            if (m_attachedMovies != null) {
                foreach (Movie movie in m_attachedMovieList.Values)
                    if (movie != null)
                        UpdateObject(movie,
                            m, c, matrixChanged, colorTransformChanged);
            }

            if (m_attachedLWFs != null) {
                foreach (KeyValuePair<string, bool> kvp in m_detachedLWFs) {
                    string attachName = kvp.Key;
                    LWFContainer lwfContainer;
                    if (m_attachedLWFs.TryGetValue(
                            attachName, out lwfContainer))
                        DeleteAttachedLWF(this, lwfContainer, true, false);
                }
                m_detachedLWFs.Clear();
                foreach (LWFContainer lwfContainer
                        in m_attachedLWFList.Values) {
                    m_lwf.RenderObject(
                        lwfContainer.child.Exec(m_lwf.thisTick, m, c));
                }
            }
            }
        }
Exemplo n.º 55
0
 public virtual void Update(Matrix m, ColorTransform c)
 {
     Utility.CalcMatrix(m_lwf, m_matrix, m, m_dataMatrixId);
     Utility.CopyColorTransform(m_colorTransform, c);
     m_lwf.RenderObject();
 }
Exemplo n.º 56
0
	public override void Update(Matrix m, ColorTransform c)
	{
		int n = m_displayList.Length;
		for (int i = 0; i < n; ++i)
			m_displayList[i].Update(m, c);
	}
Exemplo n.º 57
0
	public static void CalcColor(Color dst, Color c, ColorTransform t)
	{
		dst.red   = c.red   * t.multi.red   + t.add.red;
		dst.green = c.green * t.multi.green + t.add.green;
		dst.blue  = c.blue  * t.multi.blue  + t.add.blue;
		dst.alpha = c.alpha * t.multi.alpha + t.add.alpha;
	}
Exemplo n.º 58
0
        public static ColorTransform CopyColorTransform(
		ColorTransform dst, ColorTransform src)
        {
            if (src == null)
            dst.Clear();
            else
            dst.Set(src);
            return dst;
        }
Exemplo n.º 59
0
 public void SetColorTransformMovie(
     string instanceName, LWF.ColorTransform c, bool immortal = false)
 {
     AddMovieLoadHandler(
         instanceName, (m) => { m.SetColorTransform(c); }, immortal);
 }
Exemplo n.º 60
0
	public void SetColorTransformMovie(
		string instanceName, float vr, float vg, float vb, float va,
			float ar, float ag, float ab, float aa)
	{
		SetMovieLoadCommand(instanceName, (m) => {
			ColorTransform c =
				new ColorTransform(vr, vg, vb, va, ar, ag, ab, aa);
			m.SetColorTransform(c);
		});
	}