Ejemplo n.º 1
0
        public PrtCollision(PrtBinaryReader reader)
        {
            this.NumTypes = reader.ReadInt32();
            this.TerrainInteractionType = (PrtTerrainInteractionType)reader.ReadInt32();
            this.TerrainHeight = reader.ReadSingle();
            this.TerrainHeightVar = reader.ReadSingle();

            this.CollisionTypes = new List<PrtCollisionType>(this.NumTypes);
        }
Ejemplo n.º 2
0
        public PrtCollision(PrtBinaryReader reader)
        {
            this.NumTypes = reader.ReadInt32();
            this.TerrainInteractionType = (PrtTerrainInteractionType)reader.ReadInt32();
            this.TerrainHeight          = reader.ReadSingle();
            this.TerrainHeightVar       = reader.ReadSingle();

            this.CollisionTypes = new List <PrtCollisionType>(this.NumTypes);
        }
Ejemplo n.º 3
0
        public PrtEmitter(PrtBinaryReader reader)
        {
            this.TiedToEmitter      = reader.ReadBoolean();
            this.IgnoreRotation     = reader.ReadBoolean();
            this.EmitByMotion       = reader.ReadBoolean();
            this.Loop               = reader.ReadBoolean();
            this.InheritVelocity    = reader.ReadBoolean();
            this.UseMinVelocity     = reader.ReadBoolean();
            this.UseMaxVelocity     = reader.ReadBoolean();
            this.AlwaysActive       = reader.ReadBoolean();
            this.SyncWithAttackAnim = reader.ReadBoolean();
            reader.ReadBytes(3); // 32 bit padding

            this.MaxParticles        = reader.ReadInt32();
            this.AppearanceType      = (PrtAppearanceType)reader.ReadInt32();
            this.UpdateRadius        = reader.ReadSingle();
            this.MaxParticlesVar     = reader.ReadSingle();
            this.ParticleLife        = reader.ReadSingle();
            this.ParticleLifeVar     = reader.ReadSingle();
            this.GlobalFadeIn        = reader.ReadSingle();
            this.GlobalFadeInVar     = reader.ReadSingle();
            this.GlobalFadeOut       = reader.ReadSingle();
            this.GlobalFadeOutVar    = reader.ReadSingle();
            this.EmitDistance        = reader.ReadSingle();
            this.EmitDistanceVar     = reader.ReadSingle();
            this.EmissionRate        = reader.ReadSingle();
            this.EmissionRateVar     = reader.ReadSingle();
            this.InitialDormancy     = reader.ReadSingle();
            this.InitialDormancyVar  = reader.ReadSingle();
            this.InitialUpdate       = reader.ReadSingle();
            this.InitialUpdateVar    = reader.ReadSingle();
            this.EmissionTime        = reader.ReadSingle();
            this.EmissionTimeVar     = reader.ReadSingle();
            this.DormantTime         = reader.ReadSingle();
            this.DormantTimeVar      = reader.ReadSingle();
            this.InitialDistance     = reader.ReadSingle();
            this.InitialDistanceVar  = reader.ReadSingle();
            this.InitialVelocity     = reader.ReadSingle();
            this.InitialVelocityVar  = reader.ReadSingle();
            this.Acceleration        = reader.ReadSingle();
            this.AccelerationVar     = reader.ReadSingle();
            this.InheritInfluence    = reader.ReadSingle();
            this.InheritInfluenceVar = reader.ReadSingle();
            this.MinVelocity         = reader.ReadSingle();
            this.MinVelocityVar      = reader.ReadSingle();
            this.MaxVelocity         = reader.ReadSingle();
            this.MaxVelocityVar      = reader.ReadSingle();
        }
