Esempio n. 1
0
        static void LogFiles()
        {
            Console.Write("File path: ");
            string path = Console.ReadLine();

            if (!File.Exists(path))
            {
                Environment.Exit(69);
            }

            LogManager.GlobalLogFlags = LogFlags.Error | LogFlags.Info;

            PackedBigFile bigFile = new PackedBigFile(new FileInfo(path));

            bigFile.LoadFromDisk();

            List <BigFileFile> files = bigFile.RootFolder.GetAllFilesOfArchetype <CurveFileArchetype>();

            bigFile.FileLoader.LoadFiles(files);
            foreach (BigFileFile file in files)
            {
                CurveFileArchetype archetype = file.ArchetypeAs <CurveFileArchetype>();
                log.Info(file.Name);
                archetype.Log(log);
            }

            Console.ReadLine();
        }
Esempio n. 2
0
        static void TestTextures()
        {
            Console.Write("File path: ");
            string path = Console.ReadLine();

            if (!File.Exists(path))
            {
                Environment.Exit(69);
            }

            Console.Write("\nType: ");
            string            type = Console.ReadLine();
            YetiTextureFormat format;

            if (!Enum.TryParse(type, out format))
            {
                Environment.Exit(420);
            }

            LogManager.GlobalLogFlags = LogFlags.Error | LogFlags.Info;

            PackedBigFile bigFile = new PackedBigFile(new FileInfo(path));

            bigFile.LoadFromDisk();

            List <BigFileFile> textureFiles = bigFile.RootFolder.GetAllFilesOfArchetype <TextureMetadataFileArchetype>();

            bigFile.FileLoader.LoadFiles(textureFiles);
            foreach (BigFileFile file in textureFiles)
            {
                TextureMetadataFileArchetype archetype = file.ArchetypeAs <TextureMetadataFileArchetype>();
                if (archetype.Format == format)
                {
                    Console.WriteLine(file.FullFolderPath + file.Name + " " + string.Format("{0:X2} {1} {2}", archetype.Format, archetype.Width, archetype.Height));
                }
            }

            Console.ReadLine();
        }