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.UpdatesPerSecond = binaryReader.ReadInt16();
     this.fieldpad         = binaryReader.ReadBytes(2);
     this.DeadCellPenalty  = binaryReader.ReadSingle();
     this.LiveCellBonus    = binaryReader.ReadSingle();
     this.fieldpad0        = binaryReader.ReadBytes(80);
     this.Width            = binaryReader.ReadInt16();
     this.Height           = binaryReader.ReadInt16();
     this.CellWidth        = binaryReader.ReadSingle();
     this.Height0          = binaryReader.ReadSingle();
     this.Velocity         = binaryReader.ReadVector2();
     this.fieldpad1        = binaryReader.ReadBytes(28);
     this.Marker           = binaryReader.ReadStringID();
     this.CellularAutomata2dInterpolationFlags = ((InterpolationFlags)(binaryReader.ReadInt32()));
     this.BaseColor    = binaryReader.ReadColorR8G8B8();
     this.PeakColor    = binaryReader.ReadColorR8G8B8();
     this.fieldpad2    = binaryReader.ReadBytes(76);
     this.Width0       = binaryReader.ReadInt16();
     this.Height1      = binaryReader.ReadInt16();
     this.CellWidth0   = binaryReader.ReadSingle();
     this.Velocity0    = binaryReader.ReadVector2();
     this.fieldpad3    = binaryReader.ReadBytes(48);
     this.Marker0      = binaryReader.ReadStringID();
     this.TextureWidth = binaryReader.ReadInt16();
     this.fieldpad4    = binaryReader.ReadBytes(2);
     this.fieldpad5    = binaryReader.ReadBytes(48);
     this.Texture      = binaryReader.ReadTagReference();
     this.fieldpad6    = binaryReader.ReadBytes(160);
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(84));
     return(pointerQueue);
 }
 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.Shader = binaryReader.ReadTagReference();
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(68));
     pointerQueue             = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(pointerQueue.Concat(this.GeometryBlockInfo.ReadFields(binaryReader)));
     this.SunSpotColor        = binaryReader.ReadColorR8G8B8();
     this.ReflectionTint      = binaryReader.ReadColorR8G8B8();
     this.RefractionTint      = binaryReader.ReadColorR8G8B8();
     this.HorizonColor        = binaryReader.ReadColorR8G8B8();
     this.SunSpecularPower    = binaryReader.ReadSingle();
     this.ReflectionBumpScale = binaryReader.ReadSingle();
     this.RefractionBumpScale = binaryReader.ReadSingle();
     this.FresnelScale        = binaryReader.ReadSingle();
     this.SunDirHeading       = binaryReader.ReadSingle();
     this.SunDirPitch         = binaryReader.ReadSingle();
     this.FOV               = binaryReader.ReadSingle();
     this.Aspect            = binaryReader.ReadSingle();
     this.Height            = binaryReader.ReadSingle();
     this.Farz              = binaryReader.ReadSingle();
     this.RotateOffset      = binaryReader.ReadSingle();
     this.Center            = binaryReader.ReadVector2();
     this.Extents           = binaryReader.ReadVector2();
     this.FogNear           = binaryReader.ReadSingle();
     this.FogFar            = binaryReader.ReadSingle();
     this.DynamicHeightBias = binaryReader.ReadSingle();
     return(pointerQueue);
 }
 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.Name    = binaryReader.ReadStringID();
     pointerQueue = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(pointerQueue.Concat(this.HudWidgetInputsStruct.ReadFields(binaryReader)));
     pointerQueue = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(pointerQueue.Concat(this.HudWidgetStateDefinitionStruct.ReadFields(binaryReader)));
     this.Anchor  = ((AnchorEnum)(binaryReader.ReadInt16()));
     this.HudBitmapWidgetsFlags = ((Flags)(binaryReader.ReadInt16()));
     this.Bitmap = binaryReader.ReadTagReference();
     this.Shader = binaryReader.ReadTagReference();
     this.FullscreenSequenceIndex    = binaryReader.ReadByte();
     this.HalfscreenSequenceIndex    = binaryReader.ReadByte();
     this.QuarterscreenSequenceIndex = binaryReader.ReadByte();
     this.fieldpad                       = binaryReader.ReadBytes(1);
     this.FullscreenOffset               = binaryReader.ReadPoint();
     this.HalfscreenOffset               = binaryReader.ReadPoint();
     this.QuarterscreenOffset            = binaryReader.ReadPoint();
     this.FullscreenRegistrationPoint    = binaryReader.ReadVector2();
     this.HalfscreenRegistrationPoint    = binaryReader.ReadVector2();
     this.QuarterscreenRegistrationPoint = binaryReader.ReadVector2();
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(104));
     this.SpecialHudType = ((SpecialHudTypeEnum)(binaryReader.ReadInt16()));
     this.fieldpad0      = binaryReader.ReadBytes(2);
     return(pointerQueue);
 }
Example #4
0
 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.Position  = binaryReader.ReadVector3();
     this.Texcoord0 = binaryReader.ReadVector2();
     this.Texcoord1 = binaryReader.ReadVector2();
     this.Color     = binaryReader.ReadColourR1G1B1();
     return(pointerQueue);
 }
 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.InitialPosition = binaryReader.ReadVector3();
     this.Uv = binaryReader.ReadVector2();
     return(pointerQueue);
 }
 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.MagnetismFriction          = binaryReader.ReadSingle();
     this.MagnetismAdhesion          = binaryReader.ReadSingle();
     this.InconsequentialTargetScale = binaryReader.ReadSingle();
     this.fieldpad                       = binaryReader.ReadBytes(12);
     this.CrosshairLocation              = binaryReader.ReadVector2();
     this.SecondsToStart                 = binaryReader.ReadSingle();
     this.SecondsToFullSpeed             = binaryReader.ReadSingle();
     this.DecayRate                      = binaryReader.ReadSingle();
     this.FullSpeedMultiplier            = binaryReader.ReadSingle();
     this.PeggedMagnitude                = binaryReader.ReadSingle();
     this.PeggedAngularThreshold         = binaryReader.ReadSingle();
     this.fieldpad0                      = binaryReader.ReadBytes(8);
     this.LookDefaultPitchRate           = binaryReader.ReadSingle();
     this.LookDefaultYawRate             = binaryReader.ReadSingle();
     this.LookPegThreshold01             = binaryReader.ReadSingle();
     this.LookYawAccelerationTime        = binaryReader.ReadSingle();
     this.LookYawAccelerationScale       = binaryReader.ReadSingle();
     this.LookPitchAccelerationTime      = binaryReader.ReadSingle();
     this.LookPitchAccelerationScale     = binaryReader.ReadSingle();
     this.LookAutolevellingScale         = binaryReader.ReadSingle();
     this.fieldpad1                      = binaryReader.ReadBytes(8);
     this.GravityScale                   = binaryReader.ReadSingle();
     this.fieldpad2                      = binaryReader.ReadBytes(2);
     this.MinimumAutolevellingTicks      = binaryReader.ReadInt16();
     this.MinimumAngleForVehicleFlipping = binaryReader.ReadSingle();
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(4));
     this.MinimumActionHoldTime = binaryReader.ReadSingle();
     return(pointerQueue);
 }
 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.Name           = binaryReader.ReadStringID();
     this.Position       = binaryReader.ReadVector3();
     this.ReferenceFrame = binaryReader.ReadInt16();
     this.fieldpad       = binaryReader.ReadBytes(2);
     this.Facing         = binaryReader.ReadVector2();
     this.ActorStartingLocationsFlags = ((Flags)(binaryReader.ReadInt32()));
     this.CharacterType          = binaryReader.ReadShortBlockIndex1();
     this.InitialWeapon          = binaryReader.ReadShortBlockIndex1();
     this.InitialSecondaryWeapon = binaryReader.ReadShortBlockIndex1();
     this.fieldpad0               = binaryReader.ReadBytes(2);
     this.VehicleType             = binaryReader.ReadShortBlockIndex1();
     this.SeatType                = ((SeatTypeEnum)(binaryReader.ReadInt16()));
     this.GrenadeType             = ((GrenadeTypeEnum)(binaryReader.ReadInt16()));
     this.SwarmCount              = binaryReader.ReadInt16();
     this.ActorVariantName        = binaryReader.ReadStringID();
     this.VehicleVariantName      = binaryReader.ReadStringID();
     this.InitialMovementDistance = binaryReader.ReadSingle();
     this.EmitterVehicle          = binaryReader.ReadShortBlockIndex1();
     this.InitialMovementMode     = ((InitialMovementModeEnum)(binaryReader.ReadInt16()));
     this.PlacementScript         = binaryReader.ReadString32();
     this.fieldskip               = binaryReader.ReadBytes(2);
     this.fieldpad1               = binaryReader.ReadBytes(2);
     return(pointerQueue);
 }
 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.FalloffAngle              = binaryReader.ReadSingle();
     this.CutoffAngle               = binaryReader.ReadSingle();
     this.fieldskip                 = binaryReader.ReadBytes(4);
     this.fieldskip0                = binaryReader.ReadBytes(4);
     this.OcclusionRadius           = binaryReader.ReadSingle();
     this.OcclusionOffsetDirection  = ((OcclusionOffsetDirectionEnum)(binaryReader.ReadInt16()));
     this.OcclusionInnerRadiusScale = ((OcclusionInnerRadiusScaleEnum)(binaryReader.ReadInt16()));
     this.NearFadeDistance          = binaryReader.ReadSingle();
     this.FarFadeDistance           = binaryReader.ReadSingle();
     this.Bitmap                = binaryReader.ReadTagReference();
     this.LensFlareFlags        = ((Flags)(binaryReader.ReadInt16()));
     this.fieldskip1            = binaryReader.ReadBytes(2);
     this.RotationFunction      = ((RotationFunctionEnum)(binaryReader.ReadInt16()));
     this.fieldpad              = binaryReader.ReadBytes(2);
     this.RotationFunctionScale = binaryReader.ReadSingle();
     this.CoronaScale           = binaryReader.ReadVector2();
     this.FalloffFunction       = ((FalloffFunctionEnum)(binaryReader.ReadInt16()));
     this.fieldpad0             = binaryReader.ReadBytes(2);
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(48));
     this.LensFlareLensFlareFlags0 = ((LensFlareFlags0)(binaryReader.ReadInt16()));
     this.fieldpad1 = binaryReader.ReadBytes(2);
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(8));
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(8));
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(8));
     return(pointerQueue);
 }
 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.ScenarioFunctionFlags = ((Flags)(binaryReader.ReadInt32()));
     this.Name                = binaryReader.ReadString32();
     this.Period              = binaryReader.ReadSingle();
     this.ScalePeriodBy       = binaryReader.ReadShortBlockIndex1();
     this.Function            = ((FunctionEnum)(binaryReader.ReadInt16()));
     this.ScaleFunctionBy     = binaryReader.ReadShortBlockIndex1();
     this.WobbleFunction      = ((WobbleFunctionEnum)(binaryReader.ReadInt16()));
     this.WobblePeriod        = binaryReader.ReadSingle();
     this.WobbleMagnitude     = binaryReader.ReadSingle();
     this.SquareWaveThreshold = binaryReader.ReadSingle();
     this.StepCount           = binaryReader.ReadInt16();
     this.MapTo               = ((MapToEnum)(binaryReader.ReadInt16()));
     this.SawtoothCount       = binaryReader.ReadInt16();
     this.fieldpad            = binaryReader.ReadBytes(2);
     this.ScaleResultBy       = binaryReader.ReadShortBlockIndex1();
     this.BoundsMode          = ((BoundsModeEnum)(binaryReader.ReadInt16()));
     this.Bounds              = binaryReader.ReadVector2();
     this.fieldpad0           = binaryReader.ReadBytes(4);
     this.fieldpad1           = binaryReader.ReadBytes(2);
     this.TurnOffWith         = binaryReader.ReadShortBlockIndex1();
     this.fieldpad2           = binaryReader.ReadBytes(16);
     this.fieldpad3           = binaryReader.ReadBytes(16);
     return(pointerQueue);
 }
