Ejemplo n.º 1
0
        //Open
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog f = new OpenFileDialog();

            f.Filter = "Swarchive|*.swar";
            f.Title  = "Import the file";
            f.ShowDialog();

            if (f.FileName != "")
            {
                file = new swarFile();
                file.load(File.ReadAllBytes(f.FileName));

                file.fixOffsets();
                updateNodes();
            }
        }
Ejemplo n.º 2
0
        public SwarEditor(MainWindow parent, byte[] b, string name, int index)
        {
            InitializeComponent();

            //Load swar.
            file = new swarFile();
            file.load(b);

            //Change nodes.
            this.Text          = name;
            tree.Nodes[0].Text = name;

            //Update nodes.
            updateNodes();

            this.parent = parent;
            parentIndex = index;
        }
Ejemplo n.º 3
0
        public void FixInstrumentIndexStuffOther(ref sbnkFile.basicInstrumentStuff u, ref Dictionary <int, Dictionary <int, int> > newSwavs, ref UInt16 swavId, ref List <byte[]> files, BankData bankData)
        {
            //See if wave has been loaded.
            try
            {
                int index = newSwavs[(int)GetRealSwarFileId(u.swarNumber, bankData)][u.swavNumber];
                u.swarNumber = 0;
                u.swavNumber = (UInt16)index;
            }

            //Not loaded.
            catch
            {
                //Add to loaded things.
                Dictionary <int, int> swavThing = new Dictionary <int, int>();
                swavThing.Add(u.swavNumber, swavId);

                try
                {
                    newSwavs[(int)GetRealSwarFileId(u.swarNumber, bankData)].Add(u.swavNumber, swavId);
                }

                catch
                {
                    newSwavs.Add((int)GetRealSwarFileId(u.swarNumber, bankData), swavThing);
                }

                //Add that swav file.
                swarFile sf = new swarFile();
                sf.load(parent.sdat.files.files[(int)GetRealSwarFileId(u.swarNumber, bankData)]);
                files.Add(sf.data[0].files[u.swavNumber]);

                u.swarNumber = 0;
                u.swavNumber = swavId;
                swavId      += 1;
            }
        }