Skip to content

Commit

Permalink
Merge pull request #614 from rlabrecque/rlabrecque/update-to-1.59
Browse files Browse the repository at this point in the history
Update to Steamworks SDK 1.59
  • Loading branch information
rlabrecque authored Jun 17, 2024
2 parents ac8d019 + 078ed3c commit d52ef7b
Show file tree
Hide file tree
Showing 42 changed files with 276 additions and 629 deletions.
2 changes: 2 additions & 0 deletions CodeGen/src/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def __init__(self, name, value, type_, precomments, comment, spacing):
"POSIX",
"STEAM_PRIVATE_API(",
"STEAMNETWORKINGSOCKETS_INTERFACE",
"S_OVERRIDE",

# We just create multiple versions of this struct, Valve renamed them.
"ControllerAnalogActionData_t",
Expand Down Expand Up @@ -105,6 +106,7 @@ def __init__(self, name, value, type_, precomments, comment, spacing):
"k_uAppIdInvalid",
"k_uDepotIdInvalid",
"k_uAPICallInvalid",
"k_uAccountIdInvalid",

# steamnetworkingtypes.h
"k_HSteamNetConnection_Invalid",
Expand Down
4 changes: 0 additions & 4 deletions CodeGen/src/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
"SteamNetworkingMessage_t *": "IntPtr",

# TODO: UGH
"ISteamAppList *": "IntPtr",
"ISteamApps *": "IntPtr",
"ISteamController *": "IntPtr",
"ISteamFriends *": "IntPtr",
Expand Down Expand Up @@ -144,9 +143,6 @@

g_SpecialArgsDict = {
# These args are missing a clang attribute like ARRAY_COUNT
"ISteamAppList_GetInstalledApps": {
"pvecAppID": "AppId_t[]",
},
"ISteamApps_GetInstalledDepots": {
"pvecDepots": "DepotId_t[]",
},
Expand Down
4 changes: 4 additions & 0 deletions CodeGen/src/typedefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@
"HSteamNetPollGroup": OrderedDict([
("Invalid", "0"),
]),

"AccountID_t": OrderedDict([
("Invalid", "0"),
]),
}


Expand Down
68 changes: 0 additions & 68 deletions CodeGen/steam/isteamapplist.h

This file was deleted.