Ejemplo n.º 4
0
        public PrtEmitter(PrtBinaryReader reader)
        {
            this.TiedToEmitter = reader.ReadBoolean();
            this.IgnoreRotation = reader.ReadBoolean();
            this.EmitByMotion = reader.ReadBoolean();
            this.Loop = reader.ReadBoolean();
            this.InheritVelocity = reader.ReadBoolean();
            this.UseMinVelocity = reader.ReadBoolean();
            this.UseMaxVelocity = reader.ReadBoolean();
            this.AlwaysActive = reader.ReadBoolean();
            this.SyncWithAttackAnim = reader.ReadBoolean();
            reader.ReadBytes(3); // 32 bit padding

            this.MaxParticles = reader.ReadInt32();
            this.AppearanceType = (PrtAppearanceType)reader.ReadInt32();
            this.UpdateRadius = reader.ReadSingle();
            this.MaxParticlesVar = reader.ReadSingle();
            this.ParticleLife = reader.ReadSingle();
            this.ParticleLifeVar = reader.ReadSingle();
            this.GlobalFadeIn = reader.ReadSingle();
            this.GlobalFadeInVar = reader.ReadSingle();
            this.GlobalFadeOut = reader.ReadSingle();
            this.GlobalFadeOutVar = reader.ReadSingle();
            this.EmitDistance = reader.ReadSingle();
            this.EmitDistanceVar = reader.ReadSingle();
            this.EmissionRate = reader.ReadSingle();
            this.EmissionRateVar = reader.ReadSingle();
            this.InitialDormancy = reader.ReadSingle();
            this.InitialDormancyVar = reader.ReadSingle();
            this.InitialUpdate = reader.ReadSingle();
            this.InitialUpdateVar = reader.ReadSingle();
            this.EmissionTime = reader.ReadSingle();
            this.EmissionTimeVar = reader.ReadSingle();
            this.DormantTime = reader.ReadSingle();
            this.DormantTimeVar = reader.ReadSingle();
            this.InitialDistance = reader.ReadSingle();
            this.InitialDistanceVar = reader.ReadSingle();
            this.InitialVelocity = reader.ReadSingle();
            this.InitialVelocityVar = reader.ReadSingle();
            this.Acceleration = reader.ReadSingle();
            this.AccelerationVar = reader.ReadSingle();
            this.InheritInfluence = reader.ReadSingle();
            this.InheritInfluenceVar = reader.ReadSingle();
            this.MinVelocity = reader.ReadSingle();
            this.MinVelocityVar = reader.ReadSingle();
            this.MaxVelocity = reader.ReadSingle();
            this.MaxVelocityVar = reader.ReadSingle();
        }
Ejemplo n.º 5
0
        public PrtColor(PrtBinaryReader reader)
        {
            this.UsePalette = reader.ReadBoolean();
            this.LoopingCycle = reader.ReadBoolean();
            reader.ReadBytes(2);

            this.NumPaletteColors = reader.ReadInt32();
            this.NumStages = reader.ReadInt32();
            this.CycleTime = reader.ReadSingle();
            this.CycleTimeVar = reader.ReadSingle();
            this.WorldLightingInfluence = reader.ReadSingle();
            this.Color = reader.ReadTexel();

            this.PaletteColors = new List<Texel>(this.NumPaletteColors);
            this.ColorStages = new List<PrtColorStage>(this.NumStages);
        }
Ejemplo n.º 6
0
        public PrtColor(PrtBinaryReader reader)
        {
            this.UsePalette   = reader.ReadBoolean();
            this.LoopingCycle = reader.ReadBoolean();
            reader.ReadBytes(2);

            this.NumPaletteColors       = reader.ReadInt32();
            this.NumStages              = reader.ReadInt32();
            this.CycleTime              = reader.ReadSingle();
            this.CycleTimeVar           = reader.ReadSingle();
            this.WorldLightingInfluence = reader.ReadSingle();
            this.Color = reader.ReadTexel();

            this.PaletteColors = new List <Texel>(this.NumPaletteColors);
            this.ColorStages   = new List <PrtColorStage>(this.NumStages);
        }
