Add ControlType, fix a bunch of numerics

This commit is contained in:
Matt Nadareski
2020-09-06 23:00:13 -07:00
parent aa414bc3cd
commit 5d5520dbdd
16 changed files with 323 additions and 248 deletions

View File

@@ -255,23 +255,11 @@ namespace SabreTools.Library.DatFiles
var dataArea = new DataArea
{
Name = reader.GetAttribute("name"),
Size = Sanitizer.CleanLong(reader.GetAttribute("size")),
Width = Sanitizer.CleanLong(reader.GetAttribute("width")),
Endianness = reader.GetAttribute("endianness").AsEndianness(),
};
// Set the size
if (reader.GetAttribute("size") != null)
{
if (Int64.TryParse(reader.GetAttribute("width"), out long size))
dataArea.Size = size;
}
// Set the width
if (reader.GetAttribute("width") != null)
{
if (Int64.TryParse(reader.GetAttribute("width"), out long width))
dataArea.Width = width;
}
List<DatItem> roms = ReadDataArea(reader.ReadSubtree(), dataArea);
// If we got valid roms, add them to the list