From a9be52c41a02d207233199e98898fe7483d7e817 Mon Sep 17 00:00:00 2001 From: ModMaker101 <119018978+ModMaker101@users.noreply.github.com> Date: Sat, 7 Mar 2026 21:56:03 -0500 Subject: 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 --- Minecraft.Client/Common/XUI/XUI_FullscreenProgress.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'Minecraft.Client/Common/XUI/XUI_FullscreenProgress.cpp') diff --git a/Minecraft.Client/Common/XUI/XUI_FullscreenProgress.cpp b/Minecraft.Client/Common/XUI/XUI_FullscreenProgress.cpp index f66c0d70..cc235915 100644 --- a/Minecraft.Client/Common/XUI/XUI_FullscreenProgress.cpp +++ b/Minecraft.Client/Common/XUI/XUI_FullscreenProgress.cpp @@ -18,7 +18,7 @@ HRESULT CScene_FullscreenProgress::OnInit( XUIMessageInit* pInitData, BOOL& bHan m_buttonConfirm.SetText( app.GetString( IDS_CONFIRM_OK ) ); - LoadingInputParams *params = (LoadingInputParams *)pInitData->pvInitData; + LoadingInputParams *params = static_cast(pInitData->pvInitData); m_CompletionData = params->completionData; m_iPad=params->completionData->iPad; @@ -67,10 +67,10 @@ HRESULT CScene_FullscreenProgress::OnInit( XUIMessageInit* pInitData, BOOL& bHan // The framework calls this handler when the object is to be destroyed. HRESULT CScene_FullscreenProgress::OnDestroy() { - if( thread != NULL && thread != INVALID_HANDLE_VALUE ) + if( thread != nullptr && thread != INVALID_HANDLE_VALUE ) delete thread; - if( m_CompletionData != NULL ) + if( m_CompletionData != nullptr ) delete m_CompletionData; return S_OK; @@ -86,7 +86,7 @@ HRESULT CScene_FullscreenProgress::OnKeyDown(XUIMessageInput* pInputData, BOOL& case VK_PAD_B: case VK_ESCAPE: // 4J-JEV: Fix for Xbox360 #162749 - TU17: Save Upload: Content: UI: Player is presented with non-functional Tooltips after the Upload Save For Xbox One is completed. - if( m_cancelFunc != NULL && !m_threadCompleted ) + if( m_cancelFunc != nullptr && !m_threadCompleted ) { m_cancelFunc( m_cancelFuncParam ); m_bWasCancelled=true; @@ -201,7 +201,7 @@ HRESULT CScene_FullscreenProgress::OnTransitionStart( XUIMessageTransition *pTra HRESULT CScene_FullscreenProgress::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) { int code = thread->GetExitCode(); - DWORD exitcode = *((DWORD *)&code); + DWORD exitcode = *static_cast(&code); //app.DebugPrintf("CScene_FullscreenProgress Timer %d\n",pTimer->nId); @@ -244,7 +244,7 @@ HRESULT CScene_FullscreenProgress::OnTimer( XUIMessageTimer *pTimer, BOOL& bHand UINT uiIDA[1]; uiIDA[0]=IDS_CONFIRM_OK; - StorageManager.RequestMessageBox( IDS_CONNECTION_FAILED, IDS_CONNECTION_LOST_SERVER, uiIDA,1,ProfileManager.GetPrimaryPad(),NULL,NULL, app.GetStringTable()); + StorageManager.RequestMessageBox( IDS_CONNECTION_FAILED, IDS_CONNECTION_LOST_SERVER, uiIDA,1,ProfileManager.GetPrimaryPad(),nullptr,nullptr, app.GetStringTable()); app.NavigateToHomeMenu(); ui.UpdatePlayerBasePositions(); @@ -292,7 +292,7 @@ HRESULT CScene_FullscreenProgress::OnTimer( XUIMessageTimer *pTimer, BOOL& bHand CXuiSceneBase::ShowOtherPlayersBaseScene(iPad, true); // This just allows it to be shown Minecraft *pMinecraft = Minecraft::GetInstance(); - if(pMinecraft->localgameModes[ProfileManager.GetPrimaryPad()] != NULL) pMinecraft->localgameModes[ProfileManager.GetPrimaryPad()]->getTutorial()->showTutorialPopup(true); + if(pMinecraft->localgameModes[ProfileManager.GetPrimaryPad()] != nullptr) pMinecraft->localgameModes[ProfileManager.GetPrimaryPad()]->getTutorial()->showTutorialPopup(true); ui.UpdatePlayerBasePositions(); } break; -- cgit v1.2.3