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

@@ -30,7 +30,7 @@ PS3LeaderboardManager::PS3LeaderboardManager()
m_myXUID = INVALID_XUID;
m_scores = nullptr; //m_stats = nullptr;
m_scores = NULL; //m_stats = NULL;
m_statsType = eStatsType_Kills;
m_difficulty = 0;
@@ -42,7 +42,7 @@ PS3LeaderboardManager::PS3LeaderboardManager()
InitializeCriticalSection(&m_csViewsLock);
m_running = false;
m_threadScoreboard = nullptr;
m_threadScoreboard = NULL;
}
PS3LeaderboardManager::~PS3LeaderboardManager()
@@ -196,7 +196,7 @@ bool PS3LeaderboardManager::getScoreByIds()
CellRtcTick last_sort_date;
SceNpScoreRankNumber mTotalRecord;
SceNpId *npIds = nullptr;
SceNpId *npIds = NULL;
int ret;
@@ -246,7 +246,7 @@ bool PS3LeaderboardManager::getScoreByIds()
sceNpScoreDestroyTransactionCtx(ret);
if (npIds != nullptr) delete [] npIds;
if (npIds != NULL) delete [] npIds;
return false;
}
else if (ret < 0)
@@ -256,7 +256,7 @@ bool PS3LeaderboardManager::getScoreByIds()
m_eStatsState = eStatsState_Failed;
if (npIds != nullptr) delete [] npIds;
if (npIds != NULL) delete [] npIds;
return false;
}
else
@@ -270,7 +270,7 @@ bool PS3LeaderboardManager::getScoreByIds()
comments = new SceNpScoreComment[num];
/* app.DebugPrintf("sceNpScoreGetRankingByNpId(\n\t transaction=%i,\n\t boardID=0,\n\t npId=%i,\n\t friendCount*sizeof(SceNpId)=%i*%i=%i,\
rankData=%i,\n\t friendCount*sizeof(SceNpScorePlayerRankData)=%i,\n\t nullptr, 0, nullptr, 0,\n\t friendCount=%i,\n...\n",
rankData=%i,\n\t friendCount*sizeof(SceNpScorePlayerRankData)=%i,\n\t NULL, 0, NULL, 0,\n\t friendCount=%i,\n...\n",
transaction, npId, friendCount, sizeof(SceNpId), friendCount*sizeof(SceNpId),
rankData, friendCount*sizeof(SceNpScorePlayerRankData), friendCount
); */
@@ -285,14 +285,14 @@ bool PS3LeaderboardManager::getScoreByIds()
comments, sizeof(SceNpScoreComment) * num, //OUT: Comments
nullptr, 0, // GameData. (unused)
NULL, 0, // GameData. (unused)
num,
&last_sort_date,
&mTotalRecord,
nullptr // Reserved, specify null.
NULL // Reserved, specify null.
);
if (ret == SCE_NP_COMMUNITY_ERROR_ABORTED)
@@ -319,7 +319,7 @@ bool PS3LeaderboardManager::getScoreByIds()
delete [] comments;
delete [] npIds;
m_scores = nullptr;
m_scores = NULL;
m_readCount = 0;
m_maxRank = num;
@@ -335,7 +335,7 @@ bool PS3LeaderboardManager::getScoreByIds()
m_readCount = num;
// Filter scorers and construct output structure.
if (m_scores != nullptr) delete [] m_scores;
if (m_scores != NULL) delete [] m_scores;
m_scores = new ReadScore[m_readCount];
convertToOutput(m_readCount, m_scores, ptr, comments);
m_maxRank = m_readCount;
@@ -368,7 +368,7 @@ error3:
delete [] ptr;
delete [] comments;
error2:
if (npIds != nullptr) delete [] npIds;
if (npIds != NULL) delete [] npIds;
error1:
if (m_eStatsState != eStatsState_Canceled) m_eStatsState = eStatsState_Failed;
app.DebugPrintf("[LeaderboardManger] getScoreByIds() FAILED, ret=0x%X\n", ret);
@@ -422,14 +422,14 @@ bool PS3LeaderboardManager::getScoreByRange()
comments, sizeof(SceNpScoreComment) * num, //OUT: Comment Data
nullptr, 0, // GameData.
NULL, 0, // GameData.
num,
&last_sort_date,
&m_maxRank, // 'Total number of players registered in the target scoreboard.'
nullptr // Reserved, specify null.
NULL // Reserved, specify null.
);
if (ret == SCE_NP_COMMUNITY_ERROR_ABORTED)
@@ -454,7 +454,7 @@ bool PS3LeaderboardManager::getScoreByRange()
delete [] ptr;
delete [] comments;
m_scores = nullptr;
m_scores = NULL;
m_readCount = 0;
m_eStatsState = eStatsState_Ready;
@@ -472,7 +472,7 @@ bool PS3LeaderboardManager::getScoreByRange()
//m_stats = ptr; //Maybe: addPadding(num,ptr);
if (m_scores != nullptr) delete [] m_scores;
if (m_scores != NULL) delete [] m_scores;
m_readCount = ret;
m_scores = new ReadScore[m_readCount];
for (int i=0; i<m_readCount; i++)
@@ -558,11 +558,11 @@ bool PS3LeaderboardManager::setScore()
rscore.m_score, //IN: new score,
&comment, // Comments
nullptr, // GameInfo
NULL, // GameInfo
&tmp, //OUT: current rank,
nullptr // Reserved, specify null.
NULL // Reserved, specify null.
);
if (ret==SCE_NP_COMMUNITY_SERVER_ERROR_NOT_BEST_SCORE) //0x8002A415
@@ -600,7 +600,7 @@ void PS3LeaderboardManager::Tick()
{
case eStatsState_Ready:
{
assert(m_scores != nullptr || m_readCount == 0);
assert(m_scores != NULL || m_readCount == 0);
view.m_numQueries = m_readCount;
view.m_queries = m_scores;
@@ -612,7 +612,7 @@ void PS3LeaderboardManager::Tick()
if (view.m_numQueries > 0)
ret = eStatsReturn_Success;
if (m_readListener != nullptr)
if (m_readListener != NULL)
{
app.DebugPrintf("[LeaderboardManager] OnStatsReadComplete(%i, %i, _), m_readCount=%i.\n", ret, m_maxRank, m_readCount);
m_readListener->OnStatsReadComplete(ret, m_maxRank, view);
@@ -621,16 +621,16 @@ void PS3LeaderboardManager::Tick()
m_eStatsState = eStatsState_Idle;
delete [] m_scores;
m_scores = nullptr;
m_scores = NULL;
}
break;
case eStatsState_Failed:
{
view.m_numQueries = 0;
view.m_queries = nullptr;
view.m_queries = NULL;
if ( m_readListener != nullptr )
if ( m_readListener != NULL )
m_readListener->OnStatsReadComplete(eStatsReturn_NetworkError, 0, view);
m_eStatsState = eStatsState_Idle;
@@ -652,7 +652,7 @@ bool PS3LeaderboardManager::OpenSession()
{
if (m_openSessions == 0)
{
if (m_threadScoreboard == nullptr)
if (m_threadScoreboard == NULL)
{
m_threadScoreboard = new C4JThread(&scoreboardThreadEntry, this, "4JScoreboard");
m_threadScoreboard->SetProcessor(CPU_CORE_LEADERBOARDS);
@@ -747,7 +747,7 @@ void PS3LeaderboardManager::FlushStats() {}
void PS3LeaderboardManager::CancelOperation()
{
m_readListener = nullptr;
m_readListener = NULL;
m_eStatsState = eStatsState_Canceled;
if (m_transactionCtx != 0)
@@ -897,7 +897,7 @@ void PS3LeaderboardManager::fromBase32(void *out, SceNpScoreComment *in)
for (int i = 0; i < SCE_NP_SCORE_COMMENT_MAXLEN; i++)
{
ch[0] = in->data[i];
unsigned char fivebits = strtol(ch, nullptr, 32) << 3;
unsigned char fivebits = strtol(ch, NULL, 32) << 3;
int sByte = (i*5) / 8;
int eByte = (5+(i*5)) / 8;
@@ -958,7 +958,7 @@ bool PS3LeaderboardManager::test_string(string testing)
int ctx = sceNpScoreCreateTransactionCtx(m_titleContext);
if (ctx<0) return false;
int ret = sceNpScoreCensorComment(ctx, (const void *) &comment, nullptr);
int ret = sceNpScoreCensorComment(ctx, (const void *) &comment, NULL);
if (ret == SCE_NP_COMMUNITY_SERVER_ERROR_CENSORED)
{