mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-02-21 03:11:24 +00:00
Last few finishing touches for the HUD
Battle Mode cards & Race countdown timers display properly
This commit is contained in:
parent
189d2f7a34
commit
ab010f91b0
6 changed files with 53 additions and 30 deletions
|
@ -422,8 +422,7 @@ extern UINT8 maxXtraLife; // Max extra lives from rings
|
|||
extern mobj_t *hunt1, *hunt2, *hunt3; // Emerald hunt locations
|
||||
|
||||
// For racing
|
||||
extern UINT32 countdown;
|
||||
extern UINT32 countdown2;
|
||||
extern UINT32 countdown, countdown2;
|
||||
|
||||
extern fixed_t gravity;
|
||||
|
||||
|
|
49
src/k_kart.c
49
src/k_kart.c
|
@ -4140,7 +4140,7 @@ static void K_initKartHUD(void)
|
|||
}
|
||||
}
|
||||
|
||||
static INT32 K_calcSplitFlags(INT32 snapflags)
|
||||
INT32 K_calcSplitFlags(INT32 snapflags)
|
||||
{
|
||||
INT32 splitflags = 0;
|
||||
|
||||
|
@ -5053,9 +5053,12 @@ static void K_drawBattleFullscreen(void)
|
|||
{
|
||||
INT32 x = BASEVIDWIDTH/2;
|
||||
INT32 y = -64+(stplyr->kartstuff[k_cardanimation]); // card animation goes from 0 to 164, 164 is the middle of the screen
|
||||
fixed_t scale = FRACUNIT;
|
||||
|
||||
if (splitscreen)
|
||||
{
|
||||
scale /= 2;
|
||||
|
||||
if ((splitscreen == 1 && stplyr == &players[secondarydisplayplayer])
|
||||
|| (splitscreen > 1 && (stplyr == &players[thirddisplayplayer] || stplyr == &players[fourthdisplayplayer])))
|
||||
y = 232-(stplyr->kartstuff[k_cardanimation]/2);
|
||||
|
@ -5078,45 +5081,53 @@ static void K_drawBattleFullscreen(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (stplyr == &players[displayplayer])
|
||||
V_DrawFadeScreen();
|
||||
|
||||
if (stplyr->exiting)
|
||||
{
|
||||
if (stplyr == &players[displayplayer])
|
||||
V_DrawFadeScreen();
|
||||
if (stplyr->kartstuff[k_balloon])
|
||||
V_DrawScaledPatch(x, y, 0, kp_battlewin);
|
||||
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, scale, 0, kp_battlewin, NULL);
|
||||
else if (splitscreen < 2)
|
||||
V_DrawScaledPatch(x, y, 0, kp_battlelose);
|
||||
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, scale, 0, kp_battlelose, NULL);
|
||||
}
|
||||
else if (stplyr->kartstuff[k_balloon] <= 0 && stplyr->kartstuff[k_comebacktimer] && cv_kartcomeback.value)
|
||||
{
|
||||
INT32 t = stplyr->kartstuff[k_comebacktimer]/TICRATE;
|
||||
INT32 tx = x;
|
||||
INT32 ty = (BASEVIDHEIGHT/2) + 66;
|
||||
INT32 txoff = 0;
|
||||
INT32 ty = (BASEVIDHEIGHT/2)+66;
|
||||
|
||||
if (t == 0)
|
||||
tx -= 8;
|
||||
txoff = 8;
|
||||
else
|
||||
{
|
||||
while (t)
|
||||
{
|
||||
tx -= 8;
|
||||
txoff += 8;
|
||||
t /= 10;
|
||||
}
|
||||
}
|
||||
|
||||
if (!stplyr->kartstuff[k_comebackshowninfo] && !splitscreen)
|
||||
V_DrawScaledPatch(x, y, 0, kp_battleinfo);
|
||||
if (splitscreen)
|
||||
{
|
||||
if (splitscreen > 2)
|
||||
ty = (BASEVIDHEIGHT/4)+33;
|
||||
if ((splitscreen == 1 && stplyr == &players[secondarydisplayplayer])
|
||||
|| stplyr == &players[thirddisplayplayer] || stplyr == &players[fourthdisplayplayer])
|
||||
ty += (BASEVIDHEIGHT/2);
|
||||
}
|
||||
|
||||
if (!stplyr->kartstuff[k_comebackshowninfo])
|
||||
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, scale, 0, kp_battleinfo, NULL);
|
||||
else
|
||||
V_DrawScaledPatch(x, y, 0, kp_battlewait);
|
||||
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, scale, 0, kp_battlewait, NULL);
|
||||
|
||||
if (splitscreen > 1)
|
||||
ty = (BASEVIDHEIGHT/4)+33;
|
||||
|
||||
if (splitscreen < 2)
|
||||
V_DrawScaledPatch(x, ty, 0, kp_timeoutsticker);
|
||||
|
||||
V_DrawKartString(tx, ty, 0, va("%d", stplyr->kartstuff[k_comebacktimer]/TICRATE));
|
||||
V_DrawString(x-(txoff/2), ty, 0, va("%d", stplyr->kartstuff[k_comebacktimer]/TICRATE));
|
||||
else
|
||||
{
|
||||
V_DrawFixedPatch(x<<FRACBITS, ty<<FRACBITS, scale, K_calcSplitFlags(0), kp_timeoutsticker, NULL);
|
||||
V_DrawKartString(x-txoff, ty, 0, va("%d", stplyr->kartstuff[k_comebacktimer]/TICRATE));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground, fixed_t forwardmove
|
|||
void K_MoveKartPlayer(player_t *player, boolean onground);
|
||||
void K_CheckBalloons(void);
|
||||
|
||||
INT32 K_calcSplitFlags(INT32 snapflags);
|
||||
void K_LoadKartHUDGraphics(void);
|
||||
fixed_t K_FindCheckX(fixed_t px, fixed_t py, angle_t ang, fixed_t mx, fixed_t my);
|
||||
void K_drawKartHUD(void);
|
||||
|
|
|
@ -2009,8 +2009,7 @@ boolean P_CheckRacers(void)
|
|||
|
||||
if (i == MAXPLAYERS) // finished
|
||||
{
|
||||
countdown = 0;
|
||||
countdown2 = 0;
|
||||
countdown = countdown2 = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
15
src/p_spec.c
15
src/p_spec.c
|
@ -4146,12 +4146,15 @@ DoneSection2:
|
|||
if (player->pflags & PF_NIGHTSMODE)
|
||||
player->drillmeter += 48*20;
|
||||
|
||||
if (player->laps >= (UINT8)cv_numlaps.value)
|
||||
CONS_Printf(M_GetText("%s has finished the race.\n"), player_names[player-players]);
|
||||
else if (player->laps == (UINT8)(cv_numlaps.value - 1))
|
||||
CONS_Printf("%s started the final lap\n", player_names[player-players]);
|
||||
else
|
||||
CONS_Printf(M_GetText("%s started lap %u\n"), player_names[player-players], (UINT32)player->laps+1);
|
||||
if (netgame)
|
||||
{
|
||||
if (player->laps >= (UINT8)cv_numlaps.value)
|
||||
CONS_Printf(M_GetText("%s has finished the race.\n"), player_names[player-players]);
|
||||
else if (player->laps == (UINT8)(cv_numlaps.value - 1))
|
||||
CONS_Printf("%s started the final lap\n", player_names[player-players]);
|
||||
else
|
||||
CONS_Printf(M_GetText("%s started lap %u\n"), player_names[player-players], (UINT32)player->laps+1);
|
||||
}
|
||||
|
||||
// Reset starposts (checkpoints) info
|
||||
// SRB2kart 200117
|
||||
|
|
|
@ -1834,7 +1834,17 @@ static void ST_overlayDrawer(void)
|
|||
{
|
||||
// Countdown timer for Race Mode
|
||||
if (countdown)
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(176), 0, va("%d", countdown/TICRATE));
|
||||
{
|
||||
INT32 x = BASEVIDWIDTH/2;
|
||||
INT32 y = BASEVIDHEIGHT-24;
|
||||
if (splitscreen)
|
||||
{
|
||||
y = (BASEVIDHEIGHT/2)-12;
|
||||
if (splitscreen > 1)
|
||||
x = BASEVIDWIDTH/4;
|
||||
}
|
||||
V_DrawCenteredString(x, y, K_calcSplitFlags(0), va("%d", countdown/TICRATE));
|
||||
}
|
||||
|
||||
K_drawKartHUD();
|
||||
|
||||
|
|
Loading…
Reference in a new issue