Example #10
0
 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.MaximumAimingDeviation  = binaryReader.ReadVector2();
     this.MaximumLookingDeviation = binaryReader.ReadVector2();
     this.fieldpad             = binaryReader.ReadBytes(16);
     this.NoncombatLookDeltaL  = binaryReader.ReadSingle();
     this.NoncombatLookDeltaR  = binaryReader.ReadSingle();
     this.CombatLookDeltaL     = binaryReader.ReadSingle();
     this.CombatLookDeltaR     = binaryReader.ReadSingle();
     this.NoncombatIdleLooking = binaryReader.ReadRange();
     this.NoncombatIdleAiming  = binaryReader.ReadRange();
     this.CombatIdleLooking    = binaryReader.ReadRange();
     this.CombatIdleAiming     = binaryReader.ReadRange();
     return(pointerQueue);
 }
Example #11
0
 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.GainModifier         = binaryReader.ReadRange();
     this.PitchModifier        = binaryReader.ReadInt32();
     this.SkipFractionModifier = binaryReader.ReadVector2();
     return(pointerQueue);
 }
Example #12
0
 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.fieldpad = binaryReader.ReadBytes(4);
     this.Name     = binaryReader.ReadString32();
     this.Position = binaryReader.ReadVector3();
     this.Facing   = binaryReader.ReadVector2();
     return(pointerQueue);
 }
 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.Position         = binaryReader.ReadVector3();
     this.StartingYawPitch = binaryReader.ReadVector2();
     this.Radius           = binaryReader.ReadSingle();
     this.Weight           = binaryReader.ReadSingle();
     return(pointerQueue);
 }
 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.Color     = binaryReader.ReadColorR8G8B8();
     this.fieldpad  = binaryReader.ReadBytes(12);
     this.Density   = binaryReader.ReadVector2();
     this.Distance  = binaryReader.ReadRange();
     this.fieldpad0 = binaryReader.ReadBytes(32);
     this.PatchyFog = binaryReader.ReadTagReference();
     return(pointerQueue);
 }
 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.DirectionVector = binaryReader.ReadVector3();
     this.Direction       = binaryReader.ReadVector2();
     this.LensFlare       = binaryReader.ReadTagReference();
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(44));
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(44));
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(40));
     return(pointerQueue);
 }
Example #16
0
 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.Velocity             = binaryReader.ReadRange();
     this.VariationArea        = binaryReader.ReadVector2();
     this.LocalVariationWeight = binaryReader.ReadSingle();
     this.LocalVariationRate   = binaryReader.ReadSingle();
     this.Damping  = binaryReader.ReadSingle();
     this.fieldpad = binaryReader.ReadBytes(36);
     return(pointerQueue);
 }
Example #17
0
 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.Position             = binaryReader.ReadVector3();
     this.ReferenceFrame       = binaryReader.ReadInt16();
     this.FiringPositionsFlags = ((Flags)(binaryReader.ReadInt16()));
     this.Area         = binaryReader.ReadShortBlockIndex1();
     this.ClusterIndex = binaryReader.ReadInt16();
     this.fieldskip    = binaryReader.ReadBytes(4);
     this.Normal       = binaryReader.ReadVector2();
     return(pointerQueue);
 }
Example #18
0
 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.Type           = ((TypeEnum)(binaryReader.ReadInt16()));
     this.fieldpad       = binaryReader.ReadBytes(2);
     this.Point          = binaryReader.ReadVector3();
     this.ReferenceFrame = binaryReader.ReadInt16();
     this.fieldpad0      = binaryReader.ReadBytes(2);
     this.SectorIndex    = binaryReader.ReadInt32();
     this.Normal         = binaryReader.ReadVector2();
     return(pointerQueue);
 }
 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.fieldpad             = binaryReader.ReadBytes(2);
     this.Type                 = binaryReader.ReadInt16();
     this.FramebufferBlendFunc = ((FramebufferBlendFuncEnum)(binaryReader.ReadInt16()));
     this.fieldpad0            = binaryReader.ReadBytes(2);
     this.fieldpad1            = binaryReader.ReadBytes(32);
     this.PrimaryAnchor        = ((PrimaryAnchorEnum)(binaryReader.ReadInt16()));
     this.SecondaryAnchor      = ((SecondaryAnchorEnum)(binaryReader.ReadInt16()));
     this.TertiaryAnchor       = ((TertiaryAnchorEnum)(binaryReader.ReadInt16()));
     this._0To1BlendFunc       = ((_0To1BlendFuncEnum)(binaryReader.ReadInt16()));
     this._1To2BlendFunc       = ((_1To2BlendFuncEnum)(binaryReader.ReadInt16()));
     this.fieldpad2            = binaryReader.ReadBytes(2);
     this.PrimaryScale         = binaryReader.ReadVector2();
     this.SecondaryScale       = binaryReader.ReadVector2();
     this.TertiaryScale        = binaryReader.ReadVector2();
     this.PrimaryOffset        = binaryReader.ReadVector2();
     this.SecondaryOffset      = binaryReader.ReadVector2();
     this.TertiaryOffset       = binaryReader.ReadVector2();
     this.Primary              = binaryReader.ReadTagReference();
     this.Secondary            = binaryReader.ReadTagReference();
     this.Tertiary             = binaryReader.ReadTagReference();
     this.PrimaryWrapMode      = ((PrimaryWrapModeEnum)(binaryReader.ReadInt16()));
     this.SecondaryWrapMode    = ((SecondaryWrapModeEnum)(binaryReader.ReadInt16()));
     this.TertiaryWrapMode     = ((TertiaryWrapModeEnum)(binaryReader.ReadInt16()));
     this.fieldpad3            = binaryReader.ReadBytes(2);
     this.fieldpad4            = binaryReader.ReadBytes(184);
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(220));
     this.fieldpad5 = binaryReader.ReadBytes(128);
     return(pointerQueue);
 }