Ejemplo n.º 7
0
        public PrtAppearance(PrtBinaryReader reader)
        {
            this.OrientByMotion = reader.ReadBoolean();
            reader.ReadBytes(3);

            this.NumFiles         = reader.ReadInt32();
            this.NumFrames        = reader.ReadInt32();
            this.FrameWidth       = reader.ReadInt32();
            this.FrameHeight      = reader.ReadInt32();
            this.MaterialType     = (PrtMaterialType)reader.ReadInt32();
            this.Emissive         = reader.ReadTexel();
            this.Specular         = reader.ReadTexel();
            this.SpecularExponent = reader.ReadSingle();
            this.FramesPerSecond  = reader.ReadSingle();
            this.AnimationRate    = reader.ReadSingle();
            this.AnimationRateVar = reader.ReadSingle();

            this.AppearanceWeights = new List <float>(this.NumFiles);
            this.AppearanceFiles   = new List <string>(this.NumFiles);
        }
Ejemplo n.º 8
0
        public PrtAppearance(PrtBinaryReader reader)
        {
            this.OrientByMotion = reader.ReadBoolean();
            reader.ReadBytes(3);

            this.NumFiles = reader.ReadInt32();
            this.NumFrames = reader.ReadInt32();
            this.FrameWidth = reader.ReadInt32();
            this.FrameHeight = reader.ReadInt32();
            this.MaterialType = (PrtMaterialType)reader.ReadInt32();
            this.Emissive = reader.ReadTexel();
            this.Specular = reader.ReadTexel();
            this.SpecularExponent = reader.ReadSingle();
            this.FramesPerSecond = reader.ReadSingle();
            this.AnimationRate = reader.ReadSingle();
            this.AnimationRateVar = reader.ReadSingle();

            this.AppearanceWeights = new List<float>(this.NumFiles);
            this.AppearanceFiles = new List<string>(this.NumFiles);
        }
Ejemplo n.º 9
0
        public PrtFile(Stream stream)
        {
            using (PrtBinaryReader reader = new PrtBinaryReader(new LittleEndianBitConverter(), stream))
            {
                this.Version = reader.ReadInt32();

                this.Emitter    = new PrtEmitter(reader);
                this.Shape      = new PrtShape(reader);
                this.Appearance = new PrtAppearance(reader);
                this.Opacity    = new PrtOpacity(reader);
                this.Scale      = new PrtScale(reader);
                this.Color      = new PrtColor(reader);
                this.Forces     = new PrtForces(reader);
                this.Collision  = new PrtCollision(reader);

                this.BrgFileName = reader.ReadString();

                for (int i = 0; i < this.Color.NumPaletteColors; i++)
                {
                    this.Color.PaletteColors.Add(reader.ReadTexel());
                }

                for (int i = 0; i < this.Appearance.NumFiles; i++)
                {
                    this.Appearance.AppearanceWeights.Add(reader.ReadSingle());
                }
                for (int i = 0; i < this.Appearance.NumFiles; i++)
                {
                    this.Appearance.AppearanceFiles.Add(reader.ReadString());
                }

                for (int i = 0; i < this.Opacity.NumStages; i++)
                {
                    this.Opacity.OpacityStages.Add(new PrtOpacityStage(reader));
                }

                for (int i = 0; i < this.Scale.NumStages; i++)
                {
                    this.Scale.ScaleStages.Add(new PrtScaleStage(reader));
                }

                for (int i = 0; i < this.Color.NumStages; i++)
                {
                    this.Color.ColorStages.Add(new PrtColorStage(reader));
                }

                for (int i = 0; i < this.Collision.NumTypes; i++)
                {
                    this.Collision.CollisionTypes.Add(new PrtCollisionType(reader));
                }
            }
        }
