Makes up a DGRPImage.
Inheritance: ITextureProvider, IWorldTextureProvider
Exemple #1
0
        /// <summary>
        /// Reads a DGRPImage from a stream.
        /// </summary>
        /// <param name="iff">An Iff instance.</param>
        /// <param name="stream">A Stream object holding a DGRPImage.</param>
        public void Read(uint version, IoBuffer io)
        {
            uint spriteCount = 0;

            if (version < 20003)
            {
                spriteCount = io.ReadUInt16();
                Direction   = io.ReadByte();
                Zoom        = io.ReadByte();
            }
            else
            {
                Direction   = io.ReadUInt32();
                Zoom        = io.ReadUInt32();
                spriteCount = io.ReadUInt32();
            }

            this.Sprites = new DGRPSprite[spriteCount];
            for (var i = 0; i < spriteCount; i++)
            {
                var sprite = new DGRPSprite(Parent);
                sprite.Read(version, io);
                this.Sprites[i] = sprite;
            }
        }
Exemple #2
0
        /// <summary>
        /// Reads a DGRPImage from a stream.
        /// </summary>
        /// <param name="iff">An Iff instance.</param>
        /// <param name="stream">A Stream object holding a DGRPImage.</param>
        public void Read(uint version, IoBuffer io)
        {
            uint spriteCount = 0;
            if (version < 20003){
                spriteCount = io.ReadUInt16();
                Direction = io.ReadByte();
                Zoom = io.ReadByte();
            }else{
                Direction = io.ReadUInt32();
                Zoom = io.ReadUInt32();
                spriteCount = io.ReadUInt32();
            }

            this.Sprites = new DGRPSprite[spriteCount];
            for (var i = 0; i < spriteCount; i++){
                var sprite = new DGRPSprite(Parent);
                sprite.Read(version, io);
                this.Sprites[i] = sprite;
            }
        }