static void H2CacheExtractionMethod(object param) { var args = param as CacheFileOutputInfoArgs; using (var handler = new CacheHandler <Blam.Halo2.CacheFile>(args.Game, args.MapPath)) { handler.Read(); var cache = handler.CacheInterface; var ti = cache.TagIndexManager as Blam.Halo2.InternalCacheTagIndex; ti.ExtractionInitialize(); Assert.IsNotNull(ti.kVertexBuffers); { string test_results_tags_path = Path.Combine(args.ExtractDirectory, EngineGetTestResultsPath(args.Game), @"tags"); // extract with dependents, database and overwrite existing tag files var ex_args = new Blam.CacheExtractionArguments(test_results_tags_path, args.Output_DB, args.Recursive, args.Overrite, kExtractionDontUseTags); var cei = ti.ExtractionBegin(args.DatumIndex, ex_args); ti.Extract(cei); ti.ExtractionEnd(); } ti.ExtractionDispose(); } args.SignalFinished(); }
/// <summary>Initialize the extraction process</summary> /// <param name="tag_datum"></param> /// <param name="args"></param> /// <returns></returns> public Blam.CacheExtractionInfo ExtractionBegin(Blam.DatumIndex tag_datum, Blam.CacheExtractionArguments args) { if (tag_datum == Blam.DatumIndex.Null) { throw new ArgumentNullException("tag_datum", "Null datum index!"); } var cei = new Blam.CacheExtractionInfo(cacheFile, tag_datum, args); cacheFile.PrepareForExtraction(cei); return(cei); }
static void CacheExtractionMethod(object param) { var args = param as CacheFileOutputInfoArgs; using (var handler = new CacheHandler <Blam.Halo2.CacheFile>(args.Game, args.MapPath)) { handler.Read(); var cache = handler.CacheInterface; var ti = cache.TagIndexManager as Blam.Halo2.InternalCacheTagIndex; ti.ExtractionInitialize(); Assert.IsNotNull(ti.kVertexBuffers); { string test_results_tags_path = EngineGetTestResultsPath(args.Game) + @"tags\"; // extract with dependents, database and overwrite existing tag files var ex_args = new Blam.CacheExtractionArguments(test_results_tags_path, true, true, true, kExtractionDontUseTags); Blam.CacheIndex.Item tag_item; Assert.IsTrue(cache.TryAndFind(@"scenarios\objects\nature\trees\tree_ancient\bitmaps\detail_ancient_bark", Blam.Halo2.TagGroups.bitm, out tag_item)); // Assert.IsTrue(cache.TryAndFind(@"objects\characters\bugger\bugger", Blam.Halo2.TagGroups.hlmt, out tag_item)); // Assert.IsTrue(cache.TryAndFind(@"objects\characters\bugger\bugger", Blam.Halo2.TagGroups.mode, out tag_item)); // Assert.IsTrue(cache.TryAndFind(@"objects\characters\bugger\bugger", Blam.Halo2.TagGroups.jmad, out tag_item)); // Assert.IsTrue(cache.TryAndFind(@"objects\characters\bugger\bugger", Blam.Halo2.TagGroups.phmo, out tag_item)); //Assert.IsTrue(cache.TryAndFind(@"scenarios\solo\07a_highcharity\07a_highcharity_high_0_lightmap", Blam.Halo2.TagGroups.ltmp, out tag_item)); //Assert.IsTrue(cache.TryAndFind(@"scenarios\multi\example\example_example_lightmap", Blam.Halo2.TagGroups.ltmp, out tag_item)); //Assert.IsTrue(cache.TryAndFind(@"scenarios\objects\covenant\military\scarab\scarab", Blam.Halo2.TagGroups.mode, out tag_item)); //Assert.IsTrue(cache.TryAndFind(@"scenarios\solo\03b_newmombasa\earthcity_4", Blam.Halo2.TagGroups.sbsp, out tag_item)); //Assert.IsTrue(cache.TryAndFind(@"ui\hud\hud_messages", Blam.Halo2.TagGroups.unic, out tag_item));// { var cei = ti.ExtractionBegin(tag_item.Datum, ex_args); Assert.IsTrue(ti.Extract(cei)); ti.ExtractionEnd(); } } ti.ExtractionDispose(); } args.SignalFinished(); }
static void CacheExtractionMethod(object param) { var args = param as CacheFileOutputInfoArgs; using (var handler = new CacheHandler<Blam.Halo2.CacheFile>(args.Game, args.MapPath)) { handler.Read(); var cache = handler.CacheInterface; var ti = cache.TagIndexManager as Blam.Halo2.InternalCacheTagIndex; ti.ExtractionInitialize(); Assert.IsNotNull(ti.kVertexBuffers); { string test_results_tags_path = EngineGetTestResultsPath(args.Game) + @"tags\"; // extract with dependents, database and overwrite existing tag files var ex_args = new Blam.CacheExtractionArguments(test_results_tags_path, true, true, true, kExtractionDontUseTags); Blam.CacheIndex.Item tag_item; //Assert.IsTrue(cache.TryAndFind(@"objects\characters\masterchief\masterchief", Blam.Halo2.TagGroups.hlmt, out tag_item)); //Assert.IsTrue(cache.TryAndFind(@"scenarios\solo\07a_highcharity\07a_highcharity_high_0_lightmap", Blam.Halo2.TagGroups.ltmp, out tag_item)); //Assert.IsTrue(cache.TryAndFind(@"scenarios\multi\example\example_example_lightmap", Blam.Halo2.TagGroups.ltmp, out tag_item)); //Assert.IsTrue(cache.TryAndFind(@"scenarios\objects\covenant\military\scarab\scarab", Blam.Halo2.TagGroups.mode, out tag_item)); Assert.IsTrue(cache.TryAndFind(@"scenarios\solo\03b_newmombasa\earthcity_4", Blam.Halo2.TagGroups.sbsp, out tag_item)); //Assert.IsTrue(cache.TryAndFind(@"ui\hud\hud_messages", Blam.Halo2.TagGroups.unic, out tag_item)); { var cei = ti.ExtractionBegin(tag_item.Datum, ex_args); Assert.IsTrue(ti.Extract(cei)); ti.ExtractionEnd(); } } ti.ExtractionDispose(); } args.SignalFinished(); }