8 changes: 1 addition & 7 deletions CodeGen/steam/isteamclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,12 @@ class ISteamClient
// Expose HTTP interface
virtual ISteamHTTP *GetISteamHTTP( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;

// Deprecated - the ISteamUnifiedMessages interface is no longer intended for public consumption.
STEAM_PRIVATE_API( virtual void *DEPRECATED_GetISteamUnifiedMessages( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0 ; )

// Exposes the ISteamController interface - deprecated in favor of Steam Input
virtual ISteamController *GetISteamController( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;

// Exposes the ISteamUGC interface
virtual ISteamUGC *GetISteamUGC( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;

// returns app list interface, only available on specially registered apps
virtual ISteamAppList *GetISteamAppList( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;

// Music Player
virtual ISteamMusic *GetISteamMusic( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0;

Expand Down Expand Up @@ -162,7 +156,7 @@ class ISteamClient
STEAM_PRIVATE_API( virtual void DestroyAllInterfaces() = 0; )

};
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient020"
#define STEAMCLIENT_INTERFACE_VERSION "SteamClient021"

#ifndef STEAM_API_EXPORTS

Expand Down
1 change: 0 additions & 1 deletion CodeGen/steam/isteamcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,6 @@ typedef uint64 ControllerAnalogActionHandle_t;
#define ControllerAnalogActionData_t InputAnalogActionData_t
#define ControllerDigitalActionData_t InputDigitalActionData_t
#define ControllerMotionData_t InputMotionData_t
#define ControllerMotionDataV2_t InputMotionDataV2_t
#else
struct ControllerAnalogActionData_t
{
Expand Down
4 changes: 4 additions & 0 deletions CodeGen/steam/isteamfriends.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ struct FriendGameInfo_t
};
#pragma pack( pop )

// special values for FriendGameInfo_t::m_usQueryPort
const uint16 k_usFriendGameInfoQueryPort_NotInitialized = 0xFFFF; // We haven't asked the GS for this query port's actual value yet. Was #define QUERY_PORT_NOT_INITIALIZED in older versions of Steamworks SDK.
const uint16 k_usFriendGameInfoQueryPort_Error = 0xFFFE; // We were unable to get the query port for this server. Was #define QUERY_PORT_ERROR in older versions of Steamworks SDK.

// maximum number of characters in a user's name. Two flavors; one for UTF-8 and one for UTF-16.
// The UTF-8 version has to be very generous to accomodate characters that get large when encoded
// in UTF-8.
Expand Down
52 changes: 0 additions & 52 deletions CodeGen/steam/isteaminput.h
Original file line number Diff line number Diff line change
Expand Up @@ -660,58 +660,6 @@ struct InputMotionData_t
float rotVelZ;
};


struct InputMotionDataV2_t
{
//
// Gyro post processing:
//

// Drift Corrected Quaternion is calculated after steam input controller calibration values have been applied.
// Rawest _useful_ version of a quaternion.
// Most camera implementations should use this by comparing last rotation against current rotation, and applying the difference to the in game camera (plus your own sensitivity tweaks)
// It is worth viewing
float driftCorrectedQuatX;
float driftCorrectedQuatY;
float driftCorrectedQuatZ;
float driftCorrectedQuatW;

// Sensor fusion corrects using accelerometer, and "average forward over time" for "forward".
// This can "ouija" your aim, so it's not so appropriate for camera controls (sensor fusion was originally made for racing game steering )
// Same result as from old InputMotionData_t::rotQuatX/Y/Z/W
float sensorFusionQuatX;
float sensorFusionQuatY;
float sensorFusionQuatZ;
float sensorFusionQuatW;

// Deferred Sensor fusion quaternion with deferred correction
// Reduces perception of "ouija" effect by only applying correction when the controller is below "low noise" thresholds,
// while the controller rotates fast - never when the user is attempting precision aim.
float deferredSensorFusionQuatX;
float deferredSensorFusionQuatY;
float deferredSensorFusionQuatZ;
float deferredSensorFusionQuatW;

// Same as accel but values are calibrated such that 1 unit = 1G.
// X = Right
// Y = Forward out through the joystick USB port.
// Z = Up through the joystick axis.
float gravityX;
float gravityY;
float gravityZ;

//
// Same as rotVel values in GetMotionData but values are calibrated to degrees per second.
// Local Space (controller relative)
// X = Pitch = left to right axis
// Y = Roll = axis through charging port
// Z = Yaw = axis through sticks
float degreesPerSecondX;
float degreesPerSecondY;
float degreesPerSecondZ;

};

//-----------------------------------------------------------------------------
// Purpose: when callbacks are enabled this fires each time a controller action
// state changes
Expand Down
2 changes: 1 addition & 1 deletion CodeGen/steam/isteamparentalsettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ enum EParentalFeature
k_EFeatureLibrary = 11,
k_EFeatureTest = 12,
k_EFeatureSiteLicense = 13,
k_EFeatureKioskMode = 14,
k_EFeatureKioskMode_Deprecated = 14,
k_EFeatureMax
};

Expand Down
1 change: 1 addition & 0 deletions CodeGen/steam/isteamremoteplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ enum ESteamDeviceFormFactor
k_ESteamDeviceFormFactorTablet = 2,
k_ESteamDeviceFormFactorComputer = 3,
k_ESteamDeviceFormFactorTV = 4,
k_ESteamDeviceFormFactorVRHeadset = 5,
};

// Steam Remote Play session ID
Expand Down
3 changes: 2 additions & 1 deletion CodeGen/steam/isteamremotestorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,10 @@ enum EWorkshopFileType
k_EWorkshopFileTypeSteamworksAccessInvite = 13, // internal
k_EWorkshopFileTypeSteamVideo = 14, // Steam video
k_EWorkshopFileTypeGameManagedItem = 15, // managed completely by the game, not the user, and not shown on the web
k_EWorkshopFileTypeClip = 16, // internal

// Update k_EWorkshopFileTypeMax if you add values.
k_EWorkshopFileTypeMax = 16
k_EWorkshopFileTypeMax = 17

};

Expand Down
2 changes: 2 additions & 0 deletions CodeGen/steam/isteamugc.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ enum EItemState
k_EItemStateNeedsUpdate = 8, // items needs an update. Either because it's not installed yet or creator updated content
k_EItemStateDownloading = 16, // item update is currently downloading
k_EItemStateDownloadPending = 32, // DownloadItem() was called for this item, content isn't available until DownloadItemResult_t is fired
k_EItemStateDisabledLocally = 64, // Item is disabled locally, so it shouldn't be considered subscribed
};

enum EItemStatistic
Expand Down Expand Up @@ -154,6 +155,7 @@ enum EItemPreviewType
// | |Dn | |
// +---+---+---+---+
k_EItemPreviewType_EnvironmentMap_LatLong = 4, // standard image file expected
k_EItemPreviewType_Clip = 5, // clip id is stored
k_EItemPreviewType_ReservedMax = 255, // you can specify your own types above this value
};

Expand Down
3 changes: 3 additions & 0 deletions CodeGen/steam/isteamutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ class ISteamUtils