Example #20
0
        public int MeshFlags; // 60 is normal, 124 is decal

        public static int Deserialise(BinaryReader reader, GameObject parent)
        {
            GameObject go = new GameObject("Mesh Part");
            MeshPart part = go.AddComponent<MeshPart>();
            part.transform.SetParent(parent.transform);

            long offset = reader.BaseStream.Position;

            int NextOffset = reader.ReadInt32();
            reader.SkipInt32(64);
            reader.SkipInt32();//Length 
            reader.SkipInt32(0);

            int VertexCount = reader.ReadInt32();
            part.ObjectType = reader.ReadInt32(); //1 = static, 2 = can be or not there, 3 = can move
            int val = reader.ReadInt32();
            part.OcclusionGroup = "0x" + val.ToString("X") + " 0b" + Convert.ToString(val, 2);
            part.MeshFlags = reader.ReadInt32();

            reader.SkipBytes(32, 0);

            go.isStatic = part.ObjectType != 3;

            Matrix4x4 matrix = part.GetComponentInParent<Scene>().GetSH3ToUnityMatrix();

            List<Vector3> _verts = new List<Vector3>();
            List<Vector3> _norms = new List<Vector3>();
            List<Vector2> _uvs = new List<Vector2>();
            List<Color32> _colors = new List<Color32>();
            for (int i = 0; i != VertexCount; i++)
            {
                Vector3 temp = reader.ReadVector3();
                temp.y = -temp.y;
                _verts.Add(matrix.MultiplyPoint(temp));

                temp = reader.ReadVector3();
                temp.x = -temp.x;
                temp.z = -temp.z;
                _norms.Add(temp);

                _uvs.Add(reader.ReadVector2());
                _colors.Add(reader.ReadBGRA());
            }

            Mesh mesh = MeshUtils.MakeStripped(_verts, _norms, _uvs, _colors);

            mesh.name = "mesh_" + offset;
            go.AddComponent<MeshFilter>().sharedMesh = mesh;
            go.AddComponent<MeshRenderer>().shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;

            return NextOffset;
        }
 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.Type = ((TypeEnum)(binaryReader.ReadInt16()));
     this.DeviceMachineDeviceMachineFlags = ((DeviceMachineFlags)(binaryReader.ReadInt16()));
     this.DoorOpenTime        = binaryReader.ReadSingle();
     this.DoorOcclusionBounds = binaryReader.ReadVector2();
     this.CollisionResponse   = ((CollisionResponseEnum)(binaryReader.ReadInt16()));
     this.ElevatorNode        = binaryReader.ReadInt16();
     this.PathfindingPolicy   = ((PathfindingPolicyEnum)(binaryReader.ReadInt16()));
     this.fieldpad4           = binaryReader.ReadBytes(2);
     return(pointerQueue);
 }
 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.BitmapIndex       = binaryReader.ReadInt16();
     this.fieldpad          = binaryReader.ReadBytes(2);
     this.fieldpad0         = binaryReader.ReadBytes(4);
     this.Left              = binaryReader.ReadSingle();
     this.Right             = binaryReader.ReadSingle();
     this.Top               = binaryReader.ReadSingle();
     this.Bottom            = binaryReader.ReadSingle();
     this.RegistrationPoint = binaryReader.ReadVector2();
     return(pointerQueue);
 }
 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.HudReferenceFlags = ((Flags)(binaryReader.ReadInt32()));
     this.AnimationIndex    = ((AnimationIndexEnum)(binaryReader.ReadInt16()));
     this.IntroAnimationDelayMilliseconds = binaryReader.ReadInt16();
     this.RenderDepthBias             = binaryReader.ReadInt16();
     this.StartingBitmapSequenceIndex = binaryReader.ReadInt16();
     this.Bitmap = binaryReader.ReadTagReference();
     this.Shader = binaryReader.ReadTagReference();
     this.Bounds = binaryReader.ReadVector2();
     return(pointerQueue);
 }
