public override System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> ReadFields(System.IO.BinaryReader binaryReader)
 {
     System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer> pointerQueue = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(base.ReadFields(binaryReader));
     this.ScenarioObjectDatumStructPlacementFlags = ((PlacementFlags)(binaryReader.ReadInt32()));
     this.Position = binaryReader.ReadVector3();
     this.Rotation = binaryReader.ReadVector3();
     this.Scale    = binaryReader.ReadSingle();
     this.ScenarioObjectDatumStructTransformFlags = ((TransformFlags)(binaryReader.ReadInt16()));
     this.ManualBSPFlags = binaryReader.ReadBlockFlags16();
     pointerQueue        = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(pointerQueue.Concat(this.ObjectID.ReadFields(binaryReader)));
     this.BSPPolicy      = ((BSPPolicyEnum)(binaryReader.ReadByte()));
     this.fieldpad       = binaryReader.ReadBytes(1);
     this.EditorFolder   = binaryReader.ReadShortBlockIndex1();
     return(pointerQueue);
 }
Example #2
0
            /// <summary>
            /// For ScaleRotateYawPitchRollSpawn objects, the first 52 bytes are all
            /// generic for Halo 2.
            /// </summary>
            /// <param name="map">The HaloMap.Map.Map</param>
            public override void Read(Map map)
            {
                map.BR.BaseStream.Position = this.offset;
                this.PaletteIndex = map.BR.ReadInt16();
                this.NameIndex = map.BR.ReadInt16();
                this.Placements = (PlacementFlags)map.BR.ReadInt32();

                this.X = map.BR.ReadSingle();
                this.Y = map.BR.ReadSingle();
                this.Z = map.BR.ReadSingle();
                switch (map.HaloVersion)
                {
                    // Halo 1 Stores values in Degrees
                    case HaloVersionEnum.Halo1:
                        this.Yaw = Renderer.DegreeToRadian(map.BR.ReadSingle());
                        this.Pitch = Renderer.DegreeToRadian(map.BR.ReadSingle());
                        this.Roll = Renderer.DegreeToRadian(map.BR.ReadSingle());
                        break;

                    case HaloVersionEnum.Halo2:
                    case HaloVersionEnum.Halo2Vista:
                        // Is this correct? I think it should be Yaw, Pitch, Roll.
                        // Before cleaing code into this shared read section some spawns
                        // were Y,P,R and some were R,P,Y.
                        this.Yaw = map.BR.ReadSingle();
                        this.Pitch = map.BR.ReadSingle();
                        this.Roll = map.BR.ReadSingle();
                        this.Scale = map.BR.ReadSingle();

                        // None of this is currently saved
                        this.Transforms = (TransformFlags)map.BR.ReadInt16();
                        this.ManualBSPs = (ManualBSPFlags)map.BR.ReadInt16();
                        this.UniqueID = map.BR.ReadUInt32();
                        this.OriginBSP = map.BR.ReadInt16();
                        this.MetaSpawnType = (SpawnTypeEnum)map.BR.ReadByte();
                        this.Source = (SourceEnum)map.BR.ReadByte();
                        this.BSPPolicy = (BSPPolicyEnum)map.BR.ReadByte(); ;
                        this.Unused = map.BR.ReadByte();
                        this.EditorFolder = map.BR.ReadInt16();
                        break;
                }
            }