コード例 #1
0
ファイル: Form1.cs プロジェクト: marcussacana/CatSceneEditor
        private void PackDir(string Dir)
        {
            if (!Dir.EndsWith("\\"))
            {
                Dir += '\\';
            }
            string OutPath = Dir.TrimEnd('\\', ' ', '~') + ".int";

            string[]    Files   = Directory.GetFiles(Dir, "*.*");
            FileEntry[] Entries = new FileEntry[Files.Length];
            for (uint i = 0; i < Files.Length; i++)
            {
                string FN = Path.GetFileName(Files[i]);
                Entries[i] = new FileEntry()
                {
                    FileName = FN,
                    Content  = new StreamReader(Files[i]).BaseStream
                };
            }

            Stream Output = new StreamWriter(OutPath).BaseStream;

            Int.Repack(Output, Entries, true);
        }