示例#1
0
        public bool DumpTexture(Scene?scene, ArcTextureLoadedEventArgs e)
        {
            if (!_config.IsDumpingTexture)
            {
                return(false);
            }

            if (scene == null)
            {
                return(false);
            }

            var key = $"Texture:{e.Name}";

            if (TextureDumpCache.Contains($"Texture:{e.Name}"))
            {
                return(false);
            }

            if (e.Name.StartsWith("!"))
            {
                return(false);
            }

            var texture = e.Data.CreateTexture2D();

            DumpTexture2D(texture, Path.Combine(TextureDumpDir, e.Name + ".png"));
            if (!_config.ForceDumping)
            {
                TextureDumpCache.Add(key);
            }
            return(true);
        }
示例#2
0
 private void OnArcTextureLoaded(object sender, ArcTextureLoadedEventArgs e)
 {
     try
     {
         if (Dumper.DumpTexture(CurrentScene, e))
         {
             Logger.Log(LogLevel.Debug, $"Texture '{e.Name}' dumped.");
         }
     }
     catch (Exception ex)
     {
         Logger.Log(LogLevel.Error, ex);
     }
 }