Ejemplo n.º 10
0
        public PrtFile(Stream stream)
        {
            using (PrtBinaryReader reader = new PrtBinaryReader(new LittleEndianBitConverter(), stream))
            {
                this.Version = reader.ReadInt32();

                this.Emitter = new PrtEmitter(reader);
                this.Shape = new PrtShape(reader);
                this.Appearance = new PrtAppearance(reader);
                this.Opacity = new PrtOpacity(reader);
                this.Scale = new PrtScale(reader);
                this.Color = new PrtColor(reader);
                this.Forces = new PrtForces(reader);
                this.Collision = new PrtCollision(reader);

                this.BrgFileName = reader.ReadString();

                for (int i = 0; i < this.Color.NumPaletteColors; i++)
                {
                    this.Color.PaletteColors.Add(reader.ReadTexel());
                }

                for (int i = 0; i < this.Appearance.NumFiles; i++)
                {
                    this.Appearance.AppearanceWeights.Add(reader.ReadSingle());
                }
                for (int i = 0; i < this.Appearance.NumFiles; i++)
                {
                    this.Appearance.AppearanceFiles.Add(reader.ReadString());
                }

                for (int i = 0; i < this.Opacity.NumStages; i++)
                {
                    this.Opacity.OpacityStages.Add(new PrtOpacityStage(reader));
                }

                for (int i = 0; i < this.Scale.NumStages; i++)
                {
                    this.Scale.ScaleStages.Add(new PrtScaleStage(reader));
                }

                for (int i = 0; i < this.Color.NumStages; i++)
                {
                    this.Color.ColorStages.Add(new PrtColorStage(reader));
                }

                for (int i = 0; i < this.Collision.NumTypes; i++)
                {
                    this.Collision.CollisionTypes.Add(new PrtCollisionType(reader));
                }
            }
        }
Ejemplo n.º 11
0
        public PrtOpacity(PrtBinaryReader reader)
        {
            this.LoopingCycle = reader.ReadBoolean();
            reader.ReadBytes(3);

            this.NumStages    = reader.ReadInt32();
            this.Opacity      = reader.ReadSingle();
            this.OpacityVar   = reader.ReadSingle();
            this.CycleTime    = reader.ReadSingle();
            this.CycleTimeVar = reader.ReadSingle();

            this.OpacityStages = new List <PrtOpacityStage>(this.NumStages);
        }
Ejemplo n.º 12
0
        public PrtOpacity(PrtBinaryReader reader)
        {
            this.LoopingCycle = reader.ReadBoolean();
            reader.ReadBytes(3);

            this.NumStages = reader.ReadInt32();
            this.Opacity = reader.ReadSingle();
            this.OpacityVar = reader.ReadSingle();
            this.CycleTime = reader.ReadSingle();
            this.CycleTimeVar = reader.ReadSingle();

            this.OpacityStages = new List<PrtOpacityStage>(this.NumStages);
        }
Ejemplo n.º 13
0
        public PrtCollisionType(PrtBinaryReader reader)
        {
            this.SpawnSystem    = reader.ReadBoolean();
            this.CollideTerrain = reader.ReadBoolean();
            this.CollideWater   = reader.ReadBoolean();
            this.CollideUnits   = reader.ReadBoolean();

            this.Result        = reader.ReadInt32();
            this.NumFileNames  = reader.ReadInt32();
            this.LingerTime    = reader.ReadSingle();
            this.LingerTimeVar = reader.ReadSingle();
            this.FadeTime      = reader.ReadSingle();
            this.FadeTimeVar   = reader.ReadSingle();
            this.EnergyLoss    = reader.ReadSingle();
            this.EnergyLossVar = reader.ReadSingle();

            this.Name      = reader.ReadString();
            this.FileNames = new List <string>(this.NumFileNames);
            for (int i = 0; i < this.NumFileNames; i++)
            {
                this.FileNames.Add(reader.ReadString());
            }
        }
Ejemplo n.º 14
0
        public PrtCollisionType(PrtBinaryReader reader)
        {
            this.SpawnSystem = reader.ReadBoolean();
            this.CollideTerrain = reader.ReadBoolean();
            this.CollideWater = reader.ReadBoolean();
            this.CollideUnits = reader.ReadBoolean();

            this.Result = reader.ReadInt32();
            this.NumFileNames = reader.ReadInt32();
            this.LingerTime = reader.ReadSingle();
            this.LingerTimeVar = reader.ReadSingle();
            this.FadeTime = reader.ReadSingle();
            this.FadeTimeVar = reader.ReadSingle();
            this.EnergyLoss = reader.ReadSingle();
            this.EnergyLossVar = reader.ReadSingle();

            this.Name = reader.ReadString();
            this.FileNames = new List<string>(this.NumFileNames);
            for (int i = 0; i < this.NumFileNames; i++)
            {
                this.FileNames.Add(reader.ReadString());
            }
        }
