Exemplo n.º 1
0
        private void button8_Click(object sender, EventArgs e)
        {
            MessageBox.Show("Segment 4 Uncompressed");
            OpenFileDialog fileOpen = new OpenFileDialog();

            if (fileOpen.ShowDialog() == DialogResult.OK)
            {
                byte[] segment4 = File.ReadAllBytes(fileOpen.FileName);

                MessageBox.Show("Segment 7 Uncompressed");

                if (fileOpen.ShowDialog() == DialogResult.OK)
                {
                    byte[] segment7 = File.ReadAllBytes(fileOpen.FileName);

                    MessageBox.Show("File Save");
                    SaveFileDialog fileSave = new SaveFileDialog();

                    if (fileSave.ShowDialog() == DialogResult.OK)
                    {
                        Aspose.ThreeD.Scene exportData = tarmac64.dumpface2(segment4, segment7);
                        exportData.Save(fileSave.FileName, FileFormat.WavefrontOBJ);
                    }
                }
            }
        }
Exemplo n.º 2
0
        private void button10_Click(object sender, EventArgs e)
        {
            if (fileOpen.ShowDialog() == DialogResult.OK)
            {
                string[]    fileData = File.ReadAllLines(fileOpen.FileName);
                List <byte> segment4 = new List <byte>();
                List <byte> segment7 = new List <byte>();

                for (int currentLine = 4; currentLine < 2222; currentLine++)
                {
                    fileData[currentLine] = fileData[currentLine].Replace("0x", "");
                    string[] byteString = fileData[currentLine].Split(',');

                    foreach (string thisLine in byteString)
                    {
                        if (thisLine != "")
                        {
                            segment4.Add(byte.Parse(thisLine, System.Globalization.NumberStyles.HexNumber));
                        }
                    }
                }

                for (int currentLine = 2238; currentLine < 3202; currentLine++)
                {
                    fileData[currentLine] = fileData[currentLine].Replace("0x", "");
                    string[] byteString = fileData[currentLine].Split(',');

                    foreach (string thisLine in byteString)
                    {
                        if (thisLine != "")
                        {
                            segment7.Add(byte.Parse(thisLine, System.Globalization.NumberStyles.HexNumber));
                        }
                    }
                }

                byte[] seg4 = tarmac64.decompressMIO0(segment4.ToArray());
                byte[] seg7 = tarmacLibrary.decompress_seg7(segment7.ToArray());

                MessageBox.Show("File Save");
                SaveFileDialog fileSave = new SaveFileDialog();

                if (fileSave.ShowDialog() == DialogResult.OK)
                {
                    Aspose.ThreeD.Scene exportData = tarmac64.dumpface2(seg4, seg7);
                    exportData.Save(fileSave.FileName, FileFormat.WavefrontOBJ);
                }
            }
        }