Commits

g3gg0  committed 4864d54

reordered lens correction profile output XML

  • Participants
  • Parent commits 085e67b

Comments (0)

Files changed (1)

File contrib/g3gg0-tools/LensDumper/LensDataAccessor.cs

             public UInt16 Unknown5;
 
             public LensEntry[] LensEntries;
-            public LensData[] LensDatas;
         }
 
         public class LensEntry
             public UInt16 Wide;
             public UInt16 ExtenderType;
             public UInt32 Offset;
+
+            public LensData LensData;
         }
 
         public class LensData
 
         public class ProfileTypeA
         {
-            /* 0x14 bytes */
-            [XmlIgnore]
-            public byte[] HeaderData;
-
-            [XmlAttribute("header")]
-            public string HeaderData_
-            {
-                get
-                {
-                    StringBuilder str = new StringBuilder();
-                    if (HeaderData != null)
-                    {
-                        for (int pos = 0; pos < HeaderData.Length; pos++)
-                        {
-                            str.AppendFormat("{0:X2}", HeaderData[pos]);
-                        }
-                    }
-                    return str.ToString();
-                }
-                set
-                {
-                }
-            }
+            [XmlElement("UnknownHeaderData")]
+            public UInt16[] UnknownHeaderData;
 
             public ProfileTypeAData[] Data;
         }
 
         public class ProfileTypeB
         {
-            /* 0x14 bytes */
-            [XmlIgnore]
-            public byte[] HeaderData;
-
-            [XmlAttribute("header")]
-            public string HeaderData_
-            {
-                get
-                {
-                    StringBuilder str = new StringBuilder();
-                    if (HeaderData != null)
-                    {
-                        for (int pos = 0; pos < HeaderData.Length; pos++)
-                        {
-                            str.AppendFormat("{0:X2}", HeaderData[pos]);
-                        }
-                    }
-                    return str.ToString();
-                }
-                set
-                {
-                }
-            }
+            [XmlElement("UnknownHeaderData")]
+            public UInt16[] UnknownHeaderData;
 
             public ProfileTypeBData[] Data;
         }
 
         public class ProfileTypeC
         {
-            /* 0x14 bytes */
-            [XmlIgnore]
-            public byte[] HeaderData;
-
-            [XmlAttribute("header")]
-            public string HeaderData_
-            {
-                get
-                {
-                    StringBuilder str = new StringBuilder();
-                    if (HeaderData != null)
-                    {
-                        for (int pos = 0; pos < HeaderData.Length; pos++)
-                        {
-                            str.AppendFormat("{0:X2}", HeaderData[pos]);
-                        }
-                    }
-                    return str.ToString();
-                }
-                set
-                {
-                }
-            }
+            [XmlElement("UnknownHeaderData")]
+            public UInt16[] UnknownHeaderData;
 
             public ProfileTypeCData[] Data;
         }
             offset += (ulong)data.LensEntriesReserved * 0x10;
 
             Log.WriteLine("  Parsing " + data.LensEntryCount + " lens datas");
-            data.LensDatas = new LensData[data.LensEntryCount];
             for (ulong entry = 0; entry < data.LensEntryCount; entry++)
             {
                 LensEntry lensEntry = data.LensEntries[entry];
 
-                data.LensDatas[entry] = ParseLensCorrection(buffer, offset + lensEntry.Offset);
+                data.LensEntries[entry].LensData = ParseLensCorrection(buffer, offset + lensEntry.Offset);
             }
 
             return data;
             focalLengths[3] = GetUInt16(buffer, offset + 0x06);
             offset += 0x08;
 
-            data.HeaderData = new byte[0x14];
-            Array.Copy(buffer, (int)offset, data.HeaderData, 0, 0x14);
-            offset += 0x14;
+            data.UnknownHeaderData = new UInt16[0x0A];
+            for (int pos = 0; pos < 0x0A; pos++)
+            {
+                data.UnknownHeaderData[pos] = GetUInt16(buffer, offset);
+                offset += 0x02;
+            }
 
             data.Data = new ProfileTypeCData[4];
             for (int pos = 0; pos < 4; pos++)
             focalLengths[3] = GetUInt16(buffer, offset + 0x06);
             offset += 0x08;
 
-            data.HeaderData = new byte[0x14];
-            Array.Copy(buffer, (int)offset, data.HeaderData, 0, 0x14);
-            offset += 0x14;
+            data.UnknownHeaderData = new UInt16[0x0A];
+            for (int pos = 0; pos < 0x0A; pos++)
+            {
+                data.UnknownHeaderData[pos] = GetUInt16(buffer, offset);
+                offset += 0x02;
+            }
 
             data.Data = new ProfileTypeBData[4];
             for (int pos = 0; pos < 4; pos++)
             focalLengths[3] = GetUInt16(buffer, offset + 0x06);
             offset += 0x08;
 
-            data.HeaderData = new byte[0x14];
-            Array.Copy(buffer, (int)offset, data.HeaderData, 0, 0x14);
-            offset += 0x14;
+            data.UnknownHeaderData = new UInt16[0x0A];
+            for (int pos = 0; pos < 0x0A; pos++)
+            {
+                data.UnknownHeaderData[pos] = GetUInt16(buffer, offset);
+                offset += 0x02;
+            }
 
             data.Data = new ProfileTypeAData[4];
             for (int pos = 0; pos < 4; pos++)