Beispiel #1
0
        public override void Deserialize(FAssetArchive Ar, long validPos)
        {
            base.Deserialize(Ar, validPos);

            var bCooked = false;

            if (FFortniteMainBranchObjectVersion.Get(Ar) >= FFortniteMainBranchObjectVersion.Type.SerializeInstancedStaticMeshRenderData ||
                FEditorObjectVersion.Get(Ar) >= FEditorObjectVersion.Type.SerializeInstancedStaticMeshRenderData)
            {
                bCooked = Ar.ReadBoolean();
            }

            PerInstanceSMData = Ar.ReadBulkArray(() => new FInstancedStaticMeshInstanceData(Ar));

            if (FRenderingObjectVersion.Get(Ar) >= FRenderingObjectVersion.Type.PerInstanceCustomData)
            {
                PerInstanceSMCustomData = Ar.ReadBulkArray(Ar.Read <float>);
            }

            if (bCooked && (FFortniteMainBranchObjectVersion.Get(Ar) >= FFortniteMainBranchObjectVersion.Type.SerializeInstancedStaticMeshRenderData ||
                            FEditorObjectVersion.Get(Ar) >= FEditorObjectVersion.Type.SerializeInstancedStaticMeshRenderData))
            {
                var renderDataSizeBytes = Ar.Read <long>();

                if (renderDataSizeBytes > 0)
                {
                    // idk what to do here... But it fixes the warnings ­ЪциРђЇ
                    Ar.Position = validPos;
                }
            }
        }
Beispiel #2
0
        public override void Deserialize(FAssetArchive Ar, long validPos)
        {
            base.Deserialize(Ar, validPos);

            var numRows = Ar.Read <int>();

            var bUpgradingCurveTable = FFortniteMainBranchObjectVersion.Get(Ar) < FFortniteMainBranchObjectVersion.Type.ShrinkCurveTableSize;

            if (bUpgradingCurveTable)
            {
                CurveTableMode = numRows > 0 ? ECurveTableMode.RichCurves : ECurveTableMode.Empty;
            }
            else
            {
                CurveTableMode = Ar.Read <ECurveTableMode>();
            }
            RowMap = new Dictionary <FName, FStructFallback>(numRows);
            for (var i = 0; i < numRows; i++)
            {
                var    rowName   = Ar.ReadFName();
                string rowStruct = CurveTableMode switch
                {
                    ECurveTableMode.SimpleCurves => "SimpleCurve",
                    ECurveTableMode.RichCurves => "RichCurve",
                    _ => ""
                };
                RowMap[rowName] = new FStructFallback(Ar, rowStruct);
            }
        }
Beispiel #3
0
        public FStaticTerrainLayerWeightParameter(FArchive Ar) : base(Ar)
        {
            if (FFortniteMainBranchObjectVersion.Get(Ar) >= FFortniteMainBranchObjectVersion.Type.StaticParameterTerrainLayerWeightBlendType)
            {
                bWeightBasedBlend = Ar.ReadBoolean();
            }

            WeightmapIndex = Ar.Read <int>();
            bOverride      = Ar.ReadBoolean();
            ExpressionGuid = Ar.Read <FGuid>();
        }
Beispiel #4
0
        public override void Deserialize(FAssetArchive Ar, long validPos)
        {
            base.Deserialize(Ar, validPos);

            if (FFortniteMainBranchObjectVersion.Get(Ar) >= FFortniteMainBranchObjectVersion.Type.BPGCCookedEditorTags)
            {
                if (validPos - Ar.Position > 4)
                {
                    var size = Ar.Read <int>();

                    EditorTags = new Dictionary <FName, string>();
                    for (var i = 0; i < size; i++)
                    {
                        EditorTags[Ar.ReadFName()] = Ar.ReadFString();
                    }
                }
            }
        }
