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 a9be52c41a.
This commit is contained in:
Loki Rautio
2026-03-07 21:12:22 -06:00
parent a9be52c41a
commit 087b7e7abf
1373 changed files with 19449 additions and 19903 deletions

View File

@@ -82,7 +82,7 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay
m_bGameModeCreative = false;
m_iGameModeId = GameType::SURVIVAL->getId();
m_pDLCPack = nullptr;
m_pDLCPack = NULL;
m_bRebuildTouchBoxes = false;
m_bMultiplayerAllowed = ProfileManager.IsSignedInLive( m_iPad ) && ProfileManager.AllowedToPlayMultiplayer(m_iPad);
@@ -96,7 +96,7 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay
// #ifdef __PS3__
// if(ProfileManager.IsSignedInLive( m_iPad ))
// {
// ProfileManager.GetChatAndContentRestrictions(m_iPad,true,&bChatRestricted,&bContentRestricted,nullptr);
// ProfileManager.GetChatAndContentRestrictions(m_iPad,true,&bChatRestricted,&bContentRestricted,NULL);
// }
// #endif
@@ -184,7 +184,7 @@ UIScene_CreateWorldMenu::UIScene_CreateWorldMenu(int iPad, void *initData, UILay
#if TO_BE_IMPLEMENTED
// 4J-PB - there may be texture packs we don't have, so use the info from TMS for this
DLC_INFO *pDLCInfo=nullptr;
DLC_INFO *pDLCInfo=NULL;
// first pass - look to see if there are any that are not in the list
bool bTexturePackAlreadyListed;
@@ -289,6 +289,7 @@ void UIScene_CreateWorldMenu::tick()
{
UIScene::tick();
if(m_iSetTexturePackDescription >= 0 )
{
UpdateTexturePackDescription( m_iSetTexturePackDescription );
@@ -431,7 +432,7 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId)
//CD - Added for audio
ui.PlayUISFX(eSFX_Press);
switch(static_cast<int>(controlId))
switch((int)controlId)
{
case eControl_EditWorldName:
{
@@ -481,7 +482,7 @@ void UIScene_CreateWorldMenu::handlePress(F64 controlId, F64 childId)
break;
case eControl_TexturePackList:
{
UpdateCurrentTexturePack(static_cast<int>(childId));
UpdateCurrentTexturePack((int)childId);
}
break;
case eControl_NewWorld:
@@ -527,7 +528,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow()
// texture pack hasn't been set yet, so check what it will be
TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack);
if(pTexturePack==nullptr)
if(pTexturePack==NULL)
{
#if TO_BE_IMPLEMENTED
// They've selected a texture pack they don't have yet
@@ -577,7 +578,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow()
{
// texture pack hasn't been set yet, so check what it will be
TexturePack *pTexturePack = pMinecraft->skins->getTexturePackById(m_MoreOptionsParams.dwTexturePack);
DLCTexturePack *pDLCTexPack=static_cast<DLCTexturePack *>(pTexturePack);
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)pTexturePack;
m_pDLCPack=pDLCTexPack->getDLCInfoParentPack();
// do we have a license?
@@ -605,7 +606,7 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow()
DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(m_pDLCPack->getPurchaseOfferId());
ULONGLONG ullOfferID_Full;
if(pDLCInfo!=nullptr)
if(pDLCInfo!=NULL)
{
ullOfferID_Full=pDLCInfo->ullOfferID_Full;
}
@@ -648,8 +649,8 @@ void UIScene_CreateWorldMenu::StartSharedLaunchFlow()
void UIScene_CreateWorldMenu::handleSliderMove(F64 sliderId, F64 currentValue)
{
WCHAR TempString[256];
int value = static_cast<int>(currentValue);
switch(static_cast<int>(sliderId))
int value = (int)currentValue;
switch((int)sliderId)
{
case eControl_Difficulty:
m_sliderDifficulty.handleSliderMove(value);
@@ -724,7 +725,7 @@ void UIScene_CreateWorldMenu::handleTimerComplete(int id)
if(m_iConfigA[i]!=-1)
{
DWORD dwBytes=0;
PBYTE pbData=nullptr;
PBYTE pbData=NULL;
//app.DebugPrintf("Retrieving iConfig %d from TPD\n",m_iConfigA[i]);
app.GetTPD(m_iConfigA[i],&pbData,&dwBytes);
@@ -733,7 +734,7 @@ void UIScene_CreateWorldMenu::handleTimerComplete(int id)
if(dwBytes > 0 && pbData)
{
DWORD dwImageBytes=0;
PBYTE pbImageData=nullptr;
PBYTE pbImageData=NULL;
app.GetFileFromTPD(eTPDFileType_Icon,pbData,dwBytes,&pbImageData,&dwImageBytes );
ListInfo.fEnabled = TRUE;
@@ -763,7 +764,7 @@ void UIScene_CreateWorldMenu::handleGainFocus(bool navBack)
int UIScene_CreateWorldMenu::KeyboardCompleteWorldNameCallback(LPVOID lpParam,bool bRes)
{
UIScene_CreateWorldMenu *pClass=static_cast<UIScene_CreateWorldMenu *>(lpParam);
UIScene_CreateWorldMenu *pClass=(UIScene_CreateWorldMenu *)lpParam;
pClass->m_bIgnoreInput=false;
// 4J HEG - No reason to set value if keyboard was cancelled
if (bRes)
@@ -890,7 +891,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
// MGH - added this so we don't try and upsell when we don't know if the player has PS Plus yet (if it can't connect to the PS Plus server).
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), nullptr, nullptr);
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL);
return;
}
@@ -910,7 +911,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
// UINT uiIDA[2];
// uiIDA[0]=IDS_PLAY_OFFLINE;
// uiIDA[1]=IDS_PLAYSTATIONPLUS_SIGNUP;
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_CreateWorldMenu::PSPlusReturned,this, app.GetStringTable(),nullptr,0,false);
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_CreateWorldMenu::PSPlusReturned,this, app.GetStringTable(),NULL,0,false);
return;
}
}
@@ -950,7 +951,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
#if defined(__PS3__) || defined(__PSVITA__)
if(isOnlineGame && isSignedInLive)
{
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,nullptr,&bContentRestricted,nullptr);
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,NULL,&bContentRestricted,NULL);
}
#endif
@@ -979,7 +980,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
// MGH - added this so we don't try and upsell when we don't know if the player has PS Plus yet (if it can't connect to the PS Plus server).
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), nullptr, nullptr);
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL);
return;
}
@@ -997,7 +998,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
// UINT uiIDA[2];
// uiIDA[0]=IDS_PLAY_OFFLINE;
// uiIDA[1]=IDS_PLAYSTATIONPLUS_SIGNUP;
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_CreateWorldMenu::PSPlusReturned,this, app.GetStringTable(),nullptr,0,false);
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_CreateWorldMenu::PSPlusReturned,this, app.GetStringTable(),NULL,0,false);
}
#endif
@@ -1039,7 +1040,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
// MGH - added this so we don't try and upsell when we don't know if the player has PS Plus yet (if it can't connect to the PS Plus server).
UINT uiIDA[1];
uiIDA[0]=IDS_OK;
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), nullptr, nullptr);
ui.RequestAlertMessage(IDS_ERROR_NETWORK_TITLE, IDS_ERROR_NETWORK, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL);
return;
}
@@ -1061,7 +1062,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
// UINT uiIDA[2];
// uiIDA[0]=IDS_PLAY_OFFLINE;
// uiIDA[1]=IDS_PLAYSTATIONPLUS_SIGNUP;
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_CreateWorldMenu::PSPlusReturned,this, app.GetStringTable(),nullptr,0,false);
// ui.RequestMessageBox( IDS_FAILED_TO_CREATE_GAME_TITLE, IDS_NO_PLAYSTATIONPLUS, uiIDA,2,ProfileManager.GetPrimaryPad(),&UIScene_CreateWorldMenu::PSPlusReturned,this, app.GetStringTable(),NULL,0,false);
}
#endif
@@ -1071,7 +1072,7 @@ void UIScene_CreateWorldMenu::checkStateAndStartGame()
if(isOnlineGame)
{
bool chatRestricted = false;
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,nullptr,nullptr);
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,NULL,NULL);
if(chatRestricted)
{
ProfileManager.DisplaySystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_CHAT_RESTRICTION, ProfileManager.GetPrimaryPad() );
@@ -1135,7 +1136,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD
if (wSeed.length() != 0)
{
int64_t value = 0;
unsigned int len = static_cast<unsigned int>(wSeed.length());
unsigned int len = (unsigned int)wSeed.length();
//Check if the input string contains a numerical value
bool isNumber = true;
@@ -1173,7 +1174,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD
param->seed = seedValue;
param->saveData = nullptr;
param->saveData = NULL;
param->texturePackId = pClass->m_MoreOptionsParams.dwTexturePack;
Minecraft *pMinecraft = Minecraft::GetInstance();
@@ -1209,8 +1210,8 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD
app.SetGameHostOption(eGameHostOption_WasntSaveOwner, false);
#ifdef _LARGE_WORLDS
app.SetGameHostOption(eGameHostOption_WorldSize, pClass->m_MoreOptionsParams.worldSize+1 ); // 0 is GAME_HOST_OPTION_WORLDSIZE_UNKNOWN
pClass->m_MoreOptionsParams.currentWorldSize = static_cast<EGameHostOptionWorldSize>(pClass->m_MoreOptionsParams.worldSize + 1);
pClass->m_MoreOptionsParams.newWorldSize = static_cast<EGameHostOptionWorldSize>(pClass->m_MoreOptionsParams.worldSize + 1);
pClass->m_MoreOptionsParams.currentWorldSize = (EGameHostOptionWorldSize)(pClass->m_MoreOptionsParams.worldSize+1);
pClass->m_MoreOptionsParams.newWorldSize = (EGameHostOptionWorldSize)(pClass->m_MoreOptionsParams.worldSize+1);
#endif
g_NetworkManager.HostGame(dwLocalUsersMask,isClientSide,isPrivate,MINECRAFT_NET_MAX_PLAYERS,0);
@@ -1252,7 +1253,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD
LoadingInputParams *loadingParams = new LoadingInputParams();
loadingParams->func = &CGameNetworkManager::RunNetworkGameThreadProc;
loadingParams->lpParam = static_cast<LPVOID>(param);
loadingParams->lpParam = (LPVOID)param;
// Reset the autosave time
app.SetAutosaveTimerTime();
@@ -1270,7 +1271,7 @@ void UIScene_CreateWorldMenu::CreateGame(UIScene_CreateWorldMenu* pClass, DWORD
int UIScene_CreateWorldMenu::StartGame_SignInReturned(void *pParam,bool bContinue, int iPad)
{
UIScene_CreateWorldMenu* pClass = static_cast<UIScene_CreateWorldMenu *>(pParam);
UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu*)pParam;
if(bContinue==true)
{
@@ -1378,7 +1379,7 @@ int UIScene_CreateWorldMenu::StartGame_SignInReturned(void *pParam,bool bContinu
int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
{
UIScene_CreateWorldMenu* pClass = static_cast<UIScene_CreateWorldMenu *>(pParam);
UIScene_CreateWorldMenu* pClass = (UIScene_CreateWorldMenu*)pParam;
if(result==C4JStorage::EMessage_ResultAccept)
{
@@ -1431,7 +1432,7 @@ int UIScene_CreateWorldMenu::ConfirmCreateReturned(void *pParam,int iPad,C4JStor
if(isOnlineGame)
{
bool chatRestricted = false;
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,nullptr,nullptr);
ProfileManager.GetChatAndContentRestrictions(ProfileManager.GetPrimaryPad(),false,&chatRestricted,NULL,NULL);
if(chatRestricted)
{
ProfileManager.DisplaySystemMessage( SCE_MSG_DIALOG_SYSMSG_TYPE_TRC_PSN_CHAT_RESTRICTION, ProfileManager.GetPrimaryPad() );