Nibble math works better than parsing things manually

This commit is contained in:
Lani Aung
2021-10-08 22:17:09 -05:00
parent 3fc504a4f6
commit 5646b3451f
6 changed files with 135 additions and 79 deletions
+4 -2
View File
@@ -46,7 +46,9 @@ namespace fxl.codes.kisekae.Services
model.Height = int.Parse(resolutionMatch.Groups[2].Value);
break;
case '[':
model.BorderColorIndex = int.Parse(line.Replace("[", ""));
var borderValue = line.Replace("[", "");
if (borderValue.Contains(';')) borderValue = borderValue.Split(';')[0].Trim();
model.BorderColorIndex = int.Parse(borderValue);
break;
case '%':
model.Palettes.Add(new PaletteModel(line));
@@ -70,7 +72,7 @@ namespace fxl.codes.kisekae.Services
_fileParser.ParsePalette(directory, palette);
}
foreach (var cel in model.Cels)
foreach (var cel in model.Cels.Where(x => !string.IsNullOrEmpty(x.FileName)))
{
_fileParser.ParseCel(directory, cel, model.Palettes);
}