Generator changes to support 1.52

This commit is contained in:
André Straubmeier 2021-11-22 13:23:07 +01:00
parent 2f8c19a1d1
commit 70b2a301ca
3 changed files with 11 additions and 1 deletions

View File

@ -60,7 +60,8 @@ public static string ConvertType( string type )
type = type.Replace( "ISteamNetworkingMessage", "NetMsg" );
type = type.Replace( "SteamNetworkingMessage_t", "NetMsg" );
type = type.Replace( "SteamIPAddress_t", "SteamIPAddress" );
type = type.Replace( "SteamNetworkingQuickConnectionStatus", "ConnectionStatus" );
type = type.Replace( "SteamNetConnectionRealTimeStatus_t", "ConnectionStatus" );
type = type.Replace( "SteamNetConnectionRealTimeLaneStatus_t", "ConnectionLaneStatus" );
type = type.Replace( "SteamInputGlyphSize", "GlyphSize" );
type = type.Replace( "FloatingGamepadTextInputMode", "TextInputMode" );
@ -105,6 +106,7 @@ public static bool ShouldCreate( string type )
if ( type == "CCallbackBase" ) return false;
if ( type == "CSteamGameServerAPIContext" ) return false;
if ( type == "ConnectionStatus") return false;
if ( type == "ConnectionLaneStatus" ) return false;
if ( type == "SteamInputActionEventCallbackPointer" ) return false;
if ( type.StartsWith( "FnSteam" ) ) return false;

View File

@ -92,6 +92,13 @@ private void StructFields( SteamApiDefinition.StructDef.StructFields[] fields )
WriteLine( $"[MarshalAs(UnmanagedType.ByValArray, SizeConst = {num})] // {m.Name}" );
}
if ( t.StartsWith( "ushort " ) && t.Contains( "[" ) )
{
var num = t.Replace( "ushort", "" ).Trim( '[', ']', ' ' );
t = $"ushort[]";
WriteLine( $"[MarshalAs(UnmanagedType.ByValArray, SizeConst = {num}, ArraySubType = UnmanagedType.U2)]" );
}
if ( t.StartsWith( "SteamId" ) && t.Contains( "[" ) )
{
var num = t.Replace( "SteamId", "" ).Trim( '[', ']', ' ' );

View File

@ -107,6 +107,7 @@ public virtual bool IsVector
if ( Func == "SendP2PPacket" ) return false;
if ( VarName == "pOutMessageNumber" ) return false;
if ( VarName == "pOptions" ) return true;
if ( VarName == "pLanes" ) return true;
if ( VarName == "pOut" ) return false;
if ( VarName == "pOutBuffer" ) return false;