示例#1
0
 public void RemoveSoundFromSNDI(uint assetID)
 {
     foreach (Asset a in assetDictionary.Values)
     {
         if (a is AssetSNDI_GCN_V1 SNDI_G1)
         {
             if (SNDI_G1.HasReference(assetID))
             {
                 SNDI_G1.RemoveEntry(assetID, GetFromAssetID(assetID).AHDR.assetType);
             }
         }
         else if (a is AssetSNDI_GCN_V2 SNDI_G2)
         {
             if (SNDI_G2.HasReference(assetID))
             {
                 SNDI_G2.RemoveEntry(assetID);
             }
         }
         else if (a is AssetSNDI_XBOX SNDI_X)
         {
             if (SNDI_X.HasReference(assetID))
             {
                 SNDI_X.RemoveEntry(assetID, GetFromAssetID(assetID).AHDR.assetType);
             }
         }
         else if (a is AssetSNDI_PS2 SNDI_P)
         {
             if (SNDI_P.HasReference(assetID))
             {
                 SNDI_P.RemoveEntry(assetID, GetFromAssetID(assetID).AHDR.assetType);
             }
         }
     }
 }
示例#2
0
        public byte[] GetHeaderFromSNDI(uint assetID)
        {
            foreach (Asset a in assetDictionary.Values)
            {
                if (a is AssetSNDI_GCN_V1 SNDI_G1)
                {
                    if (SNDI_G1.HasReference(assetID))
                    {
                        return(SNDI_G1.GetHeader(assetID, GetFromAssetID(assetID).AHDR.assetType));
                    }
                }
                else if (a is AssetSNDI_GCN_V2 SNDI_G2)
                {
                    if (SNDI_G2.HasReference(assetID))
                    {
                        return(SNDI_G2.GetHeader(assetID));
                    }
                }
                else if (a is AssetSNDI_XBOX SNDI_X)
                {
                    if (SNDI_X.HasReference(assetID))
                    {
                        return(SNDI_X.GetHeader(assetID, GetFromAssetID(assetID).AHDR.assetType));
                    }
                }
                else if (a is AssetSNDI_PS2 SNDI_P)
                {
                    if (SNDI_P.HasReference(assetID))
                    {
                        return(SNDI_P.GetHeader(assetID, GetFromAssetID(assetID).AHDR.assetType));
                    }
                }
            }

            throw new Exception("Error: could not find SNDI asset which contains this sound in this archive.");
        }