From c4947ce99ab87ee4aa9996921943efc8285cc85a Mon Sep 17 00:00:00 2001 From: notmatthewbeshay <92357869+NotMachow@users.noreply.github.com> Date: Tue, 10 Mar 2026 19:27:44 +1100 Subject: [PATCH] Use standard screenshot buffer types --- Minecraft.Client/Platform/Common/Consoles_App.h | 2 +- Minecraft.Client/Platform/Durango/Durango_App.cpp | 2 +- Minecraft.Client/Platform/Durango/Durango_App.h | 2 +- Minecraft.Client/Platform/Linux/Linux_App.cpp | 2 +- Minecraft.Client/Platform/Linux/Linux_App.h | 2 +- Minecraft.Client/Platform/Orbis/Orbis_App.cpp | 2 +- Minecraft.Client/Platform/Orbis/Orbis_App.h | 2 +- Minecraft.Client/Platform/PS3/PS3_App.cpp | 2 +- Minecraft.Client/Platform/PS3/PS3_App.h | 2 +- Minecraft.Client/Platform/PSVita/PSVita_App.cpp | 2 +- Minecraft.Client/Platform/PSVita/PSVita_App.h | 2 +- Minecraft.Client/Platform/Windows64/Windows64_App.cpp | 2 +- Minecraft.Client/Platform/Windows64/Windows64_App.h | 2 +- Minecraft.Client/Platform/Xbox/Social/SocialManager.cpp | 4 ++-- Minecraft.Client/Platform/Xbox/Xbox_App.cpp | 8 ++++---- Minecraft.Client/Platform/Xbox/Xbox_App.h | 2 +- 16 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Minecraft.Client/Platform/Common/Consoles_App.h b/Minecraft.Client/Platform/Common/Consoles_App.h index 71a5821b6..4914e95c1 100644 --- a/Minecraft.Client/Platform/Common/Consoles_App.h +++ b/Minecraft.Client/Platform/Common/Consoles_App.h @@ -610,7 +610,7 @@ public: virtual void CaptureSaveThumbnail() =0; virtual void GetSaveThumbnail(std::uint8_t **thumbnailData, unsigned int *thumbnailSize)=0; virtual void ReleaseSaveThumbnail()=0; - virtual void GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize)=0; + virtual void GetScreenshot(int iPad, std::uint8_t **screenshotData, unsigned int *screenshotSize)=0; virtual void ReadBannedList(int iPad, eTMSAction action=(eTMSAction)0, bool bCallback=false)=0; diff --git a/Minecraft.Client/Platform/Durango/Durango_App.cpp b/Minecraft.Client/Platform/Durango/Durango_App.cpp index 29db239bf..5a4c95e8f 100644 --- a/Minecraft.Client/Platform/Durango/Durango_App.cpp +++ b/Minecraft.Client/Platform/Durango/Durango_App.cpp @@ -146,7 +146,7 @@ void CConsoleMinecraftApp::ReleaseSaveThumbnail() } -void CConsoleMinecraftApp::GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize) +void CConsoleMinecraftApp::GetScreenshot(int iPad, std::uint8_t **screenshotData, unsigned int *screenshotSize) { } diff --git a/Minecraft.Client/Platform/Durango/Durango_App.h b/Minecraft.Client/Platform/Durango/Durango_App.h index 18a41e003..cd775c70e 100644 --- a/Minecraft.Client/Platform/Durango/Durango_App.h +++ b/Minecraft.Client/Platform/Durango/Durango_App.h @@ -25,7 +25,7 @@ public: virtual void CaptureSaveThumbnail(); virtual void GetSaveThumbnail(std::uint8_t **thumbnailData, unsigned int *thumbnailSize); virtual void ReleaseSaveThumbnail(); - virtual void GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize); + virtual void GetScreenshot(int iPad, std::uint8_t **screenshotData, unsigned int *screenshotSize); virtual int LoadLocalTMSFile(WCHAR *wchTMSFile); virtual int LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt); diff --git a/Minecraft.Client/Platform/Linux/Linux_App.cpp b/Minecraft.Client/Platform/Linux/Linux_App.cpp index 1a520c45a..332537d07 100644 --- a/Minecraft.Client/Platform/Linux/Linux_App.cpp +++ b/Minecraft.Client/Platform/Linux/Linux_App.cpp @@ -46,7 +46,7 @@ void CConsoleMinecraftApp::ReleaseSaveThumbnail() { } -void CConsoleMinecraftApp::GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize) +void CConsoleMinecraftApp::GetScreenshot(int iPad, std::uint8_t **screenshotData, unsigned int *screenshotSize) { } diff --git a/Minecraft.Client/Platform/Linux/Linux_App.h b/Minecraft.Client/Platform/Linux/Linux_App.h index ed1f73b83..f15afd928 100644 --- a/Minecraft.Client/Platform/Linux/Linux_App.h +++ b/Minecraft.Client/Platform/Linux/Linux_App.h @@ -14,7 +14,7 @@ public: virtual void CaptureSaveThumbnail(); virtual void GetSaveThumbnail(std::uint8_t **thumbnailData, unsigned int *thumbnailSize); virtual void ReleaseSaveThumbnail(); - virtual void GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize); + virtual void GetScreenshot(int iPad, std::uint8_t **screenshotData, unsigned int *screenshotSize); virtual int LoadLocalTMSFile(WCHAR *wchTMSFile); virtual int LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt); diff --git a/Minecraft.Client/Platform/Orbis/Orbis_App.cpp b/Minecraft.Client/Platform/Orbis/Orbis_App.cpp index da4735418..16cd30972 100644 --- a/Minecraft.Client/Platform/Orbis/Orbis_App.cpp +++ b/Minecraft.Client/Platform/Orbis/Orbis_App.cpp @@ -284,7 +284,7 @@ void CConsoleMinecraftApp::ReleaseSaveThumbnail() } -void CConsoleMinecraftApp::GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize) +void CConsoleMinecraftApp::GetScreenshot(int iPad, std::uint8_t **screenshotData, unsigned int *screenshotSize) { } diff --git a/Minecraft.Client/Platform/Orbis/Orbis_App.h b/Minecraft.Client/Platform/Orbis/Orbis_App.h index 54302f77b..ef55633a9 100644 --- a/Minecraft.Client/Platform/Orbis/Orbis_App.h +++ b/Minecraft.Client/Platform/Orbis/Orbis_App.h @@ -71,7 +71,7 @@ public: virtual void GetSaveThumbnail(std::uint8_t **thumbnailData, unsigned int *thumbnailSize) {}; // NOT USED virtual void GetSaveThumbnail(std::uint8_t **thumbnailData, unsigned int *thumbnailSize, std::uint8_t **saveImageData, unsigned int *saveImageSize); virtual void ReleaseSaveThumbnail(); - virtual void GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize); + virtual void GetScreenshot(int iPad, std::uint8_t **screenshotData, unsigned int *screenshotSize); int LoadLocalTMSFile(char *chTMSFile); int LoadLocalDLCImage(SONYDLC *pDLCInfo); diff --git a/Minecraft.Client/Platform/PS3/PS3_App.cpp b/Minecraft.Client/Platform/PS3/PS3_App.cpp index e9ff2c195..b2f8d0646 100644 --- a/Minecraft.Client/Platform/PS3/PS3_App.cpp +++ b/Minecraft.Client/Platform/PS3/PS3_App.cpp @@ -450,7 +450,7 @@ void CConsoleMinecraftApp::ReleaseSaveThumbnail() } } -void CConsoleMinecraftApp::GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize) +void CConsoleMinecraftApp::GetScreenshot(int iPad, std::uint8_t **screenshotData, unsigned int *screenshotSize) { } diff --git a/Minecraft.Client/Platform/PS3/PS3_App.h b/Minecraft.Client/Platform/PS3/PS3_App.h index 369b760b2..a643280e9 100644 --- a/Minecraft.Client/Platform/PS3/PS3_App.h +++ b/Minecraft.Client/Platform/PS3/PS3_App.h @@ -71,7 +71,7 @@ public: virtual void GetSaveThumbnail(std::uint8_t **thumbnailData, unsigned int *thumbnailSize) {}; // NOT USED virtual void GetSaveThumbnail(std::uint8_t **thumbnailData, unsigned int *thumbnailSize, std::uint8_t **saveImageData, unsigned int *saveImageSize); virtual void ReleaseSaveThumbnail(); - virtual void GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize); + virtual void GetScreenshot(int iPad, std::uint8_t **screenshotData, unsigned int *screenshotSize); // BANNED LEVEL LIST virtual void ReadBannedList(int iPad, eTMSAction action=(eTMSAction)0, bool bCallback=false) {} diff --git a/Minecraft.Client/Platform/PSVita/PSVita_App.cpp b/Minecraft.Client/Platform/PSVita/PSVita_App.cpp index 9e6b8688a..888e4c854 100644 --- a/Minecraft.Client/Platform/PSVita/PSVita_App.cpp +++ b/Minecraft.Client/Platform/PSVita/PSVita_App.cpp @@ -265,7 +265,7 @@ void CConsoleMinecraftApp::ReleaseSaveThumbnail() } -void CConsoleMinecraftApp::GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize) +void CConsoleMinecraftApp::GetScreenshot(int iPad, std::uint8_t **screenshotData, unsigned int *screenshotSize) { } diff --git a/Minecraft.Client/Platform/PSVita/PSVita_App.h b/Minecraft.Client/Platform/PSVita/PSVita_App.h index 3cc0c1317..9c262dac3 100644 --- a/Minecraft.Client/Platform/PSVita/PSVita_App.h +++ b/Minecraft.Client/Platform/PSVita/PSVita_App.h @@ -73,7 +73,7 @@ public: virtual void GetSaveThumbnail(std::uint8_t **thumbnailData, unsigned int *thumbnailSize) {}; // NOT USED virtual void GetSaveThumbnail(std::uint8_t **thumbnailData, unsigned int *thumbnailSize, std::uint8_t **saveImageData, unsigned int *saveImageSize); virtual void ReleaseSaveThumbnail(); - virtual void GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize); + virtual void GetScreenshot(int iPad, std::uint8_t **screenshotData, unsigned int *screenshotSize); virtual int LoadLocalTMSFile(WCHAR *wchTMSFile); virtual int LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt); diff --git a/Minecraft.Client/Platform/Windows64/Windows64_App.cpp b/Minecraft.Client/Platform/Windows64/Windows64_App.cpp index dd20ee37f..bc60aa486 100644 --- a/Minecraft.Client/Platform/Windows64/Windows64_App.cpp +++ b/Minecraft.Client/Platform/Windows64/Windows64_App.cpp @@ -44,7 +44,7 @@ void CConsoleMinecraftApp::ReleaseSaveThumbnail() { } -void CConsoleMinecraftApp::GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize) +void CConsoleMinecraftApp::GetScreenshot(int iPad, std::uint8_t **screenshotData, unsigned int *screenshotSize) { } diff --git a/Minecraft.Client/Platform/Windows64/Windows64_App.h b/Minecraft.Client/Platform/Windows64/Windows64_App.h index ed1f73b83..f15afd928 100644 --- a/Minecraft.Client/Platform/Windows64/Windows64_App.h +++ b/Minecraft.Client/Platform/Windows64/Windows64_App.h @@ -14,7 +14,7 @@ public: virtual void CaptureSaveThumbnail(); virtual void GetSaveThumbnail(std::uint8_t **thumbnailData, unsigned int *thumbnailSize); virtual void ReleaseSaveThumbnail(); - virtual void GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize); + virtual void GetScreenshot(int iPad, std::uint8_t **screenshotData, unsigned int *screenshotSize); virtual int LoadLocalTMSFile(WCHAR *wchTMSFile); virtual int LoadLocalTMSFile(WCHAR *wchTMSFile, eFileExtensionType eExt); diff --git a/Minecraft.Client/Platform/Xbox/Social/SocialManager.cpp b/Minecraft.Client/Platform/Xbox/Social/SocialManager.cpp index f61292648..bbcfc7f11 100644 --- a/Minecraft.Client/Platform/Xbox/Social/SocialManager.cpp +++ b/Minecraft.Client/Platform/Xbox/Social/SocialManager.cpp @@ -459,8 +459,8 @@ bool CSocialManager::PostImageToSocialNetwork( ESocialNetwork eSocialNetwork, DW bool bResult = false; - PBYTE pbData=NULL; - DWORD dwDataSize; + std::uint8_t *pbData = NULL; + unsigned int dwDataSize = 0; app.GetScreenshot(dwUserIndex,&pbData,&dwDataSize); app.GetPreviewImage(dwUserIndex,&m_PostPreviewImage); diff --git a/Minecraft.Client/Platform/Xbox/Xbox_App.cpp b/Minecraft.Client/Platform/Xbox/Xbox_App.cpp index 901e025e9..6f050b2d6 100644 --- a/Minecraft.Client/Platform/Xbox/Xbox_App.cpp +++ b/Minecraft.Client/Platform/Xbox/Xbox_App.cpp @@ -1472,14 +1472,14 @@ void CConsoleMinecraftApp::ReleaseSaveThumbnail() } } -void CConsoleMinecraftApp::GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize) +void CConsoleMinecraftApp::GetScreenshot(int iPad, std::uint8_t **screenshotData, unsigned int *screenshotSize) { // on a save caused by a create world, the thumbnail capture won't have happened if(m_ScreenshotBuffer[iPad]!=NULL) { - *pbData= new BYTE [m_ScreenshotBuffer[iPad]->GetBufferSize()]; - *pdwSize=m_ScreenshotBuffer[iPad]->GetBufferSize(); - memcpy(*pbData,m_ScreenshotBuffer[iPad]->GetBufferPointer(),*pdwSize); + *screenshotData = new std::uint8_t[m_ScreenshotBuffer[iPad]->GetBufferSize()]; + *screenshotSize = static_cast(m_ScreenshotBuffer[iPad]->GetBufferSize()); + memcpy(*screenshotData, m_ScreenshotBuffer[iPad]->GetBufferPointer(), *screenshotSize); m_ScreenshotBuffer[iPad]->Release(); m_ScreenshotBuffer[iPad]=NULL; } diff --git a/Minecraft.Client/Platform/Xbox/Xbox_App.h b/Minecraft.Client/Platform/Xbox/Xbox_App.h index 4f612851e..f32438b1c 100644 --- a/Minecraft.Client/Platform/Xbox/Xbox_App.h +++ b/Minecraft.Client/Platform/Xbox/Xbox_App.h @@ -52,7 +52,7 @@ public: virtual void CaptureSaveThumbnail(); virtual void GetSaveThumbnail(std::uint8_t **thumbnailData, unsigned int *thumbnailSize); virtual void ReleaseSaveThumbnail(); - virtual void GetScreenshot(int iPad,PBYTE *pbData,DWORD *pdwSize); + virtual void GetScreenshot(int iPad, std::uint8_t **screenshotData, unsigned int *screenshotSize); virtual void RunFrame();