//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(); }
internal void ReadTdw(byte[] Tdw) { int widthPointer = BitConverter.ToInt32(Tdw, 0); int dataPointer = BitConverter.ToInt32(Tdw, 4); TIM2 tim = new TIM2(Tdw, (uint)dataPointer); menuFont = new Texture2D(Memory.graphics.GraphicsDevice, tim.GetWidth, tim.GetHeight); menuFont.SetData(tim.CreateImageBuffer(tim.GetClutColors(7))); }
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 = new Texture2D(Memory.graphics.GraphicsDevice, tim.GetWidth, tim.GetHeight); menuFont.SetData(tim.CreateImageBuffer(tim.GetClutColors(ColorID.White))); }
private static void ReadTexture(uint texturePointer) { textureInterface = new TIM2(stageBuffer, texturePointer); textures = new Texture2D[textureInterface.GetClutCount]; for (int i = 0; i < textureInterface.GetClutCount; i++) { byte[] b = textureInterface.CreateImageBuffer(textureInterface.GetClutColors(i)); Texture2D tex = new Texture2D(Memory.spriteBatch.GraphicsDevice, textureInterface.GetWidth, textureInterface.GetHeight, false, SurfaceFormat.Color); tex.SetData(b); textures[i] = tex; } }