public virtual void Load(Utility utility) { CGFXDebug.LoadStart(this, utility); TypeId = utility.ReadU32(); if (!VerifyTypeId(TypeId)) { throw new InvalidOperationException($"ChunkDICTObject Load: ERROR reading DICT -- unexpected type ID '{TypeId.ToString("X8")}'"); } var magic = utility.ReadMagic(); if (magic != Utility.MakeMagic(Magic)) { throw new InvalidOperationException($"ChunkDICTObject Load: ERROR reading DICT -- expected magic '{Magic}', got '{Utility.GetMagicString(magic)}'"); } Revision = utility.ReadU32(); Name = utility.ReadString(); MetaDatas = utility.LoadDICTFromOffset <ChunkDICTMetaData>(); }
public override void Load(Utility utility) { // Used for later resolving ONLY OriginalOffset = utility.GetReadPosition(); // Unlike most objects loaded from a DICT, bones DO NOT use the stndard // Type/Magic/Revision/Name/MetaData header and instead do their own thing... // (in short, not calling base.Load() here!!) Name = utility.ReadString(); Flags = (BoneFlags)utility.ReadU32(); Index = utility.ReadI32(); ParentIndex = utility.ReadI32(); // NOTE !! Relational data... will have to treat this carefully... // We're UNUSUALLY going to store absolute offsets only here (so // we don't pointlessly and recursively reload bones several times), // and we'll resolve them LATER... ParentOffset = utility.ReadOffset(); ChildOffset = utility.ReadOffset(); PrevSiblingOffset = utility.ReadOffset(); NextSiblingOffset = utility.ReadOffset(); Scale = Vector3.Read(utility); Rotation = Vector3.Read(utility); Translation = Vector3.Read(utility); LocalTransform = Matrix.Read(utility); WorldTransform = Matrix.Read(utility); InvWorldTransform = Matrix.Read(utility); BillboardMode = (GfxBillboardMode)utility.ReadU32(); MetaDatas = utility.LoadDICTFromOffset <ChunkDICTMetaData>(); }