// Dismisses the floating keyboard.
virtual bool DismissFloatingGamepadTextInput() = 0;

// Dismisses the full-screen text input dialog.
virtual bool DismissGamepadTextInput() = 0;
};

#define STEAMUTILS_INTERFACE_VERSION "SteamUtils010"
Expand Down
44 changes: 28 additions & 16 deletions CodeGen/steam/steam_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include "isteamhttp.h"
#include "isteamcontroller.h"
#include "isteamugc.h"
#include "isteamapplist.h"
#include "isteamhtmlsurface.h"
#include "isteaminventory.h"
#include "isteamvideo.h"
Expand All @@ -63,9 +62,27 @@ enum ESteamAPIInitResult
k_ESteamAPIInitResult_VersionMismatch = 3, // Steam client appears to be out of date
};

// Initialize the Steamworks SDK.
// On success k_ESteamAPIInitResult_OK is returned. Otherwise, if pOutErrMsg is non-NULL,
// it will receive a non-localized message that explains the reason for the failure
// Initializing the Steamworks SDK
// -----------------------------
//
// There are three different methods you can use to initialize the Steamworks SDK, depending on
// your project's environment. You should only use one method in your project.
//
// If you are able to include this C++ header in your project, we recommend using the following
// initialization methods. They will ensure that all ISteam* interfaces defined in other
// C++ header files have versions that are supported by the user's Steam Client:
// - SteamAPI_InitEx() for new projects so you can show a detailed error message to the user
// - SteamAPI_Init() for existing projects that only display a generic error message
//
// If you are unable to include this C++ header in your project and are dynamically loading
// Steamworks SDK methods from dll/so, you can use the following method:
// - SteamAPI_InitFlat()


// See "Initializing the Steamworks SDK" above for how to choose an init method.
// On success k_ESteamAPIInitResult_OK is returned. Otherwise, returns a value that can be used
// to create a localized error message for the user. If pOutErrMsg is non-NULL,
// it will receive an example error message, in English, that explains the reason for the failure.
//
// Example usage:
//
Expand All @@ -74,14 +91,18 @@ enum ESteamAPIInitResult
// FatalError( "Failed to init Steam. %s", errMsg );
inline ESteamAPIInitResult SteamAPI_InitEx( SteamErrMsg *pOutErrMsg );

// Initialize the SDK, without worrying about the cause of failure.
// This function is included for compatibility with older SDK.
// You can use it if you don't care about decent error handling
// See "Initializing the Steamworks SDK" above for how to choose an init method.
// Returns true on success
inline bool SteamAPI_Init()
{
return SteamAPI_InitEx( NULL ) == k_ESteamAPIInitResult_OK;
}

// See "Initializing the Steamworks SDK" above for how to choose an init method.
// Same usage as SteamAPI_InitEx(), however does not verify ISteam* interfaces are
// supported by the user's client and is exported from the dll
S_API ESteamAPIInitResult S_CALLTYPE SteamAPI_InitFlat( SteamErrMsg *pOutErrMsg );

// SteamAPI_Shutdown should be called during process shutdown if possible.
S_API void S_CALLTYPE SteamAPI_Shutdown();

Expand Down Expand Up @@ -277,10 +298,6 @@ inline bool CSteamAPIContext::Init()
if ( !m_pSteamUGC )
return false;

m_pSteamAppList = ::SteamAppList();
if ( !m_pSteamAppList )
return false;

m_pSteamMusic = ::SteamMusic();
if ( !m_pSteamMusic )
return false;
Expand Down Expand Up @@ -318,17 +335,12 @@ inline bool CSteamAPIContext::Init()

// Internal implementation of SteamAPI_InitEx. This is done in a way that checks
// all of the versions of interfaces from headers being compiled into this code.
// If you are not using any of the C++ interfaces and do not need this version checking
// (for example if you are only using the "flat" interfaces, which have a different type
// of version checking), you can pass a NULL interface version string.
S_API ESteamAPIInitResult S_CALLTYPE SteamInternal_SteamAPI_Init( const char *pszInternalCheckInterfaceVersions, SteamErrMsg *pOutErrMsg );
inline ESteamAPIInitResult SteamAPI_InitEx( SteamErrMsg *pOutErrMsg )
{
const char *pszInternalCheckInterfaceVersions =
STEAMUTILS_INTERFACE_VERSION "\0"
STEAMNETWORKINGUTILS_INTERFACE_VERSION "\0"

STEAMAPPLIST_INTERFACE_VERSION "\0"
STEAMAPPS_INTERFACE_VERSION "\0"
STEAMCONTROLLER_INTERFACE_VERSION "\0"
STEAMFRIENDS_INTERFACE_VERSION "\0"
Expand Down
Loading

0 comments on commit d52ef7b

Please sign in to comment.