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:
@@ -29,8 +29,8 @@ static SceRemoteStorageStatus statParams;
|
||||
// void remoteStorageCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code)
|
||||
// {
|
||||
// app.DebugPrintf("remoteStorageCallback err : 0x%08x\n");
|
||||
//
|
||||
// app.getRemoteStorage()->getRemoteFileInfo(&statParams, remoteStorageGetInfoCallback, nullptr);
|
||||
//
|
||||
// app.getRemoteStorage()->getRemoteFileInfo(&statParams, remoteStorageGetInfoCallback, NULL);
|
||||
// }
|
||||
|
||||
|
||||
@@ -39,13 +39,13 @@ static SceRemoteStorageStatus statParams;
|
||||
void SonyRemoteStorage::SetRetrievedDescData()
|
||||
{
|
||||
DescriptionData* pDescDataTest = (DescriptionData*)m_remoteFileInfo->fileDescription;
|
||||
ESavePlatform testPlatform = static_cast<ESavePlatform>(MAKE_FOURCC(pDescDataTest->m_platform[0], pDescDataTest->m_platform[1], pDescDataTest->m_platform[2], pDescDataTest->m_platform[3]));
|
||||
ESavePlatform testPlatform = (ESavePlatform)MAKE_FOURCC(pDescDataTest->m_platform[0], pDescDataTest->m_platform[1], pDescDataTest->m_platform[2], pDescDataTest->m_platform[3]);
|
||||
if(testPlatform == SAVE_FILE_PLATFORM_NONE)
|
||||
{
|
||||
// new version of the descData
|
||||
DescriptionData_V2* pDescData2 = (DescriptionData_V2*)m_remoteFileInfo->fileDescription;
|
||||
m_retrievedDescData.m_descDataVersion = GetU32FromHexBytes(pDescData2->m_descDataVersion);
|
||||
m_retrievedDescData.m_savePlatform = static_cast<ESavePlatform>(MAKE_FOURCC(pDescData2->m_platform[0], pDescData2->m_platform[1], pDescData2->m_platform[2], pDescData2->m_platform[3]));
|
||||
m_retrievedDescData.m_savePlatform = (ESavePlatform)MAKE_FOURCC(pDescData2->m_platform[0], pDescData2->m_platform[1], pDescData2->m_platform[2], pDescData2->m_platform[3]);
|
||||
m_retrievedDescData.m_seed = GetU64FromHexBytes(pDescData2->m_seed);
|
||||
m_retrievedDescData.m_hostOptions = GetU32FromHexBytes(pDescData2->m_hostOptions);
|
||||
m_retrievedDescData.m_texturePack = GetU32FromHexBytes(pDescData2->m_texturePack);
|
||||
@@ -58,7 +58,7 @@ void SonyRemoteStorage::SetRetrievedDescData()
|
||||
// old version,copy the data across to the new version
|
||||
DescriptionData* pDescData = (DescriptionData*)m_remoteFileInfo->fileDescription;
|
||||
m_retrievedDescData.m_descDataVersion = 1;
|
||||
m_retrievedDescData.m_savePlatform = static_cast<ESavePlatform>(MAKE_FOURCC(pDescData->m_platform[0], pDescData->m_platform[1], pDescData->m_platform[2], pDescData->m_platform[3]));
|
||||
m_retrievedDescData.m_savePlatform = (ESavePlatform)MAKE_FOURCC(pDescData->m_platform[0], pDescData->m_platform[1], pDescData->m_platform[2], pDescData->m_platform[3]);
|
||||
m_retrievedDescData.m_seed = GetU64FromHexBytes(pDescData->m_seed);
|
||||
m_retrievedDescData.m_hostOptions = GetU32FromHexBytes(pDescData->m_hostOptions);
|
||||
m_retrievedDescData.m_texturePack = GetU32FromHexBytes(pDescData->m_texturePack);
|
||||
@@ -73,7 +73,7 @@ void SonyRemoteStorage::SetRetrievedDescData()
|
||||
|
||||
void getSaveInfoReturnCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code)
|
||||
{
|
||||
SonyRemoteStorage* pRemoteStorage = static_cast<SonyRemoteStorage *>(lpParam);
|
||||
SonyRemoteStorage* pRemoteStorage = (SonyRemoteStorage*)lpParam;
|
||||
app.DebugPrintf("remoteStorageGetInfoCallback err : 0x%08x\n", error_code);
|
||||
if(error_code == 0)
|
||||
{
|
||||
@@ -99,7 +99,7 @@ void getSaveInfoReturnCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int
|
||||
|
||||
static void getSaveInfoInitCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code)
|
||||
{
|
||||
SonyRemoteStorage* pRemoteStorage = static_cast<SonyRemoteStorage *>(lpParam);
|
||||
SonyRemoteStorage* pRemoteStorage = (SonyRemoteStorage*)lpParam;
|
||||
if(error_code != 0)
|
||||
{
|
||||
app.DebugPrintf("getSaveInfoInitCallback err : 0x%08x\n", error_code);
|
||||
@@ -143,7 +143,7 @@ bool SonyRemoteStorage::getSaveData( const char* localDirname, CallbackFunc cb,
|
||||
|
||||
static void setSaveDataInitCallback(LPVOID lpParam, SonyRemoteStorage::Status s, int error_code)
|
||||
{
|
||||
SonyRemoteStorage* pRemoteStorage = static_cast<SonyRemoteStorage *>(lpParam);
|
||||
SonyRemoteStorage* pRemoteStorage = (SonyRemoteStorage*)lpParam;
|
||||
if(error_code != 0)
|
||||
{
|
||||
app.DebugPrintf("setSaveDataInitCallback err : 0x%08x\n", error_code);
|
||||
@@ -181,7 +181,7 @@ const char* SonyRemoteStorage::getLocalFilename()
|
||||
const char* SonyRemoteStorage::getSaveNameUTF8()
|
||||
{
|
||||
if(m_getInfoStatus != e_infoFound)
|
||||
return nullptr;
|
||||
return NULL;
|
||||
return m_retrievedDescData.m_saveNameUTF8;
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ bool SonyRemoteStorage::setData( PSAVE_INFO info, CallbackFunc cb, LPVOID lpPara
|
||||
|
||||
int SonyRemoteStorage::LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThumbnail,DWORD dwThumbnailBytes)
|
||||
{
|
||||
SonyRemoteStorage *pClass= static_cast<SonyRemoteStorage *>(lpParam);
|
||||
SonyRemoteStorage *pClass= (SonyRemoteStorage *)lpParam;
|
||||
|
||||
if(pClass->m_bAborting)
|
||||
{
|
||||
@@ -261,12 +261,12 @@ int SonyRemoteStorage::LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThum
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("Thumbnail data is nullptr, or has size 0\n");
|
||||
pClass->m_thumbnailData = nullptr;
|
||||
app.DebugPrintf("Thumbnail data is NULL, or has size 0\n");
|
||||
pClass->m_thumbnailData = NULL;
|
||||
pClass->m_thumbnailDataSize = 0;
|
||||
}
|
||||
|
||||
if(pClass->m_SetDataThread != nullptr)
|
||||
if(pClass->m_SetDataThread != NULL)
|
||||
delete pClass->m_SetDataThread;
|
||||
|
||||
pClass->m_SetDataThread = new C4JThread(setDataThread, pClass, "setDataThread");
|
||||
@@ -277,7 +277,7 @@ int SonyRemoteStorage::LoadSaveDataThumbnailReturned(LPVOID lpParam,PBYTE pbThum
|
||||
|
||||
int SonyRemoteStorage::setDataThread(void* lpParam)
|
||||
{
|
||||
SonyRemoteStorage* pClass = static_cast<SonyRemoteStorage *>(lpParam);
|
||||
SonyRemoteStorage* pClass = (SonyRemoteStorage*)lpParam;
|
||||
pClass->m_startTime = System::currentTimeMillis();
|
||||
pClass->setDataInternal();
|
||||
return 0;
|
||||
@@ -322,8 +322,8 @@ int SonyRemoteStorage::getDataProgress()
|
||||
|
||||
int64_t time = System::currentTimeMillis();
|
||||
int elapsedSecs = (time - m_startTime) / 1000;
|
||||
float estimatedTransfered = static_cast<float>(elapsedSecs * transferRatePerSec);
|
||||
int progVal = m_dataProgress + (estimatedTransfered / static_cast<float>(totalSize)) * 100;
|
||||
float estimatedTransfered = float(elapsedSecs * transferRatePerSec);
|
||||
int progVal = m_dataProgress + (estimatedTransfered / float(totalSize)) * 100;
|
||||
if(progVal > nextChunk)
|
||||
return nextChunk;
|
||||
if(progVal > 99)
|
||||
@@ -346,7 +346,7 @@ bool SonyRemoteStorage::shutdown()
|
||||
app.DebugPrintf("Term request done \n");
|
||||
m_bInitialised = false;
|
||||
free(m_memPoolBuffer);
|
||||
m_memPoolBuffer = nullptr;
|
||||
m_memPoolBuffer = NULL;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -406,11 +406,10 @@ void SonyRemoteStorage::GetDescriptionData( DescriptionData& descData)
|
||||
unsigned int uiHostOptions;
|
||||
bool bHostOptionsRead;
|
||||
DWORD uiTexturePack;
|
||||
char seed[22];
|
||||
app.GetImageTextData(m_thumbnailData, m_thumbnailDataSize, reinterpret_cast<unsigned char*>(seed),
|
||||
uiHostOptions, bHostOptionsRead, uiTexturePack);
|
||||
char seed[22];
|
||||
app.GetImageTextData(m_thumbnailData, m_thumbnailDataSize,(unsigned char *)seed, uiHostOptions, bHostOptionsRead, uiTexturePack);
|
||||
|
||||
int64_t iSeed = strtoll(seed, nullptr,10);
|
||||
int64_t iSeed = strtoll(seed,NULL,10);
|
||||
SetU64HexBytes(descData.m_seed, iSeed);
|
||||
// Save the host options that this world was last played with
|
||||
SetU32HexBytes(descData.m_hostOptions, uiHostOptions);
|
||||
@@ -449,7 +448,7 @@ void SonyRemoteStorage::GetDescriptionData( DescriptionData_V2& descData)
|
||||
char seed[22];
|
||||
app.GetImageTextData(m_thumbnailData, m_thumbnailDataSize,(unsigned char *)seed, uiHostOptions, bHostOptionsRead, uiTexturePack);
|
||||
|
||||
int64_t iSeed = strtoll(seed, nullptr,10);
|
||||
int64_t iSeed = strtoll(seed,NULL,10);
|
||||
SetU64HexBytes(descData.m_seed, iSeed);
|
||||
// Save the host options that this world was last played with
|
||||
SetU32HexBytes(descData.m_hostOptions, uiHostOptions);
|
||||
|
||||
Reference in New Issue
Block a user