Interface string

This commit is contained in:
Garry Newman 2019-04-12 22:52:55 +01:00
parent 34d6b15fb8
commit afb2e286f4
4 changed files with 11 additions and 2 deletions

View File

@ -8,6 +8,8 @@ namespace Steamworks.Internal
{ {
public class ISteamApps : BaseSteamInterface public class ISteamApps : BaseSteamInterface
{ {
public override string InterfaceName => "STEAMAPPS_INTERFACE_VERSION008";
public override void InitInternals() public override void InitInternals()
{ {
BIsSubscribedDelegatePointer = Marshal.GetDelegateForFunctionPointer<BIsSubscribedDelegate>( Marshal.ReadIntPtr( VTable, 0) ); BIsSubscribedDelegatePointer = Marshal.GetDelegateForFunctionPointer<BIsSubscribedDelegate>( Marshal.ReadIntPtr( VTable, 0) );

View File

@ -14,7 +14,7 @@ namespace Steamworks.Internal
public IntPtr Self; public IntPtr Self;
public IntPtr VTable; public IntPtr VTable;
public virtual string InterfaceName => "STEAMAPPS_INTERFACE_VERSION008"; public virtual string InterfaceName => null;
public BaseSteamInterface() public BaseSteamInterface()
{ {

View File

@ -9,6 +9,7 @@ namespace Generator
public class Class public class Class
{ {
public string Name; public string Name;
public string InterfaceString;
public class Function public class Function
{ {
@ -19,7 +20,7 @@ namespace Generator
public string CallResult; public string CallResult;
} }
public List<Function> Functions = new List<Function>(); public List<Function> Functions = new List<Function>();
internal Function AddFunction( string funcName, string returnType, string args ) internal Function AddFunction( string funcName, string returnType, string args )
{ {

View File

@ -40,6 +40,12 @@ namespace Generator
var c = new Class(); var c = new Class();
c.Name = classname; c.Name = classname;
var interfaceMatch = Regex.Match( Content, $"#define {classname.ToUpper().Substring( 1 )}_INTERFACE_VERSION \"(.+?)\"" );
if ( interfaceMatch.Success )
{
c.InterfaceString = interfaceMatch.Groups[1].Value;
}
foreach ( var line in lines ) foreach ( var line in lines )
{ {
if ( line.Trim().Length < 4 ) continue; if ( line.Trim().Length < 4 ) continue;