Remove AUTO_VAR macro and _toString function (#592)
This commit is contained in:
@@ -96,8 +96,8 @@ SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle)
|
||||
{
|
||||
wstring wstrTemp=convStringToWstring(pchTitle);
|
||||
|
||||
AUTO_VAR(it, m_SONYDLCMap.find(wstrTemp));
|
||||
if(it == m_SONYDLCMap.end())
|
||||
auto it = m_SONYDLCMap.find(wstrTemp);
|
||||
if(it == m_SONYDLCMap.end())
|
||||
{
|
||||
app.DebugPrintf("Couldn't find DLC info for %s\n", pchTitle);
|
||||
assert(0);
|
||||
@@ -113,8 +113,8 @@ SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(char *pchTitle)
|
||||
|
||||
SONYDLC *CConsoleMinecraftApp::GetSONYDLCInfo(int iTexturePackID)
|
||||
{
|
||||
for ( AUTO_VAR(it, m_SONYDLCMap.begin()); it != m_SONYDLCMap.end(); ++it )
|
||||
{
|
||||
for (auto it = m_SONYDLCMap.begin(); it != m_SONYDLCMap.end(); ++it)
|
||||
{
|
||||
if(it->second->iConfig == iTexturePackID)
|
||||
return it->second;
|
||||
}
|
||||
@@ -331,7 +331,7 @@ void CConsoleMinecraftApp::TemporaryCreateGameStart()
|
||||
app.SetGameHostOption(eGameHostOption_Gamertags,1);
|
||||
app.SetGameHostOption(eGameHostOption_BedrockFog,1);
|
||||
|
||||
app.SetGameHostOption(eGameHostOption_GameType,GameType::CREATIVE->getId());
|
||||
app.SetGameHostOption(eGameHostOption_GameType,GameType::CREATIVE->getId());
|
||||
app.SetGameHostOption(eGameHostOption_LevelType, 0 );
|
||||
app.SetGameHostOption(eGameHostOption_Structures, 1 );
|
||||
app.SetGameHostOption(eGameHostOption_BonusChest, 0 );
|
||||
@@ -410,7 +410,7 @@ void CConsoleMinecraftApp::CommerceTick()
|
||||
|
||||
break;
|
||||
case eCommerce_State_GetProductList:
|
||||
{
|
||||
{
|
||||
m_eCommerce_State=eCommerce_State_GetProductList_Pending;
|
||||
SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo();
|
||||
std::list<SonyCommerce::CategoryInfoSub>::iterator iter = pCategories->subCategories.begin();
|
||||
@@ -426,7 +426,7 @@ void CConsoleMinecraftApp::CommerceTick()
|
||||
|
||||
break;
|
||||
case eCommerce_State_AddProductInfoDetailed:
|
||||
{
|
||||
{
|
||||
m_eCommerce_State=eCommerce_State_AddProductInfoDetailed_Pending;
|
||||
|
||||
// for each of the products in the categories, get the detailed info. We really only need the long description and price info.
|
||||
@@ -463,7 +463,7 @@ void CConsoleMinecraftApp::CommerceTick()
|
||||
break;
|
||||
|
||||
case eCommerce_State_RegisterDLC:
|
||||
{
|
||||
{
|
||||
m_eCommerce_State=eCommerce_State_Online;
|
||||
// register the DLC info
|
||||
SonyCommerce::CategoryInfo *pCategories=app.GetCategoryInfo();
|
||||
@@ -550,20 +550,20 @@ SonyCommerce::CategoryInfo *CConsoleMinecraftApp::GetCategoryInfo()
|
||||
|
||||
return &m_CategoryInfo;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
void CConsoleMinecraftApp::ClearCommerceDetails()
|
||||
{
|
||||
#ifdef VITA_COMMERCE_ENABLED
|
||||
for(int i=0;i<m_ProductListCategoriesC;i++)
|
||||
{
|
||||
std::vector<SonyCommerce::ProductInfo>* pProductList=&m_ProductListA[i];
|
||||
std::vector<SonyCommerce::ProductInfo>* pProductList=&m_ProductListA[i];
|
||||
pProductList->clear();
|
||||
}
|
||||
|
||||
if(m_ProductListA!=NULL)
|
||||
{
|
||||
delete [] m_ProductListA;
|
||||
delete [] m_ProductListA;
|
||||
m_ProductListA=NULL;
|
||||
}
|
||||
|
||||
@@ -593,17 +593,17 @@ void CConsoleMinecraftApp::GetDLCSkuIDFromProductList(char * pchDLCProductID, ch
|
||||
for(int j=0;j<m_ProductListA[i].size();j++)
|
||||
{
|
||||
std::vector<SonyCommerce::ProductInfo>* pProductList=&m_ProductListA[i];
|
||||
AUTO_VAR(itEnd, pProductList->end());
|
||||
auto itEnd = pProductList->end();
|
||||
|
||||
for (AUTO_VAR(it, pProductList->begin()); it != itEnd; it++)
|
||||
{
|
||||
for (auto it = pProductList->begin(); it != itEnd; it++)
|
||||
{
|
||||
SonyCommerce::ProductInfo Info=*it;
|
||||
if(strcmp(pchDLCProductID,Info.productId)==0)
|
||||
{
|
||||
{
|
||||
memcpy(pchSkuID,Info.skuId,SCE_NP_COMMERCE2_SKU_ID_LEN);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -620,24 +620,24 @@ void CConsoleMinecraftApp::Checkout(char *pchSkuID)
|
||||
for(int j=0;j<m_ProductListA[i].size();j++)
|
||||
{
|
||||
std::vector<SonyCommerce::ProductInfo>* pProductList=&m_ProductListA[i];
|
||||
AUTO_VAR(itEnd, pProductList->end());
|
||||
auto itEnd = pProductList->end();
|
||||
|
||||
for (AUTO_VAR(it, pProductList->begin()); it != itEnd; it++)
|
||||
{
|
||||
for (auto it = pProductList->begin(); it != itEnd; it++)
|
||||
{
|
||||
SonyCommerce::ProductInfo Info=*it;
|
||||
if(strcmp(pchSkuID,Info.skuId)==0)
|
||||
{
|
||||
{
|
||||
productInfo = &(*it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(productInfo)
|
||||
{
|
||||
if(m_eCommerce_State==eCommerce_State_Online)
|
||||
{
|
||||
{
|
||||
strcpy(m_pchSkuID,productInfo->skuId);
|
||||
m_pCheckoutProductInfo = productInfo;
|
||||
m_eCommerce_State=eCommerce_State_Checkout;
|
||||
@@ -652,7 +652,7 @@ void CConsoleMinecraftApp::Checkout(char *pchSkuID)
|
||||
void CConsoleMinecraftApp::DownloadAlreadyPurchased(char *pchSkuID)
|
||||
{
|
||||
if(m_eCommerce_State==eCommerce_State_Online)
|
||||
{
|
||||
{
|
||||
strcpy(m_pchSkuID,pchSkuID);
|
||||
m_eCommerce_State=eCommerce_State_DownloadAlreadyPurchased;
|
||||
}
|
||||
@@ -661,7 +661,7 @@ void CConsoleMinecraftApp::DownloadAlreadyPurchased(char *pchSkuID)
|
||||
bool CConsoleMinecraftApp::UpgradeTrial()
|
||||
{
|
||||
if(m_eCommerce_State==eCommerce_State_Online)
|
||||
{
|
||||
{
|
||||
m_eCommerce_State=eCommerce_State_UpgradeTrial;
|
||||
return true;
|
||||
}
|
||||
@@ -700,13 +700,13 @@ bool CConsoleMinecraftApp::DLCAlreadyPurchased(char *pchTitle)
|
||||
for(int j=0;j<m_ProductListA[i].size();j++)
|
||||
{
|
||||
std::vector<SonyCommerce::ProductInfo>* pProductList=&m_ProductListA[i];
|
||||
AUTO_VAR(itEnd, pProductList->end());
|
||||
auto itEnd = pProductList->end();
|
||||
|
||||
for (AUTO_VAR(it, pProductList->begin()); it != itEnd; it++)
|
||||
{
|
||||
for (auto it = pProductList->begin(); it != itEnd; it++)
|
||||
{
|
||||
SonyCommerce::ProductInfo Info=*it;
|
||||
if(strcmp(pchTitle,Info.skuId)==0)
|
||||
{
|
||||
{
|
||||
if(Info.purchasabilityFlag==SCE_TOOLKIT_NP_COMMERCE_NOT_PURCHASED)
|
||||
{
|
||||
return false;
|
||||
@@ -716,7 +716,7 @@ bool CConsoleMinecraftApp::DLCAlreadyPurchased(char *pchTitle)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif //#ifdef VITA_COMMERCE_ENABLED
|
||||
@@ -753,7 +753,7 @@ void CConsoleMinecraftApp::CommerceGetCategoriesCallback(LPVOID lpParam,int err)
|
||||
if(err==0)
|
||||
{
|
||||
pClass->m_ProductListCategoriesC=pClass->m_CategoryInfo.countOfSubCategories;
|
||||
// allocate the memory for the product info for each categories
|
||||
// allocate the memory for the product info for each categories
|
||||
if(pClass->m_CategoryInfo.countOfSubCategories>0)
|
||||
{
|
||||
pClass->m_ProductListA = (std::vector<SonyCommerce::ProductInfo> *) new std::vector<SonyCommerce::ProductInfo> [pClass->m_CategoryInfo.countOfSubCategories];
|
||||
@@ -787,7 +787,7 @@ void CConsoleMinecraftApp::CommerceGetProductListCallback(LPVOID lpParam,int err
|
||||
{
|
||||
// we're done, so now retrieve the additional product details for each product
|
||||
pClass->m_eCommerce_State=eCommerce_State_AddProductInfoDetailed;
|
||||
pClass->m_bCommerceProductListRetrieved=true;
|
||||
pClass->m_bCommerceProductListRetrieved=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -797,21 +797,21 @@ void CConsoleMinecraftApp::CommerceGetProductListCallback(LPVOID lpParam,int err
|
||||
else
|
||||
{
|
||||
pClass->m_eCommerce_State=eCommerce_State_Error;
|
||||
pClass->m_bCommerceProductListRetrieved=true;
|
||||
pClass->m_bCommerceProductListRetrieved=true;
|
||||
}
|
||||
}
|
||||
|
||||
// void CConsoleMinecraftApp::CommerceGetDetailedProductInfoCallback(LPVOID lpParam,int err)
|
||||
// {
|
||||
// CConsoleMinecraftApp *pScene=(CConsoleMinecraftApp *)lpParam;
|
||||
//
|
||||
//
|
||||
// if(err==0)
|
||||
// {
|
||||
// pScene->m_eCommerce_State=eCommerce_State_Idle;
|
||||
// //pScene->m_bCommerceProductListRetrieved=true;
|
||||
// //pScene->m_bCommerceProductListRetrieved=true;
|
||||
// }
|
||||
// //printf("Callback hit, error 0x%08x\n", err);
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam,int err)
|
||||
@@ -831,7 +831,7 @@ void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam
|
||||
{
|
||||
// MGH - change this to a while loop so we can skip empty categories.
|
||||
do
|
||||
{
|
||||
{
|
||||
pClass->m_iCurrentCategory++;
|
||||
}while(pClass->m_ProductListA[pClass->m_iCurrentCategory].size() == 0 && pClass->m_iCurrentCategory<pClass->m_ProductListCategoriesC);
|
||||
|
||||
@@ -840,12 +840,12 @@ void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam
|
||||
{
|
||||
// there are no more categories, so we're done
|
||||
pClass->m_eCommerce_State=eCommerce_State_RegisterDLC;
|
||||
pClass->m_bProductListAdditionalDetailsRetrieved=true;
|
||||
pClass->m_bProductListAdditionalDetailsRetrieved=true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// continue with the next category
|
||||
pClass->m_eCommerce_State=eCommerce_State_AddProductInfoDetailed;
|
||||
pClass->m_eCommerce_State=eCommerce_State_AddProductInfoDetailed;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -857,7 +857,7 @@ void CConsoleMinecraftApp::CommerceAddDetailedProductInfoCallback(LPVOID lpParam
|
||||
else
|
||||
{
|
||||
pClass->m_eCommerce_State=eCommerce_State_Error;
|
||||
pClass->m_bProductListAdditionalDetailsRetrieved=true;
|
||||
pClass->m_bProductListAdditionalDetailsRetrieved=true;
|
||||
pClass->m_iCurrentProduct=0;
|
||||
pClass->m_iCurrentCategory=0;
|
||||
}
|
||||
@@ -1077,7 +1077,7 @@ bool CConsoleMinecraftApp::CheckForEmptyStore(int iPad)
|
||||
|
||||
bool bEmptyStore=true;
|
||||
if(pCategories!=NULL)
|
||||
{
|
||||
{
|
||||
if(pCategories->countOfProducts>0)
|
||||
{
|
||||
bEmptyStore=false;
|
||||
@@ -1131,7 +1131,7 @@ void printSaveState()
|
||||
case C4JStorage::ESaveGame_SaveCache: strState = "ESaveGame_SaveCache"; break;
|
||||
case C4JStorage::ESaveGame_ReconstructCache: strState = "ESaveGame_ReconstructCache"; break;
|
||||
}
|
||||
|
||||
|
||||
app.DebugPrintf("[printSaveState] GetSaveState == %s.\n", strState.c_str());
|
||||
#endif
|
||||
}
|
||||
@@ -1178,7 +1178,7 @@ void CConsoleMinecraftApp::SaveDataTick()
|
||||
{
|
||||
app.DebugPrintf("[SaveDataTick] eSaveDataDeleteState_abort.\n");
|
||||
StorageManager.CancelIncompleteOperation();
|
||||
}
|
||||
}
|
||||
else if (m_bSaveDataDeleteDialogState == eSaveDataDeleteState_continue)
|
||||
{
|
||||
app.DebugPrintf("[SaveDataTick] eSaveDataDeleteState_continue.\n");
|
||||
@@ -1262,7 +1262,7 @@ void CConsoleMinecraftApp::Callback_SaveGameIncomplete(void *pParam, C4JStorage:
|
||||
|
||||
int CConsoleMinecraftApp::NoSaveSpaceReturned(void *pParam,int iPad,C4JStorage::EMessageResult result)
|
||||
{
|
||||
if(result==C4JStorage::EMessage_ResultAccept && !UIScene_LoadOrJoinMenu::isSaveTransferRunning()) // MGH - we won't try to save again during a save tranfer
|
||||
if(result==C4JStorage::EMessage_ResultAccept && !UIScene_LoadOrJoinMenu::isSaveTransferRunning()) // MGH - we won't try to save again during a save tranfer
|
||||
{
|
||||
int blocksRequired = (int)pParam;
|
||||
if(blocksRequired > 0)
|
||||
@@ -1290,7 +1290,7 @@ int CConsoleMinecraftApp::cbConfirmDeleteMessageBox(void *pParam, int iPad, cons
|
||||
|
||||
if (pClass != NULL && pClass->m_pSaveToDelete != NULL)
|
||||
{
|
||||
if (result == C4JStorage::EMessage_ResultDecline)
|
||||
if (result == C4JStorage::EMessage_ResultDecline)
|
||||
{
|
||||
pClass->m_bSaveDataDeleteDialogState = eSaveDataDeleteState_deleting;
|
||||
C4JStorage::ESaveGameState eDeleteStatus = StorageManager.DeleteSaveData(pClass->m_pSaveToDelete, cbSaveDataDeleted, pClass);
|
||||
@@ -1324,7 +1324,7 @@ void CConsoleMinecraftApp::initSaveIncompleteDialog(int spaceNeeded)
|
||||
|
||||
param.sysMsgParam->sysMsgType = SCE_SAVEDATA_DIALOG_SYSMSG_TYPE_NOSPACE_CONTINUABLE;
|
||||
param.sysMsgParam->value = (SceInt32) spaceNeeded;
|
||||
|
||||
|
||||
SceInt32 ret = sceSaveDataDialogInit(¶m);
|
||||
if (ret == SCE_OK)
|
||||
{
|
||||
@@ -1410,13 +1410,13 @@ void CConsoleMinecraftApp::initSaveDataDeleteDialog()
|
||||
// Start getting saves data to use when deleting.
|
||||
if (StorageManager.ReturnSavesInfo() == NULL)
|
||||
{
|
||||
C4JStorage::ESaveGameState eSGIStatus
|
||||
= StorageManager.GetSavesInfo(
|
||||
C4JStorage::ESaveGameState eSGIStatus
|
||||
= StorageManager.GetSavesInfo(
|
||||
ProfileManager.GetPrimaryPad(),
|
||||
NULL,
|
||||
this,
|
||||
NULL,
|
||||
this,
|
||||
"save"
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
// Dim background because sony doesn't do that.
|
||||
@@ -1448,7 +1448,7 @@ void CConsoleMinecraftApp::updateSaveDataDeleteDialog()
|
||||
{
|
||||
SceSaveDataDialogResult dialogResult;
|
||||
ZeroMemory(&dialogResult, sizeof(SceSaveDataDialogResult));
|
||||
|
||||
|
||||
SceInt32 ret = sceSaveDataDialogGetResult(&dialogResult);
|
||||
if (ret == SCE_OK)
|
||||
{
|
||||
@@ -1472,7 +1472,7 @@ void CConsoleMinecraftApp::updateSaveDataDeleteDialog()
|
||||
{
|
||||
SceAppUtilSaveDataSlotParam slotParam;
|
||||
ret = sceAppUtilSaveDataSlotGetParam( dialogResult.slotId, &slotParam, NULL );
|
||||
|
||||
|
||||
if (ret == SCE_OK)
|
||||
{
|
||||
int saveindex = -1;
|
||||
@@ -1503,12 +1503,12 @@ void CConsoleMinecraftApp::updateSaveDataDeleteDialog()
|
||||
{
|
||||
app.DebugPrintf("[SaveDataDeleteDialog] ERROR: PERFORMING DELETE OPERATION, pSavesDetails is null.\n");
|
||||
}
|
||||
|
||||
|
||||
if (pSaveInfo != NULL)
|
||||
{
|
||||
app.DebugPrintf(
|
||||
"[SaveDataDeleteDialog] User wishes to delete slot_%d:\n\t"
|
||||
"4jsaveindex=%d, filename='%s', title='%s', subtitle='%s', size=%dKiB.\n",
|
||||
"4jsaveindex=%d, filename='%s', title='%s', subtitle='%s', size=%dKiB.\n",
|
||||
dialogResult.slotId,
|
||||
saveindex,
|
||||
pSaveInfo->UTF8SaveFilename,
|
||||
@@ -1524,14 +1524,14 @@ void CConsoleMinecraftApp::updateSaveDataDeleteDialog()
|
||||
};
|
||||
|
||||
ui.RequestErrorMessage(
|
||||
IDS_TOOLTIPS_DELETESAVE, IDS_TEXT_DELETE_SAVE,
|
||||
IDS_TOOLTIPS_DELETESAVE, IDS_TEXT_DELETE_SAVE,
|
||||
uiIDA, 2,
|
||||
0,
|
||||
&cbConfirmDeleteMessageBox, this
|
||||
);
|
||||
|
||||
m_bSaveDataDeleteDialogState = eSaveDataDeleteState_userConfirmation;
|
||||
|
||||
|
||||
m_pSaveToDelete = pSaveInfo;
|
||||
}
|
||||
else
|
||||
@@ -1604,7 +1604,7 @@ void CConsoleMinecraftApp::getSaveDataDeleteDialogParam(SceSaveDataDialogParam *
|
||||
{
|
||||
SceAppUtilSaveDataSlotParam slotParam;
|
||||
int ret = sceAppUtilSaveDataSlotGetParam( i, &slotParam, NULL );
|
||||
|
||||
|
||||
if (ret == SCE_OK)
|
||||
{
|
||||
SceAppUtilSaveDataSlot slot;
|
||||
@@ -1617,7 +1617,7 @@ void CConsoleMinecraftApp::getSaveDataDeleteDialogParam(SceSaveDataDialogParam *
|
||||
slots.push_back( slot );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SceAppUtilSaveDataSlot *pSavesList = new SceAppUtilSaveDataSlot[slots.size()];
|
||||
|
||||
int slotIndex = 0;
|
||||
@@ -1651,7 +1651,7 @@ void CConsoleMinecraftApp::getSaveDataDeleteDialogParam(SceSaveDataDialogParam *
|
||||
|
||||
listParam.listTitle = (const SceChar8 *) strPtr;
|
||||
listParam.itemStyle = SCE_SAVEDATA_DIALOG_LIST_ITEM_STYLE_TITLE_SUBTITLE_DATE;
|
||||
|
||||
|
||||
baseParam->mode = SCE_SAVEDATA_DIALOG_MODE_LIST;
|
||||
baseParam->dispType = SCE_SAVEDATA_DIALOG_TYPE_DELETE;
|
||||
baseParam->listParam = &listParam;
|
||||
@@ -1692,10 +1692,10 @@ int CConsoleMinecraftApp::cbSaveDataDeleted( void *pParam, const bool success )
|
||||
void CConsoleMinecraftApp::finishedDeletingSaves(bool bContinue)
|
||||
{
|
||||
app.DebugPrintf( "[finishedDeletingSaves] %s.\n", (bContinue?"Continuing":"Aborting") );
|
||||
|
||||
|
||||
StorageManager.SetSaveDisabled(false);
|
||||
LeaveSaveNotificationSection();
|
||||
|
||||
|
||||
StorageManager.ClearSaveError();
|
||||
StorageManager.ClearOptionsSaveError();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user