mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-05 09:46:40 +00:00
Convert menus/extras-statistics to cpp
This commit is contained in:
parent
1f6038be65
commit
96b784defd
2 changed files with 9 additions and 7 deletions
|
|
@ -3,7 +3,7 @@ target_sources(SRB2SDL2 PRIVATE
|
|||
extras-addons.c
|
||||
extras-challenges.c
|
||||
extras-egg-tv.cpp
|
||||
extras-statistics.c
|
||||
extras-statistics.cpp
|
||||
extras-wrong.c
|
||||
main-1.c
|
||||
main-goner.cpp
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ static void M_StatisticsMaps(void)
|
|||
UINT16 i;
|
||||
boolean headerexists;
|
||||
|
||||
statisticsmenu.maplist = Z_Malloc(sizeof(UINT16) * (nummapheaders+1 + numkartcupheaders), PU_STATIC, NULL);
|
||||
statisticsmenu.maplist = static_cast<UINT16*>(Z_Malloc(sizeof(UINT16) * (nummapheaders+1 + numkartcupheaders), PU_STATIC, NULL));
|
||||
statisticsmenu.nummaps = 0;
|
||||
|
||||
// Cups
|
||||
|
|
@ -119,7 +119,7 @@ static void M_StatisticsChars(void)
|
|||
{
|
||||
UINT16 i;
|
||||
|
||||
statisticsmenu.maplist = Z_Malloc(sizeof(UINT16) * (1 + numskins), PU_STATIC, NULL);
|
||||
statisticsmenu.maplist = static_cast<UINT16*>(Z_Malloc(sizeof(UINT16) * (1 + numskins), PU_STATIC, NULL));
|
||||
statisticsmenu.nummaps = 0;
|
||||
|
||||
UINT32 beststat = 0;
|
||||
|
|
@ -208,7 +208,7 @@ static void M_StatisticsChars(void)
|
|||
|
||||
static void M_StatisticsGP(void)
|
||||
{
|
||||
statisticsmenu.maplist = Z_Malloc(sizeof(UINT16) * (1 + numkartcupheaders), PU_STATIC, NULL);
|
||||
statisticsmenu.maplist = static_cast<UINT16*>(Z_Malloc(sizeof(UINT16) * (1 + numkartcupheaders), PU_STATIC, NULL));
|
||||
statisticsmenu.nummaps = 0;
|
||||
|
||||
cupheader_t *cup;
|
||||
|
|
@ -305,15 +305,17 @@ boolean M_StatisticsInputs(INT32 ch)
|
|||
{
|
||||
M_StatisticsPageClear();
|
||||
|
||||
statisticsmenu.page +=
|
||||
statisticspage_max
|
||||
int newpage = static_cast<int>(statisticsmenu.page)
|
||||
+ static_cast<int>(statisticspage_max)
|
||||
+ (
|
||||
(menucmd[pid].dpad_lr > 0)
|
||||
? 1
|
||||
: -1
|
||||
);
|
||||
|
||||
statisticsmenu.page %= statisticspage_max;
|
||||
newpage %= static_cast<int>(statisticspage_max);
|
||||
|
||||
statisticsmenu.page = static_cast<statisticspage_t>(newpage);
|
||||
|
||||
M_StatisticsPageInit();
|
||||
|
||||
Loading…
Add table
Reference in a new issue