mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Display width and height to long?
This commit is contained in:
@@ -362,8 +362,6 @@ namespace SabreTools.Library.DatFiles
|
||||
Tag = reader.GetAttribute("tag"),
|
||||
DisplayType = reader.GetAttribute("type").AsDisplayType(),
|
||||
FlipX = reader.GetAttribute("flipx").AsYesNo(),
|
||||
Width = reader.GetAttribute("width"),
|
||||
Height = reader.GetAttribute("height"),
|
||||
Refresh = reader.GetAttribute("refresh"),
|
||||
PixClock = reader.GetAttribute("pixclock"),
|
||||
HTotal = reader.GetAttribute("htotal"),
|
||||
@@ -387,6 +385,20 @@ namespace SabreTools.Library.DatFiles
|
||||
display.Rotate = rotate;
|
||||
}
|
||||
|
||||
// Set the width
|
||||
if (reader.GetAttribute("width") != null)
|
||||
{
|
||||
if (Int64.TryParse(reader.GetAttribute("width"), out long width))
|
||||
display.Width = width;
|
||||
}
|
||||
|
||||
// Set the height
|
||||
if (reader.GetAttribute("height") != null)
|
||||
{
|
||||
if (Int64.TryParse(reader.GetAttribute("height"), out long height))
|
||||
display.Height = height;
|
||||
}
|
||||
|
||||
datItems.Add(display);
|
||||
|
||||
reader.Read();
|
||||
@@ -1541,8 +1553,8 @@ namespace SabreTools.Library.DatFiles
|
||||
xtw.WriteOptionalAttributeString("type", display.DisplayType.FromDisplayType());
|
||||
xtw.WriteOptionalAttributeString("rotate", display.Rotate?.ToString());
|
||||
xtw.WriteOptionalAttributeString("flipx", display.FlipX.FromYesNo());
|
||||
xtw.WriteOptionalAttributeString("width", display.Width);
|
||||
xtw.WriteOptionalAttributeString("height", display.Height);
|
||||
xtw.WriteOptionalAttributeString("width", display.Width?.ToString());
|
||||
xtw.WriteOptionalAttributeString("height", display.Height?.ToString());
|
||||
xtw.WriteOptionalAttributeString("refresh", display.Refresh);
|
||||
xtw.WriteOptionalAttributeString("pixclock", display.PixClock);
|
||||
xtw.WriteOptionalAttributeString("htotal", display.HTotal);
|
||||
|
||||
@@ -1439,8 +1439,8 @@ namespace SabreTools.Library.DatFiles
|
||||
xtw.WriteOptionalAttributeString("type", display.DisplayType.FromDisplayType());
|
||||
xtw.WriteOptionalAttributeString("rotate", display.Rotate?.ToString());
|
||||
xtw.WriteOptionalAttributeString("flipx", display.FlipX.FromYesNo());
|
||||
xtw.WriteOptionalAttributeString("width", display.Width);
|
||||
xtw.WriteOptionalAttributeString("height", display.Height);
|
||||
xtw.WriteOptionalAttributeString("width", display.Width?.ToString());
|
||||
xtw.WriteOptionalAttributeString("height", display.Height?.ToString());
|
||||
xtw.WriteOptionalAttributeString("refresh", display.Refresh);
|
||||
xtw.WriteOptionalAttributeString("pixclock", display.PixClock);
|
||||
xtw.WriteOptionalAttributeString("htotal", display.HTotal);
|
||||
|
||||
@@ -46,19 +46,19 @@ namespace SabreTools.Library.DatItems
|
||||
/// Display width
|
||||
/// </summary>
|
||||
[JsonProperty("width", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string Width { get; set; } // TODO: Int32?
|
||||
public long? Width { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Display height
|
||||
/// </summary>
|
||||
[JsonProperty("height", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string Height { get; set; } // TODO: Int32?
|
||||
public long? Height { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Refresh rate
|
||||
/// </summary>
|
||||
[JsonProperty("refresh", DefaultValueHandling = DefaultValueHandling.Ignore)]
|
||||
public string Refresh { get; set; } // TODO: Int32? Float?
|
||||
public string Refresh { get; set; } // TODO: Float?
|
||||
|
||||
/// <summary>
|
||||
/// Pixel clock timer
|
||||
@@ -132,10 +132,16 @@ namespace SabreTools.Library.DatItems
|
||||
FlipX = mappings[Field.DatItem_FlipX].AsYesNo();
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_Width))
|
||||
Width = mappings[Field.DatItem_Width];
|
||||
{
|
||||
if (Int64.TryParse(mappings[Field.DatItem_Width], out long width))
|
||||
Width = width;
|
||||
}
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_Height))
|
||||
Height = mappings[Field.DatItem_Height];
|
||||
{
|
||||
if (Int64.TryParse(mappings[Field.DatItem_Height], out long height))
|
||||
Height = height;
|
||||
}
|
||||
|
||||
if (mappings.Keys.Contains(Field.DatItem_Refresh))
|
||||
Refresh = mappings[Field.DatItem_Refresh];
|
||||
|
||||
@@ -199,8 +199,8 @@ namespace SabreTools.Library.Filtering
|
||||
public FilterItem<DisplayType> DatItem_DisplayType { get; private set; } = new FilterItem<DisplayType>() { Positive = DisplayType.NULL, Negative = DisplayType.NULL };
|
||||
public FilterItem<long?> DatItem_Rotate { get; private set; } = new FilterItem<long?>() { Positive = null, Negative = null, Neutral = null };
|
||||
public FilterItem<bool?> DatItem_FlipX { get; private set; } = new FilterItem<bool?>() { Neutral = null };
|
||||
public FilterItem<string> DatItem_Width { get; private set; } = new FilterItem<string>();
|
||||
public FilterItem<string> DatItem_Height { get; private set; } = new FilterItem<string>();
|
||||
public FilterItem<long?> DatItem_Width { get; private set; } = new FilterItem<long?>() { Positive = null, Negative = null, Neutral = null };
|
||||
public FilterItem<long?> DatItem_Height { get; private set; } = new FilterItem<long?>() { Positive = null, Negative = null, Neutral = null };
|
||||
public FilterItem<string> DatItem_Refresh { get; private set; } = new FilterItem<string>();
|
||||
public FilterItem<string> DatItem_PixClock { get; private set; } = new FilterItem<string>();
|
||||
public FilterItem<string> DatItem_HTotal { get; private set; } = new FilterItem<string>();
|
||||
@@ -847,11 +847,11 @@ namespace SabreTools.Library.Filtering
|
||||
break;
|
||||
|
||||
case Field.DatItem_Width:
|
||||
SetStringFilter(DatItem_Width, value, negate);
|
||||
SetOptionalLongFilter(DatItem_Width, value, negate);
|
||||
break;
|
||||
|
||||
case Field.DatItem_Height:
|
||||
SetStringFilter(DatItem_Height, value, negate);
|
||||
SetOptionalLongFilter(DatItem_Height, value, negate);
|
||||
break;
|
||||
|
||||
case Field.DatItem_Refresh:
|
||||
|
||||
Reference in New Issue
Block a user