Ejemplo n.º 1
0
 Frames IAnimationOwner.GetOwnedFrames(IHue hue, int realID)
 {
     if (((this.m_iAnimationPool != realID) || (this.m_hAnimationPool != hue)) || this.m_fAnimationPool.Disposed)
     {
         this.m_fAnimationPool = hue.GetAnimation(realID);
         this.m_hAnimationPool = hue;
         this.m_iAnimationPool = realID;
     }
     return(this.m_fAnimationPool);
 }
Ejemplo n.º 2
0
 Frames IAnimationOwner.GetOwnedFrames(IHue hue, int realID)
 {
     if (this.m_iAnimationPool == realID && this.m_hAnimationPool == hue && !this.m_fAnimationPool.Disposed)
     {
         return(this.m_fAnimationPool);
     }
     this.m_fAnimationPool = hue.GetAnimation(realID);
     this.m_hAnimationPool = hue;
     this.m_iAnimationPool = realID;
     return(this.m_fAnimationPool);
 }
Ejemplo n.º 3
0
        public Frame GetFrame(IAnimationOwner owner, int BodyID, int ActionID, int Direction, int Frame, int xCenter, int yCenter, IHue h, ref int TextureX, ref int TextureY, bool preserveHue)
        {
            Frames animation;

            if (BodyID <= 0)
            {
                return(Frame.Empty);
            }
            this.m_Action = ActionID;
            Direction    &= 7;
            int direction = Direction;

            if (Direction > 4)
            {
                direction -= (Direction - 4) * 2;
            }
            this.Translate(ref BodyID, ref h);
            this.m_BodyID = BodyID;
            int realID = this.GetRealIDNoMap(BodyID, ActionID, direction);

            if ((realID < 0) || (realID >= this.m_Count))
            {
                return(Frame.Empty);
            }
            if (owner == null)
            {
                animation = h.GetAnimation(realID);
            }
            else
            {
                animation = owner.GetOwnedFrames(h, realID);
            }
            if ((Frame >= animation.FrameCount) || (Frame < 0))
            {
                return(Frame.Empty);
            }
            Frame frame = animation.FrameList[Frame];

            if (((frame != null) && (frame.Image != null)) && !frame.Image.IsEmpty())
            {
                if (Direction > 4)
                {
                    TextureX = xCenter + (frame.CenterX - frame.Image.Width);
                }
                else
                {
                    TextureX = xCenter - frame.CenterX;
                }
                TextureY = (yCenter - frame.Image.Height) - frame.CenterY;
            }
            frame.Image.Flip = Direction > 4;
            return(frame);
        }
Ejemplo n.º 4
0
 Frames IAnimationOwner.GetOwnedFrames(IHue hue, int realID)
 {
     if (((this.m_iAnimationPool != realID) || (this.m_hAnimationPool != hue)) || this.m_fAnimationPool.Disposed)
     {
         this.m_fAnimationPool = hue.GetAnimation(realID);
         this.m_hAnimationPool = hue;
         this.m_iAnimationPool = realID;
     }
     return this.m_fAnimationPool;
 }
Ejemplo n.º 5
0
 public Frame GetFrame(IAnimationOwner owner, int BodyID, int ActionID, int Direction, int Frame, int xCenter, int yCenter, IHue h, ref int TextureX, ref int TextureY, bool preserveHue)
 {
     Frames animation;
     if (BodyID <= 0)
     {
         return Frame.Empty;
     }
     this.m_Action = ActionID;
     Direction &= 7;
     int direction = Direction;
     if (Direction > 4)
     {
         direction -= (Direction - 4) * 2;
     }
     this.Translate(ref BodyID, ref h);
     this.m_BodyID = BodyID;
     int realID = this.GetRealIDNoMap(BodyID, ActionID, direction);
     if ((realID < 0) || (realID >= this.m_Count))
     {
         return Frame.Empty;
     }
     if (owner == null)
     {
         animation = h.GetAnimation(realID);
     }
     else
     {
         animation = owner.GetOwnedFrames(h, realID);
     }
     if ((Frame >= animation.FrameCount) || (Frame < 0))
     {
         return Frame.Empty;
     }
     Frame frame = animation.FrameList[Frame];
     if (((frame != null) && (frame.Image != null)) && !frame.Image.IsEmpty())
     {
         if (Direction > 4)
         {
             TextureX = xCenter + (frame.CenterX - frame.Image.Width);
         }
         else
         {
             TextureX = xCenter - frame.CenterX;
         }
         TextureY = (yCenter - frame.Image.Height) - frame.CenterY;
     }
     frame.Image.Flip = Direction > 4;
     return frame;
 }