Example #1
0
        //Splash is 640x400 16BPP typical TIM with palette of ggg bbbbb a rrrrr gg
        public static void ReadSplash(bool bLogo = false)
        {
            string[] lof = aw.GetListOfFiles();
            string   filename;

            if (splashName > 0x0f)
            {
                return;
            }
            filename = !bLogo
                ? bNames
                    ? lof.First(x => x.ToLower().Contains($"{names}{splashName.ToString("D2")}"))
                    : lof.First(x => x.ToLower().Contains($"{loops}{splashLoop.ToString("D2")}"))
                : lof.First(x => x.ToLower().Contains($"ff8.lzs"));

            byte[] buffer     = ArchiveWorker.GetBinaryFile(Memory.Archives.A_MAIN, filename);
            uint   uncompSize = BitConverter.ToUInt32(buffer, 0);

            buffer = buffer.Skip(4).ToArray(); //hotfix for new LZSS
            buffer = LZSS.DecompressAllNew(buffer);

            if (splashTex != null && !splashTex.IsDisposed)
            {
                splashTex.Dispose();
            }

            splashTex = TIM2.Overture(buffer);
            //using (FileStream fs = File.Create(Path.Combine("D:\\main", Path.GetFileNameWithoutExtension(filename) + ".png")))
            //    splashTex.SaveAsPng(fs, splashTex.Width, splashTex.Height);

            GC.Collect();
            GC.WaitForPendingFinalizers();
        }
        //Splash is 640x400 16BPP typical TIM with palette of ggg bbbbb a rrrrr gg
        private void ReadSplash()
        {
            byte[] buffer     = ArchiveWorker.GetBinaryFile(Memory.Archives.A_MAIN, filename);
            uint   uncompSize = BitConverter.ToUInt32(buffer, 0);

            buffer = buffer.Skip(4).ToArray(); //hotfix for new LZSS
            buffer = LZSS.DecompressAllNew(buffer);

            tex = TIM2.Overture(buffer);
            //using (FileStream fs = File.Create(Path.Combine("D:\\main", Path.GetFileNameWithoutExtension(filename) + ".png")))
            //    splashTex.SaveAsPng(fs, splashTex.Width, splashTex.Height);

            GC.Collect();
            GC.WaitForPendingFinalizers();
        }