Example #24
0
 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.ContrailFlags             = ((Flags)(binaryReader.ReadInt16()));
     this.ContrailScaleFlags        = ((ScaleFlags)(binaryReader.ReadInt16()));
     this.PointGenerationRate       = binaryReader.ReadSingle();
     this.PointVelocity             = binaryReader.ReadRange();
     this.PointVelocityConeAngle    = binaryReader.ReadSingle();
     this.InheritedVelocityFraction = binaryReader.ReadSingle();
     this.RenderType                = ((RenderTypeEnum)(binaryReader.ReadInt16()));
     this.fieldpad                  = binaryReader.ReadBytes(2);
     this.TextureRepeatsU           = binaryReader.ReadSingle();
     this.TextureRepeatsV           = binaryReader.ReadSingle();
     this.TextureAnimationU         = binaryReader.ReadSingle();
     this.TextureAnimationV         = binaryReader.ReadSingle();
     this.AnimationRate             = binaryReader.ReadSingle();
     this.Bitmap                    = binaryReader.ReadTagReference();
     this.FirstSequenceIndex        = binaryReader.ReadInt16();
     this.SequenceCount             = binaryReader.ReadInt16();
     this.fieldpad0                 = binaryReader.ReadBytes(40);
     this.ContrailShaderFlags       = ((ShaderFlags)(binaryReader.ReadInt16()));
     this.FramebufferBlendFunction  = ((FramebufferBlendFunctionEnum)(binaryReader.ReadInt16()));
     this.FramebufferFadeMode       = ((FramebufferFadeModeEnum)(binaryReader.ReadInt16()));
     this.ContrailMapFlags          = ((MapFlags)(binaryReader.ReadInt16()));
     this.fieldpad1                 = binaryReader.ReadBytes(28);
     this.Bitmap0                   = binaryReader.ReadTagReference();
     this.Anchor                    = ((AnchorEnum)(binaryReader.ReadInt16()));
     this.ContrailContrailFlags0    = ((ContrailFlags0)(binaryReader.ReadInt16()));
     this.fieldpad2                 = binaryReader.ReadBytes(2);
     this.UanimationFunction        = ((UanimationFunctionEnum)(binaryReader.ReadInt16()));
     this.UanimationPeriod          = binaryReader.ReadSingle();
     this.UanimationPhase           = binaryReader.ReadSingle();
     this.UanimationScale           = binaryReader.ReadSingle();
     this.fieldpad3                 = binaryReader.ReadBytes(2);
     this.VanimationFunction        = ((VanimationFunctionEnum)(binaryReader.ReadInt16()));
     this.VanimationPeriod          = binaryReader.ReadSingle();
     this.VanimationPhase           = binaryReader.ReadSingle();
     this.VanimationScale           = binaryReader.ReadSingle();
     this.fieldpad4                 = binaryReader.ReadBytes(2);
     this.RotationanimationFunction = ((RotationanimationFunctionEnum)(binaryReader.ReadInt16()));
     this.RotationanimationPeriod   = binaryReader.ReadSingle();
     this.RotationanimationPhase    = binaryReader.ReadSingle();
     this.RotationanimationScale    = binaryReader.ReadSingle();
     this.RotationanimationCenter   = binaryReader.ReadVector2();
     this.fieldpad5                 = binaryReader.ReadBytes(4);
     this.ZspriteRadiusScale        = binaryReader.ReadSingle();
     this.fieldpad6                 = binaryReader.ReadBytes(20);
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(64));
     return(pointerQueue);
 }
        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.Position = binaryReader.ReadVector3();
            int i;

            for (i = 0; (i < 4); i = (i + 1))
            {
                this.NodeIndices00[i] = new NodeIndicesBlock();
                pointerQueue          = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(pointerQueue.Concat(this.NodeIndices00[i].ReadFields(binaryReader)));
            }
            for (i = 0; (i < 4); i = (i + 1))
            {
                this.NodeWeights00[i] = new NodeWeightsBlock();
                pointerQueue          = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(pointerQueue.Concat(this.NodeWeights00[i].ReadFields(binaryReader)));
            }
            for (i = 0; (i < 4); i = (i + 1))
            {
                this.NodeIndices20[i] = new NodeIndices1Block();
                pointerQueue          = new System.Collections.Generic.Queue <Moonfish.Tags.BlamPointer>(pointerQueue.Concat(this.NodeIndices20[i].ReadFields(binaryReader)));
            }
            this.UseNewNodeIndices         = binaryReader.ReadInt32();
            this.AdjustedCompoundNodeIndex = binaryReader.ReadInt32();
            this.Texcoord                         = binaryReader.ReadVector2();
            this.Normal                           = binaryReader.ReadVector3();
            this.Binormal                         = binaryReader.ReadVector3();
            this.Tangent                          = binaryReader.ReadVector3();
            this.AnisotropicBinormal              = binaryReader.ReadVector3();
            this.SecondaryTexcoord                = binaryReader.ReadVector2();
            this.PrimaryLightmapColor             = binaryReader.ReadColorR8G8B8();
            this.PrimaryLightmapTexcoord          = binaryReader.ReadVector2();
            this.PrimaryLightmapIncidentDirection = binaryReader.ReadVector3();
            this.fieldpad                         = binaryReader.ReadBytes(12);
            this.fieldpad0                        = binaryReader.ReadBytes(8);
            this.fieldpad1                        = binaryReader.ReadBytes(12);
            return(pointerQueue);
        }
 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.SpringStrengthCoefficient = binaryReader.ReadSingle();
     this.fieldpad      = binaryReader.ReadBytes(24);
     this.Angles        = binaryReader.ReadVector2();
     this.Length        = binaryReader.ReadSingle();
     this.SequenceIndex = binaryReader.ReadInt16();
     this.fieldpad0     = binaryReader.ReadBytes(2);
     this.Color         = binaryReader.ReadVector4();
     this.LODColor      = binaryReader.ReadVector4();
     this.fieldpad1     = binaryReader.ReadBytes(40);
     this.fieldpad2     = binaryReader.ReadBytes(12);
     return(pointerQueue);
 }
 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.TextReferenceTextFlags          = ((TextFlags)(binaryReader.ReadInt32()));
     this.AnimationIndex                  = ((AnimationIndexEnum)(binaryReader.ReadInt16()));
     this.IntroAnimationDelayMilliseconds = binaryReader.ReadInt16();
     this.fieldpad        = binaryReader.ReadBytes(2);
     this.CustomFont      = ((CustomFontEnum)(binaryReader.ReadInt16()));
     this.TextColor       = binaryReader.ReadVector4();
     this.TextBounds      = binaryReader.ReadVector2();
     this.StringId        = binaryReader.ReadStringID();
     this.RenderDepthBias = binaryReader.ReadInt16();
     this.fieldpad0       = binaryReader.ReadBytes(2);
     return(pointerQueue);
 }
 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.DamagePyramidAngles = binaryReader.ReadVector2();
     this.DamagePyramidDepth = binaryReader.ReadSingle();
     this._1stHitMeleeDamage = binaryReader.ReadTagReference();
     this._1stHitMeleeResponse = binaryReader.ReadTagReference();
     this._2ndHitMeleeDamage = binaryReader.ReadTagReference();
     this._2ndHitMeleeResponse = binaryReader.ReadTagReference();
     this._3rdHitMeleeDamage = binaryReader.ReadTagReference();
     this._3rdHitMeleeResponse = binaryReader.ReadTagReference();
     this.LungeMeleeDamage = binaryReader.ReadTagReference();
     this.LungeMeleeResponse = binaryReader.ReadTagReference();
     return pointerQueue;
 }
 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.LensFlareReflectionFlags = ((Flags)(binaryReader.ReadInt16()));
     this.fieldpad         = binaryReader.ReadBytes(2);
     this.BitmapIndex      = binaryReader.ReadInt16();
     this.fieldpad0        = binaryReader.ReadBytes(2);
     this.Position         = binaryReader.ReadSingle();
     this.RotationOffset   = binaryReader.ReadSingle();
     this.Radius           = binaryReader.ReadRange();
     this.Brightness       = binaryReader.ReadVector2();
     this.ModulationFactor = binaryReader.ReadSingle();
     this.Color            = binaryReader.ReadColorR8G8B8();
     return(pointerQueue);
 }
 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.Name               = binaryReader.ReadStringID();
     this.TextBounds         = binaryReader.ReadVector2();
     this.Justification      = ((JustificationEnum)(binaryReader.ReadInt16()));
     this.Font               = ((FontEnum)(binaryReader.ReadInt16()));
     this.TextColor          = binaryReader.ReadColourR1G1B1();
     this.ShadowColor        = binaryReader.ReadColourR1G1B1();
     this.FadeInTimeseconds  = binaryReader.ReadSingle();
     this.UpTimeseconds      = binaryReader.ReadSingle();
     this.FadeOutTimeseconds = binaryReader.ReadSingle();
     this.padding            = binaryReader.ReadBytes(2);
     return(pointerQueue);
 }
 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.UiModelSceneReferenceFlags      = ((Flags)(binaryReader.ReadInt32()));
     this.AnimationIndex                  = ((AnimationIndexEnum)(binaryReader.ReadInt16()));
     this.IntroAnimationDelayMilliseconds = binaryReader.ReadInt16();
     this.RenderDepthBias                 = binaryReader.ReadInt16();
     this.fieldpad = binaryReader.ReadBytes(2);
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(32));
     pointerQueue.Enqueue(binaryReader.ReadBlamPointer(32));
     this.AnimationScaleFactor = binaryReader.ReadVector3();
     this.CameraPosition       = binaryReader.ReadVector3();
     this.FovDegress           = binaryReader.ReadSingle();
     this.UiViewport           = binaryReader.ReadVector2();
     this.UNUSEDIntroAnim      = binaryReader.ReadStringID();
     this.UNUSEDOutroAnim      = binaryReader.ReadStringID();
     this.UNUSEDAmbientAnim    = binaryReader.ReadStringID();
     return(pointerQueue);
 }
Example #32
0
        public void RestoreSuspendedState(CanvasDevice device, BinaryReader reader)
        {
            bitmapFormat = (DirectXPixelFormat)reader.ReadInt32();
            bitmapData = reader.ReadByteArray();

            Size = reader.ReadVector2();

            reader.ReadCollection(Edits, () => EditGroup.RestoreSuspendedState(this, reader));

            RecoverAfterDeviceLost(device);
        }
Example #33
0
 /// <summary>
 /// Reads a channel frame from the underlying stream.
 /// </summary>
 /// <param name="reader">The reader.</param>
 /// <param name="frame">The frame to read.</param>
 public override void ReadFrame(BinaryReader reader, int frame)
 {
     frames[frame] = reader.ReadVector2();
 }
Example #34
0
        /// <summary>
        /// Reads the event data from the underlying stream.
        /// </summary>
        /// <param name="reader">The reader.</param>
        public override void Read(BinaryReader reader)
        {
            base.Read(reader);

            Scale = new MinMax<Vector2>(reader.ReadVector2(), reader.ReadVector2());
        }
Example #35
0
 public KeyFrame(BinaryReader reader)
 {
     Cordinate = reader.ReadVector2();
     InterpolationType = (InterpolationTypes)reader.ReadInt32();
 }
Example #36
0
 public DecalVerticesBlock(BinaryReader binaryReader)
 {
     this.position = binaryReader.ReadVector3();
     this.texcoord0 = binaryReader.ReadVector2();
     this.texcoord1 = binaryReader.ReadVector2();
     this.color = binaryReader.ReadRGBColor();
 }
Example #37
0
 public void LoadFrom(Stream stream)
 {
     BinaryReader reader = new BinaryReader(stream);
     enabled = reader.ReadBoolean();
     reader.ReadBytes(3);
     curve = new MinMaxCurve(stream);
     range = reader.ReadVector2();
 }
Example #38
0
 public ScenarioCutsceneTitleBlock(BinaryReader binaryReader)
 {
     this.name = binaryReader.ReadStringID();
     this.textBoundsOnScreen = binaryReader.ReadVector2();
     this.justification = (Justification)binaryReader.ReadInt16();
     this.font = (Font)binaryReader.ReadInt16();
     this.textColor = binaryReader.ReadRGBColor();
     this.shadowColor = binaryReader.ReadRGBColor();
     this.fadeInTimeSeconds = binaryReader.ReadSingle();
     this.upTimeSeconds = binaryReader.ReadSingle();
     this.fadeOutTimeSeconds = binaryReader.ReadSingle();
     this.paddingpadding = binaryReader.ReadBytes(2);
 }
