Ejemplo n.º 1
0
        //public static Wave * get_Wave1(){return w1;};//public static Wave * get_Wave2(){return w2;};//public static Wave * get_Wave3(){return w3;};//public static Wave * get_Wave4(){return w4;};
        public static WaveSequence get_Sequence(sbyte sn)
        {
            WaveSequence s;

            switch (sn)
            {
            case 1:
                s = new WaveSequence(20);
                break;

            case 2:
                s = new WaveSequence(30);
                break;

            default:
                sn = 1;
                s  = new WaveSequence(20);
                break;
            }
            InitializeWaves(sn);
            for (int i = 0; i < ws.Length; i++)
            {
                s.AddWave(ws[i]);
            }
            return(s);
        }
Ejemplo n.º 2
0
    private SpaceRoaches InitializeWaveManager()
    {
        _waveSequence = new WaveSequence();
        GameObject waveManager = SRResources.Core.Base.WaveManager.Instantiate();

        waveManager.name = "WaveManager";
        waveManager.transform.SetParent(this.gameObject.transform, false);
        _waveManager = waveManager.GetComponent <WaveManager>();
        _waveManager.InitializeWaveManager();
        return(this);
    }
Ejemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        private void ReadWbk1Chunk()
        {
            int chunkSize = Util.GetInt(CurrentPcgMemory.Content, Index + 4, 4);

            CurrentPcgMemory.Chunks.Collection.Add(new Chunk("WBK1", Index, chunkSize));

            int startIndex = Index;

            Index += 12; // LV? Wbk1NumberOfWaveSequencesOffset; override for various synths?
            int numberOfWaveSeqsInBank = Util.GetInt(CurrentPcgMemory.Content, Index, 4);

            Index += 4;
            int sizeOfAWaveSeq = Util.GetInt(CurrentPcgMemory.Content, Index, 4);

            // ReSharper disable RedundantStringFormatCall
            Console.WriteLine($" Size of a waveseq: {sizeOfAWaveSeq}");
            // ReSharper restore RedundantStringFormatCall
            Index += 4;
            int bankId    = Util.GetInt(CurrentPcgMemory.Content, Index, 4);
            int bankIndex = WaveSequenceBankId2WaveSequenceIndex(bankId);

            Index += 4;

            WaveSequenceBank waveSeqBank = (WaveSequenceBank)CurrentPcgMemory.WaveSequenceBanks[bankIndex];

            waveSeqBank.ByteOffset = startIndex;
            waveSeqBank.PatchSize  = sizeOfAWaveSeq;
            waveSeqBank.IsWritable = true;
            waveSeqBank.IsLoaded   = true;

            for (int index = 0; index < numberOfWaveSeqsInBank; index++)
            {
                // Place in PcgMemory.
                WaveSequence waveSeq = (WaveSequence)waveSeqBank[index];
                waveSeq.ByteOffset = Index;
                waveSeq.ByteLength = sizeOfAWaveSeq;
                waveSeq.IsLoaded   = true;

                Index += sizeOfAWaveSeq;
            }
        }
Ejemplo n.º 4
0
 private void OpenWaves_Click(System.Object sender, System.EventArgs e)
 {
     if (LoadWaves.ShowDialog() == DialogResult.OK)
     {
         waves = new WaveSequence();
         try
         {
             seq = WaveSequence.get_FileSequenceCount(LoadWaves.FileName, map);
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
             seq = 0;
         }
         WaveHeader.Text = String.Concat("Waves: ", seq.ToString());
         if (seq > 0)
         {
             this.WaveFile = LoadWaves.FileName;
         }
     }
 }
Ejemplo n.º 5
0
 public void SetWaveSequenceOwner(WaveSequence a_waveOwner)
 {
     m_waveOwner = a_waveOwner;
 }