Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Steamworks SDK 1.52 #452

Merged
merged 1 commit into from
Oct 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Steamworks {
[System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)]
public delegate void SteamInputActionEventCallbackPointer(IntPtr /* SteamInputActionEvent_t* */ SteamInputActionEvent);
}

#endif // !DISABLESTEAMWORKS
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No matching #if on these? :S

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeahhhhhh.......

It's because they are actually just templates, and the header gets stamped on top when they pass through the CodeGen

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also didn't really have time to start trying to properly use this given the IntPtr, maybe next week

49 changes: 49 additions & 0 deletions CodeGen/CustomTypes/SteamInput/SteamInputActionEvent_t.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
namespace Steamworks
{
//-----------------------------------------------------------------------------
// Purpose: when callbacks are enabled this fires each time a controller action
// state changes
//-----------------------------------------------------------------------------
[System.Serializable]
[StructLayout(LayoutKind.Sequential)]
public struct SteamInputActionEvent_t
{
public InputHandle_t controllerHandle;

public ESteamInputActionEventType eEventType;

/// Option value
public OptionValue m_val;

[System.Serializable]
[StructLayout(LayoutKind.Sequential)]
public struct SteamInputAnalogActionEvent_t
{
public InputAnalogActionHandle_t actionHandle;

public InputAnalogActionData_t analogActionData;
}

[System.Serializable]
[StructLayout(LayoutKind.Sequential)]
public struct SteamInputDigitalActionEvent_t
{
public InputDigitalActionHandle_t actionHandle;

public InputDigitalActionData_t digitalActionData;
}

[System.Serializable]
[StructLayout(LayoutKind.Explicit)]
public struct OptionValue
{
[FieldOffset(0)]
public SteamInputAnalogActionEvent_t analogAction;

[FieldOffset(0)]
public SteamInputDigitalActionEvent_t digitalAction;
}
}
}

#endif // !DISABLESTEAMWORKS
2 changes: 1 addition & 1 deletion CodeGen/SteamworksParser
21 changes: 5 additions & 16 deletions CodeGen/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ def __init__(self, name, value, type_, precomments, comment, spacing):
g_TypeDict = {
# Not a bug... But, it's a giant hack.
# The issue is that most of these are used as the MarshalAs SizeConst in C# amongst other things and C# wont auto convert them.
"uint16": "ushort",

"uint32": "int",
"unsigned int": "int",

Expand Down Expand Up @@ -48,7 +50,6 @@ def __init__(self, name, value, type_, precomments, comment, spacing):
"k_steamIDLanModeGS",
"k_steamIDNotInitYetGS",
"k_steamIDNonSteamGS",
"BREAKPAD_INVALID_HANDLE",
"STEAM_PS3_PATH_MAX",
"STEAM_PS3_SERVICE_ID_MAX",
"STEAM_PS3_COMMUNICATION_ID_MAX",
Expand Down Expand Up @@ -101,35 +102,24 @@ def __init__(self, name, value, type_, precomments, comment, spacing):
"k_HAuthTicketInvalid",

# SteamTypes
"k_JobIDNil",
"k_uBundleIdInvalid",
"k_uAppIdInvalid",
"k_uDepotIdInvalid",
"k_uAPICallInvalid",
"k_uManifestIdInvalid",
"k_ulSiteIdInvalid",

# steamnetworkingtypes.h
"k_HSteamNetConnection_Invalid",
"k_HSteamListenSocket_Invalid",
"k_HSteamNetPollGroup_Invalid",
"k_SteamDatagramPOPID_dev",

#TODO: Skip all these once we have typedef autogen hooked up.
#public const ulong k_GIDNil = 0xffffffffffffffffull;
#public const ulong k_TxnIDNil = k_GIDNil;
#public const ulong k_TxnIDUnknown = 0;
#public const int k_uPackageIdFreeSub = 0x0;
#public const int k_uPackageIdInvalid = 0xFFFFFFFF;
#public const ulong k_ulAssetClassIdInvalid = 0x0;
#public const int k_uPhysicalItemIdInvalid = 0x0;
#public const int k_uCellIDInvalid = 0xFFFFFFFF;
#public const int k_uPartnerIdInvalid = 0;
# steam_gameserver.h
"MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE",
)

g_SkippedTypedefs = (
"uint8",
"int8",
"uint16",
"int32",
"uint32",
"int64",
Expand All @@ -138,7 +128,6 @@ def __init__(self, name, value, type_, precomments, comment, spacing):

g_CustomDefines = {
# "Name": ("Type", "Value"),
"MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE": ("ushort", "0xFFFF"),
"k_nMaxLobbyKeyLength": ("byte", None),
"STEAM_CONTROLLER_HANDLE_ALL_CONTROLLERS": ("ulong", "0xFFFFFFFFFFFFFFFF"),
"STEAM_CONTROLLER_MIN_ANALOG_ACTION_DATA": ("float", "-1.0f"),
Expand Down
7 changes: 3 additions & 4 deletions CodeGen/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@
"EItemState",

# SteamClientPublic
"EAppOwnershipFlags",
"EAppType",
"EChatSteamIDInstanceFlags",
"EMarketingMessageFlags",
"EMarketNotAllowedReasonFlags",
)

Expand All @@ -37,7 +34,6 @@
# Valve redefined these twice, and ifdef decided which one to use. :(
# We use the newer ones from isteaminput.h and skip the ones in
# isteamcontroller.h because it is deprecated.
"ESteamControllerPad": "isteamcontroller.h",
"EXboxOrigin": "isteamcontroller.h",
"ESteamInputType": "isteamcontroller.h",
}
Expand All @@ -46,6 +42,9 @@
"0xffffffff": "-1",
"0x80000000": "-2147483647",
"k_unSteamAccountInstanceMask": "Constants.k_unSteamAccountInstanceMask",
"( 1 << k_ESteamControllerPad_Left )": "( 1 << ESteamControllerPad.k_ESteamControllerPad_Left )",
"( 1 << k_ESteamControllerPad_Right )": "( 1 << ESteamControllerPad.k_ESteamControllerPad_Right )",
"( 1 << k_ESteamControllerPad_Left | 1 << k_ESteamControllerPad_Right )": "( 1 << ESteamControllerPad.k_ESteamControllerPad_Left | 1 << ESteamControllerPad.k_ESteamControllerPad_Right )",
}