Example #39
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TexDesc"/> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public TexDesc(NiFile file, BinaryReader reader)
		{
			this.Source = new NiRef<NiSourceTexture>(reader);
			if (file.Version <= eNifVersion.VER_20_0_0_5)
			{
				this.ClampMode = (eTexClampMode)reader.ReadUInt32();
				this.FilterMode = (eTexFilterMode)reader.ReadUInt32();
			}
			if (file.Version >= eNifVersion.VER_20_1_0_3)
			{
				this.Flags = reader.ReadUInt16();
			}
			if (file.Version <= eNifVersion.VER_20_0_0_5)
			{
				this.UVSetIndex = reader.ReadUInt32();
			}
			if (file.Version <= eNifVersion.VER_10_4_0_1)
			{
				this.PS2L = reader.ReadInt16();
				this.PS2K = reader.ReadInt16();
			}
			if (file.Version <= eNifVersion.VER_4_1_0_12)
			{
				reader.ReadUInt16();
			}
			if (file.Version >= eNifVersion.VER_10_1_0_0)
			{
				this.HasTextureTransform = reader.ReadBoolean(file.Version);
				if (this.HasTextureTransform)
				{
					this.Translation = reader.ReadVector2();
					this.Tiling = reader.ReadVector2();
					this.WRotation = reader.ReadSingle();
					this.TransformType = reader.ReadUInt32();
					this.CenterOffset = reader.ReadVector2();
				}
			}
		}
Example #40
0
 public ScenarioCutsceneFlagBlock(BinaryReader binaryReader)
 {
     this.padding = binaryReader.ReadBytes(4);
     this.name = binaryReader.ReadString32();
     this.position = binaryReader.ReadVector3();
     this.facing = binaryReader.ReadVector2();
 }
Example #41
0
 public CsPointBlock(BinaryReader binaryReader)
 {
     this.name = binaryReader.ReadString32();
     this.position = binaryReader.ReadVector3();
     this.referenceFrame = binaryReader.ReadInt16();
     this.padding = binaryReader.ReadBytes(2);
     this.surfaceIndex = binaryReader.ReadInt32();
     this.facingDirection = binaryReader.ReadVector2();
 }
Example #42
0
 public UserHintWellPointBlock(BinaryReader binaryReader)
 {
     this.type = (Type)binaryReader.ReadInt16();
     this.padding = binaryReader.ReadBytes(2);
     this.point = binaryReader.ReadVector3();
     this.referenceFrame = binaryReader.ReadInt16();
     this.padding0 = binaryReader.ReadBytes(2);
     this.sectorIndex = binaryReader.ReadInt32();
     this.normal = binaryReader.ReadVector2();
 }
        public GeometrySectionData( SectionHeader header, FramedStream stream )
        {
            SectionHeader dataHeader = new SectionHeader( stream );
            BinaryReader reader = new BinaryReader( stream );

            Flags = (GeometryFlag) reader.ReadUInt16();
            reader.ReadUInt16(); // Unknown
            FaceCount = reader.ReadUInt32();
            VertexCount = reader.ReadUInt32();
            FrameCount = reader.ReadUInt32();

            if ( dataHeader.Version == 4099 )
            {
                Ambient = reader.ReadSingle();
                Diffuse = reader.ReadSingle();
                Specular = reader.ReadSingle();
            }

            if ( ( Flags & GeometryFlag.Colors ) != 0 )
            {
                Colours = new Color4[ VertexCount ];
                for ( int i = 0; i < VertexCount; ++i )
                {
                    byte r = reader.ReadByte();
                    byte g = reader.ReadByte();
                    byte b = reader.ReadByte();
                    byte a = reader.ReadByte();
                    Colours[ i ] = new Color4( r, g, b, a );
                }
            }

            if ( ( Flags & GeometryFlag.TexCoords ) != 0 )
            {
                TexCoords = new Vector2[ VertexCount ];
                for ( int i = 0; i < VertexCount; ++i )
                    TexCoords[ i ] = reader.ReadVector2();
            }

            Faces = new FaceInfo[ FaceCount ];
            for ( int i = 0; i < FaceCount; ++i )
                Faces[ i ] = new FaceInfo( reader );

            BoundingSphere = new BoundingSphere( reader );

            HasPosition = reader.ReadUInt32();
            HasNormals = reader.ReadUInt32();

            if ( HasPosition > 1 || HasNormals > 1 )
                throw new Exception( "Well there you go" );

            Vertices = new Vector3[ VertexCount ];
            for ( int i = 0; i < VertexCount; ++i )
                Vertices[ i ] = reader.ReadVector3();

            if ( ( Flags & GeometryFlag.Normals ) != 0 )
            {
                Normals = new Vector3[ VertexCount ];
                for ( int i = 0; i < VertexCount; ++i )
                    Normals[ i ] = reader.ReadVector3();
            }

            Materials = ( new Section( stream ).Data as MaterialListSectionData ).Materials;

            SectionHeader extHeader = new SectionHeader( stream );
            MaterialSplitSectionData msplits = new Section( stream ).Data as MaterialSplitSectionData;
            MaterialSplits = msplits.MaterialSplits;
            FaceCount = msplits.FaceCount;
            IndexCount = msplits.IndexCount;

            foreach ( MaterialSplit mat in MaterialSplits )
                mat.Material = Materials[ mat.MaterialIndex ];
        }
Example #44
0
 public SpriteVerticesBlock(BinaryReader binaryReader)
 {
     this.position = binaryReader.ReadVector3();
     this.offset = binaryReader.ReadVector3();
     this.axis = binaryReader.ReadVector3();
     this.texcoord = binaryReader.ReadVector2();
     this.color = binaryReader.ReadRGBColor();
 }
Example #45
0
 public static RTSUnitData Deserialize(BinaryReader s, GameState state, int index)
 {
     RTSUnitData data = new RTSUnitData(index);
     data.FriendlyName = s.ReadString();
     data.InfoFile = s.ReadString();
     data.Health = s.ReadInt32();
     data.CapitalCost = s.ReadInt32();
     data.PopulationCost = s.ReadInt32();
     data.MaxCount = s.ReadInt32();
     data.MovementSpeed = s.ReadSingle();
     data.Impact = s.ReadInt32();
     data.BuildTime = s.ReadInt32();
     data.CarryingCapacity = s.ReadInt32();
     data.IsWorker = s.ReadBoolean();
     BaseCombatData.Deserialize(s, data.BaseCombatData);
     CollisionType ct = (CollisionType)s.ReadInt32();
     Vector2 cc = s.ReadVector2();
     bool cs = s.ReadBoolean();
     switch(ct) {
         case CollisionType.Circle:
             float cr = s.ReadSingle();
             data.ICollidableShape = new CollisionCircle(cr, cc, cs);
             break;
         case CollisionType.Rectangle:
             float cw = s.ReadSingle();
             float cd = s.ReadSingle();
             data.ICollidableShape = new CollisionRect(cw, cd, cc, cs);
             break;
         default:
             throw new Exception("Nonexistent Collision Type");
     }
     data.BBox.Min = s.ReadVector3();
     data.BBox.Max = s.ReadVector3();
     data.DefaultActionController = state.Scripts[s.ReadString()];
     data.DefaultCombatController = state.Scripts[s.ReadString()];
     data.DefaultMoveController = state.Scripts[s.ReadString()];
     data.DefaultAnimationController = state.Scripts[s.ReadString()];
     return data;
 }
 public GlobalGeometrySectionRawVertexBlock(BinaryReader binaryReader)
 {
     this.position = binaryReader.ReadVector3();
     this.nodeIndicesOLD = new NodeIndicesOLD[4];
     for (int i = 0; i < 4; ++i)
     {
         this.nodeIndicesOLD[i] = new NodeIndicesOLD(binaryReader);
     }
     this.nodeWeights = new NodeWeights[4];
     for (int i = 0; i < 4; ++i)
     {
         this.nodeWeights[i] = new NodeWeights(binaryReader);
     }
     this.nodeIndicesNEW = new NodeIndicesNEW[4];
     for (int i = 0; i < 4; ++i)
     {
         this.nodeIndicesNEW[i] = new NodeIndicesNEW(binaryReader);
     }
     this.useNewNodeIndices = binaryReader.ReadInt32();
     this.adjustedCompoundNodeIndex = binaryReader.ReadInt32();
     this.texcoord = binaryReader.ReadVector2();
     this.normal = binaryReader.ReadVector3();
     this.binormal = binaryReader.ReadVector3();
     this.tangent = binaryReader.ReadVector3();
     this.anisotropicBinormal = binaryReader.ReadVector3();
     this.secondaryTexcoord = binaryReader.ReadVector2();
     this.primaryLightmapColor = binaryReader.ReadColorR8G8B8();
     this.primaryLightmapTexcoord = binaryReader.ReadVector2();
     this.primaryLightmapIncidentDirection = binaryReader.ReadVector3();
     this.padding = binaryReader.ReadBytes(12);
     this.padding0 = binaryReader.ReadBytes(8);
     this.padding1 = binaryReader.ReadBytes(12);
 }
