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:
@@ -26,9 +26,9 @@ WCHAR *CScene_SkinSelect::wchDefaultNamesA[]=
|
||||
//----------------------------------------------------------------------------------
|
||||
HRESULT CScene_SkinSelect::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
|
||||
{
|
||||
m_iPad=*static_cast<int *>(pInitData->pvInitData);
|
||||
m_iPad=*(int *)pInitData->pvInitData;
|
||||
// if we're not in the game, we need to use basescene 0
|
||||
bool bNotInGame=(Minecraft::GetInstance()->level==nullptr);
|
||||
bool bNotInGame=(Minecraft::GetInstance()->level==NULL);
|
||||
m_bIgnoreInput=false;
|
||||
|
||||
// 4J Stu - Added this so that we have skins loaded
|
||||
@@ -46,7 +46,7 @@ HRESULT CScene_SkinSelect::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
|
||||
m_skinIndex = 0;
|
||||
m_currentSkinPath = app.GetPlayerSkinName(m_iPad);
|
||||
m_originalSkinId = app.GetPlayerSkinId(m_iPad);
|
||||
m_currentPack = nullptr;
|
||||
m_currentPack = NULL;
|
||||
m_bSlidingSkins = false;
|
||||
m_bAnimatingMove = false;
|
||||
currentPackCount = 0;
|
||||
@@ -86,7 +86,7 @@ HRESULT CScene_SkinSelect::OnInit( XUIMessageInit* pInitData, BOOL& bHandled )
|
||||
// Change to display the favorites if there are any. The current skin will be in there (probably) - need to check for it
|
||||
m_currentPack = app.m_dlcManager.getPackContainingSkin(m_currentSkinPath);
|
||||
bool bFound;
|
||||
if(m_currentPack != nullptr)
|
||||
if(m_currentPack != NULL)
|
||||
{
|
||||
m_packIndex = app.m_dlcManager.getPackIndex(m_currentPack,bFound,DLCManager::e_DLCType_Skin) + SKIN_SELECT_MAX_DEFAULTS;
|
||||
}
|
||||
@@ -232,7 +232,7 @@ HRESULT CScene_SkinSelect::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle
|
||||
}
|
||||
break;
|
||||
default:
|
||||
if( m_currentPack != nullptr )
|
||||
if( m_currentPack != NULL )
|
||||
{
|
||||
DLCSkinFile *skinFile = m_currentPack->getSkinFile(m_skinIndex);
|
||||
|
||||
@@ -266,7 +266,7 @@ HRESULT CScene_SkinSelect::OnKeyDown(XUIMessageInput* pInputData, BOOL& rfHandle
|
||||
DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(m_currentPack->getPurchaseOfferId());
|
||||
ULONGLONG ullOfferID_Full;
|
||||
|
||||
if(pDLCInfo!=nullptr)
|
||||
if(pDLCInfo!=NULL)
|
||||
{
|
||||
ullOfferID_Full=pDLCInfo->ullOfferID_Full;
|
||||
}
|
||||
@@ -626,8 +626,8 @@ void CScene_SkinSelect::handleSkinIndexChanged()
|
||||
wstring skinOrigin = L"";
|
||||
bool bSkinIsFree=false;
|
||||
bool bLicensed=false;
|
||||
DLCSkinFile *skinFile=nullptr;
|
||||
DLCPack *Pack=nullptr;
|
||||
DLCSkinFile *skinFile=NULL;
|
||||
DLCPack *Pack=NULL;
|
||||
BYTE sidePreviewControlsL,sidePreviewControlsR;
|
||||
bool bNoSkinsToShow=false;
|
||||
|
||||
@@ -635,7 +635,7 @@ void CScene_SkinSelect::handleSkinIndexChanged()
|
||||
m_selectedGroup.SetShow( FALSE );
|
||||
m_skinDetails.SetShow( FALSE );
|
||||
|
||||
if( m_currentPack != nullptr )
|
||||
if( m_currentPack != NULL )
|
||||
{
|
||||
skinFile = m_currentPack->getSkinFile(m_skinIndex);
|
||||
m_selectedSkinPath = skinFile->getPath();
|
||||
@@ -665,7 +665,7 @@ void CScene_SkinSelect::handleSkinIndexChanged()
|
||||
{
|
||||
m_selectedSkinPath = L"";
|
||||
m_selectedCapePath = L"";
|
||||
m_vAdditionalSkinBoxes = nullptr;
|
||||
m_vAdditionalSkinBoxes = NULL;
|
||||
|
||||
switch(m_packIndex)
|
||||
{
|
||||
@@ -753,13 +753,13 @@ void CScene_SkinSelect::handleSkinIndexChanged()
|
||||
{
|
||||
// add the boxes to the humanoid model, but only if we've not done this already
|
||||
vector<ModelPart *> *pAdditionalModelParts = app.GetAdditionalModelParts(skinFile->getSkinID());
|
||||
if(pAdditionalModelParts==nullptr)
|
||||
if(pAdditionalModelParts==NULL)
|
||||
{
|
||||
pAdditionalModelParts = app.SetAdditionalSkinBoxes(skinFile->getSkinID(),m_vAdditionalSkinBoxes);
|
||||
}
|
||||
}
|
||||
|
||||
if(skinFile!=nullptr)
|
||||
if(skinFile!=NULL)
|
||||
{
|
||||
app.SetAnimOverrideBitmask(skinFile->getSkinID(),skinFile->getAnimOverrideBitmask());
|
||||
}
|
||||
@@ -774,7 +774,7 @@ void CScene_SkinSelect::handleSkinIndexChanged()
|
||||
|
||||
wstring otherSkinPath = L"";
|
||||
wstring otherCapePath = L"";
|
||||
vector<SKIN_BOX *> *othervAdditionalSkinBoxes=nullptr;
|
||||
vector<SKIN_BOX *> *othervAdditionalSkinBoxes=NULL;
|
||||
wchar_t chars[256];
|
||||
|
||||
// turn off all displays
|
||||
@@ -820,10 +820,10 @@ void CScene_SkinSelect::handleSkinIndexChanged()
|
||||
{
|
||||
if(showNext)
|
||||
{
|
||||
skinFile=nullptr;
|
||||
skinFile=NULL;
|
||||
m_previewNextControls[i]->SetShow(TRUE);
|
||||
|
||||
if( m_currentPack != nullptr )
|
||||
if( m_currentPack != NULL )
|
||||
{
|
||||
skinFile = m_currentPack->getSkinFile(nextIndex);
|
||||
otherSkinPath = skinFile->getPath();
|
||||
@@ -835,7 +835,7 @@ void CScene_SkinSelect::handleSkinIndexChanged()
|
||||
{
|
||||
otherSkinPath = L"";
|
||||
otherCapePath = L"";
|
||||
othervAdditionalSkinBoxes=nullptr;
|
||||
othervAdditionalSkinBoxes=NULL;
|
||||
switch(m_packIndex)
|
||||
{
|
||||
case SKIN_SELECT_PACK_DEFAULT:
|
||||
@@ -867,13 +867,13 @@ void CScene_SkinSelect::handleSkinIndexChanged()
|
||||
if(othervAdditionalSkinBoxes && othervAdditionalSkinBoxes->size()!=0)
|
||||
{
|
||||
vector<ModelPart *> *pAdditionalModelParts = app.GetAdditionalModelParts(skinFile->getSkinID());
|
||||
if(pAdditionalModelParts==nullptr)
|
||||
if(pAdditionalModelParts==NULL)
|
||||
{
|
||||
pAdditionalModelParts = app.SetAdditionalSkinBoxes(skinFile->getSkinID(),othervAdditionalSkinBoxes);
|
||||
}
|
||||
}
|
||||
// 4J-PB - anim override needs set before SetTexture
|
||||
if(skinFile!=nullptr)
|
||||
if(skinFile!=NULL)
|
||||
{
|
||||
app.SetAnimOverrideBitmask(skinFile->getSkinID(),skinFile->getAnimOverrideBitmask());
|
||||
}
|
||||
@@ -892,10 +892,10 @@ void CScene_SkinSelect::handleSkinIndexChanged()
|
||||
{
|
||||
if(showPrevious)
|
||||
{
|
||||
skinFile=nullptr;
|
||||
skinFile=NULL;
|
||||
m_previewPreviousControls[i]->SetShow(TRUE);
|
||||
|
||||
if( m_currentPack != nullptr )
|
||||
if( m_currentPack != NULL )
|
||||
{
|
||||
skinFile = m_currentPack->getSkinFile(previousIndex);
|
||||
otherSkinPath = skinFile->getPath();
|
||||
@@ -907,7 +907,7 @@ void CScene_SkinSelect::handleSkinIndexChanged()
|
||||
{
|
||||
otherSkinPath = L"";
|
||||
otherCapePath = L"";
|
||||
othervAdditionalSkinBoxes=nullptr;
|
||||
othervAdditionalSkinBoxes=NULL;
|
||||
switch(m_packIndex)
|
||||
{
|
||||
case SKIN_SELECT_PACK_DEFAULT:
|
||||
@@ -939,7 +939,7 @@ void CScene_SkinSelect::handleSkinIndexChanged()
|
||||
if(othervAdditionalSkinBoxes && othervAdditionalSkinBoxes->size()!=0)
|
||||
{
|
||||
vector<ModelPart *> *pAdditionalModelParts = app.GetAdditionalModelParts(skinFile->getSkinID());
|
||||
if(pAdditionalModelParts==nullptr)
|
||||
if(pAdditionalModelParts==NULL)
|
||||
{
|
||||
pAdditionalModelParts = app.SetAdditionalSkinBoxes(skinFile->getSkinID(),othervAdditionalSkinBoxes);
|
||||
}
|
||||
@@ -957,7 +957,7 @@ void CScene_SkinSelect::handleSkinIndexChanged()
|
||||
}
|
||||
|
||||
// update the tooltips
|
||||
bool bNotInGame=(Minecraft::GetInstance()->level==nullptr);
|
||||
bool bNotInGame=(Minecraft::GetInstance()->level==NULL);
|
||||
|
||||
if(bNoSkinsToShow)
|
||||
{
|
||||
@@ -1001,10 +1001,10 @@ void CScene_SkinSelect::handlePackIndexChanged()
|
||||
}
|
||||
else
|
||||
{
|
||||
m_currentPack = nullptr;
|
||||
m_currentPack = NULL;
|
||||
}
|
||||
m_skinIndex = 0;
|
||||
if(m_currentPack != nullptr)
|
||||
if(m_currentPack != NULL)
|
||||
{
|
||||
bool found;
|
||||
DWORD currentSkinIndex = m_currentPack->getSkinIndexAt(m_currentSkinPath, found);
|
||||
@@ -1021,7 +1021,7 @@ void CScene_SkinSelect::handlePackIndexChanged()
|
||||
DWORD defaultSkinIndex = GET_DEFAULT_SKIN_ID_FROM_BITMASK(m_originalSkinId);
|
||||
if( ugcSkinIndex == 0 )
|
||||
{
|
||||
m_skinIndex = static_cast<EDefaultSkins>(defaultSkinIndex);
|
||||
m_skinIndex = (EDefaultSkins) defaultSkinIndex;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1199,7 +1199,7 @@ int CScene_SkinSelect::getNextSkinIndex(DWORD sourceIndex)
|
||||
{
|
||||
nextSkin = eDefaultSkins_ServerSelected;
|
||||
}
|
||||
else if(m_currentPack != nullptr && nextSkin>=m_currentPack->getSkinCount())
|
||||
else if(m_currentPack != NULL && nextSkin>=m_currentPack->getSkinCount())
|
||||
{
|
||||
nextSkin = 0;
|
||||
}
|
||||
@@ -1233,7 +1233,7 @@ int CScene_SkinSelect::getPreviousSkinIndex(DWORD sourceIndex)
|
||||
{
|
||||
previousSkin = eDefaultSkins_Count - 1;
|
||||
}
|
||||
else if(m_currentPack != nullptr)
|
||||
else if(m_currentPack != NULL)
|
||||
{
|
||||
previousSkin = m_currentPack->getSkinCount()-1;
|
||||
}
|
||||
@@ -1311,7 +1311,7 @@ void CScene_SkinSelect::updateClipping()
|
||||
|
||||
int CScene_SkinSelect::UnlockSkinReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
CScene_SkinSelect* pScene = static_cast<CScene_SkinSelect *>(pParam);
|
||||
CScene_SkinSelect* pScene = (CScene_SkinSelect*)pParam;
|
||||
#ifdef _XBOX
|
||||
if(result==C4JStorage::EMessage_ResultAccept)
|
||||
{
|
||||
@@ -1320,7 +1320,7 @@ int CScene_SkinSelect::UnlockSkinReturned(void *pParam,int iPad,C4JStorage::EMes
|
||||
ULONGLONG ullIndexA[1];
|
||||
DLC_INFO *pDLCInfo = app.GetDLCInfoForTrialOfferID(pScene->m_currentPack->getPurchaseOfferId());
|
||||
|
||||
if(pDLCInfo!=nullptr)
|
||||
if(pDLCInfo!=NULL)
|
||||
{
|
||||
ullIndexA[0]=pDLCInfo->ullOfferID_Full;
|
||||
}
|
||||
@@ -1330,13 +1330,13 @@ int CScene_SkinSelect::UnlockSkinReturned(void *pParam,int iPad,C4JStorage::EMes
|
||||
}
|
||||
|
||||
// If we're in-game, then we need to enable DLC downloads. They'll be set back to Auto on leaving the pause menu
|
||||
if(Minecraft::GetInstance()->level!=nullptr)
|
||||
if(Minecraft::GetInstance()->level!=NULL)
|
||||
{
|
||||
// need to allow downloads here, or the player would need to quit the game to let the download of a skin pack happen. This might affect the network traffic, since the download could take all the bandwidth...
|
||||
XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_ALWAYS_ALLOW);
|
||||
}
|
||||
|
||||
StorageManager.InstallOffer(1,ullIndexA,nullptr,nullptr);
|
||||
StorageManager.InstallOffer(1,ullIndexA,NULL,NULL);
|
||||
|
||||
// the license change coming in when the offer has been installed will cause this scene to refresh
|
||||
}
|
||||
@@ -1380,7 +1380,7 @@ HRESULT CScene_SkinSelect::OnCustomMessage_DLCMountingComplete()
|
||||
if(app.m_dlcManager.getPackCount(DLCManager::e_DLCType_Skin)>0)
|
||||
{
|
||||
m_currentPack = app.m_dlcManager.getPackContainingSkin(m_currentSkinPath);
|
||||
if(m_currentPack != nullptr)
|
||||
if(m_currentPack != NULL)
|
||||
{
|
||||
bool bFound = false;
|
||||
m_packIndex = app.m_dlcManager.getPackIndex(m_currentPack,bFound,DLCManager::e_DLCType_Skin) + SKIN_SELECT_MAX_DEFAULTS;
|
||||
@@ -1400,7 +1400,7 @@ HRESULT CScene_SkinSelect::OnCustomMessage_DLCMountingComplete()
|
||||
updateCurrentFocus();
|
||||
m_bIgnoreInput=false;
|
||||
app.m_dlcManager.checkForCorruptDLCAndAlert();
|
||||
bool bInGame=(Minecraft::GetInstance()->level!=nullptr);
|
||||
bool bInGame=(Minecraft::GetInstance()->level!=NULL);
|
||||
|
||||
if(bInGame) XBackgroundDownloadSetMode(XBACKGROUND_DOWNLOAD_MODE_AUTO);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user