mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-25 06:05:46 +03:00
More marhsalling
This commit is contained in:
parent
69b342c504
commit
43705fed86
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -151,7 +151,7 @@ internal string InteropVariable()
|
||||
return $"{Name}";
|
||||
}
|
||||
|
||||
internal string InteropParameter( bool LargePack )
|
||||
internal string InteropParameter( bool LargePack, bool includeMarshalling = false )
|
||||
{
|
||||
var ps = LargePack ? "" : ".PackSmall";
|
||||
|
||||
@ -161,6 +161,12 @@ internal string InteropParameter( bool LargePack )
|
||||
if ( TypeDef != null )
|
||||
ps = string.Empty;
|
||||
|
||||
if ( includeMarshalling )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ( ShouldBeIntPtr )
|
||||
return $"IntPtr /*{NativeType}*/ {Name}";
|
||||
|
||||
@ -187,6 +193,7 @@ internal string InteropParameter( bool LargePack )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( NativeType.EndsWith( "*" ) && ManagedType.Contains( "_t" ) )
|
||||
{
|
||||
return $"IntPtr /*{NativeType}*/ {Name} ";
|
||||
|
@ -162,7 +162,7 @@ private void InteropClassMethod( string library, string classname, SteamApiDefin
|
||||
flatName = methodName;
|
||||
|
||||
|
||||
var argstring = string.Join( ", ", arguments.Select( x => x.InteropParameter( LargePack ) ) );
|
||||
var argstring = string.Join( ", ", arguments.Select( x => x.InteropParameter( LargePack, true ) ) );
|
||||
|
||||
if ( methodDef.NeedsSelfPointer )
|
||||
{
|
||||
@ -171,7 +171,11 @@ private void InteropClassMethod( string library, string classname, SteamApiDefin
|
||||
|
||||
if ( argstring != "" ) argstring = $" {argstring} ";
|
||||
|
||||
WriteLine( $"[DllImportAttribute( \"{library}\", EntryPoint = \"{flatName}\" )] internal static extern {ret.Return()} {methodName}({argstring});" );
|
||||
WriteLine( $"[DllImportAttribute( \"{library}\", EntryPoint = \"{flatName}\" )]" );
|
||||
|
||||
if ( ret.Return() == "bool" )WriteLine( "[return: MarshalAs(UnmanagedType.Bool)]" );
|
||||
|
||||
WriteLine( $"internal static extern {ret.Return()} {methodName}({argstring});" );
|
||||
LastMethodName = methodDef.Name;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user