Ejemplo n.º 1
0
        //Splash is 640x400 16BPP typical TIM with palette of ggg bbbbb a rrrrr gg
        private void ReadSplash()
        {
            if (string.IsNullOrWhiteSpace(filename))
            {
                return;
            }
            string fn = Path.GetFileNameWithoutExtension(filename);
            //Debug.Assert(!fn.Equals("ff8", StringComparison.OrdinalIgnoreCase));
            ArchiveBase aw = ArchiveWorker.Load(Memory.Archives.A_MAIN);

            byte[] buffer = aw.GetBinaryFile(filename);

            TIM_OVERTURE tim = new TIM_OVERTURE(buffer);

            if ((fn.Equals("ff8", StringComparison.OrdinalIgnoreCase)) || (fn.IndexOf("loop", StringComparison.OrdinalIgnoreCase) >= 0))
            {
                tim.IgnoreAlpha = true;
            }

            tex = TextureHandler.Create(fn, tim, 0);//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
        //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);
            string fn         = Path.GetFileNameWithoutExtension(filename);
            uint   uncompSize = BitConverter.ToUInt32(buffer, 0);

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

            if ((fn.Equals("ff8", StringComparison.OrdinalIgnoreCase)) || (fn.IndexOf("loop", StringComparison.OrdinalIgnoreCase) >= 0))
            {
                tim.IgnoreAlpha = true;
            }

            tex = (Texture2D)TextureHandler.Create(fn, tim, 0);//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();
        }