diff --git a/dll/dll/steam_screenshots.h b/dll/dll/steam_screenshots.h index 5faae8b5..2ce12667 100644 --- a/dll/dll/steam_screenshots.h +++ b/dll/dll/steam_screenshots.h @@ -26,6 +26,8 @@ struct screenshot_infos_t { }; class Steam_Screenshots : +public ISteamScreenshots001, +public ISteamScreenshots002, public ISteamScreenshots { class Local_Storage *local_storage{}; diff --git a/dll/steam_client_interface_getter.cpp b/dll/steam_client_interface_getter.cpp index 6701bcc8..f689a02e 100644 --- a/dll/steam_client_interface_getter.cpp +++ b/dll/steam_client_interface_getter.cpp @@ -609,9 +609,11 @@ ISteamScreenshots *Steam_Client::GetISteamScreenshots( HSteamUser hSteamuser, HS PRINT_DEBUG("%s", pchVersion); if (!steam_pipes.count(hSteamPipe) || !hSteamuser) return NULL; - // Here we always use the STEAMSCREENSHOTS_INTERFACE_VERSION003 since 01-02 has small difference - - if (strcmp(pchVersion, STEAMSCREENSHOTS_INTERFACE_VERSION) == 0) { + if (strcmp(pchVersion, "STEAMSCREENSHOTS_INTERFACE_VERSION001") == 0) { + return reinterpret_cast(static_cast(steam_screenshots)); + } else if (strcmp(pchVersion, "STEAMSCREENSHOTS_INTERFACE_VERSION002") == 0) { + return reinterpret_cast(static_cast(steam_screenshots)); + } else if (strcmp(pchVersion, STEAMSCREENSHOTS_INTERFACE_VERSION) == 0) { return reinterpret_cast(static_cast(steam_screenshots)); } else { return reinterpret_cast(static_cast(steam_screenshots)); diff --git a/sdk/steam/isteamscreenshot001.h b/sdk/steam/isteamscreenshot001.h new file mode 100644 index 00000000..2e6bd3d1 --- /dev/null +++ b/sdk/steam/isteamscreenshot001.h @@ -0,0 +1,42 @@ +//====== Copyright © 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: public interface to user remote file storage in Steam +// +//============================================================================= + +#ifndef ISTEAMSCREENSHOTS001_H +#define ISTEAMSCREENSHOTS001_H +#ifdef _WIN32 +#pragma once +#endif + +//----------------------------------------------------------------------------- +// Purpose: Functions for adding screenshots to the user's screenshot library +//----------------------------------------------------------------------------- +class ISteamScreenshots001 +{ +public: + // Writes a screenshot to the user's screenshot library given the raw image data, which must be in RGB format. + // The return value is a handle that is valid for the duration of the game process and can be used to apply tags. + virtual ScreenshotHandle WriteScreenshot( void *pubRGB, uint32 cubRGB, int nWidth, int nHeight ) = 0; + + // Adds a screenshot to the user's screenshot library from disk. If a thumbnail is provided, it must be 200 pixels wide and the same aspect ratio + // as the screenshot, otherwise a thumbnail will be generated if the user uploads the screenshot. The screenshots must be in either JPEG or TGA format. + // The return value is a handle that is valid for the duration of the game process and can be used to apply tags. + virtual ScreenshotHandle AddScreenshotToLibrary( const char *pchJpegOrTGAFilename, const char *pchJpegOrTGAThumbFilename, int nWidth, int nHeight ) = 0; + + // Causes the Steam overlay to take a screenshot. If screenshots are being hooked by the game then a ScreenshotRequested_t callback is sent back to the game instead. + virtual void TriggerScreenshot() = 0; + + // Toggles whether the overlay handles screenshots when the user presses the screenshot hotkey, or the game handles them. If the game is hooking screenshots, + // then the ScreenshotRequested_t callback will be sent if the user presses the hotkey, and the game is expected to call WriteScreenshot or AddScreenshotToLibrary + // in response. + virtual void HookScreenshots( bool bHook ) = 0; + + // Sets metadata about a screenshot's location (for example, the name of the map) + virtual bool SetLocation( ScreenshotHandle hScreenshot, const char *pchLocation ) = 0; + + // Tags a user as being visible in the screenshot + virtual bool TagUser( ScreenshotHandle hScreenshot, CSteamID steamID ) = 0; +}; +#endif // ISTEAMSCREENSHOTS001_H \ No newline at end of file diff --git a/sdk/steam/isteamscreenshot002.h b/sdk/steam/isteamscreenshot002.h new file mode 100644 index 00000000..350a7d4a --- /dev/null +++ b/sdk/steam/isteamscreenshot002.h @@ -0,0 +1,46 @@ +//====== Copyright � 1996-2008, Valve Corporation, All rights reserved. ======= +// +// Purpose: public interface to user remote file storage in Steam +// +//============================================================================= + +#ifndef ISTEAMSCREENSHOTS002_H +#define ISTEAMSCREENSHOTS002_H +#ifdef _WIN32 +#pragma once +#endif + +//----------------------------------------------------------------------------- +// Purpose: Functions for adding screenshots to the user's screenshot library +//----------------------------------------------------------------------------- +class ISteamScreenshots002 +{ +public: + // Writes a screenshot to the user's screenshot library given the raw image data, which must be in RGB format. + // The return value is a handle that is valid for the duration of the game process and can be used to apply tags. + virtual ScreenshotHandle WriteScreenshot( void *pubRGB, uint32 cubRGB, int nWidth, int nHeight ) = 0; + + // Adds a screenshot to the user's screenshot library from disk. If a thumbnail is provided, it must be 200 pixels wide and the same aspect ratio + // as the screenshot, otherwise a thumbnail will be generated if the user uploads the screenshot. The screenshots must be in either JPEG or TGA format. + // The return value is a handle that is valid for the duration of the game process and can be used to apply tags. + // JPEG, TGA, and PNG formats are supported. + virtual ScreenshotHandle AddScreenshotToLibrary( const char *pchFilename, const char *pchThumbnailFilename, int nWidth, int nHeight ) = 0; + + // Causes the Steam overlay to take a screenshot. If screenshots are being hooked by the game then a ScreenshotRequested_t callback is sent back to the game instead. + virtual void TriggerScreenshot() = 0; + + // Toggles whether the overlay handles screenshots when the user presses the screenshot hotkey, or the game handles them. If the game is hooking screenshots, + // then the ScreenshotRequested_t callback will be sent if the user presses the hotkey, and the game is expected to call WriteScreenshot or AddScreenshotToLibrary + // in response. + virtual void HookScreenshots( bool bHook ) = 0; + + // Sets metadata about a screenshot's location (for example, the name of the map) + virtual bool SetLocation( ScreenshotHandle hScreenshot, const char *pchLocation ) = 0; + + // Tags a user as being visible in the screenshot + virtual bool TagUser( ScreenshotHandle hScreenshot, CSteamID steamID ) = 0; + + // Tags a published file as being visible in the screenshot + virtual bool TagPublishedFile( ScreenshotHandle hScreenshot, PublishedFileId_t unPublishedFileID ) = 0; +}; +#endif // ISTEAMSCREENSHOTS002_H \ No newline at end of file