Ejemplo n.º 1
0
        public void BulkExtractEverything()
        {
            //var fs = new InlinePackageFile(@"F:\Steam\SteamApps\common\Team Fortress 2\tf\tf2_textures_dir.vpk");
            var fs    = new InlinePackageFile(@"F:\Steam\SteamApps\common\dota 2 beta\dota\pak01_dir.vpk");
            var files = fs.GetFiles("\\.vtf$", true).OrderBy(x => x.Name).Take(20000).GroupBy(x => x.Name).Select(x => x.First()).ToList();

            //return;

            /*foreach (var f in files)
             * {
             *  var vtf = VtfProvider.GetImage(f);
             *  //Console.WriteLine(f.Name + " " + vtf.Height);
             *  //vtf.Save(@"D:\Github\Chisel\_Resources\VTF\extract\" + f.Name + ".png");
             *  //if (i > 1) break;
             * }*/
            Parallel.ForEach(files, x =>
            {
                try
                {
                    var vtf = VtfProvider.GetImage(x);
                    //Console.WriteLine(x.Name);
                    //vtf.Save(@"D:\Github\Chisel\_Resources\VTF\extract\" + x.Name + ".png");
                }
                catch (Exception ex)
                {
                    throw new Exception(x.Name + " " + ex.Message);
                }
            });
        }
Ejemplo n.º 2
0
 public void BulkExtractEverything()
 {
     //var fs = new InlinePackageFile(@"F:\Steam\SteamApps\common\Team Fortress 2\tf\tf2_textures_dir.vpk");
     var fs = new InlinePackageFile(@"F:\Steam\SteamApps\common\dota 2 beta\dota\pak01_dir.vpk");
     var files = fs.GetFiles("\\.vtf$", true).OrderBy(x => x.Name).Take(20000).GroupBy(x => x.Name).Select(x => x.First()).ToList();
     //return;
     /*foreach (var f in files)
     {
         var vtf = VtfProvider.GetImage(f);
         //Console.WriteLine(f.Name + " " + vtf.Height);
         //vtf.Save(@"D:\Github\sledge\_Resources\VTF\extract\" + f.Name + ".png");
         //if (i > 1) break;
     }*/
     Parallel.ForEach(files, x =>
     {
         try
         {
             var vtf = VtfProvider.GetImage(x);
             //Console.WriteLine(x.Name);
             //vtf.Save(@"D:\Github\sledge\_Resources\VTF\extract\" + x.Name + ".png");
         }
         catch (Exception ex)
         {
             throw new Exception(x.Name + " " + ex.Message);
         }
     });
 }