mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-24 04:28:00 +03:00
Moved callback functions to ThisCall subclass
This commit is contained in:
parent
5fdcf82eac
commit
6e7afc1ac9
@ -28,10 +28,14 @@ namespace SteamNative
|
|||||||
//
|
//
|
||||||
// All possible functions
|
// All possible functions
|
||||||
//
|
//
|
||||||
|
internal class ThisCall
|
||||||
|
{
|
||||||
|
[UnmanagedFunctionPointer( CallingConvention.StdCall )] public delegate void Result( IntPtr thisptr, IntPtr pvParam );
|
||||||
|
[UnmanagedFunctionPointer( CallingConvention.StdCall )] public delegate void ResultWithInfo( IntPtr thisptr, IntPtr pvParam, bool bIOFailure, SteamNative.SteamAPICall_t hSteamAPICall );
|
||||||
|
[UnmanagedFunctionPointer( CallingConvention.StdCall )] public delegate int GetSize( IntPtr thisptr );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] public delegate void Result( IntPtr thisptr, IntPtr pvParam );
|
|
||||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] public delegate void ResultWithInfo( IntPtr thisptr, IntPtr pvParam, bool bIOFailure, SteamNative.SteamAPICall_t hSteamAPICall );
|
|
||||||
[UnmanagedFunctionPointer( CallingConvention.ThisCall )] public delegate int GetSize( IntPtr thisptr );
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -248,8 +248,8 @@ namespace Generator
|
|||||||
|
|
||||||
if ( Result )
|
if ( Result )
|
||||||
{
|
{
|
||||||
WriteLine( $"Callback.Result funcA = ( _, p ) => {{ handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }};" );
|
WriteLine( $"Callback.ThisCall.Result funcA = ( _, p ) => {{ handle.Dispose(); CallbackFunction( FromPointer( p ), false ); }};" );
|
||||||
StartBlock( $"Callback.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => " );
|
StartBlock( $"Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => " );
|
||||||
{
|
{
|
||||||
WriteLine( "if ( hSteamAPICall != call ) return;" );
|
WriteLine( "if ( hSteamAPICall != call ) return;" );
|
||||||
WriteLine();
|
WriteLine();
|
||||||
@ -262,11 +262,11 @@ namespace Generator
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WriteLine( $"Callback.Result funcA = ( _, p ) => {{ CallbackFunction( FromPointer( p ), false ); }};" );
|
WriteLine( $"Callback.ThisCall.Result funcA = ( _, p ) => {{ CallbackFunction( FromPointer( p ), false ); }};" );
|
||||||
WriteLine( $"Callback.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => {{ CallbackFunction( FromPointer( p ), bIOFailure ); }};" );
|
WriteLine( $"Callback.ThisCall.ResultWithInfo funcB = ( _, p, bIOFailure, hSteamAPICall ) => {{ CallbackFunction( FromPointer( p ), bIOFailure ); }};" );
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteLine( $"Callback.GetSize funcC = ( _ ) => {{ return Marshal.SizeOf( typeof( {c.Name} ) ); }};" );
|
WriteLine( $"Callback.ThisCall.GetSize funcC = ( _ ) => Marshal.SizeOf( typeof( {c.Name} ) );" );
|
||||||
WriteLine();
|
WriteLine();
|
||||||
WriteLine( "//" );
|
WriteLine( "//" );
|
||||||
WriteLine( "// If this platform is PackSmall, use PackSmall versions of everything instead" );
|
WriteLine( "// If this platform is PackSmall, use PackSmall versions of everything instead" );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user