Example #47
0
 public void LoadFrom(Stream stream)
 {
     BinaryReader reader = new BinaryReader(stream);
     enabled = reader.ReadBoolean();
     reader.ReadBytes(3);
     gradient = new MinMaxGradient(stream);
     range = reader.ReadVector2();
 }
Example #48
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NiGeometryData" /> class.
        /// </summary>
        /// <param name="file">The file.</param>
        /// <param name="reader">The reader.</param>
        public NiGeometryData(NiFile file, BinaryReader reader) : base(file, reader)
		{
			if (base.Version >= eNifVersion.VER_10_2_0_0)
			{
				this.Unkown1 = reader.ReadUInt32();
			}
			
			this.NumVertices = (uint)reader.ReadUInt16();
			if (base.Version >= eNifVersion.VER_10_1_0_0)
			{
				this.KeepFlags = reader.ReadByte();
				this.CompressFlags = reader.ReadByte();
			}
			
			this.HasVertices = reader.ReadBoolean(Version);
			if (this.HasVertices)
			{
				this.Vertices = new Vector3[this.NumVertices];
				int num = 0;
				while ((long)num < (long)((ulong)this.NumVertices))
				{
					this.Vertices[num] = reader.ReadVector3();
					num++;
				}
			}
			
			int numUvSets = 0;
			if (base.Version >= eNifVersion.VER_10_0_1_0)
			{
				numUvSets = (int)reader.ReadByte();
				this.TSpaceFlag = reader.ReadByte();
			}
			
			this.HasNormals = reader.ReadBoolean(Version);
			if (this.HasNormals)
			{
				this.Normals = new Vector3[this.NumVertices];
				int num3 = 0;
				while ((long)num3 < (long)((ulong)this.NumVertices))
				{
					this.Normals[num3] = reader.ReadVector3();
					num3++;
				}
			}
			if (base.Version >= eNifVersion.VER_10_1_0_0)
			{
				this.Binormals = new Vector3[this.NumVertices];
				this.Tangents = new Vector3[this.NumVertices];
				if (this.HasNormals && (this.TSpaceFlag & 240) != 0)
				{
					int num4 = 0;
					while ((long)num4 < (long)((ulong)this.NumVertices))
					{
						this.Binormals[num4] = reader.ReadVector3();
						num4++;
					}
					int num5 = 0;
					while ((long)num5 < (long)((ulong)this.NumVertices))
					{
						this.Tangents[num5] = reader.ReadVector3();
						num5++;
					}
				}
			}
			
			this.Center = reader.ReadVector3();
			this.Radius = reader.ReadSingle();
			
			this.HasVertexColors = reader.ReadBoolean(Version);
			if (this.HasVertexColors)
			{
				this.VertexColors = new Color4[this.NumVertices];
				int num6 = 0;
				while ((long)num6 < (long)((ulong)this.NumVertices))
				{
					this.VertexColors[num6] = reader.ReadColor4();
					num6++;
				}
			}
			if (base.Version <= eNifVersion.VER_4_2_2_0)
			{
				numUvSets = (int)reader.ReadByte();
				this.TSpaceFlag = reader.ReadByte();
			}
			if (base.Version <= eNifVersion.VER_4_0_0_2)
			{
				this.HasUV = reader.ReadBoolean(Version);
			}
			int num7;
			if (base.Version < eNifVersion.VER_20_2_0_7 || this.File.Header.UserVersion != 1u)
			{
				num7 = (numUvSets & 63);
			}
			else
			{
				num7 = (numUvSets & 1);
			}
			this.UVSets = new Vector2[num7][];
			for (int i = 0; i < num7; i++)
			{
				this.UVSets[i] = new Vector2[this.NumVertices];
				int num8 = 0;
				while ((long)num8 < (long)((ulong)this.NumVertices))
				{
					this.UVSets[i][num8] = reader.ReadVector2();
					num8++;
				}
			}
			if (base.Version >= eNifVersion.VER_10_0_1_0)
			{
				this.ConsistencyFlags = reader.ReadUInt16();
			}
			if (base.Version >= eNifVersion.VER_20_0_0_4)
			{
				this.AdditionalDataID = reader.ReadUInt32();
			}
		}
Example #49
0
		private void init(string filename, Stream stream, string contentDirectory, Dictionary<string,Type> materialTypes, List<MaterialFieldBinder> value1BinderTypes, List<MaterialFieldBinder> value2BinderTypes, List<MaterialFieldBinder> value3BinderTypes, List<MaterialFieldBinder> value4BinderTypes, List<MaterialFieldBinder> textureBinderTypes, Dictionary<string,string> fileExtOverrides, int classicInstanceCount, Loader.LoadedCallbackMethod loadedCallback)
		{
			try
			{
				var reader = new BinaryReader(stream);

				// meta data
				if (reader.ReadInt32() != Streams.MakeFourCC('R', 'M', 'F', 'T')) Debug.ThrowError("Error", "Not a ReignModel file: " + filename);
				float version = reader.ReadSingle();
				if (version != 1.0f) Debug.ThrowError("Error", "Unsuported model version: " + version.ToString());
				bool compressed = reader.ReadBoolean();

				// frames
				FrameStart = reader.ReadSingle();
				FrameEnd = reader.ReadSingle();
				FrameCount = FrameEnd - FrameStart;
				FPS = reader.ReadSingle();

				// materials
				int materialCount = reader.ReadInt32();
				Materials = new MaterialI[materialCount];
				Textures = new List<ITexture2D>();
				for (int i = 0; i != materialCount; ++i)
				{
					string name = reader.ReadString();

					// create material
					bool pass = false;
					foreach (var materialType in (Dictionary<string,Type>)materialTypes)
					{
						if (materialType.Key == name)
						{
							Materials[i] = (MaterialI)Activator.CreateInstance(materialType.Value);
							Materials[i].Name = name;
							pass = true;
							break;
						}
					}
					if (!pass) Debug.ThrowError("Model", "Failed to find a valid material type for: " + name);
					var material = Materials[i];

					// values1
					var values1 = new Dictionary<string,float>();
					int valueCount = reader.ReadInt32();
					for (int i2 = 0; i2 != valueCount; ++i2) values1.Add(reader.ReadString(), reader.ReadSingle());
					bindTypes(material, values1, value1BinderTypes, contentDirectory, fileExtOverrides, handleFoundValueBinder);

					// values2
					var values2 = new Dictionary<string,Vector2>();
					valueCount = reader.ReadInt32();
					for (int i2 = 0; i2 != valueCount; ++i2) values2.Add(reader.ReadString(), reader.ReadVector2());
					bindTypes(material, values2, value2BinderTypes, contentDirectory, fileExtOverrides, handleFoundValueBinder);

					// values3
					var values3 = new Dictionary<string,Vector3>();
					valueCount = reader.ReadInt32();
					for (int i2 = 0; i2 != valueCount; ++i2) values3.Add(reader.ReadString(), reader.ReadVector3());
					bindTypes(material, values3, value3BinderTypes, contentDirectory, fileExtOverrides, handleFoundValueBinder);

					// values4
					var values4 = new Dictionary<string,Vector4>();
					valueCount = reader.ReadInt32();
					for (int i2 = 0; i2 != valueCount; ++i2) values4.Add(reader.ReadString(), reader.ReadVector4());
					bindTypes(material, values4, value4BinderTypes, contentDirectory, fileExtOverrides, handleFoundValueBinder);

					// textures
					var textures = new Dictionary<string,string>();
					int textureCount = reader.ReadInt32();
					for (int i2 = 0; i2 != textureCount; ++i2) textures.Add(reader.ReadString(), reader.ReadString());
					bindTypes(material, textures, textureBinderTypes, contentDirectory, fileExtOverrides, handleFoundTextureBinder);
				}

				// meshes
				int meshCount = reader.ReadInt32();
				Meshes = new Mesh[meshCount];
				for (int i = 0; i != meshCount; ++i)
				{
					Meshes[i] = new Mesh(reader, this, classicInstanceCount);
				}

				// actions
				int actionCount = reader.ReadInt32();
				Actions = new Action[actionCount];
				for (int i = 0; i != actionCount; ++i)
				{
					Actions[i] = new Action(reader);
				}

				// armatures
				int armatureCount = reader.ReadInt32();
				Armatures = new Armature[armatureCount];
				for (int i = 0; i != armatureCount; ++i)
				{
					Armatures[i] = new Armature(reader);
				}

				// objects
				int objectCount = reader.ReadInt32();
				Objects = new Object[objectCount];
				for (int i = 0; i != objectCount; ++i)
				{
					string type = reader.ReadString();
					if (type == "MESH") Objects[i] = new ObjectMesh(reader, this);
					else if (type == "ARMATURE") Objects[i] = new ObjectArmature(reader, this);
					else Debug.ThrowError("Mesh", "Unsuported Object type: " + type);
				}

				// link objects
				foreach (var o in Objects)
				{
					o.linkObjects(Objects);
				}
			}
			catch (Exception e)
			{
				FailedToLoad = true;
				Loader.AddLoadableException(e);
				Dispose();
				if (loadedCallback != null) loadedCallback(this, false);
				return;
			}

			if (Textures.Count == 0)
			{
				Loaded = true;
				if (loadedCallback != null) loadedCallback(this, true);
			}
			else
			{
				new LoadWaiter(Textures.ToArray(),
				delegate(object sender, bool succeeded)
				{
					if (succeeded)
					{
						Loaded = true;
						if (loadedCallback != null) loadedCallback(this, true);
					}
					else
					{
						FailedToLoad = true;
						Dispose();
						if (loadedCallback != null) loadedCallback(this, false);
					}
				});
			}
		}
