mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
K_drawKartPositionFaces: refactor into class so splitscreen drawing methods can be added
This commit is contained in:
parent
a14adfa410
commit
c3a6f6b77d
1 changed files with 40 additions and 18 deletions
|
|
@ -2211,24 +2211,20 @@ static void K_DrawKartPositionNum(UINT8 num)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean K_drawKartPositionFaces(void)
|
struct PositionFacesInfo
|
||||||
{
|
{
|
||||||
// FACE_X = 15; // 15
|
INT32 ranklines = 0;
|
||||||
// FACE_Y = 72; // 72
|
INT32 strank = -1;
|
||||||
|
INT32 numplayersingame = 0;
|
||||||
|
INT32 rankplayer[MAXPLAYERS] = {};
|
||||||
|
|
||||||
INT32 Y = FACE_Y-9; // -9 to offset where it's being drawn if there are more than one
|
PositionFacesInfo();
|
||||||
INT32 i, j, ranklines, strank = -1;
|
void draw_1p();
|
||||||
boolean completed[MAXPLAYERS];
|
};
|
||||||
INT32 rankplayer[MAXPLAYERS];
|
|
||||||
INT32 bumperx, emeraldx, numplayersingame = 0;
|
|
||||||
INT32 xoff, yoff, flipflag = 0;
|
|
||||||
UINT8 workingskin;
|
|
||||||
UINT8 *colormap;
|
|
||||||
UINT32 skinflags;
|
|
||||||
|
|
||||||
ranklines = 0;
|
PositionFacesInfo::PositionFacesInfo()
|
||||||
memset(completed, 0, sizeof (completed));
|
{
|
||||||
memset(rankplayer, 0, sizeof (rankplayer));
|
INT32 i, j;
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
{
|
{
|
||||||
|
|
@ -2241,10 +2237,9 @@ static boolean K_drawKartPositionFaces(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (numplayersingame <= 1)
|
if (numplayersingame <= 1)
|
||||||
return true;
|
return;
|
||||||
|
|
||||||
if (!LUA_HudEnabled(hud_minirankings))
|
boolean completed[MAXPLAYERS] = {};
|
||||||
return false; // Don't proceed but still return true for free play above if HUD is disabled.
|
|
||||||
|
|
||||||
for (j = 0; j < numplayersingame; j++)
|
for (j = 0; j < numplayersingame; j++)
|
||||||
{
|
{
|
||||||
|
|
@ -2273,6 +2268,20 @@ static boolean K_drawKartPositionFaces(void)
|
||||||
|
|
||||||
ranklines++;
|
ranklines++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PositionFacesInfo::draw_1p()
|
||||||
|
{
|
||||||
|
// FACE_X = 15; // 15
|
||||||
|
// FACE_Y = 72; // 72
|
||||||
|
|
||||||
|
INT32 Y = FACE_Y-9; // -9 to offset where it's being drawn if there are more than one
|
||||||
|
INT32 i, j;
|
||||||
|
INT32 bumperx, emeraldx;
|
||||||
|
INT32 xoff, yoff, flipflag = 0;
|
||||||
|
UINT8 workingskin;
|
||||||
|
UINT8 *colormap;
|
||||||
|
UINT32 skinflags;
|
||||||
|
|
||||||
if (gametyperules & GTR_POINTLIMIT) // playing battle
|
if (gametyperules & GTR_POINTLIMIT) // playing battle
|
||||||
Y += (9*5) - 5; // <-- arbitrary calculation
|
Y += (9*5) - 5; // <-- arbitrary calculation
|
||||||
|
|
@ -2456,6 +2465,19 @@ static boolean K_drawKartPositionFaces(void)
|
||||||
|
|
||||||
Y -= 18;
|
Y -= 18;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static boolean K_drawKartPositionFaces(void)
|
||||||
|
{
|
||||||
|
PositionFacesInfo state{};
|
||||||
|
|
||||||
|
if (state.numplayersingame <= 1)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (!LUA_HudEnabled(hud_minirankings))
|
||||||
|
return false; // Don't proceed but still return true for free play above if HUD is disabled.
|
||||||
|
|
||||||
|
state.draw_1p();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue