Ejemplo n.º 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();
        }
Ejemplo n.º 2
0
        public void ReadTdw(byte[] Tdw)
        {
            uint widthPointer = BitConverter.ToUInt32(Tdw, 0);
            uint dataPointer  = BitConverter.ToUInt32(Tdw, 4);

            getWidths(Tdw, widthPointer, dataPointer - widthPointer);
            TIM2 tim = new TIM2(Tdw, dataPointer);

            menuFont = tim.GetTexture((ushort)ColorID.White);
        }
Ejemplo n.º 3
0
        private void ReadTIM(int id, BinaryReader br, out TextureHandler[] tex)
        {
            var temp = new TIM2(br, EXE_Offsets.TIM[id]);

            tex = new TextureHandler[temp.GetClutCount];
            for (ushort i = 0; i < temp.GetClutCount; i++)
            {
                tex[i] = TextureHandler.Create($"ff8exe{id.ToString("D2")}", temp, i);
            }
        }
Ejemplo n.º 4
0
 public Card_Game()
 {
     using (BinaryReader br = new BinaryReader(File.OpenRead(EXE_Offsets.FileName)))
     {
         TIM2 SymbolsNumbers = new TIM2(br, EXE_Offsets.TIM[0]);
         TIM2 CardFaces      = new TIM2(br, EXE_Offsets.TIM[2]);
         TIM2 CardGameBG     = new TIM2(br, EXE_Offsets.TIM[50]);
         TIM2 CardOtherBG    = new TIM2(br, EXE_Offsets.TIM[51]);
     }
 }
Ejemplo n.º 5
0
        //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();
        }
Ejemplo n.º 6
0
 public texl(byte[] texlBuffer)
 {
     textures = new TextureHandler[20][];
     using (var br = new BinaryReader(new MemoryStream(texlBuffer)))
         for (var i = 0; i < TEX_COUNT; i++)
         {
             var timOffset = i * TEX_SIZE;
             var tim       = new TIM2(texlBuffer, (uint)timOffset);
             textures[i] = new TextureHandler[tim.GetClutCount];
             for (ushort k = 0; k < textures[i].Length; k++)
             {
                 textures[i][k] = TextureHandler.Create($"texl_tim{(i + 1).ToString("D2")}.tim", tim, k, null);
             }
             //todo detect if mods aren't using palettes.
         }
 }