From 087b7e7abfe81dd7f0fdcdea36ac9f245950df1a Mon Sep 17 00:00:00 2001 From: Loki Rautio Date: Sat, 7 Mar 2026 21:12:22 -0600 Subject: Revert "Project modernization (#630)" This code was not tested and breaks in Release builds, reverting to restore functionality of the nightly. All in-game menus do not work and generating a world crashes. This reverts commit a9be52c41a02d207233199e98898fe7483d7e817. --- Minecraft.Client/Common/XUI/XUI_DebugOverlay.cpp | 42 ++++++++++++------------ 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'Minecraft.Client/Common/XUI/XUI_DebugOverlay.cpp') diff --git a/Minecraft.Client/Common/XUI/XUI_DebugOverlay.cpp b/Minecraft.Client/Common/XUI/XUI_DebugOverlay.cpp index 338eb853..e6db6a80 100644 --- a/Minecraft.Client/Common/XUI/XUI_DebugOverlay.cpp +++ b/Minecraft.Client/Common/XUI/XUI_DebugOverlay.cpp @@ -37,7 +37,7 @@ HRESULT CScene_DebugOverlay::OnInit( XUIMessageInit *pInitData, BOOL &bHandled ) for(unsigned int i = 0; i < Item::items.length; ++i) { - if(Item::items[i] != nullptr) + if(Item::items[i] != NULL) { //m_items.InsertItems(m_items.GetItemCount(),1); m_itemIds.push_back(i); @@ -102,7 +102,7 @@ HRESULT CScene_DebugOverlay::OnInit( XUIMessageInit *pInitData, BOOL &bHandled ) Minecraft *pMinecraft = Minecraft::GetInstance(); m_setTime.SetValue( pMinecraft->level->getLevelData()->getTime() % 24000 ); - m_setFov.SetValue( static_cast(pMinecraft->gameRenderer->GetFovVal())); + m_setFov.SetValue( (int)pMinecraft->gameRenderer->GetFovVal()); XuiSetTimer(m_hObj,0,DEBUG_OVERLAY_UPDATE_TIME_PERIOD); @@ -148,7 +148,7 @@ HRESULT CScene_DebugOverlay::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress /*else if( hObjPressed == m_saveToDisc ) // 4J-JEV: Doesn't look like we use this debug option anymore. { #ifndef _CONTENT_PACKAGE - pMinecraft->level->save(true, nullptr); + pMinecraft->level->save(true, NULL); int radius; m_chunkRadius.GetValue(&radius); @@ -166,7 +166,7 @@ HRESULT CScene_DebugOverlay::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress { #ifndef _CONTENT_PACKAGE // load from the .xzp file - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(nullptr); + const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); HXUIOBJ hScene; HRESULT hr; @@ -175,7 +175,7 @@ HRESULT CScene_DebugOverlay::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress WCHAR szResourceLocator[ LOCATOR_SIZE ]; swprintf(szResourceLocator, LOCATOR_SIZE, L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/"); - hr = XuiSceneCreate(szResourceLocator,app.GetSceneName(eUIScene_DebugCreateSchematic,false, false), nullptr, &hScene); + hr = XuiSceneCreate(szResourceLocator,app.GetSceneName(eUIScene_DebugCreateSchematic,false, false), NULL, &hScene); this->NavigateForward(hScene); //app.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_DebugCreateSchematic); #endif @@ -184,7 +184,7 @@ HRESULT CScene_DebugOverlay::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress { #ifndef _CONTENT_PACKAGE // load from the .xzp file - const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(nullptr); + const ULONG_PTR c_ModuleHandle = (ULONG_PTR)GetModuleHandle(NULL); HXUIOBJ hScene; HRESULT hr; @@ -193,7 +193,7 @@ HRESULT CScene_DebugOverlay::OnNotifyPressEx(HXUIOBJ hObjPressed, XUINotifyPress WCHAR szResourceLocator[ LOCATOR_SIZE ]; swprintf(szResourceLocator, LOCATOR_SIZE, L"section://%X,%ls#%ls",c_ModuleHandle,L"media", L"media/"); - hr = XuiSceneCreate(szResourceLocator,app.GetSceneName(eUIScene_DebugSetCamera, false, false), nullptr, &hScene); + hr = XuiSceneCreate(szResourceLocator,app.GetSceneName(eUIScene_DebugSetCamera, false, false), NULL, &hScene); this->NavigateForward(hScene); //app.NavigateToScene(ProfileManager.GetPrimaryPad(),eUIScene_DebugCreateSchematic); #endif @@ -266,7 +266,7 @@ HRESULT CScene_DebugOverlay::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotify if( hObjSource == m_setFov ) { Minecraft *pMinecraft = Minecraft::GetInstance(); - pMinecraft->gameRenderer->SetFovVal(static_cast(pNotifyValueChangedData->nValue)); + pMinecraft->gameRenderer->SetFovVal((float)pNotifyValueChangedData->nValue); } return S_OK; } @@ -274,10 +274,10 @@ HRESULT CScene_DebugOverlay::OnNotifyValueChanged( HXUIOBJ hObjSource, XUINotify HRESULT CScene_DebugOverlay::OnTimer( XUIMessageTimer *pTimer, BOOL& bHandled ) { Minecraft *pMinecraft = Minecraft::GetInstance(); - if(pMinecraft->level != nullptr) + if(pMinecraft->level != NULL) { m_setTime.SetValue( pMinecraft->level->getLevelData()->getTime() % 24000 ); - m_setFov.SetValue( static_cast(pMinecraft->gameRenderer->GetFovVal())); + m_setFov.SetValue( (int)pMinecraft->gameRenderer->GetFovVal()); } return S_OK; } @@ -286,9 +286,9 @@ void CScene_DebugOverlay::SetSpawnToPlayerPos() { Minecraft *pMinecraft = Minecraft::GetInstance(); - pMinecraft->level->getLevelData()->setXSpawn(static_cast(pMinecraft->player->x)); - pMinecraft->level->getLevelData()->setYSpawn(static_cast(pMinecraft->player->y)); - pMinecraft->level->getLevelData()->setZSpawn(static_cast(pMinecraft->player->z)); + pMinecraft->level->getLevelData()->setXSpawn((int)pMinecraft->player->x); + pMinecraft->level->getLevelData()->setYSpawn((int)pMinecraft->player->y); + pMinecraft->level->getLevelData()->setZSpawn((int)pMinecraft->player->z); } #ifndef _CONTENT_PACKAGE @@ -301,14 +301,14 @@ void CScene_DebugOverlay::SaveLimitedFile(int chunkRadius) ConsoleSaveFile *currentSave = pMinecraft->level->getLevelStorage()->getSaveFile(); // With a size of 0 but a value in the data pointer we should create a new save - ConsoleSaveFileOriginal newSave( currentSave->getFilename(), nullptr, 0, true ); + ConsoleSaveFileOriginal newSave( currentSave->getFilename(), NULL, 0, true ); // TODO Make this only happen for the new save //SetSpawnToPlayerPos(); FileEntry *origFileEntry = currentSave->createFile( wstring( L"level.dat" ) ); byteArray levelData( origFileEntry->getFileSize() ); DWORD bytesRead; - currentSave->setFilePointer(origFileEntry,0,nullptr,FILE_BEGIN); + currentSave->setFilePointer(origFileEntry,0,NULL,FILE_BEGIN); currentSave->readFile( origFileEntry, levelData.data, // data buffer @@ -331,10 +331,10 @@ void CScene_DebugOverlay::SaveLimitedFile(int chunkRadius) { for(int zPos = playerChunkZ - chunkRadius; zPos < playerChunkZ + chunkRadius; ++zPos) { - CompoundTag *chunkData=nullptr; + CompoundTag *chunkData=NULL; DataInputStream *is = RegionFileCache::getChunkDataInputStream(currentSave, L"", xPos, zPos); - if (is != nullptr) + if (is != NULL) { chunkData = NbtIo::read((DataInput *)is); is->deleteChildStream(); @@ -342,7 +342,7 @@ void CScene_DebugOverlay::SaveLimitedFile(int chunkRadius) } app.DebugPrintf("Processing chunk (%d, %d)\n", xPos, zPos); DataOutputStream *os = getChunkDataOutputStream(newFileCache, &newSave, L"", xPos, zPos); - if(os != nullptr) + if(os != NULL) { NbtIo::write(chunkData, os); os->close(); @@ -352,7 +352,7 @@ void CScene_DebugOverlay::SaveLimitedFile(int chunkRadius) os->deleteChildStream(); delete os; } - if(chunkData != nullptr) + if(chunkData != NULL) { delete chunkData; } @@ -367,13 +367,13 @@ RegionFile *CScene_DebugOverlay::getRegionFile(unordered_map>5) + L"." + std::to_wstring(chunkZ>>5) + L".mcr" ); - RegionFile *ref = nullptr; + RegionFile *ref = NULL; auto it = newFileCache.find(file); if( it != newFileCache.end() ) ref = it->second; // 4J Jev, put back in. - if (ref != nullptr) + if (ref != NULL) { return ref; } -- cgit v1.2.3