mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-12 22:58:01 +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 @@ namespace Generator
|
||||
return $"{Name}";
|
||||
}
|
||||
|
||||
internal string InteropParameter( bool LargePack )
|
||||
internal string InteropParameter( bool LargePack, bool includeMarshalling = false )
|
||||
{
|
||||
var ps = LargePack ? "" : ".PackSmall";
|
||||
|
||||
@ -161,6 +161,12 @@ namespace Generator
|
||||
if ( TypeDef != null )
|
||||
ps = string.Empty;
|
||||
|
||||
if ( includeMarshalling )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ( ShouldBeIntPtr )
|
||||
return $"IntPtr /*{NativeType}*/ {Name}";
|
||||
|
||||
@ -187,6 +193,7 @@ namespace Generator
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( NativeType.EndsWith( "*" ) && ManagedType.Contains( "_t" ) )
|
||||
{
|
||||
return $"IntPtr /*{NativeType}*/ {Name} ";
|
||||
|
@ -162,7 +162,7 @@ namespace Generator
|
||||
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 @@ namespace Generator
|
||||
|
||||
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…
x
Reference in New Issue
Block a user