Exemplo n.º 1
0
        /// <summary>
        /// Loads the file from the specified stream.
        /// </summary>
        /// <param name="stream">The stream to read from.</param>
        public override void Load(Stream stream)
        {
            BinaryReader reader = new BinaryReader(stream, CodePagesEncodingProvider.Instance.GetEncoding("EUC-KR"));

            Name          = reader.ReadIntString();
            SoundEnabled  = reader.ReadInt32() != 0;
            SoundFilePath = reader.ReadIntString();
            LoopCount     = reader.ReadInt32();

            int particleCount = reader.ReadInt32();

            for (int i = 0; i < particleCount; i++)
            {
                EffectParticle particle = new EffectParticle();
                particle.Name               = reader.ReadIntString();
                particle.UniqueIdentifier   = reader.ReadIntString();
                particle.ParticleIndex      = reader.ReadInt32();
                particle.FilePath           = reader.ReadIntString();
                particle.AnimationEnabled   = reader.ReadInt32() != 0;
                particle.AnimationName      = reader.ReadIntString();
                particle.AnimationLoopCount = reader.ReadInt32();
                particle.AnimationIndex     = reader.ReadInt32();
                particle.Position           = reader.ReadVector3();
                particle.Rotation           = reader.ReadQuaternion();
                particle.Delay              = reader.ReadInt32();
                particle.LinkedToRoot       = reader.ReadInt32() != 0;

                Particles.Add(particle);
            }

            int animationCount = reader.ReadInt32();

            for (int i = 0; i < animationCount; i++)
            {
                EffectAnimation animation = new EffectAnimation();
                animation.EffectName         = reader.ReadIntString();
                animation.MeshName           = reader.ReadIntString();
                animation.MeshIndex          = reader.ReadInt32();
                animation.MeshFilePath       = reader.ReadIntString();
                animation.AnimationFilePath  = reader.ReadIntString();
                animation.TextureFilePath    = reader.ReadIntString();
                animation.AlphaEnabled       = reader.ReadInt32() != 0;
                animation.TwoSidedEnabled    = reader.ReadInt32() != 0;
                animation.AlphaTestEnabled   = reader.ReadInt32() != 0;
                animation.DepthTestEnabled   = reader.ReadInt32() != 0;
                animation.DepthWriteEnabled  = reader.ReadInt32() != 0;
                animation.SourceBlend        = reader.ReadInt32();
                animation.DestinationBlend   = reader.ReadInt32();
                animation.BlendOperation     = reader.ReadInt32();
                animation.AnimationEnabled   = reader.ReadInt32() != 0;
                animation.AnimationName      = reader.ReadIntString();
                animation.AnimationLoopCount = reader.ReadInt32();
                animation.AnimationIndex     = reader.ReadInt32();
                animation.Position           = reader.ReadVector3();
                animation.Rotation           = reader.ReadQuaternion();
                animation.Delay        = reader.ReadInt32();
                animation.LoopCount    = reader.ReadInt32();
                animation.LinkedToRoot = reader.ReadInt32() != 0;

                Animations.Add(animation);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Loads the file from the specified stream.
        /// </summary>
        /// <param name="stream">The stream to read from.</param>
        public override void Load(Stream stream)
        {
            BinaryReader reader = new BinaryReader(stream, Encoding.GetEncoding("EUC-KR"));

            Name = reader.ReadIntString();
            SoundEnabled = reader.ReadInt32() != 0;
            SoundFilePath = reader.ReadIntString();
            LoopCount = reader.ReadInt32();

            int particleCount = reader.ReadInt32();

            for (int i = 0; i < particleCount; i++) {
                EffectParticle particle = new EffectParticle();
                particle.Name = reader.ReadIntString();
                particle.UniqueIdentifier = reader.ReadIntString();
                particle.ParticleIndex = reader.ReadInt32();
                particle.FilePath = reader.ReadIntString();
                particle.AnimationEnabled = reader.ReadInt32() != 0;
                particle.AnimationName = reader.ReadIntString();
                particle.AnimationLoopCount = reader.ReadInt32();
                particle.AnimationIndex = reader.ReadInt32();
                particle.Position = reader.ReadVector3();
                particle.Rotation = reader.ReadQuaternion();
                particle.Delay = reader.ReadInt32();
                particle.LinkedToRoot = reader.ReadInt32() != 0;

                Particles.Add(particle);
            }

            int animationCount = reader.ReadInt32();

            for (int i = 0; i < animationCount; i++) {
                EffectAnimation animation = new EffectAnimation();
                animation.EffectName = reader.ReadIntString();
                animation.MeshName = reader.ReadIntString();
                animation.MeshIndex = reader.ReadInt32();
                animation.MeshFilePath = reader.ReadIntString();
                animation.AnimationFilePath = reader.ReadIntString();
                animation.TextureFilePath = reader.ReadIntString();
                animation.AlphaEnabled = reader.ReadInt32() != 0;
                animation.TwoSidedEnabled = reader.ReadInt32() != 0;
                animation.AlphaTestEnabled = reader.ReadInt32() != 0;
                animation.DepthTestEnabled = reader.ReadInt32() != 0;
                animation.DepthWriteEnabled = reader.ReadInt32() != 0;
                animation.SourceBlend = reader.ReadInt32();
                animation.DestinationBlend = reader.ReadInt32();
                animation.BlendOperation = reader.ReadInt32();
                animation.AnimationEnabled = reader.ReadInt32() != 0;
                animation.AnimationName = reader.ReadIntString();
                animation.AnimationLoopCount = reader.ReadInt32();
                animation.AnimationIndex = reader.ReadInt32();
                animation.Position = reader.ReadVector3();
                animation.Rotation = reader.ReadQuaternion();
                animation.Delay = reader.ReadInt32();
                animation.LoopCount = reader.ReadInt32();
                animation.LinkedToRoot = reader.ReadInt32() != 0;

                Animations.Add(animation);
            }
        }