Display referesh to double?

This commit is contained in:
Matt Nadareski
2020-09-04 11:04:58 -07:00
parent 762f8dda27
commit ef414dd48b
4 changed files with 76 additions and 9 deletions

View File

@@ -362,7 +362,6 @@ namespace SabreTools.Library.DatFiles
Tag = reader.GetAttribute("tag"),
DisplayType = reader.GetAttribute("type").AsDisplayType(),
FlipX = reader.GetAttribute("flipx").AsYesNo(),
Refresh = reader.GetAttribute("refresh"),
Source = new Source
{
@@ -392,6 +391,13 @@ namespace SabreTools.Library.DatFiles
display.Height = height;
}
// Set the refresh
if (reader.GetAttribute("refresh") != null)
{
if (Double.TryParse(reader.GetAttribute("refresh"), out double refresh))
display.Refresh = refresh;
}
// Set the pixclock
if (reader.GetAttribute("pixclock") != null)
{
@@ -1597,7 +1603,7 @@ namespace SabreTools.Library.DatFiles
xtw.WriteOptionalAttributeString("flipx", display.FlipX.FromYesNo());
xtw.WriteOptionalAttributeString("width", display.Width?.ToString());
xtw.WriteOptionalAttributeString("height", display.Height?.ToString());
xtw.WriteOptionalAttributeString("refresh", display.Refresh);
xtw.WriteOptionalAttributeString("refresh", display.Refresh?.ToString("N6"));
xtw.WriteOptionalAttributeString("pixclock", display.PixClock?.ToString());
xtw.WriteOptionalAttributeString("htotal", display.HTotal?.ToString());
xtw.WriteOptionalAttributeString("hbend", display.HBEnd?.ToString());