Example #50
0
 public static RTSBuilding Deserialize(BinaryReader s, RTSTeam team, out int? target)
 {
     int type = s.ReadInt32();
     RTSBuilding e = team.AddBuilding(type, Vector2.Zero);
     if(e == null) throw new Exception("Could Not Create A Building That Was Previously Created");
     e.UUID = s.ReadInt32();
     e.State = s.ReadInt32();
     e.ViewDirection = s.ReadVector2();
     e.GridPosition = s.ReadVector2();
     e.Height = s.ReadSingle();
     if(s.ReadBoolean()) {
         target = s.ReadInt32();
     }
     else {
         target = null;
     }
     e.Health = s.ReadInt32();
     for(int i = 0; i < GameState.MAX_PLAYERS; i++) {
         e.viewedInfo.Set(i, s.ReadBoolean());
     }
     if(s.ReadBoolean()) {
         if(e.ActionController != null) e.ActionController.Deserialize(s);
     }
     else {
         e.ActionController = null;
     }
     return e;
 }
Example #51
0
 public static EnemyBuildingUpdater Deserialize(BinaryReader s, GameState state)
 {
     int ti = s.ReadInt32();
     ViewedBuilding vb = new ViewedBuilding();
     vb.Team = s.ReadInt32();
     vb.Type = s.ReadInt32();
     vb.CellPoint = s.ReadPoint();
     vb.WorldPosition = s.ReadVector3();
     vb.ViewDirection = s.ReadVector2();
     int uuid = s.ReadInt32();
     RTSBuilding b = null;
     foreach(var building in state.teams[vb.Team].Buildings) {
         if(building.UUID == uuid) {
             b = building;
             break;
         }
     }
     EnemyBuildingUpdater ebu = new EnemyBuildingUpdater(state, ti, vb, b);
     ebu.Added = s.ReadBoolean();
     ebu.isDead = s.ReadBoolean();
     if(ebu.Added) {
         state.teams[ebu.teamIndex].ViewedEnemyBuildings.Add(vb);
     }
     return ebu;
 }
Example #52
0
        static void ReadMOTV2(BinaryReader br, WMOGroup group, uint size)
        {
            // Texture coordinates, 2 floats per vertex in (X,Y) order. The values range from 0.0 to 1.0.
            // Vertices, normals and texture coordinates are in corresponding order, of course. 
            group.TextureVertices2 = new Vector2[size / 8];

            for (int i = 0; i < group.TextureVertices2.Length; i++)
            {
                group.TextureVertices2[i] = br.ReadVector2();
            }
        }
Example #53
0
 private static void LoadNPCs(BinaryReader reader)
 {
     int num = 0;
     bool flag = reader.ReadBoolean();
     while (flag)
     {
         NPC nPC = Main.npc[num];
         nPC.SetDefaults(reader.ReadString());
         nPC.displayName = reader.ReadString();
         nPC.position.X = reader.ReadSingle();
         nPC.position.Y = reader.ReadSingle();
         nPC.homeless = reader.ReadBoolean();
         nPC.homeTileX = reader.ReadInt32();
         nPC.homeTileY = reader.ReadInt32();
         num++;
         flag = reader.ReadBoolean();
     }
     if (WorldFile.versionNumber < 140)
     {
         return;
     }
     flag = reader.ReadBoolean();
     while (flag)
     {
         NPC nPC = Main.npc[num];
         nPC.SetDefaults(reader.ReadString());
         nPC.position = reader.ReadVector2();
         num++;
         flag = reader.ReadBoolean();
     }
 }
Example #54
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"));

            string identifier = reader.ReadNullTerminatedString();

            int version;

            if (string.Compare(identifier, FILE_IDENTIFIER_7, false) == 0) {
                version = 7;
            } else if (string.Compare(identifier, FILE_IDENTIFIER_8, false) == 0) {
                version = 8;
            } else {
                throw new FileIdentifierMismatchException(FilePath, string.Format("{0} / {1}", FILE_IDENTIFIER_7, FILE_IDENTIFIER_8), identifier);
            }

            format = (VertexFormat)reader.ReadInt32();
            BoundingBox = new Bounds(reader.ReadVector3(), reader.ReadVector3());

            short boneCount = reader.ReadInt16();

            for (int i = 0; i < boneCount; i++) {
                BoneTable.Add(reader.ReadInt16());
            }

            short vertexCount = reader.ReadInt16();

            for (int i = 0; i < vertexCount; i++) {
                ModelVertex vertex = new ModelVertex();
                vertex.Position = reader.ReadVector3();

                Vertices.Add(vertex);
            }

            if (NormalsEnabled) {
                for (int i = 0; i < vertexCount; i++) {
                    ModelVertex vertex = Vertices[i];
                    vertex.Normal = reader.ReadVector3();
                }
            }

            if (ColoursEnabled) {
                for (int i = 0; i < vertexCount; i++) {
                    float a = reader.ReadSingle();
                    ModelVertex vertex = Vertices[i];
                    vertex.Colour = new Color(reader.ReadSingle(), reader.ReadSingle(), reader.ReadSingle(), a);
                }
            }

            if (BonesEnabled) {
                for (int i = 0; i < vertexCount; i++) {
                    ModelVertex vertex = Vertices[i];
                    vertex.BoneWeights = reader.ReadVector4();
                    vertex.BoneIndices = reader.ReadShortVector4();
                }
            }

            if (TangentsEnabled) {
                for (int i = 0; i < vertexCount; i++) {
                    ModelVertex vertex = Vertices[i];
                    vertex.Tangent = reader.ReadVector3();
                }
            }

            if (TextureCoordinates1Enabled) {
                for (int i = 0; i < vertexCount; i++) {
                    ModelVertex vertex = Vertices[i];
                    vertex.TextureCoordinates[0] = reader.ReadVector2();
                }
            }

            if (TextureCoordinates2Enabled) {
                for (int i = 0; i < vertexCount; i++) {
                    ModelVertex vertex = Vertices[i];
                    vertex.TextureCoordinates[1] = reader.ReadVector2();
                }
            }

            if (TextureCoordinates3Enabled) {
                for (int i = 0; i < vertexCount; i++) {
                    ModelVertex vertex = Vertices[i];
                    vertex.TextureCoordinates[2] = reader.ReadVector2();
                }
            }

            if (TextureCoordinates4Enabled) {
                for (int i = 0; i < vertexCount; i++) {
                    ModelVertex vertex = Vertices[i];
                    vertex.TextureCoordinates[3] = reader.ReadVector2();
                }
            }

            short indexCount = reader.ReadInt16();

            for (int i = 0; i < indexCount; i++) {
                Indices.Add(reader.ReadShortVector3());
            }

            short materialCount = reader.ReadInt16();

            for (int i = 0; i < materialCount; i++) {
                Materials.Add(reader.ReadInt16());
            }

            short stripCount = reader.ReadInt16();

            for (int i = 0; i < stripCount; i++) {
                Strips.Add(reader.ReadInt16());
            }

            if (version >= 8) {
                Pool = (PoolType)reader.ReadInt16();
            }
        }
