Ejemplo n.º 1
0
 public Wem(string aName, ulong aID, byte[] aBinary)
 {
     Name         = aName;
     ID           = aID;
     File         = aBinary;
     LanguageEnum = 0;
     AssignedHirc = new WemHirc();
 }
Ejemplo n.º 2
0
 public Wem(string aName, ulong aID, byte[] aBinary, uint lanEnum, uint FileOffset)
 {
     Name         = aName;
     ID           = aID;
     File         = aBinary;
     LanguageEnum = lanEnum;
     Offset       = FileOffset;
     AssignedHirc = new WemHirc();
 }
Ejemplo n.º 3
0
        public Wem(string aName, string aID, BinaryReader aFile, uint newOffset)
        {
            Name = Path.GetFileName(aName);

            ulong TempID = 0;

            if (UInt64.TryParse(Path.GetFileName(aID.Replace(".wem", "")), out TempID))
            {
                ID = TempID;
            }
            else
            {
                ID = 0;
            }

            File         = aFile.ReadBytes((int)aFile.BaseStream.Length);
            LanguageEnum = 0;
            Offset       = newOffset;
            AssignedHirc = new WemHirc();
            aFile.Close();
        }
Ejemplo n.º 4
0
 private void CheckHirc(WemHirc AssignedHirc, int Key)
 {
     if (Settings.ContainsKey(Key))
     {
         AssignedHirc.Settings.AddRange(Settings[Key]);
     }
     else if (Event.ContainsKey(Key))
     {
         AssignedHirc.Event.AddRange(Event[Key]);
     }
     else if (RandomContainer.ContainsKey(Key))
     {
         AssignedHirc.RandomContainer.AddRange(RandomContainer[Key]);
     }
     else if (SwitchContainer.ContainsKey(Key))
     {
         AssignedHirc.SwitchContainer.AddRange(SwitchContainer[Key]);
     }
     else if (ActorMixer.ContainsKey(Key))
     {
         AssignedHirc.ActorMixer.AddRange(ActorMixer[Key]);
     }
     else if (AudioBus.ContainsKey(Key))
     {
         AssignedHirc.AudioBus.AddRange(AudioBus[Key]);
     }
     else if (BlendContainer.ContainsKey(Key))
     {
         AssignedHirc.BlendContainer.AddRange(BlendContainer[Key]);
     }
     else if (MusicSequence.ContainsKey(Key))
     {
         AssignedHirc.MusicSequence.AddRange(MusicSequence[Key]);
     }
     else if (MusicSwitchContainer.ContainsKey(Key))
     {
         AssignedHirc.MusicSwitchContainer.AddRange(MusicSwitchContainer[Key]);
     }
     else if (Attenuation.ContainsKey(Key))
     {
         AssignedHirc.Attenuation.AddRange(Attenuation[Key]);
     }
     else if (FeedbackNode.ContainsKey(Key))
     {
         AssignedHirc.FeedbackNode.AddRange(FeedbackNode[Key]);
     }
     else if (FxShareSet.ContainsKey(Key))
     {
         AssignedHirc.FxShareSet.AddRange(FxShareSet[Key]);
     }
     else if (FxCustom.ContainsKey(Key))
     {
         AssignedHirc.FxCustom.AddRange(FxCustom[Key]);
     }
     else if (AuxiliaryBus.ContainsKey(Key))
     {
         AssignedHirc.AuxiliaryBus.AddRange(AuxiliaryBus[Key]);
     }
     else if (LFO.ContainsKey(Key))
     {
         AssignedHirc.LFO.AddRange(LFO[Key]);
     }
     else if (Envelope.ContainsKey(Key))
     {
         AssignedHirc.Envelope.AddRange(Envelope[Key]);
     }
 }
