Example #1
0
        /* Prepare archive. */
        static bool CheckArchive(string path)
        {
            bool result;

            if (!File.Exists(path))
            {
                Console.WriteLine($"An archive was not found at path: {path}\nAn archive will be generated for you.");
                result = false;
            }
            else
            {
                try
                {
                    ArchiveHeader = ChaArchive.GetFromArchive(path, 0, 0x40);
                    SpriteHeader  = ChaArchive.GetFromArchive(path, 0x40, 0x10);
                    Console.WriteLine("Archive passed.");
                    result = true;
                }
                catch
                {
                    Console.WriteLine("Could not grab header from archive. Check that the file is a valid Eversion graphics archive and is not corrupt.");
                    Console.WriteLine("An archive will be generated for you.");
                    result = false;
                }
            }

            return(result);
        }