mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
small hud performance improvement
now that we have spots on the player struct for both gradingfactor and exp, store exp in the exp field after adjusting gradingfactor, and just reference it instead of recalculating every time
This commit is contained in:
parent
144e2be262
commit
50fd04bdb1
5 changed files with 8 additions and 7 deletions
|
|
@ -4716,8 +4716,8 @@ static void G_DoCompleted(void)
|
||||||
|
|
||||||
if (grandprixinfo.eventmode == GPEVENT_NONE)
|
if (grandprixinfo.eventmode == GPEVENT_NONE)
|
||||||
{
|
{
|
||||||
grandprixinfo.rank.winPoints += K_CalculateGPRankPoints(K_GetEXP(player), grandprixinfo.rank.position, grandprixinfo.rank.totalPlayers);
|
grandprixinfo.rank.winPoints += K_CalculateGPRankPoints(player->exp, grandprixinfo.rank.position, grandprixinfo.rank.totalPlayers);
|
||||||
grandprixinfo.rank.exp += K_GetEXP(player);
|
grandprixinfo.rank.exp += player->exp;
|
||||||
}
|
}
|
||||||
else if (grandprixinfo.eventmode == GPEVENT_SPECIAL)
|
else if (grandprixinfo.eventmode == GPEVENT_SPECIAL)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3246,7 +3246,7 @@ static boolean K_drawKartLaps(void)
|
||||||
INT32 bump = 0;
|
INT32 bump = 0;
|
||||||
boolean drewsticker = false;
|
boolean drewsticker = false;
|
||||||
|
|
||||||
UINT16 displayEXP = K_GetEXP(stplyr);
|
UINT16 displayEXP = stplyr->exp;
|
||||||
|
|
||||||
// Jesus Christ.
|
// Jesus Christ.
|
||||||
// I do not understand the way this system of offsets is laid out at all,
|
// I do not understand the way this system of offsets is laid out at all,
|
||||||
|
|
|
||||||
|
|
@ -4235,6 +4235,7 @@ void K_CheckpointCrossAward(player_t *player)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
player->gradingfactor += K_GetGradingMultAdjustment(player);
|
player->gradingfactor += K_GetGradingMultAdjustment(player);
|
||||||
|
player->exp = K_GetEXP(player);
|
||||||
if (!player->cangrabitems)
|
if (!player->cangrabitems)
|
||||||
player->cangrabitems = 1;
|
player->cangrabitems = 1;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -343,12 +343,12 @@ void level_tally_t::Init(player_t *player)
|
||||||
|
|
||||||
if ((gametypes[gt]->rules & GTR_CIRCUIT) == GTR_CIRCUIT)
|
if ((gametypes[gt]->rules & GTR_CIRCUIT) == GTR_CIRCUIT)
|
||||||
{
|
{
|
||||||
UINT16 displayEXP = K_GetEXP(player);
|
UINT16 displayEXP = player->exp;
|
||||||
|
|
||||||
if (displayEXP != UINT16_MAX)
|
if (displayEXP != UINT16_MAX)
|
||||||
{
|
{
|
||||||
exp = displayEXP;
|
exp = displayEXP;
|
||||||
totalExp = 100;
|
totalExp = TARGETEXP;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -309,7 +309,7 @@ static void Y_CalculateMatchData(UINT8 rankingsmode, void (*comparison)(INT32))
|
||||||
if (data.pos[data.numplayers] < pointgetters
|
if (data.pos[data.numplayers] < pointgetters
|
||||||
&& !(players[i].pflags & PF_NOCONTEST))
|
&& !(players[i].pflags & PF_NOCONTEST))
|
||||||
{
|
{
|
||||||
data.increase[i] = K_CalculateGPRankPoints(K_GetEXP(&players[i]), data.pos[data.numplayers], pointgetters);
|
data.increase[i] = K_CalculateGPRankPoints((&players[i])->exp, data.pos[data.numplayers], pointgetters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2196,7 +2196,7 @@ static UINT32 Y_EstimatePodiumScore(player_t *const player, UINT8 numPlaying)
|
||||||
UINT8 pos = Y_PlayersBestPossiblePosition(player);
|
UINT8 pos = Y_PlayersBestPossiblePosition(player);
|
||||||
UINT32 ourScore = player->score;
|
UINT32 ourScore = player->score;
|
||||||
|
|
||||||
ourScore += K_CalculateGPRankPoints(K_GetEXP(player), pos, numPlaying);
|
ourScore += K_CalculateGPRankPoints(player->exp, pos, numPlaying);
|
||||||
|
|
||||||
return ourScore;
|
return ourScore;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue