mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-12 14:48:02 +03:00
Fixed IsReturnedWeird ordering
This commit is contained in:
parent
f7e09ec7bf
commit
920ea6ce6b
@ -132,14 +132,14 @@ namespace Steamworks.Internal
|
|||||||
|
|
||||||
#region FunctionMeta
|
#region FunctionMeta
|
||||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||||
public delegate void GetFriendByIndexDelegate( IntPtr self, int iFriend, int iFriendFlags, ref CSteamID retVal );
|
public delegate void GetFriendByIndexDelegate( IntPtr self, ref CSteamID retVal, int iFriend, int iFriendFlags );
|
||||||
private GetFriendByIndexDelegate GetFriendByIndexDelegatePointer;
|
private GetFriendByIndexDelegate GetFriendByIndexDelegatePointer;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
public CSteamID GetFriendByIndex( int iFriend, int iFriendFlags )
|
public CSteamID GetFriendByIndex( int iFriend, int iFriendFlags )
|
||||||
{
|
{
|
||||||
var retVal = default( CSteamID );
|
var retVal = default( CSteamID );
|
||||||
GetFriendByIndexDelegatePointer( Self, iFriend, iFriendFlags, ref retVal );
|
GetFriendByIndexDelegatePointer( Self, ref retVal, iFriend, iFriendFlags );
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -289,14 +289,14 @@ namespace Steamworks.Internal
|
|||||||
|
|
||||||
#region FunctionMeta
|
#region FunctionMeta
|
||||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||||
public delegate void GetClanByIndexDelegate( IntPtr self, int iClan, ref CSteamID retVal );
|
public delegate void GetClanByIndexDelegate( IntPtr self, ref CSteamID retVal, int iClan );
|
||||||
private GetClanByIndexDelegate GetClanByIndexDelegatePointer;
|
private GetClanByIndexDelegate GetClanByIndexDelegatePointer;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
public CSteamID GetClanByIndex( int iClan )
|
public CSteamID GetClanByIndex( int iClan )
|
||||||
{
|
{
|
||||||
var retVal = default( CSteamID );
|
var retVal = default( CSteamID );
|
||||||
GetClanByIndexDelegatePointer( Self, iClan, ref retVal );
|
GetClanByIndexDelegatePointer( Self, ref retVal, iClan );
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,14 +358,14 @@ namespace Steamworks.Internal
|
|||||||
|
|
||||||
#region FunctionMeta
|
#region FunctionMeta
|
||||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||||
public delegate void GetFriendFromSourceByIndexDelegate( IntPtr self, CSteamID steamIDSource, int iFriend, ref CSteamID retVal );
|
public delegate void GetFriendFromSourceByIndexDelegate( IntPtr self, ref CSteamID retVal, CSteamID steamIDSource, int iFriend );
|
||||||
private GetFriendFromSourceByIndexDelegate GetFriendFromSourceByIndexDelegatePointer;
|
private GetFriendFromSourceByIndexDelegate GetFriendFromSourceByIndexDelegatePointer;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
public CSteamID GetFriendFromSourceByIndex( CSteamID steamIDSource, int iFriend )
|
public CSteamID GetFriendFromSourceByIndex( CSteamID steamIDSource, int iFriend )
|
||||||
{
|
{
|
||||||
var retVal = default( CSteamID );
|
var retVal = default( CSteamID );
|
||||||
GetFriendFromSourceByIndexDelegatePointer( Self, steamIDSource, iFriend, ref retVal );
|
GetFriendFromSourceByIndexDelegatePointer( Self, ref retVal, steamIDSource, iFriend );
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -516,14 +516,14 @@ namespace Steamworks.Internal
|
|||||||
|
|
||||||
#region FunctionMeta
|
#region FunctionMeta
|
||||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||||
public delegate void GetClanOwnerDelegate( IntPtr self, CSteamID steamIDClan, ref CSteamID retVal );
|
public delegate void GetClanOwnerDelegate( IntPtr self, ref CSteamID retVal, CSteamID steamIDClan );
|
||||||
private GetClanOwnerDelegate GetClanOwnerDelegatePointer;
|
private GetClanOwnerDelegate GetClanOwnerDelegatePointer;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
public CSteamID GetClanOwner( CSteamID steamIDClan )
|
public CSteamID GetClanOwner( CSteamID steamIDClan )
|
||||||
{
|
{
|
||||||
var retVal = default( CSteamID );
|
var retVal = default( CSteamID );
|
||||||
GetClanOwnerDelegatePointer( Self, steamIDClan, ref retVal );
|
GetClanOwnerDelegatePointer( Self, ref retVal, steamIDClan );
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -540,14 +540,14 @@ namespace Steamworks.Internal
|
|||||||
|
|
||||||
#region FunctionMeta
|
#region FunctionMeta
|
||||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||||
public delegate void GetClanOfficerByIndexDelegate( IntPtr self, CSteamID steamIDClan, int iOfficer, ref CSteamID retVal );
|
public delegate void GetClanOfficerByIndexDelegate( IntPtr self, ref CSteamID retVal, CSteamID steamIDClan, int iOfficer );
|
||||||
private GetClanOfficerByIndexDelegate GetClanOfficerByIndexDelegatePointer;
|
private GetClanOfficerByIndexDelegate GetClanOfficerByIndexDelegatePointer;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
public CSteamID GetClanOfficerByIndex( CSteamID steamIDClan, int iOfficer )
|
public CSteamID GetClanOfficerByIndex( CSteamID steamIDClan, int iOfficer )
|
||||||
{
|
{
|
||||||
var retVal = default( CSteamID );
|
var retVal = default( CSteamID );
|
||||||
GetClanOfficerByIndexDelegatePointer( Self, steamIDClan, iOfficer, ref retVal );
|
GetClanOfficerByIndexDelegatePointer( Self, ref retVal, steamIDClan, iOfficer );
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -654,14 +654,14 @@ namespace Steamworks.Internal
|
|||||||
|
|
||||||
#region FunctionMeta
|
#region FunctionMeta
|
||||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||||
public delegate void GetCoplayFriendDelegate( IntPtr self, int iCoplayFriend, ref CSteamID retVal );
|
public delegate void GetCoplayFriendDelegate( IntPtr self, ref CSteamID retVal, int iCoplayFriend );
|
||||||
private GetCoplayFriendDelegate GetCoplayFriendDelegatePointer;
|
private GetCoplayFriendDelegate GetCoplayFriendDelegatePointer;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
public CSteamID GetCoplayFriend( int iCoplayFriend )
|
public CSteamID GetCoplayFriend( int iCoplayFriend )
|
||||||
{
|
{
|
||||||
var retVal = default( CSteamID );
|
var retVal = default( CSteamID );
|
||||||
GetCoplayFriendDelegatePointer( Self, iCoplayFriend, ref retVal );
|
GetCoplayFriendDelegatePointer( Self, ref retVal, iCoplayFriend );
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -723,14 +723,14 @@ namespace Steamworks.Internal
|
|||||||
|
|
||||||
#region FunctionMeta
|
#region FunctionMeta
|
||||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
[UnmanagedFunctionPointer( CallingConvention.ThisCall )]
|
||||||
public delegate void GetChatMemberByIndexDelegate( IntPtr self, CSteamID steamIDClan, int iUser, ref CSteamID retVal );
|
public delegate void GetChatMemberByIndexDelegate( IntPtr self, ref CSteamID retVal, CSteamID steamIDClan, int iUser );
|
||||||
private GetChatMemberByIndexDelegate GetChatMemberByIndexDelegatePointer;
|
private GetChatMemberByIndexDelegate GetChatMemberByIndexDelegatePointer;
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
public CSteamID GetChatMemberByIndex( CSteamID steamIDClan, int iUser )
|
public CSteamID GetChatMemberByIndex( CSteamID steamIDClan, int iUser )
|
||||||
{
|
{
|
||||||
var retVal = default( CSteamID );
|
var retVal = default( CSteamID );
|
||||||
GetChatMemberByIndexDelegatePointer( Self, steamIDClan, iUser, ref retVal );
|
GetChatMemberByIndexDelegatePointer( Self, ref retVal, steamIDClan, iUser );
|
||||||
return retVal;
|
return retVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,12 +68,12 @@ namespace Generator
|
|||||||
|
|
||||||
var args = func.Arguments.Select( x => BaseType.Parse( x.Value, x.Key ) ).ToArray();
|
var args = func.Arguments.Select( x => BaseType.Parse( x.Value, x.Key ) ).ToArray();
|
||||||
var argstr = string.Join( ", ", args.Select( x => x.AsArgument() ) );
|
var argstr = string.Join( ", ", args.Select( x => x.AsArgument() ) );
|
||||||
var delegateargstr = "IntPtr self, " + string.Join( ", ", args.Select( x => x.AsArgument() ) );
|
var delegateargstr = string.Join( ", ", args.Select( x => x.AsArgument() ) );
|
||||||
|
|
||||||
if ( returnType.IsReturnedWeird )
|
if ( returnType.IsReturnedWeird )
|
||||||
{
|
{
|
||||||
delegateargstr += $", ref {returnType.TypeName} retVal";
|
delegateargstr = $"ref {returnType.TypeName} retVal, {delegateargstr}";
|
||||||
delegateargstr = delegateargstr.Replace( ", , ", ", " );
|
delegateargstr = delegateargstr.Trim( ',', ' ' );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( returnType is SteamApiCallType sap )
|
if ( returnType is SteamApiCallType sap )
|
||||||
@ -88,7 +88,7 @@ namespace Generator
|
|||||||
if ( returnType.ReturnAttribute != null)
|
if ( returnType.ReturnAttribute != null)
|
||||||
WriteLine( returnType.ReturnAttribute );
|
WriteLine( returnType.ReturnAttribute );
|
||||||
|
|
||||||
WriteLine( $"public delegate {(returnType.IsReturnedWeird?"void":returnType.TypeNameFrom)} {func.Name}Delegate( {delegateargstr} );".Replace( "( IntPtr self, )", "( IntPtr self )" ) );
|
WriteLine( $"public delegate {(returnType.IsReturnedWeird?"void":returnType.TypeNameFrom)} {func.Name}Delegate( IntPtr self, {delegateargstr} );".Replace( "( IntPtr self, )", "( IntPtr self )" ) );
|
||||||
WriteLine( $"private {func.Name}Delegate {func.Name}DelegatePointer;" );
|
WriteLine( $"private {func.Name}Delegate {func.Name}DelegatePointer;" );
|
||||||
WriteLine();
|
WriteLine();
|
||||||
WriteLine( $"#endregion" );
|
WriteLine( $"#endregion" );
|
||||||
@ -100,7 +100,7 @@ namespace Generator
|
|||||||
if ( returnType.IsReturnedWeird )
|
if ( returnType.IsReturnedWeird )
|
||||||
{
|
{
|
||||||
WriteLine( $"var retVal = default( {returnType.TypeName} );" );
|
WriteLine( $"var retVal = default( {returnType.TypeName} );" );
|
||||||
WriteLine( $"{func.Name}DelegatePointer( Self, {callargs}, ref retVal );".Replace( ", , ", ", " ) );
|
WriteLine( $"{func.Name}DelegatePointer( Self, ref retVal, {callargs} );".Replace( ", );", " );" ) );
|
||||||
WriteLine( $"{returnType.Return( "retVal" )}" );
|
WriteLine( $"{returnType.Return( "retVal" )}" );
|
||||||
}
|
}
|
||||||
else if ( returnType.IsVoid )
|
else if ( returnType.IsVoid )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user