internal static void TestSndComparer(TestContext tc, BlamVersion game, string dir, string[] map_names)
        {
            int map_count = map_names.Length;
            List <MapSndComparer> maps = new List <MapSndComparer>(map_count);

            var thread_code = new System.Threading.WaitCallback(delegate(object param)
            {
                var args = param as CacheFileOutputInfoArgs;

                MapSndComparer cmp = SndComparerMethod(args);
                lock (maps)
                    maps.Add(cmp);

                args.SignalFinished();
            });

            CacheFileOutputInfoArgs.TestThreadedMethod(tc, thread_code,
                                                       game, dir, map_names);

            SndComparer snd_cmp = new SndComparer(map_count);

            snd_cmp.PreProcess(maps, map_count);
            snd_cmp.ScanForDiffs();
            snd_cmp.OutputDiffs(BuildResultPath(kTestResultsPath, game, null, "sound_cmp_results", "txt"));
        }
        static MapSndComparer SndComparerMethod(CacheFileOutputInfoArgs args)
        {
            string dir = Path.GetDirectoryName(args.MapPath);

            MapSndComparer cmp;

            using (var handler = new CacheHandler <Blam.Halo3.CacheFileBase>(args.Game, args.MapPath))
            {
                handler.Read();
                var cache = handler.CacheInterface;

                cmp = new MapSndComparer(args.MapPath, cache.IndexHalo3.TagCount);
                foreach (var tag in cache.IndexHalo3)
                {
                    if (tag.GroupTag != Blam.Halo3.TagGroups.snd_)
                    {
                        continue;
                    }

                    var snd_index = cache.TagIndexManager.Open(tag.Datum);
                    var snd_man   = cache.TagIndexManager[snd_index];

                    cmp.Add(cache.References[snd_man.ReferenceName], snd_man.TagDefinition as Blam.Halo3.Tags.cache_file_sound_group);
                    cache.TagIndexManager.Unload(snd_index);
                }
            }

            return(cmp);
        }
Exemple #3
0
		static MapSndComparer SndComparerMethod(CacheFileOutputInfoArgs args)
		{
			string dir = Path.GetDirectoryName(args.MapPath);

			MapSndComparer cmp;
			using (var handler = new CacheHandler<Blam.Halo3.CacheFileBase>(args.Game, args.MapPath))
			{
				handler.Read();
				var cache = handler.CacheInterface;

				cmp = new MapSndComparer(args.MapPath, cache.IndexHalo3.TagCount);
				foreach (var tag in cache.IndexHalo3)
				{
					if (tag.GroupTag != Blam.Halo3.TagGroups.snd_) continue;

					var snd_index = cache.TagIndexManager.Open(tag.Datum);
					var snd_man = cache.TagIndexManager[snd_index];

					cmp.Add(cache.References[snd_man.ReferenceName], snd_man.TagDefinition as Blam.Halo3.Tags.cache_file_sound_group);
					cache.TagIndexManager.Unload(snd_index);
				}

			}

			return cmp;
		}