Beispiel #1
0
 void SaveBntx()
 {
     if (bntx == null)
     {
         return;
     }
     sarc.Files[@"timg/__Combined.bntx"] = bntx.Write();
     bntx = null;
 }
Beispiel #2
0
        public static BflytFile.PatchResult PatchBntx(SARCExt.SarcData sarc, DDSEncoder.DDSLoadResult DDS, PatchTemplate targetPatch)
        {
            QuickBntx q = new QuickBntx(new BinaryDataReader(new MemoryStream(sarc.Files[@"timg/__Combined.bntx"])));

            if (q.Rlt.Length != 0x80)
            {
                return(BflytFile.PatchResult.Fail);
            }
            q.ReplaceTex(targetPatch.MaintextureName, DDS);
            DDS = null;
            sarc.Files[@"timg/__Combined.bntx"] = null;
            sarc.Files[@"timg/__Combined.bntx"] = q.Write();
            return(BflytFile.PatchResult.OK);
        }
Beispiel #3
0
        public static BflytFile.PatchResult PatchBntxTexture(SARCExt.SarcData sarc, byte[] DDS, string texName, uint TexFlag = 0xFFFFFFFF)
        {
            QuickBntx q = new QuickBntx(new BinaryDataReader(new MemoryStream(sarc.Files[@"timg/__Combined.bntx"])));

            if (q.Rlt.Length != 0x80)
            {
                return(BflytFile.PatchResult.Fail);
            }
            q.ReplaceTex(texName, DDS);
            if (TexFlag != 0xFFFFFFFF)
            {
                q.Textures.Where(x => x.Name == texName).First().ChannelTypes = (int)TexFlag;
            }
            sarc.Files[@"timg/__Combined.bntx"] = null;
            sarc.Files[@"timg/__Combined.bntx"] = q.Write();
            return(BflytFile.PatchResult.OK);
        }