// ---- METHODS ------------------------------------------------------------------------------------------------ void IResData.Load(ResFileLoader loader) { loader.CheckSignature(_signature); if (loader.IsSwitch) { if (loader.ResFile.VersionMajor2 == 9) { _flags = loader.ReadUInt32(); } else { ((Switch.Core.ResFileSwitchLoader)loader).LoadHeaderBlock(); } long BoneDictOffset = loader.ReadOffset(); long BoneArrayOffset = loader.ReadOffset(); Bones = loader.LoadDictValues <Bone>(BoneDictOffset, BoneArrayOffset); uint MatrixToBoneListOffset = loader.ReadOffset(); uint InverseModelMatricesOffset = loader.ReadOffset(); if (loader.ResFile.VersionMajor2 == 8) { loader.Seek(16); } if (loader.ResFile.VersionMajor2 == 9) { loader.Seek(8); } long userPointer = loader.ReadInt64(); if (loader.ResFile.VersionMajor2 != 9) { _flags = loader.ReadUInt32(); } ushort numBone = loader.ReadUInt16(); ushort numSmoothMatrix = loader.ReadUInt16(); ushort numRigidMatrix = loader.ReadUInt16(); loader.Seek(6); MatrixToBoneList = loader.LoadCustom(() => loader.ReadUInt16s((numSmoothMatrix + numRigidMatrix)), MatrixToBoneListOffset); InverseModelMatrices = loader.LoadCustom(() => loader.ReadMatrix3x4s(numSmoothMatrix), InverseModelMatricesOffset)?.ToList(); } else { _flags = loader.ReadUInt32(); ushort numBone = loader.ReadUInt16(); ushort numSmoothMatrix = loader.ReadUInt16(); ushort numRigidMatrix = loader.ReadUInt16(); loader.Seek(2); Bones = loader.LoadDict <Bone>(); uint ofsBoneList = loader.ReadOffset(); // Only load dict. MatrixToBoneList = loader.LoadCustom(() => loader.ReadUInt16s((numSmoothMatrix + numRigidMatrix))); if (loader.ResFile.Version >= 0x03040000) { InverseModelMatrices = loader.LoadCustom(() => loader.ReadMatrix3x4s(numSmoothMatrix))?.ToList(); } uint userPointer = loader.ReadUInt32(); } }
// ---- METHODS ------------------------------------------------------------------------------------------------ void IResData.Load(ResFileLoader loader) { unk = loader.ReadUInt32(); uint Size = loader.ReadUInt32(); BufferOffset = loader.ReadInt64(); byte[] padding = loader.ReadBytes(16); }
void IResData.Load(ResFileLoader loader) { if (loader.IsSwitch) { Name = loader.LoadString(); uint CurveOffset = loader.ReadOffset(); uint BaseDataOffset = loader.ReadOffset(); if (loader.ResFile.VersionMajor2 == 9) { long unk1 = loader.ReadInt64(); long unk2 = loader.ReadInt64(); } _flags = loader.ReadUInt32(); BeginRotate = loader.ReadByte(); BeginTranslate = loader.ReadByte(); byte numCurve = loader.ReadByte(); BeginBaseTranslate = loader.ReadByte(); BeginCurve = loader.ReadInt32(); int padding = loader.ReadInt32(); BaseData = loader.LoadCustom(() => new BoneAnimData(loader, FlagsBase), BaseDataOffset); Curves = loader.LoadList <AnimCurve>(numCurve, CurveOffset); } else { _flags = loader.ReadUInt32(); Name = loader.LoadString(); BeginRotate = loader.ReadByte(); BeginTranslate = loader.ReadByte(); byte numCurve = loader.ReadByte(); BeginBaseTranslate = loader.ReadByte(); BeginCurve = loader.ReadByte(); loader.Seek(3); Curves = loader.LoadList <AnimCurve>(numCurve); BaseData = loader.LoadCustom(() => new BoneAnimData(loader, FlagsBase)); } }
// ---- METHODS ------------ void IResData.Load(ResFileLoader loader) { if (loader.IsSwitch) { long callbackPointer = loader.ReadInt64(); Name = loader.LoadString(); Type = loader.ReadEnum <ShaderParamType>(true); byte sizData = loader.ReadByte(); DataOffset = loader.ReadUInt16(); int offset = loader.ReadInt32(); // Uniform variable offset. DependedIndex = loader.ReadUInt16(); DependIndex = loader.ReadUInt16(); uint padding2 = loader.ReadUInt32(); // Uniform variable offset. } else { Type = loader.ReadEnum <ShaderParamType>(true); byte sizData = loader.ReadByte(); if (sizData != (byte)DataSize && sizData > DataSize) { UsePadding = true; PaddingLength = sizData - (byte)DataSize; } DataOffset = loader.ReadUInt16(); offset = loader.ReadInt32(); // Uniform variable offset. if (loader.ResFile.Version >= 0x03040000) { callbackPointer = loader.ReadUInt32(); DependedIndex = loader.ReadUInt16(); DependIndex = loader.ReadUInt16(); } else if (loader.ResFile.Version >= 0x03030000 && loader.ResFile.Version < 0x03040000) { callbackPointer = loader.ReadUInt32(); DependedIndex = loader.ReadUInt16(); DependIndex = loader.ReadUInt16(); uint FMATOffset = loader.ReadUInt32(); //Why does this have this???? } Name = loader.LoadString(); } }
void IResData.Load(ResFileLoader loader) { Strings.Clear(); if (loader.IsSwitch) { loader.Seek(-0x14, System.IO.SeekOrigin.Current); uint Signature = loader.ReadUInt32(); uint blockOffset = loader.ReadUInt32(); long BlockSize = loader.ReadInt64(); uint StringCount = loader.ReadUInt32(); for (int i = 0; i < StringCount + 1; i++) { ushort size = loader.ReadUInt16(); Strings.Add(loader.ReadString(BinaryStringFormat.ZeroTerminated)); loader.Align(2); } } }