Handle AppId_t arrays

This commit is contained in:
Garry Newman 2018-01-23 11:00:14 +00:00
parent 01e7d1d378
commit 59f7e0ca0a
2 changed files with 11 additions and 2 deletions

View File

@ -24800,7 +24800,8 @@ internal struct GetAppDependenciesResult_t
public const int CallbackId = CallbackIdentifiers.ClientUGC + 16;
public Result Result; // m_eResult enum EResult
public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t
public AppId_t [32] GAppIDs; // m_rgAppIDs AppId_t [32]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.U4)]
public AppId_t[] GAppIDs; // m_rgAppIDs AppId_t [32]
public uint NumAppDependencies; // m_nNumAppDependencies uint32
public uint TotalNumAppDependencies; // m_nTotalNumAppDependencies uint32
@ -24818,7 +24819,8 @@ internal struct PackSmall
{
public Result Result; // m_eResult enum EResult
public ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t
public AppId_t [32] GAppIDs; // m_rgAppIDs AppId_t [32]
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.U4)]
public AppId_t[] GAppIDs; // m_rgAppIDs AppId_t [32]
public uint NumAppDependencies; // m_nNumAppDependencies uint32
public uint TotalNumAppDependencies; // m_nTotalNumAppDependencies uint32

View File

@ -192,6 +192,13 @@ private void StructFields( SteamApiDefinition.StructDef.StructFields[] fields )
t = "IntPtr";
}
if (t.StartsWith("AppId_t ") && t.Contains("["))
{
var num = t.Replace("AppId_t", "").Trim('[', ']', ' ');
t = $"AppId_t[]";
WriteLine($"[MarshalAs(UnmanagedType.ByValArray, SizeConst = {num}, ArraySubType = UnmanagedType.U4)]");
}
WriteLine( $"public {t} {CleanMemberName( m.Name )}; // {m.Name} {m.Type}" );
}
}