From b7195adc892aa8761d8449eda0413949095cf1d2 Mon Sep 17 00:00:00 2001 From: Sean L Date: Fri, 26 Jan 2018 03:05:10 +0100 Subject: [PATCH] Added AddScreenshotToLibrary Added AddScreenshotToLibrary(filename, thumbnailFilename, width, height); and AddScreenshotToLibrary(filename, width, height); We use Application.TakeScreenshot(path, superSize) in some of our in-game tools (like the camera) to allow for higher-res screenshots, and this feels like a much faster way of doing it then loading the PNG back into a texture2D, converting it into a correct format, and using Write. --- Facepunch.Steamworks/Client/Screenshots.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Facepunch.Steamworks/Client/Screenshots.cs b/Facepunch.Steamworks/Client/Screenshots.cs index a0a9f2b..32be36c 100644 --- a/Facepunch.Steamworks/Client/Screenshots.cs +++ b/Facepunch.Steamworks/Client/Screenshots.cs @@ -66,5 +66,15 @@ public unsafe void Write( byte[] rgbData, int width, int height ) client.native.screenshots.WriteScreenshot( (IntPtr) ptr, (uint) rgbData.Length, width, height ); } } + + public unsafe void AddScreenshotToLibrary( string filename, string thumbnailFilename, int width, int height) + { + client.native.screenshots.AddScreenshotToLibrary(filename, thumbnailFilename, width, height); + } + + public unsafe void AddScreenshotToLibrary( string filename, int width, int height) + { + client.native.screenshots.AddScreenshotToLibrary(filename, null, width, height); + } } }