// ---- METHODS ------------------------------------------------------------------------------------------------ void IResData.Load(ResFileLoader loader) { TexSampler = new TexSampler(loader.ReadUInt32s(3)); uint handle = loader.ReadUInt32(); Name = loader.LoadString(); byte idx = loader.ReadByte(); loader.Seek(3); }
// ---- METHODS ------------------------------------------------------------------------------------------------ void IResData.Load(ResFileLoader loader) { loader.CheckSignature(_signature); Dim = loader.ReadEnum <GX2SurfaceDim>(true); Width = loader.ReadUInt32(); Height = loader.ReadUInt32(); Depth = loader.ReadUInt32(); MipCount = loader.ReadUInt32(); Format = loader.ReadEnum <GX2SurfaceFormat>(true); AAMode = loader.ReadEnum <GX2AAMode>(true); Use = loader.ReadEnum <GX2SurfaceUse>(true); uint sizData = loader.ReadUInt32(); uint imagePointer = loader.ReadUInt32(); uint sizMipData = loader.ReadUInt32(); uint mipPointer = loader.ReadUInt32(); TileMode = loader.ReadEnum <GX2TileMode>(true); Swizzle = loader.ReadUInt32(); Alignment = loader.ReadUInt32(); Pitch = loader.ReadUInt32(); MipOffsets = loader.ReadUInt32s(13); ViewMipFirst = loader.ReadUInt32(); ViewMipCount = loader.ReadUInt32(); ViewSliceFirst = loader.ReadUInt32(); ViewSliceCount = loader.ReadUInt32(); CompSelR = loader.ReadEnum <GX2CompSel>(true); CompSelG = loader.ReadEnum <GX2CompSel>(true); CompSelB = loader.ReadEnum <GX2CompSel>(true); CompSelA = loader.ReadEnum <GX2CompSel>(true); Regs = loader.ReadUInt32s(5); uint handle = loader.ReadUInt32(); ArrayLength = loader.ReadUInt32(); // Possibly just a byte. Name = loader.LoadString(); Path = loader.LoadString(); Data = loader.LoadCustom(() => loader.ReadBytes((int)sizData)); MipData = loader.LoadCustom(() => loader.ReadBytes((int)sizMipData)); UserData = loader.LoadDict <UserData>(); ushort numUserData = loader.ReadUInt16(); loader.Seek(2); }
void IResData.Load(ResFileLoader loader) { if (loader.IsSwitch) { sampler = new SamplerSwitch(); ((IResData)sampler).Load(loader); TexSampler = sampler.ToTexSampler(); } else { TexSampler = new TexSampler(loader.ReadUInt32s(3)); uint handle = loader.ReadUInt32(); Name = loader.LoadString(); byte idx = loader.ReadByte(); loader.Seek(3); } }
// ---- METHODS ------------------------------------------------------------------------------------------------ void IResData.Load(ResFileLoader loader) { loader.CheckSignature(_signature); Dim = loader.ReadEnum <GX2SurfaceDim>(true); Width = loader.ReadUInt32(); Height = loader.ReadUInt32(); Depth = loader.ReadUInt32(); MipCount = loader.ReadUInt32(); Format = loader.ReadEnum <GX2SurfaceFormat>(true); AAMode = loader.ReadEnum <GX2AAMode>(true); Use = loader.ReadEnum <GX2SurfaceUse>(true); uint sizData = loader.ReadUInt32(); uint imagePointer = loader.ReadUInt32(); uint sizMipData = loader.ReadUInt32(); uint mipPointer = loader.ReadUInt32(); TileMode = loader.ReadEnum <GX2TileMode>(true); Swizzle = loader.ReadUInt32(); Alignment = loader.ReadUInt32(); Pitch = loader.ReadUInt32(); MipOffsets = loader.ReadUInt32s(13); ViewMipFirst = loader.ReadUInt32(); ViewMipCount = loader.ReadUInt32(); ViewSliceFirst = loader.ReadUInt32(); ViewSliceCount = loader.ReadUInt32(); CompSelR = loader.ReadEnum <GX2CompSel>(true); CompSelG = loader.ReadEnum <GX2CompSel>(true); CompSelB = loader.ReadEnum <GX2CompSel>(true); CompSelA = loader.ReadEnum <GX2CompSel>(true); Regs = loader.ReadUInt32s(5); uint handle = loader.ReadUInt32(); ArrayLength = loader.ReadByte(); // Possibly just a byte. loader.Seek(3, System.IO.SeekOrigin.Current); Name = loader.LoadString(); Path = loader.LoadString(); // Load texture data. bool?isMainTextureFile = loader.ResFile.Name.Contains(".Tex1") ? new bool?(true) : loader.ResFile.Name.Contains(".Tex2") ? new bool?(false) : null; switch (isMainTextureFile) { case true: Data = loader.LoadCustom(() => loader.ReadBytes((int)sizData)); loader.ReadOffset(); // MipData not used. break; case false: MipData = loader.LoadCustom(() => loader.ReadBytes((int)sizMipData)); loader.ReadOffset(); // Data not used. break; default: Data = loader.LoadCustom(() => loader.ReadBytes((int)sizData)); MipData = loader.LoadCustom(() => loader.ReadBytes((int)sizMipData)); break; } UserData = loader.LoadDict <UserData>(); ushort numUserData = loader.ReadUInt16(); loader.Seek(2); }