public override bool Load(BinaryReader reader) { Start(reader); if (!ReadHeader(reader) || !IsValidVersion(1)) { return(false); } Geometry = new GPCEChunk(); if (!Geometry.Load(reader)) { return(false); } UInt32 count = reader.ReadUInt32(); for (UInt32 i = 0; i < count; i++) { string boneName = reader.ReadCString(); LogInfo("bone: " + boneName); } End(reader); return(true); }
private void btnTestPARM_Click(object sender, EventArgs e) { List <string> files = new List <string>(); DateTime start = DateTime.Now; foreach (PackedFile file in trData.Filesystem.Values) { if (file.GetFileType() == TRFileType.GEO) { using (MemoryStream memory = new MemoryStream(file.GetContents())) { ChunkFile chunkie = new ChunkFile(); if (chunkie.Load(memory) && chunkie.Chunks.Count > 0) { GBODChunk gbod = chunkie.Chunks[0] as GBODChunk; foreach (var child in gbod.Children) { GPCEChunk piece = null; if (child is GSKNChunk) { piece = (child as GSKNChunk).Geometry; } if (child is GPCEChunk) { piece = child as GPCEChunk; } if (piece != null) { if (piece.Effect.parms.Where(p => p.Key == "DiffuseTexture").Count() == 0) { files.Add(file.Filename); } } } } } } } DateTime end = DateTime.Now; Console.WriteLine("Operation took {0}", (end - start).ToString()); files.ForEach(v => Console.WriteLine("ndf: {0}", v)); MessageBox.Show("FINISHED"); }