コード例 #1
0
        private void SelectPaletteButton_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter = "Act Files|*.act";

            if (dlg.ShowDialog(this) == DialogResult.OK)
            {
                RSDKvRS.Reader reader = new RSDKvRS.Reader(dlg.FileName);

                for (int i = 0; i < 255; i++)
                {
                    GFX.GFXpal[i].R = reader.ReadByte();
                    GFX.GFXpal[i].G = reader.ReadByte();
                    GFX.GFXpal[i].B = reader.ReadByte();
                }
                GFX.ReDrawImage();
            }
        }
コード例 #2
0
        private void BuildDataFromFoldersRS(DirectoryInfo directoryInfo)
        {
            string dir = directoryInfo.FullName.Replace(help.GetUntilOrEmpty(directoryInfo.FullName, "Data"), "");

            RSDKvRS.DataFile.DirInfo dirinfo = new RSDKvRS.DataFile.DirInfo();

            dir.Replace("\\", "/");

            dirinfo.Directory = dir + "/";

            if (directoryInfo.GetFiles().Length > 0)
            {
                DatavRS.Directories.Add(dirinfo);
                DirID++;
            }

            foreach (FileInfo file in directoryInfo.GetFiles())
            {
                RSDKvRS.DataFile.FileInfo File = new RSDKvRS.DataFile.FileInfo();

                File.DirID        = (byte)(DirID - 1);
                File.FullFileName = file.FullName.Replace(help.GetUntilOrEmpty(file.FullName, "Data"), "");

                RSDKvRS.Reader reader = new RSDKvRS.Reader(file.FullName);

                File.Filedata = reader.ReadBytes(reader.BaseStream.Length);
                File.fileSize = (ulong)reader.BaseStream.Length;

                reader.Close();

                File.FileName = Path.GetFileName(file.FullName);

                DatavRS.Files.Add(File);
            }

            foreach (DirectoryInfo subdir in directoryInfo.GetDirectories())
            {
                BuildDataFromFoldersRS(subdir);
            }
        }