mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-04-15 22:02:28 +03:00
Added IsPack4OnWindows to codegen struct
This commit is contained in:
parent
c625bbaef9
commit
ad21e90e90
@ -5620,21 +5620,7 @@ namespace Steamworks.Data
|
|||||||
internal ulong UGC; // m_hUGC UGCHandle_t
|
internal ulong UGC; // m_hUGC UGCHandle_t
|
||||||
|
|
||||||
#region Marshalling
|
#region Marshalling
|
||||||
internal static LeaderboardEntry_t Fill( IntPtr p ) => Config.PackSmall ? ((LeaderboardEntry_t)(LeaderboardEntry_t) Marshal.PtrToStructure( p, typeof(LeaderboardEntry_t) )) : ((LeaderboardEntry_t)(Pack8) Marshal.PtrToStructure( p, typeof(Pack8) ));
|
internal static LeaderboardEntry_t Fill( IntPtr p ) => ((LeaderboardEntry_t)(LeaderboardEntry_t) Marshal.PtrToStructure( p, typeof(LeaderboardEntry_t) ) );
|
||||||
#endregion
|
|
||||||
#region Packed Versions
|
|
||||||
|
|
||||||
[StructLayout( LayoutKind.Sequential, Pack = 8 )]
|
|
||||||
public struct Pack8
|
|
||||||
{
|
|
||||||
internal ulong SteamIDUser; // m_steamIDUser class CSteamID
|
|
||||||
internal int GlobalRank; // m_nGlobalRank int32
|
|
||||||
internal int Score; // m_nScore int32
|
|
||||||
internal int CDetails; // m_cDetails int32
|
|
||||||
internal ulong UGC; // m_hUGC UGCHandle_t
|
|
||||||
|
|
||||||
public static implicit operator LeaderboardEntry_t ( LeaderboardEntry_t.Pack8 d ) => new LeaderboardEntry_t{ SteamIDUser = d.SteamIDUser,GlobalRank = d.GlobalRank,Score = d.Score,CDetails = d.CDetails,UGC = d.UGC, };
|
|
||||||
}
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,10 +53,7 @@ namespace Generator
|
|||||||
if ( name.Contains( "::" ) )
|
if ( name.Contains( "::" ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int defaultPack = 8;
|
int defaultPack = c.IsPack4OnWindows ? 4 : 8;
|
||||||
|
|
||||||
if ( c.Fields.Any( x => x.Type.Contains( "CSteamID" ) ) && !ForceLargePackStructs.Contains( c.Name ) )
|
|
||||||
defaultPack = 4;
|
|
||||||
|
|
||||||
var isCallback = !string.IsNullOrEmpty( c.CallbackId );
|
var isCallback = !string.IsNullOrEmpty( c.CallbackId );
|
||||||
|
|
||||||
|
@ -54,6 +54,22 @@ namespace Generator
|
|||||||
|
|
||||||
public string CallbackId { get; set; }
|
public string CallbackId { get; set; }
|
||||||
public bool IsCallResult { get; set; }
|
public bool IsCallResult { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public bool IsPack4OnWindows
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
// if ( Name.Contains( "LeaderboardEntry_t" ) )
|
||||||
|
// return false;
|
||||||
|
|
||||||
|
if ( Fields.Any( x => x.Type.Contains( "CSteamID" ) ) )
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<StructDef> structs { get; set; }
|
public List<StructDef> structs { get; set; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user