public void Halo1TestCOLLADAScenarioExport() { var settings = new TestColladaSettings( true, Path.Combine(kTestInstallationRootPath, kTestDataDir), AssetFormat.bmp); using (var handler = new TagIndexHandler <Managers.TagIndex>(BlamVersion.Halo1_CE, kTestInstallationRootPath, kTestDataDir)) { var tagindex = handler.IndexInterface; foreach (var scenario_def in ScenarioTestDefinitions) { StartStopwatch(); { scenario_def.Open(tagindex); Console.WriteLine(scenario_def.TypeString + " LOAD: Time taken: {0}", m_testStopwatch.Elapsed); } Console.WriteLine("TAG INDEX: Time taken: {0}", StopStopwatch()); var tagManager = tagindex[scenario_def.TagIndex]; var scenarioData = new BlamLib.Render.COLLADA.Halo1.ScenarioData(); scenarioData.CollectData(tagindex, tagManager); var exporter = new BlamLib.Render.COLLADA.Halo1.ColladaScenarioExporter(settings, tagindex, tagManager); exporter.MessageSent += (object sender, BlamLib.Messaging.MessageArgs args) => { Console.WriteLine("COLLADA_ERROR: {0}", args.Message); }; exporter.AddDataProvider(scenarioData); StartStopwatch(); Assert.IsTrue(exporter.BuildColladaInstance(), "Failed to build collada instance for {0}", scenario_def.Name); exporter.SaveDAE(Path.Combine(kTestResultsDataPath, tagManager.Name) + "-objects.dae"); Console.WriteLine("EXPORT {0} TIME: Time taken: {1}", scenario_def.Name, StopStopwatch()); scenario_def.Close(tagindex); } } }
public void Halo1TestCOLLADAScenarioExport() { var settings = new TestColladaSettings( true, Path.Combine(kTestInstallationRootPath, kTestDataDir), AssetFormat.bmp); using (var handler = new TagIndexHandler<Managers.TagIndex>(BlamVersion.Halo1_CE, kTestInstallationRootPath, kTestDataDir)) { var tagindex = handler.IndexInterface; foreach (var scenario_def in ScenarioTestDefinitions) { StartStopwatch(); { scenario_def.Open(tagindex); Console.WriteLine(scenario_def.TypeString + " LOAD: Time taken: {0}", m_testStopwatch.Elapsed); } Console.WriteLine("TAG INDEX: Time taken: {0}", StopStopwatch()); var tagManager = tagindex[scenario_def.TagIndex]; var scenarioData = new BlamLib.Render.COLLADA.Halo1.ScenarioData(); scenarioData.CollectData(tagindex, tagManager); var exporter = new BlamLib.Render.COLLADA.Halo1.ColladaScenarioExporter(settings, tagindex, tagManager); exporter.MessageSent += (object sender, BlamLib.Messaging.MessageArgs args) => { Console.WriteLine("COLLADA_ERROR: {0}", args.Message); }; exporter.AddDataProvider(scenarioData); StartStopwatch(); Assert.IsTrue(exporter.BuildColladaInstance(), "Failed to build collada instance for {0}", scenario_def.Name); exporter.SaveDAE(Path.Combine(kTestResultsDataPath, tagManager.Name) + "-objects.dae"); Console.WriteLine("EXPORT {0} TIME: Time taken: {1}", scenario_def.Name, StopStopwatch()); scenario_def.Close(tagindex); } } }