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:
@@ -39,7 +39,7 @@ CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp()
|
||||
// debugOverlayCreated = false;
|
||||
// #endif
|
||||
|
||||
m_ProductListA=nullptr;
|
||||
m_ProductListA=NULL;
|
||||
|
||||
m_pRemoteStorage = new SonyRemoteStorage_Orbis;
|
||||
|
||||
@@ -106,7 +106,7 @@ SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle)
|
||||
{
|
||||
app.DebugPrintf("Couldn't find DLC info for %s\n", pchTitle);
|
||||
assert(0);
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
return it->second;
|
||||
}
|
||||
@@ -124,7 +124,7 @@ SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfoFromKeyname(char *pchKeyName)
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#define WRAPPED_READFILE(hFile,lpBuffer,nNumberOfBytesToRead,lpNumberOfBytesRead,lpOverlapped) {if(ReadFile(hFile,lpBuffer,nNumberOfBytesToRead,lpNumberOfBytesRead,lpOverlapped)==FALSE) { return FALSE;}}
|
||||
@@ -133,8 +133,8 @@ BOOL CConsoleMinecraftApp::ReadProductCodes()
|
||||
char chDLCTitle[64];
|
||||
|
||||
// 4J-PB - Read the file containing the product codes. This will be different for the SCEE/SCEA/SCEJ builds
|
||||
//HANDLE file = CreateFile("orbis/DLCImages/TP01_360x360.png", GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
HANDLE file = CreateFile("orbis/PS4ProductCodes.bin", GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
//HANDLE file = CreateFile("orbis/DLCImages/TP01_360x360.png", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
HANDLE file = CreateFile("orbis/PS4ProductCodes.bin", GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if( file == INVALID_HANDLE_VALUE )
|
||||
{
|
||||
DWORD error = GetLastError();
|
||||
@@ -149,12 +149,12 @@ BOOL CConsoleMinecraftApp::ReadProductCodes()
|
||||
{
|
||||
DWORD bytesRead;
|
||||
|
||||
WRAPPED_READFILE(file,ProductCodes.chProductCode,PRODUCT_CODE_SIZE,&bytesRead,nullptr);
|
||||
WRAPPED_READFILE(file,ProductCodes.chSaveFolderPrefix,SAVEFOLDERPREFIX_SIZE,&bytesRead,nullptr);
|
||||
WRAPPED_READFILE(file,ProductCodes.chCommerceCategory,COMMERCE_CATEGORY_SIZE,&bytesRead,nullptr);
|
||||
WRAPPED_READFILE(file,ProductCodes.chTexturePackID,SCE_NP_COMMERCE2_CATEGORY_ID_LEN,&bytesRead,nullptr);
|
||||
WRAPPED_READFILE(file,ProductCodes.chUpgradeKey,UPGRADE_KEY_SIZE,&bytesRead,nullptr);
|
||||
WRAPPED_READFILE(file,ProductCodes.chSkuPostfix,SKU_POSTFIX_SIZE,&bytesRead,nullptr);
|
||||
WRAPPED_READFILE(file,ProductCodes.chProductCode,PRODUCT_CODE_SIZE,&bytesRead,NULL);
|
||||
WRAPPED_READFILE(file,ProductCodes.chSaveFolderPrefix,SAVEFOLDERPREFIX_SIZE,&bytesRead,NULL);
|
||||
WRAPPED_READFILE(file,ProductCodes.chCommerceCategory,COMMERCE_CATEGORY_SIZE,&bytesRead,NULL);
|
||||
WRAPPED_READFILE(file,ProductCodes.chTexturePackID,SCE_NP_COMMERCE2_CATEGORY_ID_LEN,&bytesRead,NULL);
|
||||
WRAPPED_READFILE(file,ProductCodes.chUpgradeKey,UPGRADE_KEY_SIZE,&bytesRead,NULL);
|
||||
WRAPPED_READFILE(file,ProductCodes.chSkuPostfix,SKU_POSTFIX_SIZE,&bytesRead,NULL);
|
||||
|
||||
app.DebugPrintf("ProductCodes.chProductCode %s\n",ProductCodes.chProductCode);
|
||||
app.DebugPrintf("ProductCodes.chSaveFolderPrefix %s\n",ProductCodes.chSaveFolderPrefix);
|
||||
@@ -165,7 +165,7 @@ BOOL CConsoleMinecraftApp::ReadProductCodes()
|
||||
|
||||
// DLC
|
||||
unsigned int uiDLC;
|
||||
WRAPPED_READFILE(file,&uiDLC,sizeof(int),&bytesRead,nullptr);
|
||||
WRAPPED_READFILE(file,&uiDLC,sizeof(int),&bytesRead,NULL);
|
||||
|
||||
for(unsigned int i=0;i<uiDLC;i++)
|
||||
{
|
||||
@@ -174,20 +174,20 @@ BOOL CConsoleMinecraftApp::ReadProductCodes()
|
||||
memset(chDLCTitle,0,64);
|
||||
|
||||
unsigned int uiVal;
|
||||
WRAPPED_READFILE(file,&uiVal,sizeof(int),&bytesRead,nullptr);
|
||||
WRAPPED_READFILE(file,pDLCInfo->chDLCKeyname,sizeof(char)*uiVal,&bytesRead,nullptr);
|
||||
WRAPPED_READFILE(file,&uiVal,sizeof(int),&bytesRead,NULL);
|
||||
WRAPPED_READFILE(file,pDLCInfo->chDLCKeyname,sizeof(char)*uiVal,&bytesRead,NULL);
|
||||
|
||||
WRAPPED_READFILE(file,&uiVal,sizeof(int),&bytesRead,nullptr);
|
||||
WRAPPED_READFILE(file,chDLCTitle,sizeof(char)*uiVal,&bytesRead,nullptr);
|
||||
WRAPPED_READFILE(file,&uiVal,sizeof(int),&bytesRead,NULL);
|
||||
WRAPPED_READFILE(file,chDLCTitle,sizeof(char)*uiVal,&bytesRead,NULL);
|
||||
app.DebugPrintf("DLC title %s\n",chDLCTitle);
|
||||
|
||||
WRAPPED_READFILE(file,&pDLCInfo->eDLCType,sizeof(int),&bytesRead,nullptr);
|
||||
WRAPPED_READFILE(file,&pDLCInfo->eDLCType,sizeof(int),&bytesRead,NULL);
|
||||
|
||||
WRAPPED_READFILE(file,&uiVal,sizeof(int),&bytesRead,nullptr);
|
||||
WRAPPED_READFILE(file,pDLCInfo->chDLCPicname,sizeof(char)*uiVal,&bytesRead,nullptr);
|
||||
WRAPPED_READFILE(file,&uiVal,sizeof(int),&bytesRead,NULL);
|
||||
WRAPPED_READFILE(file,pDLCInfo->chDLCPicname,sizeof(char)*uiVal,&bytesRead,NULL);
|
||||
|
||||
WRAPPED_READFILE(file,&pDLCInfo->iFirstSkin,sizeof(int),&bytesRead,nullptr);
|
||||
WRAPPED_READFILE(file,&pDLCInfo->iConfig,sizeof(int),&bytesRead,nullptr);
|
||||
WRAPPED_READFILE(file,&pDLCInfo->iFirstSkin,sizeof(int),&bytesRead,NULL);
|
||||
WRAPPED_READFILE(file,&pDLCInfo->iConfig,sizeof(int),&bytesRead,NULL);
|
||||
|
||||
// push this into a vector
|
||||
|
||||
@@ -310,7 +310,7 @@ void CConsoleMinecraftApp::FreeLocalDLCImages()
|
||||
{
|
||||
free(pDLCInfo->pbImageData);
|
||||
pDLCInfo->dwImageBytes=0;
|
||||
pDLCInfo->pbImageData=nullptr;
|
||||
pDLCInfo->pbImageData=NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -323,7 +323,7 @@ int CConsoleMinecraftApp::LoadLocalDLCImage(SONYDLC *pDLCInfo)
|
||||
|
||||
sprintf(pchFilename,"orbis/DLCImages/%s_360x360.png",pDLCInfo->chDLCPicname);
|
||||
// 4J-PB - Read the file containing the product codes. This will be different for the SCEE/SCEA/SCEJ builds
|
||||
HANDLE hFile = CreateFile(pchFilename, GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
HANDLE hFile = CreateFile(pchFilename, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
|
||||
if( hFile == INVALID_HANDLE_VALUE )
|
||||
{
|
||||
@@ -339,7 +339,7 @@ int CConsoleMinecraftApp::LoadLocalDLCImage(SONYDLC *pDLCInfo)
|
||||
DWORD dwBytesRead;
|
||||
pDLCInfo->pbImageData=(PBYTE)malloc(pDLCInfo->dwImageBytes);
|
||||
|
||||
if(ReadFile(hFile,pDLCInfo->pbImageData,pDLCInfo->dwImageBytes,&dwBytesRead,nullptr)==FALSE)
|
||||
if(ReadFile(hFile,pDLCInfo->pbImageData,pDLCInfo->dwImageBytes,&dwBytesRead,NULL)==FALSE)
|
||||
{
|
||||
// failed
|
||||
free(pDLCInfo->pbImageData);
|
||||
@@ -375,7 +375,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
|
||||
{
|
||||
////////////////////////////////////////////////////////////////////////////////////////////// From CScene_Main::OnInit
|
||||
|
||||
app.setLevelGenerationOptions(nullptr);
|
||||
app.setLevelGenerationOptions(NULL);
|
||||
|
||||
// From CScene_Main::RunPlayGame
|
||||
Minecraft *pMinecraft=Minecraft::GetInstance();
|
||||
@@ -404,7 +404,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
|
||||
|
||||
NetworkGameInitData *param = new NetworkGameInitData();
|
||||
param->seed = seedValue;
|
||||
param->saveData = nullptr;
|
||||
param->saveData = NULL;
|
||||
|
||||
app.SetGameHostOption(eGameHostOption_Difficulty,0);
|
||||
app.SetGameHostOption(eGameHostOption_FriendsOfFriends,0);
|
||||
@@ -620,7 +620,7 @@ SonyCommerce::CategoryInfo *CConsoleMinecraftApp::GetCategoryInfo()
|
||||
{
|
||||
if(m_bCommerceCategoriesRetrieved==false)
|
||||
{
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &m_CategoryInfo;
|
||||
@@ -636,10 +636,10 @@ void CConsoleMinecraftApp::ClearCommerceDetails()
|
||||
pProductList->clear();
|
||||
}
|
||||
|
||||
if(m_ProductListA!=nullptr)
|
||||
if(m_ProductListA!=NULL)
|
||||
{
|
||||
delete [] m_ProductListA;
|
||||
m_ProductListA=nullptr;
|
||||
m_ProductListA=NULL;
|
||||
}
|
||||
|
||||
m_ProductListRetrievedC=0;
|
||||
@@ -665,7 +665,7 @@ void CConsoleMinecraftApp::GetDLCSkuIDFromProductList(char * pchDLCProductID, ch
|
||||
// find the DLC
|
||||
for(int i=0;i<m_ProductListCategoriesC;i++)
|
||||
{
|
||||
for(size_t j=0;j<m_ProductListA[i].size();j++)
|
||||
for(int j=0;j<m_ProductListA[i].size();j++)
|
||||
{
|
||||
std::vector<SonyCommerce::ProductInfo>* pProductList=&m_ProductListA[i];
|
||||
for ( SonyCommerce::ProductInfo& : *pProductList )
|
||||
@@ -727,7 +727,7 @@ std::vector<SonyCommerce::ProductInfo>* CConsoleMinecraftApp::GetProductList(int
|
||||
{
|
||||
if((m_bCommerceProductListRetrieved==false) || (m_bProductListAdditionalDetailsRetrieved==false) )
|
||||
{
|
||||
return nullptr;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &m_ProductListA[iIndex];
|
||||
@@ -1175,7 +1175,7 @@ int CConsoleMinecraftApp::Callback_SaveGameIncompleteMessageBoxReturned(void *pP
|
||||
StorageManager.CancelIncompleteOperation();
|
||||
break;
|
||||
case C4JStorage::EMessage_ResultThirdOption:
|
||||
ui.NavigateToScene(iPad, eUIScene_InGameSaveManagementMenu, nullptr, eUILayer_Error, eUIGroup_Fullscreen);
|
||||
ui.NavigateToScene(iPad, eUIScene_InGameSaveManagementMenu, NULL, eUILayer_Error, eUIGroup_Fullscreen);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
@@ -1186,7 +1186,7 @@ bool CConsoleMinecraftApp::CheckForEmptyStore(int iPad)
|
||||
SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo();
|
||||
|
||||
bool bEmptyStore=true;
|
||||
if(pCategories!=nullptr)
|
||||
if(pCategories!=NULL)
|
||||
{
|
||||
if(pCategories->countOfProducts>0)
|
||||
{
|
||||
@@ -1244,7 +1244,7 @@ void CConsoleMinecraftApp::PatchAvailableDialogTick()
|
||||
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0]=IDS_PRO_NOTONLINE_DECLINE;
|
||||
ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION_PATCH_AVAILABLE, uiIDA, 1, ProfileManager.GetPrimaryPad(), nullptr, nullptr, app.GetStringTable());
|
||||
ui.RequestMessageBox(IDS_ONLINE_SERVICE_TITLE, IDS_CONTENT_RESTRICTION_PATCH_AVAILABLE, uiIDA, 1, ProfileManager.GetPrimaryPad(), NULL, NULL, app.GetStringTable());
|
||||
m_bPatchAvailableDialogRunning=false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user