Beispiel #5
0
        public FFieldPath(FAssetArchive Ar)
        {
            var pathNum = Ar.Read <int>();

            Path = new List <FName>(pathNum);
            for (int i = 0; i < pathNum; i++)
            {
                Path.Add(Ar.ReadFName());
            }

            // The old serialization format could save 'None' paths, they should be just empty
            if (Path.Count == 1 && Path[0].IsNone)
            {
                Path.Clear();
            }

            if (FFortniteMainBranchObjectVersion.Get(Ar) >= FFortniteMainBranchObjectVersion.Type.FFieldPathOwnerSerialization || FReleaseObjectVersion.Get(Ar) >= FReleaseObjectVersion.Type.FFieldPathOwnerSerialization)
            {
                ResolvedOwner = new FPackageIndex(Ar);
            }
        }
        public FMovieSceneFloatChannel(FAssetArchive Ar)
        {
            if (FSequencerObjectVersion.Get(Ar) < FSequencerObjectVersion.Type.SerializeFloatChannelCompletely) // && FFortniteMainBranchObjectVersion.Get(Ar) < FFortniteMainBranchObjectVersion.Type.SerializeFloatChannelShowCurve
            {
                PreInfinityExtrap  = ERichCurveExtrapolation.RCCE_None;
                PostInfinityExtrap = ERichCurveExtrapolation.RCCE_None;
                Times            = Array.Empty <FFrameNumber>();
                Values           = Array.Empty <FMovieSceneFloatValue>();
                DefaultValue     = 0;
                bHasDefaultValue = false;
                TickResolution   = default;
                bShowCurve       = false;
                return;
            }

            PreInfinityExtrap  = Ar.Read <ERichCurveExtrapolation>();
            PostInfinityExtrap = Ar.Read <ERichCurveExtrapolation>();

            var CurrentSerializedElementSize = Unsafe.SizeOf <FFrameNumber>();
            var SerializedElementSize        = Ar.Read <int>();

            if (SerializedElementSize == CurrentSerializedElementSize)
            {
                Times = Ar.ReadArray <FFrameNumber>();
            }
            else
            {
                var ArrayNum = Ar.Read <int>();

                if (ArrayNum > 0)
                {
                    var padding = SerializedElementSize - CurrentSerializedElementSize;
                    Times = new FFrameNumber[ArrayNum];

                    for (var i = 0; i < ArrayNum; i++)
                    {
                        Ar.Position += padding;
                        Times[i]     = Ar.Read <FFrameNumber>();
                        //Ar.Position += padding; TODO check this
                    }
                }
                else
                {
                    Times = Array.Empty <FFrameNumber>();
                }
            }

            CurrentSerializedElementSize = Unsafe.SizeOf <FMovieSceneFloatValue>();
            SerializedElementSize        = Ar.Read <int>();

            if (SerializedElementSize == CurrentSerializedElementSize)
            {
                Values = Ar.ReadArray <FMovieSceneFloatValue>();
            }
            else
            {
                var ArrayNum = Ar.Read <int>();

                if (ArrayNum > 0)
                {
                    var padding = SerializedElementSize - CurrentSerializedElementSize;
                    Values = new FMovieSceneFloatValue[ArrayNum];

                    for (var i = 0; i < ArrayNum; i++)
                    {
                        Ar.Position += padding;
                        Values[i]    = Ar.Read <FMovieSceneFloatValue>();
                        //Ar.Position += padding; TODO check this
                    }
                }
                else
                {
                    Values = Array.Empty <FMovieSceneFloatValue>();
                }
            }

            DefaultValue     = Ar.Read <float>();
            bHasDefaultValue = Ar.ReadBoolean();
            TickResolution   = Ar.Read <FFrameRate>();
            bShowCurve       = FFortniteMainBranchObjectVersion.Get(Ar) >= FFortniteMainBranchObjectVersion.Type.SerializeFloatChannelShowCurve && Ar.ReadBoolean(); // bShowCurve should still only be assigned while in editor
        }