def main(parser):
Expand Down
11 changes: 6 additions & 5 deletions CodeGen/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@
"SteamNetworkingErrMsg &": "out SteamNetworkingErrMsg",
"const SteamNetConnectionInfo_t &": "ref SteamNetConnectionInfo_t",
"SteamNetworkingMessage_t **": "IntPtr[]",

# SteamNetworkingTypes which are stubbed
"SteamDatagramGameCoordinatorServerLogin *": "IntPtr",

}

g_WrapperArgsTypeDict = {
Expand Down Expand Up @@ -142,7 +146,7 @@
"ISteamApps_GetInstalledDepots": {
"pvecDepots": "DepotId_t[]",
},
"ISteamGameServer_SendUserConnectAndAuthenticate": {
"ISteamGameServer_SendUserConnectAndAuthenticate_DEPRECATED": {
"pvAuthBlob": "byte[]",
},
"ISteamGameServer_GetAuthSessionTicket": {
Expand Down Expand Up @@ -238,7 +242,7 @@
"ISteamUGC_StopPlaytimeTracking": {
"pvecPublishedFileID": "PublishedFileId_t[]",
},
"ISteamUser_InitiateGameConnection": {
"ISteamUser_InitiateGameConnection_DEPRECATED": {
"pAuthBlob": "byte[]",
},
"ISteamUser_GetAvailableVoice": {
Expand Down Expand Up @@ -276,9 +280,6 @@
},

# GameServer Copies
"ISteamGameServerApps_GetInstalledDepots": {
"pvecDepots": "DepotId_t[]",
},
"ISteamGameServerHTTP_GetHTTPResponseHeaderValue": {
"pHeaderValueBuffer": "byte[]",
},
Expand Down
11 changes: 6 additions & 5 deletions CodeGen/steam/isteamapplist.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#endif

#include "steam_api_common.h"
#include "steamtypes.h"

//-----------------------------------------------------------------------------
// Purpose: This is a restricted interface that can only be used by previously approved apps,
Expand Down Expand Up @@ -51,16 +50,18 @@ STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamAppList *, SteamAppList, STEAMAPPLIS
// Purpose: Sent when a new app is installed
//---------------------------------------------------------------------------------
STEAM_CALLBACK_BEGIN( SteamAppInstalled_t, k_iSteamAppListCallbacks + 1 )
STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs
STEAM_CALLBACK_END(1)
STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs
STEAM_CALLBACK_MEMBER( 1, int, m_iInstallFolderIndex ) // library folder the app is installed
STEAM_CALLBACK_END( 2 )


//---------------------------------------------------------------------------------
// Purpose: Sent when an app is uninstalled
//---------------------------------------------------------------------------------
STEAM_CALLBACK_BEGIN( SteamAppUninstalled_t, k_iSteamAppListCallbacks + 2 )
STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs
STEAM_CALLBACK_END(1)
STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs
STEAM_CALLBACK_MEMBER( 1, int, m_iInstallFolderIndex ) // library folder the app was installed
STEAM_CALLBACK_END(2)


#pragma pack( pop )
Expand Down
4 changes: 0 additions & 4 deletions CodeGen/steam/isteamapps.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,6 @@ class ISteamApps
inline ISteamApps *SteamApps();
STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamApps *, SteamApps, STEAMAPPS_INTERFACE_VERSION );

// Global accessor for the gameserver client
inline ISteamApps *SteamGameServerApps();
STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamApps *, SteamGameServerApps, STEAMAPPS_INTERFACE_VERSION );

// callbacks
#if defined( VALVE_CALLBACK_PACK_SMALL )
#pragma pack( push, 4 )
Expand Down
7 changes: 6 additions & 1 deletion CodeGen/steam/isteamcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,11 @@ enum EControllerActionOrigin
k_EControllerActionOrigin_PS5_Gyro_Yaw,
k_EControllerActionOrigin_PS5_Gyro_Roll,

k_EControllerActionOrigin_XBoxOne_LeftGrip_Lower,
k_EControllerActionOrigin_XBoxOne_LeftGrip_Upper,
k_EControllerActionOrigin_XBoxOne_RightGrip_Lower,
k_EControllerActionOrigin_XBoxOne_RightGrip_Upper,
k_EControllerActionOrigin_XBoxOne_Share,

k_EControllerActionOrigin_Count, // If Steam has added support for new controllers origins will go here.
k_EControllerActionOrigin_MaximumPossibleValue = 32767, // Origins are currently a maximum of 16 bits.
Expand Down Expand Up @@ -592,7 +597,7 @@ class ISteamController
virtual void SetLEDColor( ControllerHandle_t controllerHandle, uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ) = 0;

//-----------------------------------------------------------------------------
// Utility functions availible without using the rest of Steam Input API
// Utility functions available without using the rest of Steam Input API
//-----------------------------------------------------------------------------

// Invokes the Steam overlay and brings up the binding screen if the user is using Big Picture Mode
Expand Down
Loading