mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-07 03:25:57 +00:00
optimized list in PCKAudioFileReader
This commit is contained in:
@@ -56,7 +56,7 @@ namespace PckStudio.Classes.IO.PCK
|
||||
}
|
||||
}
|
||||
|
||||
private List<PCKAudioFile.AudioCategory> original_categories = new List<PCKAudioFile.AudioCategory>();
|
||||
private List<PCKAudioFile.AudioCategory.EAudioType> original_audio_types = new List<PCKAudioFile.AudioCategory.EAudioType>();
|
||||
private void ReadCategories(Stream stream)
|
||||
{
|
||||
int categoryEntryCount = ReadInt(stream);
|
||||
@@ -67,7 +67,7 @@ namespace PckStudio.Classes.IO.PCK
|
||||
string name = ReadString(stream);
|
||||
// AddCategory puts the file's categories out of order and causes some songs to be put in the wrong categories
|
||||
// This is my simple fix for the issue.
|
||||
original_categories.Add(new PCKAudioFile.AudioCategory(name, parameterType, audioType));
|
||||
original_audio_types.Add(audioType);
|
||||
_file.AddCategory(parameterType, audioType, name);
|
||||
}
|
||||
}
|
||||
@@ -76,7 +76,7 @@ namespace PckStudio.Classes.IO.PCK
|
||||
{
|
||||
List<string> credits = new List<string>();
|
||||
List<string> creditIds = new List<string>();
|
||||
foreach (var c in original_categories)
|
||||
foreach (var c in original_audio_types)
|
||||
{
|
||||
int audioCount = ReadInt(stream);
|
||||
for (; 0 < audioCount; audioCount--)
|
||||
@@ -86,7 +86,7 @@ namespace PckStudio.Classes.IO.PCK
|
||||
switch (key)
|
||||
{
|
||||
case "CUENAME":
|
||||
_file.GetCategory(c.audioType).SongNames.Add(value);
|
||||
_file.GetCategory(c).SongNames.Add(value);
|
||||
break;
|
||||
case "CREDIT":
|
||||
credits.Add(value);
|
||||
|
||||
Reference in New Issue
Block a user