Skip to content

Commit 83c95fb

Browse files
committed
Score Generations: update rank table API
1 parent 696420d commit 83c95fb

4 files changed

Lines changed: 14 additions & 13 deletions

File tree

Games/Sonic Generations/ScoreGenerations/API/ScoreGenerationsAPIv2.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,11 @@ static ScoreTable& SCORE_GENS_API GetScoreTable()
7777
return TableProvider::GetScoreTable();
7878
}
7979

80-
static RankTable& SCORE_GENS_API GetCurrentRankTable()
80+
static RankTable& SCORE_GENS_API GetRankTable()
8181
{
8282
return TableProvider::GetRankTables()[g_pStageID];
8383
}
8484

85-
static RankTable& SCORE_GENS_API GetRankTable(const char* in_pStageID)
86-
{
87-
return TableProvider::GetRankTables()[in_pStageID];
88-
}
89-
9085
static void SCORE_GENS_API GetRankTables(RankTableNode** out_ppBuffer, int* out_pLength)
9186
{
9287
auto& rRankTables = TableProvider::GetRankTables();
@@ -105,6 +100,11 @@ static void SCORE_GENS_API GetRankTables(RankTableNode** out_ppBuffer, int* out_
105100
*out_pLength = length;
106101
}
107102

103+
static RankTable& SCORE_GENS_API FindRankTable(const char* in_pStageID)
104+
{
105+
return TableProvider::GetRankTables()[in_pStageID];
106+
}
107+
108108
static BonusTable& SCORE_GENS_API GetBonusTable()
109109
{
110110
return TableProvider::GetBonusTable();
@@ -160,9 +160,9 @@ API g_ScoreGenerationsAPI
160160
ComputeUserBonus,
161161
GetStatistics,
162162
GetScoreTable,
163-
GetCurrentRankTable,
164163
GetRankTable,
165164
GetRankTables,
165+
FindRankTable,
166166
GetBonusTable,
167167
GetMultiplierTable,
168168
GetTimerTable,

Games/Sonic Generations/ScoreGenerations/API/ScoreGenerationsAPIv2.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ namespace ScoreGenerations
2424
DECLARE_API_FUNC(int, ComputeUserBonus);
2525
DECLARE_API_FUNC(Statistics&, GetStatistics);
2626
DECLARE_API_FUNC(ScoreTable&, GetScoreTable);
27-
DECLARE_API_FUNC(RankTable&, GetCurrentRankTable);
28-
DECLARE_API_FUNC(RankTable&, GetRankTable, const char* in_pStageID);
27+
DECLARE_API_FUNC(RankTable&, GetRankTable);
2928
DECLARE_API_FUNC(void, GetRankTables, RankTableNode** out_ppBuffer, int* out_pLength);
29+
DECLARE_API_FUNC(RankTable&, FindRankTable, const char* in_pStageID);
3030
DECLARE_API_FUNC(BonusTable&, GetBonusTable);
3131
DECLARE_API_FUNC(MultiplierTable&, GetMultiplierTable);
3232
DECLARE_API_FUNC(TimerTable&, GetTimerTable);

Games/Sonic Generations/ScoreGenerations/API/ScoreGenerationsTypes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ namespace ScoreGenerations
168168
: pStageID(in_pStageID), pRankTable(in_pRankTable) {}
169169
};
170170

171+
typedef std::unordered_map<std::string, RankTable> RankTableMap_t;
172+
171173
struct BonusTable
172174
{
173175
int HomingChainBonus{};
@@ -194,6 +196,4 @@ namespace ScoreGenerations
194196
float SuperSonicTimer{};
195197
float SlamTimer{};
196198
};
197-
198-
typedef std::unordered_map<std::string, RankTable> RankTableMap_t;
199199
};

Games/Sonic Generations/ScoreGenerationsAPIDebug/DllMain.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ EXPORT void OnFrame()
161161
#if SCORE_GENS_API_VERSION == 1
162162
ScoreGenerationsAPI::GetRankTables();
163163
#elif SCORE_GENS_API_VERSION == 2
164-
LOGFN_WARNING("GetCurrentRankTable() = 0x{:X}", (size_t)&pApi->GetCurrentRankTable());
165-
LOGFN_WARNING("GetRankTable(\"{}\") = 0x{:X}", pApi->GetStageID(), (size_t)&pApi->GetRankTable(pApi->GetStageID()));
164+
LOGFN_WARNING("GetRankTable() = 0x{:X}", (size_t)&pApi->GetRankTable());
166165

167166
ScoreGenerations::RankTableNode* pRankTables{};
168167
int rankTablesLength{};
@@ -190,6 +189,8 @@ EXPORT void OnFrame()
190189
}
191190

192191
delete[] pRankTables;
192+
193+
LOGFN_WARNING("FindRankTable(\"{}\") = 0x{:X}", pApi->GetStageID(), (size_t)&pApi->FindRankTable(pApi->GetStageID()));
193194
#endif
194195
}
195196

0 commit comments

Comments
 (0)