Example #55
0
 public FlockSourceBlock(BinaryReader binaryReader)
 {
     this.position = binaryReader.ReadVector3();
     this.startingYawPitchDegrees = binaryReader.ReadVector2();
     this.radius = binaryReader.ReadSingle();
     this.weightProbabilityOfProducingAtThisSource = binaryReader.ReadSingle();
 }
Example #56
0
        static void ReadVertices(BinaryReader br, M2Model model)
        {
            var vertInfo = model.Header.Vertices;

            model.Vertices = new ModelVertices[vertInfo.Count];

            br.BaseStream.Position = vertInfo.Offset;
            for (int i = 0; i < vertInfo.Count; i++)
            {
                var mv = new ModelVertices
                             {
                                 Position = br.ReadVector3(),
                                 BoneWeight = br.ReadBytes(4),
                                 BoneIndices = br.ReadBytes(4),
                                 Normal = br.ReadVector3(),
                                 TextureCoordinates = br.ReadVector2(),
                                 Float_1 = br.ReadSingle(),
                                 Float_2 = br.ReadSingle()
                             };

                model.Vertices[i] = mv;
            }
        }
 public static RTSBuildingData Deserialize(BinaryReader s, GameState state, int index)
 {
     RTSBuildingData data = new RTSBuildingData(index);
     data.FriendlyName = s.ReadString();
     data.InfoFile = s.ReadString();
     data.Health = s.ReadInt32();
     data.CapitalCost = s.ReadInt32();
     data.PopCapChange = s.ReadInt32();
     data.MaxCount = s.ReadInt32();
     data.IsResource = s.ReadBoolean();
     data.Impact = s.ReadInt32();
     data.BuildAmount = s.ReadInt32();
     data.Depositable = s.ReadBoolean();
     data.SightRadius = s.ReadInt32();
     data.GridSize = s.ReadPoint();
     CollisionType ct = (CollisionType)s.ReadInt32();
     Vector2 cc = s.ReadVector2();
     bool cs = s.ReadBoolean();
     switch(ct) {
         case CollisionType.Circle:
             float cr = s.ReadSingle();
             data.ICollidableShape = new CollisionCircle(cr, cc, cs);
             break;
         case CollisionType.Rectangle:
             float cw = s.ReadSingle();
             float cd = s.ReadSingle();
             data.ICollidableShape = new CollisionRect(cw, cd, cc, cs);
             break;
         default:
             throw new Exception("Nonexistent Collision Type");
     }
     data.BBox.Min = s.ReadVector3();
     data.BBox.Max = s.ReadVector3();
     data.DefaultActionController = state.Scripts[s.ReadString()];
     return data;
 }
Example #58
0
 public ActorStartingLocationsBlock(BinaryReader binaryReader)
 {
     this.name = binaryReader.ReadStringID();
     this.position = binaryReader.ReadVector3();
     this.referenceFrame = binaryReader.ReadInt16();
     this.padding = binaryReader.ReadBytes(2);
     this.facingYawPitchDegrees = binaryReader.ReadVector2();
     this.flags = (Flags)binaryReader.ReadInt32();
     this.characterType = binaryReader.ReadShortBlockIndex1();
     this.initialWeapon = binaryReader.ReadShortBlockIndex1();
     this.initialSecondaryWeapon = binaryReader.ReadShortBlockIndex1();
     this.padding0 = binaryReader.ReadBytes(2);
     this.vehicleType = binaryReader.ReadShortBlockIndex1();
     this.seatType = (SeatType)binaryReader.ReadInt16();
     this.grenadeType = (GrenadeType)binaryReader.ReadInt16();
     this.swarmCountNumberOfCreturesInSwarmIfASwarmIsSpawnedAtThisLocation = binaryReader.ReadInt16();
     this.actorVariantName = binaryReader.ReadStringID();
     this.vehicleVariantName = binaryReader.ReadStringID();
     this.initialMovementDistanceBeforeDoingAnythingElseTheActorWillTravelTheGivenDistanceInItsForwardDirection = binaryReader.ReadSingle();
     this.emitterVehicle = binaryReader.ReadShortBlockIndex1();
     this.initialMovementMode = (InitialMovementMode)binaryReader.ReadInt16();
     this.placementScript = binaryReader.ReadString32();
     this.skip1 = binaryReader.ReadBytes(2);
     this.padding2 = binaryReader.ReadBytes(2);
 }
Example #59
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"));

            int blockCount = reader.ReadInt32();

            for (int i = 0; i < blockCount; i++) {
                ZoneBlock type = (ZoneBlock)reader.ReadInt32();
                int offset = reader.ReadInt32();

                long nextBlock = stream.Position;
                stream.Seek(offset, SeekOrigin.Begin);

                switch (type) {
                    case ZoneBlock.Info:
                        Type = (ZoneType)reader.ReadInt32();
                        Width = reader.ReadInt32();
                        Height = reader.ReadInt32();
                        GridCount = reader.ReadInt32();
                        GridSize = reader.ReadSingle();
                        StartPosition = new IntVector2(reader.ReadInt32(), reader.ReadInt32());

                        for (int w = 0; w < Width; w++) {
                            for (int h = 0; h < Height; h++) {
                                Positions[w, h].IsUsed = reader.ReadBoolean();
                                Positions[w, h].Position = reader.ReadVector2();
                            }
                        }
                        break;
                    case ZoneBlock.SpawnPoints:
                        int spawnCount = reader.ReadInt32();

                        for (int j = 0; j < spawnCount; j++) {
                            SpawnPoint spawnPoint = new SpawnPoint();
                            spawnPoint.Position = reader.ReadVector3();
                            spawnPoint.Name = reader.ReadByteString();

                            SpawnPoints.Add(spawnPoint);
                        }
                        break;
                    case ZoneBlock.Textures:
                        int textureCount = reader.ReadInt32();

                        for (int j = 0; j < textureCount; j++) {
                            Textures.Add(reader.ReadByteString());
                        }
                        break;
                    case ZoneBlock.Tiles:
                        int tileCount = reader.ReadInt32();

                        for (int j = 0; j < tileCount; j++) {
                            ZoneTile tile = new ZoneTile();
                            tile.Layer1 = reader.ReadInt32();
                            tile.Layer2 = reader.ReadInt32();
                            tile.Offset1 = reader.ReadInt32();
                            tile.Offset2 = reader.ReadInt32();
                            tile.BlendingEnabled = reader.ReadInt32() != 0;
                            tile.Rotation = (TileRotation)reader.ReadInt32();
                            tile.TileType = reader.ReadInt32();

                            Tiles.Add(tile);
                        }
                        break;
                    case ZoneBlock.Economy:
                        Name = reader.ReadByteString();
                        IsUnderground = reader.ReadInt32() != 0;
                        BackgroundMusicFilePath = reader.ReadByteString();
                        SkyFilePath = reader.ReadByteString();
                        EconomyCheckRate = reader.ReadInt32();
                        PopulationBase = reader.ReadInt32();
                        PopulationGrowthRate = reader.ReadInt32();
                        MetalConsumption = reader.ReadInt32();
                        StoneConsumption = reader.ReadInt32();
                        WoodConsumption = reader.ReadInt32();
                        LeatherConsumption = reader.ReadInt32();
                        ClothConsumption = reader.ReadInt32();
                        AlchemyConsumption = reader.ReadInt32();
                        ChemicalConsumption = reader.ReadInt32();
                        IndustrialConsumption = reader.ReadInt32();
                        MedicineConsumption = reader.ReadInt32();
                        FoodConsumption = reader.ReadInt32();
                        break;
                }

                if (i < blockCount - 1) {
                    stream.Seek(nextBlock, SeekOrigin.Begin);
                }
            }
        }
Example #60
0
 public FiringPositionsBlock(BinaryReader binaryReader)
 {
     this.positionLocal = binaryReader.ReadVector3();
     this.referenceFrame = binaryReader.ReadInt16();
     this.flags = (Flags)binaryReader.ReadInt16();
     this.area = binaryReader.ReadShortBlockIndex1();
     this.clusterIndex = binaryReader.ReadInt16();
     this.skip = binaryReader.ReadBytes(4);
     this.normal = binaryReader.ReadVector2();
 }