aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Xbox/Social/SocialManager.cpp
diff options
context:
space:
mode:
authorModMaker101 <119018978+ModMaker101@users.noreply.github.com>2026-03-07 21:56:03 -0500
committerGitHub <noreply@github.com>2026-03-08 09:56:03 +0700
commita9be52c41a02d207233199e98898fe7483d7e817 (patch)
tree71dfaec3a86b05e9ca409b97d8eb9d7f993bfdd0 /Minecraft.Client/Xbox/Social/SocialManager.cpp
parent1be5faaea781402e7de06b263eeca4c688b7712c (diff)
Project modernization (#630)
* Fixed boats falling and a TP glitch #266 * Replaced every C-style cast with C++ ones * Replaced every C-style cast with C++ ones * Fixed boats falling and a TP glitch #266 * Updated NULL to nullptr and fixing some type issues * Modernized and fixed a few bugs - Replaced most instances of `NULL` with `nullptr`. - Replaced most `shared_ptr(new ...)` with `make_shared`. - Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances. * Fixing more conflicts * Replace int loops with size_t and start work on overrides
Diffstat (limited to 'Minecraft.Client/Xbox/Social/SocialManager.cpp')
-rw-r--r--Minecraft.Client/Xbox/Social/SocialManager.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/Minecraft.Client/Xbox/Social/SocialManager.cpp b/Minecraft.Client/Xbox/Social/SocialManager.cpp
index b7a108bc..b89fda70 100644
--- a/Minecraft.Client/Xbox/Social/SocialManager.cpp
+++ b/Minecraft.Client/Xbox/Social/SocialManager.cpp
@@ -67,14 +67,14 @@ CSocialManager::CSocialManager()
// WESTY : Not sure if we even need to get social access key!
/*
- m_pAccessKeyText = NULL;
+ m_pAccessKeyText = nullptr;
m_dwAccessKeyTextSize = 0;
*/
- m_pMainImageBuffer = NULL;
+ m_pMainImageBuffer = nullptr;
m_dwMainImageBufferSize = 0;
- m_PostPreviewImage.pBytes = NULL;
+ m_PostPreviewImage.pBytes = nullptr;
m_dwCurrRequestUser = -1;
ZeroMemory(m_wchTitleA,sizeof(WCHAR)*MAX_SOCIALPOST_CAPTION);
@@ -304,14 +304,14 @@ bool CSocialManager::AreAllUsersAllowedToPostImages()
void CSocialManager::DestroyMainPostImage()
{
delete [] m_PostImageParams.pFullImage;
- m_PostImageParams.pFullImage=NULL;
+ m_PostImageParams.pFullImage=nullptr;
m_dwMainImageBufferSize=0;
}
void CSocialManager::DestroyPreviewPostImage()
{
XPhysicalFree( (void *)m_PostPreviewImage.pBytes );
- m_PostPreviewImage.pBytes = NULL;
+ m_PostPreviewImage.pBytes = nullptr;
}
void CSocialManager::SetSocialPostText(LPCWSTR pwchTitle, LPCWSTR pwchCaption, LPCWSTR pwchDesc)
@@ -459,7 +459,7 @@ bool CSocialManager::PostImageToSocialNetwork( ESocialNetwork eSocialNetwork, DW
bool bResult = false;
- PBYTE pbData=NULL;
+ PBYTE pbData=nullptr;
DWORD dwDataSize;
app.GetScreenshot(dwUserIndex,&pbData,&dwDataSize);
@@ -536,10 +536,10 @@ bool CSocialManager::GetSocialNetworkAccessKey( ESocialNetwork eSocialNetwork, D
DWORD dwResult;
// Ensure that we free any previously used access key buffer.
- if ( m_pAccessKeyText != NULL )
+ if ( m_pAccessKeyText != nullptr )
{
delete [] m_pAccessKeyText;
- m_pAccessKeyText = NULL;
+ m_pAccessKeyText = nullptr;
}
// Get social network ID and permissions.
@@ -554,39 +554,39 @@ bool CSocialManager::GetSocialNetworkAccessKey( ESocialNetwork eSocialNetwork, D
{
if ( bUsingKinect )
{
- dwResult = XShowNuiSocialGetUserToken( dwUserTrackingIndex, dwUserIndex, dwSocialNetworkID, pRequiredPermissions, m_pAccessKeyText, &( m_dwAccessKeyTextSize ), NULL );
+ dwResult = XShowNuiSocialGetUserToken( dwUserTrackingIndex, dwUserIndex, dwSocialNetworkID, pRequiredPermissions, m_pAccessKeyText, &( m_dwAccessKeyTextSize ), nullptr );
// If buffer for key text was not large enough, reallocate buffer that is large enough and try again.
if ( dwResult == ERROR_INSUFFICIENT_BUFFER )
{
delete [] m_pAccessKeyText;
m_pAccessKeyText = new wchar_t[ m_dwAccessKeyTextSize ];
- dwResult = XShowNuiSocialGetUserToken( dwUserTrackingIndex, dwUserIndex, dwSocialNetworkID, pRequiredPermissions, m_pAccessKeyText, &( m_dwAccessKeyTextSize ), NULL );
+ dwResult = XShowNuiSocialGetUserToken( dwUserTrackingIndex, dwUserIndex, dwSocialNetworkID, pRequiredPermissions, m_pAccessKeyText, &( m_dwAccessKeyTextSize ), nullptr );
}
}
else // using standard controller interface.
{
- dwResult = XShowSocialGetUserToken( dwUserIndex, dwSocialNetworkID, pRequiredPermissions, m_pAccessKeyText, &( m_dwAccessKeyTextSize ), NULL );
+ dwResult = XShowSocialGetUserToken( dwUserIndex, dwSocialNetworkID, pRequiredPermissions, m_pAccessKeyText, &( m_dwAccessKeyTextSize ), nullptr );
// If buffer for key text was not large enough, reallocate buffer that is large enough and try again.
if ( dwResult == ERROR_INSUFFICIENT_BUFFER )
{
delete [] m_pAccessKeyText;
m_pAccessKeyText = new wchar_t[ m_dwAccessKeyTextSize ];
- dwResult = XShowSocialGetUserToken( dwUserIndex, dwSocialNetworkID, pRequiredPermissions, m_pAccessKeyText, &( m_dwAccessKeyTextSize ), NULL );
+ dwResult = XShowSocialGetUserToken( dwUserIndex, dwSocialNetworkID, pRequiredPermissions, m_pAccessKeyText, &( m_dwAccessKeyTextSize ), nullptr );
}
}
}
else // we are trying to obtain cached user access key.
{
- dwResult = XSocialGetUserToken( dwUserIndex, dwSocialNetworkID, pRequiredPermissions, m_pAccessKeyText, &( m_dwAccessKeyTextSize ), NULL );
+ dwResult = XSocialGetUserToken( dwUserIndex, dwSocialNetworkID, pRequiredPermissions, m_pAccessKeyText, &( m_dwAccessKeyTextSize ), nullptr );
// If buffer for key text was not large enough, reallocate buffer that is large enough and try again.
if ( dwResult == ERROR_INSUFFICIENT_BUFFER )
{
delete [] m_pAccessKeyText;
m_pAccessKeyText = new wchar_t[ m_dwAccessKeyTextSize ];
- dwResult = XSocialGetUserToken( dwUserIndex, dwSocialNetworkID, pRequiredPermissions, m_pAccessKeyText, &( m_dwAccessKeyTextSize ), NULL );
+ dwResult = XSocialGetUserToken( dwUserIndex, dwSocialNetworkID, pRequiredPermissions, m_pAccessKeyText, &( m_dwAccessKeyTextSize ), nullptr );
}
}