Ejemplo n.º 5
0
        public void AssignHirc(WemHirc AssignedHirc)
        {
            foreach (int ID in AssignedHirc.MusicTrack)
            {
                int index = ID;

                if (index < 0 || index > Data.Count)
                {
                    continue;
                }

                if (MusicSegment.ContainsKey((int)Data[index].MusicTrack.ID))
                {
                    foreach (int Type10 in MusicSegment[(int)Data[index].MusicTrack.ID])
                    {
                        AssignedHirc.MusicSegment.Add((int)Type10);
                    }
                }
            }

            List <int> CheckedIDs = new List <int>();

            foreach (int ID in AssignedHirc.MusicSegment)
            {
                int index = ID;

                if (index < 0 || index > Data.Count)
                {
                    continue;
                }

                int directParent = (int)Data[index].MusicSegment.NodeBase.DirectParentID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }

                directParent = (int)Data[index].MusicSegment.NodeBase.AttenuationID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }

                if (EventAction.ContainsKey((int)Data[index].MusicSegment.ID))
                {
                    AssignedHirc.EventAction.AddRange(EventAction[(int)Data[index].MusicSegment.ID]);
                }
            }

            CheckedIDs = new List <int>();
            foreach (int ID in AssignedHirc.MusicSequence)
            {
                int index = ID;

                if (index < 0 || index > Data.Count)
                {
                    continue;
                }

                int directParent = (int)Data[index].MusicSequence.NodeBase.DirectParentID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }

                directParent = (int)Data[index].MusicSequence.NodeBase.AttenuationID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }

                if (EventAction.ContainsKey((int)Data[index].MusicSequence.ID))
                {
                    AssignedHirc.EventAction.AddRange(EventAction[(int)Data[index].MusicSequence.ID]);
                }
            }

            CheckedIDs = new List <int>();
            for (int i = 0; i < AssignedHirc.MusicSwitchContainer.Count; i++)
            {
                int index = AssignedHirc.MusicSwitchContainer[i];

                if (index < 0 || index > Data.Count)
                {
                    continue;
                }

                int directParent = (int)Data[index].MusicSwitchContainer.NodeBase.DirectParentID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }
            }

            for (int i = 0; i < AssignedHirc.MusicSwitchContainer.Count; i++)
            {
                int index = AssignedHirc.MusicSwitchContainer[i];

                if (index < 0 || index > Data.Count)
                {
                    continue;
                }

                int directParent = (int)Data[index].MusicSwitchContainer.NodeBase.DirectParentID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }

                directParent = (int)Data[index].MusicSwitchContainer.NodeBase.AttenuationID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }

                if (EventAction.ContainsKey((int)Data[index].MusicSwitchContainer.ID))
                {
                    AssignedHirc.EventAction.AddRange(EventAction[(int)Data[index].MusicSwitchContainer.ID]);
                }
            }

            CheckedIDs = new List <int>();
            foreach (int ID in AssignedHirc.SoundSFX)
            {
                int index = ID;

                if (index < 0 || index > Data.Count)
                {
                    continue;
                }

                int directParent = (int)Data[index].SoundSFXObject.NodeBase.DirectParentID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }

                directParent = (int)Data[index].SoundSFXObject.NodeBase.AttenuationID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }

                if (EventAction.ContainsKey((int)Data[index].SoundSFXObject.ID))
                {
                    AssignedHirc.EventAction.AddRange(EventAction[(int)Data[index].SoundSFXObject.ID]);
                }
            }

            CheckedIDs = new List <int>();
            for (int i = 0; i < AssignedHirc.RandomContainer.Count; i++)
            {
                int index = AssignedHirc.RandomContainer[i];

                if (index < 0 || index > Data.Count)
                {
                    continue;
                }

                int directParent = (int)Data[index].RandomContainer.NodeBase.DirectParentID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }
            }

            for (int i = 0; i < AssignedHirc.RandomContainer.Count; i++)
            {
                int index = AssignedHirc.RandomContainer[i];

                if (index < 0 || index > Data.Count)
                {
                    continue;
                }

                int directParent = (int)Data[index].RandomContainer.NodeBase.DirectParentID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }

                directParent = (int)Data[index].RandomContainer.NodeBase.AttenuationID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }

                if (EventAction.ContainsKey((int)Data[index].RandomContainer.ID))
                {
                    AssignedHirc.EventAction.AddRange(EventAction[(int)Data[index].RandomContainer.ID]);
                }
            }

            CheckedIDs = new List <int>();
            for (int i = 0; i < AssignedHirc.BlendContainer.Count; i++)
            {
                int index = AssignedHirc.BlendContainer[i];

                if (index < 0 || index > Data.Count)
                {
                    continue;
                }

                int directParent = (int)Data[index].BlendContainer.NodeBase.DirectParentID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }
            }

            for (int i = 0; i < AssignedHirc.BlendContainer.Count; i++)
            {
                int index = AssignedHirc.BlendContainer[i];

                if (index < 0 || index > Data.Count)
                {
                    continue;
                }

                int directParent = (int)Data[index].BlendContainer.NodeBase.DirectParentID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }

                directParent = (int)Data[index].BlendContainer.NodeBase.AttenuationID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }

                if (EventAction.ContainsKey((int)Data[index].BlendContainer.ID))
                {
                    AssignedHirc.EventAction.AddRange(EventAction[(int)Data[index].BlendContainer.ID]);
                }
            }

            CheckedIDs = new List <int>();
            for (int i = 0; i < AssignedHirc.SwitchContainer.Count; i++)
            {
                int index = AssignedHirc.SwitchContainer[i];

                if (index < 0 || index > Data.Count)
                {
                    continue;
                }

                int directParent = (int)Data[index].SwitchContainer.NodeBase.DirectParentID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }
            }

            for (int i = 0; i < AssignedHirc.SwitchContainer.Count; i++)
            {
                int index = AssignedHirc.SwitchContainer[i];

                if (index < 0 || index > Data.Count)
                {
                    continue;
                }

                int directParent = (int)Data[index].SwitchContainer.NodeBase.DirectParentID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }

                directParent = (int)Data[index].SwitchContainer.NodeBase.AttenuationID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }

                if (EventAction.ContainsKey((int)Data[index].SwitchContainer.ID))
                {
                    AssignedHirc.EventAction.AddRange(EventAction[(int)Data[index].SwitchContainer.ID]);
                }
            }

            CheckedIDs = new List <int>();
            for (int i = 0; i < AssignedHirc.ActorMixer.Count; i++)
            {
                int index = AssignedHirc.ActorMixer[i];

                if (index < 0 || index > Data.Count)
                {
                    continue;
                }

                int directParent = (int)Data[index].ActorMixer.NodeBase.DirectParentID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }
            }

            for (int i = 0; i < AssignedHirc.ActorMixer.Count; i++)
            {
                int index = AssignedHirc.ActorMixer[i];

                if (index < 0 || index > Data.Count)
                {
                    continue;
                }

                int directParent = (int)Data[index].ActorMixer.NodeBase.DirectParentID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }

                directParent = (int)Data[index].ActorMixer.NodeBase.AttenuationID;
                if (!CheckedIDs.Contains(directParent))
                {
                    CheckHirc(AssignedHirc, directParent);
                    CheckedIDs.Add(directParent);
                }

                if (EventAction.ContainsKey((int)Data[index].ActorMixer.ID))
                {
                    AssignedHirc.EventAction.AddRange(EventAction[(int)Data[index].ActorMixer.ID]);
                }
            }

            foreach (int ID in AssignedHirc.EventAction)
            {
                int index = ID;

                if (index < 0 || index > Data.Count)
                {
                    continue;
                }

                if (Event.ContainsKey((int)Data[index].EventAction.ID))
                {
                    AssignedHirc.Event.AddRange(Event[(int)Data[index].EventAction.ID]);
                }
            }
        }