Ejemplo n.º 15
0
        public PrtScale(PrtBinaryReader reader)
        {
            this.LoopingCycle = reader.ReadBoolean();
            reader.ReadBytes(3);

            this.NumStages    = reader.ReadInt32();
            this.Scale        = reader.ReadSingle();
            this.ScaleVar     = reader.ReadSingle();
            this.XScale       = reader.ReadSingle();
            this.XScaleVar    = reader.ReadSingle();
            this.YScale       = reader.ReadSingle();
            this.YScaleVar    = reader.ReadSingle();
            this.ZScale       = reader.ReadSingle();
            this.ZScaleVar    = reader.ReadSingle();
            this.CycleTime    = reader.ReadSingle();
            this.CycleTimeVar = reader.ReadSingle();

            this.ScaleStages = new List <PrtScaleStage>(this.NumStages);
        }
Ejemplo n.º 16
0
        public PrtScale(PrtBinaryReader reader)
        {
            this.LoopingCycle = reader.ReadBoolean();
            reader.ReadBytes(3);

            this.NumStages = reader.ReadInt32();
            this.Scale = reader.ReadSingle();
            this.ScaleVar = reader.ReadSingle();
            this.XScale = reader.ReadSingle();
            this.XScaleVar = reader.ReadSingle();
            this.YScale = reader.ReadSingle();
            this.YScaleVar = reader.ReadSingle();
            this.ZScale = reader.ReadSingle();
            this.ZScaleVar = reader.ReadSingle();
            this.CycleTime = reader.ReadSingle();
            this.CycleTimeVar = reader.ReadSingle();

            this.ScaleStages = new List<PrtScaleStage>(this.NumStages);
        }
Ejemplo n.º 17
0
        public PrtShape(PrtBinaryReader reader)
        {
            this.StartFull        = reader.ReadBoolean();
            this.EmitAwayFromBias = reader.ReadBoolean();
            this.UseSpreader      = reader.ReadBoolean();
            reader.ReadByte();

            this.ShapeType       = (PrtShapeType)reader.ReadInt32();
            this.OuterXRadius    = reader.ReadSingle();
            this.InnerXRadius    = reader.ReadSingle();
            this.OuterYRadius    = reader.ReadSingle();
            this.InnerYRadius    = reader.ReadSingle();
            this.OuterZRadius    = reader.ReadSingle();
            this.InnerZRadius    = reader.ReadSingle();
            this.CenterHeight    = reader.ReadSingle();
            this.OffAxis         = reader.ReadSingle();
            this.OffAxisSpread   = reader.ReadSingle();
            this.OffPlane        = reader.ReadSingle();
            this.OffPlaneSpread  = reader.ReadSingle();
            this.BiasPointHeight = reader.ReadSingle();
        }
Ejemplo n.º 18
0
        public PrtShape(PrtBinaryReader reader)
        {
            this.StartFull = reader.ReadBoolean();
            this.EmitAwayFromBias = reader.ReadBoolean();
            this.UseSpreader = reader.ReadBoolean();
            reader.ReadByte();

            this.ShapeType = (PrtShapeType)reader.ReadInt32();
            this.OuterXRadius = reader.ReadSingle();
            this.InnerXRadius = reader.ReadSingle();
            this.OuterYRadius = reader.ReadSingle();
            this.InnerYRadius = reader.ReadSingle();
            this.OuterZRadius = reader.ReadSingle();
            this.InnerZRadius = reader.ReadSingle();
            this.CenterHeight = reader.ReadSingle();
            this.OffAxis = reader.ReadSingle();
            this.OffAxisSpread = reader.ReadSingle();
            this.OffPlane = reader.ReadSingle();
            this.OffPlaneSpread = reader.ReadSingle();
            this.BiasPointHeight = reader.ReadSingle();
        }