public PrtColorStage(PrtBinaryReader reader) { this.UsePalette = reader.ReadBoolean(); reader.ReadBytes(3); this.Color = reader.ReadTexel(); this.Hold = reader.ReadSingle(); this.Fade = reader.ReadSingle(); }
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); }
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); }
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)); } } }
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); }
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); }