mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 03:51:50 +00:00
Very minor fix to WRONG WAY
More opaque waypoint markers for kartdebugwaypoints Looks like whitespace got murdered in k_kart.c again
This commit is contained in:
parent
738d1f1940
commit
e874af3e43
2 changed files with 355 additions and 343 deletions
695
src/k_kart.c
695
src/k_kart.c
|
|
@ -2217,44 +2217,44 @@ void K_RespawnChecker(player_t *player)
|
|||
S_StartSound(player->mo, sfx_s23c);
|
||||
player->kartstuff[k_startboost] = 50;
|
||||
K_SpawnDashDustRelease(player);
|
||||
}
|
||||
}
|
||||
|
||||
player->mo->colorized = false;
|
||||
player->kartstuff[k_dropdash] = 0;
|
||||
player->kartstuff[k_respawn] = 0;
|
||||
player->kartstuff[k_respawn] = 0;
|
||||
|
||||
//P_PlayRinglossSound(player->mo);
|
||||
P_PlayerRingBurst(player, 3);
|
||||
|
||||
if (G_BattleGametype())
|
||||
{
|
||||
if (player->kartstuff[k_bumper] > 0)
|
||||
{
|
||||
if (player->kartstuff[k_bumper] == 1)
|
||||
{
|
||||
mobj_t *karmahitbox = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_KARMAHITBOX); // Player hitbox is too small!!
|
||||
P_SetTarget(&karmahitbox->target, player->mo);
|
||||
karmahitbox->destscale = player->mo->scale;
|
||||
P_SetScale(karmahitbox, player->mo->scale);
|
||||
CONS_Printf(M_GetText("%s lost all of their bumpers!\n"), player_names[player-players]);
|
||||
}
|
||||
player->kartstuff[k_bumper]--;
|
||||
if (K_IsPlayerWanted(player))
|
||||
K_CalculateBattleWanted();
|
||||
}
|
||||
|
||||
if (!player->kartstuff[k_bumper])
|
||||
{
|
||||
player->kartstuff[k_comebacktimer] = comebacktime;
|
||||
if (player->kartstuff[k_comebackmode] == 2)
|
||||
{
|
||||
mobj_t *poof = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_EXPLODE);
|
||||
S_StartSound(poof, mobjinfo[MT_KARMAHITBOX].seesound);
|
||||
player->kartstuff[k_comebackmode] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
K_CheckBumpers();
|
||||
P_PlayerRingBurst(player, 3);
|
||||
|
||||
if (G_BattleGametype())
|
||||
{
|
||||
if (player->kartstuff[k_bumper] > 0)
|
||||
{
|
||||
if (player->kartstuff[k_bumper] == 1)
|
||||
{
|
||||
mobj_t *karmahitbox = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_KARMAHITBOX); // Player hitbox is too small!!
|
||||
P_SetTarget(&karmahitbox->target, player->mo);
|
||||
karmahitbox->destscale = player->mo->scale;
|
||||
P_SetScale(karmahitbox, player->mo->scale);
|
||||
CONS_Printf(M_GetText("%s lost all of their bumpers!\n"), player_names[player-players]);
|
||||
}
|
||||
player->kartstuff[k_bumper]--;
|
||||
if (K_IsPlayerWanted(player))
|
||||
K_CalculateBattleWanted();
|
||||
}
|
||||
|
||||
if (!player->kartstuff[k_bumper])
|
||||
{
|
||||
player->kartstuff[k_comebacktimer] = comebacktime;
|
||||
if (player->kartstuff[k_comebackmode] == 2)
|
||||
{
|
||||
mobj_t *poof = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_EXPLODE);
|
||||
S_StartSound(poof, mobjinfo[MT_KARMAHITBOX].seesound);
|
||||
player->kartstuff[k_comebackmode] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
K_CheckBumpers();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5566,25 +5566,25 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
player->mo->colorized = false;
|
||||
player->mo->color = player->skincolor;
|
||||
}
|
||||
}
|
||||
else if (player->kartstuff[k_killfield]) // You're gonna REALLY diiiiie
|
||||
{
|
||||
const INT32 flashtime = 4<<(4-(player->kartstuff[k_killfield]/TICRATE));
|
||||
if (player->kartstuff[k_killfield] == 1 || (player->kartstuff[k_killfield] % (flashtime/2) != 0))
|
||||
{
|
||||
player->mo->colorized = false;
|
||||
player->mo->color = player->skincolor;
|
||||
}
|
||||
else if (player->kartstuff[k_killfield] % flashtime == 0)
|
||||
{
|
||||
player->mo->colorized = true;
|
||||
player->mo->color = SKINCOLOR_BYZANTIUM;
|
||||
}
|
||||
else
|
||||
{
|
||||
player->mo->colorized = true;
|
||||
player->mo->color = SKINCOLOR_RUBY;
|
||||
}
|
||||
}
|
||||
else if (player->kartstuff[k_killfield]) // You're gonna REALLY diiiiie
|
||||
{
|
||||
const INT32 flashtime = 4<<(4-(player->kartstuff[k_killfield]/TICRATE));
|
||||
if (player->kartstuff[k_killfield] == 1 || (player->kartstuff[k_killfield] % (flashtime/2) != 0))
|
||||
{
|
||||
player->mo->colorized = false;
|
||||
player->mo->color = player->skincolor;
|
||||
}
|
||||
else if (player->kartstuff[k_killfield] % flashtime == 0)
|
||||
{
|
||||
player->mo->colorized = true;
|
||||
player->mo->color = SKINCOLOR_BYZANTIUM;
|
||||
}
|
||||
else
|
||||
{
|
||||
player->mo->colorized = true;
|
||||
player->mo->color = SKINCOLOR_RUBY;
|
||||
}
|
||||
}
|
||||
else if (player->kartstuff[k_ringboost] && (leveltime & 1)) // ring boosting
|
||||
{
|
||||
|
|
@ -5764,27 +5764,27 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
|
||||
K_KartPlayerHUDUpdate(player);
|
||||
|
||||
if (G_BattleGametype() && player->kartstuff[k_bumper] > 0
|
||||
&& !player->kartstuff[k_spinouttimer] && !player->kartstuff[k_squishedtimer]
|
||||
&& !player->kartstuff[k_respawn] && !player->powers[pw_flashing])
|
||||
{
|
||||
player->kartstuff[k_wanted]++;
|
||||
if (battleovertime.enabled >= 10*TICRATE)
|
||||
{
|
||||
if (P_AproxDistance(player->mo->x - battleovertime.x, player->mo->y - battleovertime.y) > battleovertime.radius)
|
||||
{
|
||||
player->kartstuff[k_killfield]++;
|
||||
if (player->kartstuff[k_killfield] > 4*TICRATE)
|
||||
{
|
||||
K_SpinPlayer(player, NULL, 0, NULL, false);
|
||||
//player->kartstuff[k_killfield] = 1;
|
||||
}
|
||||
}
|
||||
else if (player->kartstuff[k_killfield] > 0)
|
||||
player->kartstuff[k_killfield]--;
|
||||
}
|
||||
}
|
||||
else if (player->kartstuff[k_killfield] > 0)
|
||||
if (G_BattleGametype() && player->kartstuff[k_bumper] > 0
|
||||
&& !player->kartstuff[k_spinouttimer] && !player->kartstuff[k_squishedtimer]
|
||||
&& !player->kartstuff[k_respawn] && !player->powers[pw_flashing])
|
||||
{
|
||||
player->kartstuff[k_wanted]++;
|
||||
if (battleovertime.enabled >= 10*TICRATE)
|
||||
{
|
||||
if (P_AproxDistance(player->mo->x - battleovertime.x, player->mo->y - battleovertime.y) > battleovertime.radius)
|
||||
{
|
||||
player->kartstuff[k_killfield]++;
|
||||
if (player->kartstuff[k_killfield] > 4*TICRATE)
|
||||
{
|
||||
K_SpinPlayer(player, NULL, 0, NULL, false);
|
||||
//player->kartstuff[k_killfield] = 1;
|
||||
}
|
||||
}
|
||||
else if (player->kartstuff[k_killfield] > 0)
|
||||
player->kartstuff[k_killfield]--;
|
||||
}
|
||||
}
|
||||
else if (player->kartstuff[k_killfield] > 0)
|
||||
player->kartstuff[k_killfield]--;
|
||||
|
||||
if (P_IsObjectOnGround(player->mo))
|
||||
|
|
@ -6012,8 +6012,14 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
|
|||
{
|
||||
bestwaypoint = waypoint->nextwaypoints[i];
|
||||
|
||||
nextbestdelta = angledelta;
|
||||
nextbestmomdelta = momdelta;
|
||||
if (angledelta < nextbestdelta)
|
||||
{
|
||||
nextbestdelta = angledelta;
|
||||
}
|
||||
if (momdelta < nextbestmomdelta)
|
||||
{
|
||||
nextbestmomdelta = momdelta;
|
||||
}
|
||||
|
||||
// Remove wrong way flag if we're using nextwaypoints
|
||||
player->kartstuff[k_wrongway] = 0;
|
||||
|
|
@ -6049,7 +6055,7 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
|
|||
nextbestdelta = angledelta;
|
||||
nextbestmomdelta = momdelta;
|
||||
|
||||
// Ser wrong way flag if we're using prevwaypoints
|
||||
// Set wrong way flag if we're using prevwaypoints
|
||||
player->kartstuff[k_wrongway] = 1;
|
||||
updaterespawn = false;
|
||||
}
|
||||
|
|
@ -7811,7 +7817,7 @@ static patch_t *kp_lapanim_number[10][3];
|
|||
static patch_t *kp_lapanim_emblem[2];
|
||||
static patch_t *kp_lapanim_hand[3];
|
||||
|
||||
static patch_t *kp_yougotem;
|
||||
static patch_t *kp_yougotem;
|
||||
static patch_t *kp_itemminimap;
|
||||
|
||||
static patch_t *kp_alagles[10];
|
||||
|
|
@ -8117,7 +8123,7 @@ void K_LoadKartHUDGraphics(void)
|
|||
kp_lapanim_hand[i] = (patch_t *) W_CachePatchName(buffer, PU_HUDGFX);
|
||||
}
|
||||
|
||||
kp_yougotem = (patch_t *) W_CachePatchName("YOUGOTEM", PU_HUDGFX);
|
||||
kp_yougotem = (patch_t *) W_CachePatchName("YOUGOTEM", PU_HUDGFX);
|
||||
kp_itemminimap = (patch_t *) W_CachePatchName("MMAPITEM", PU_HUDGFX);
|
||||
|
||||
sprintf(buffer, "ALAGLESx");
|
||||
|
|
@ -9682,247 +9688,247 @@ static void K_drawKartPlayerCheck(void)
|
|||
V_DrawMappedPatch(x, CHEK_Y, V_HUDTRANS|splitflags, kp_check[pnum], colormap);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void K_drawKartMinimapIcon(fixed_t objx, fixed_t objy, INT32 hudx, INT32 hudy, INT32 flags, patch_t *icon, UINT8 *colormap, patch_t *AutomapPic)
|
||||
{
|
||||
// amnum xpos & ypos are the icon's speed around the HUD.
|
||||
// The number being divided by is for how fast it moves.
|
||||
// The higher the number, the slower it moves.
|
||||
|
||||
// am xpos & ypos are the icon's starting position. Withouht
|
||||
// it, they wouldn't 'spawn' on the top-right side of the HUD.
|
||||
|
||||
fixed_t amnumxpos, amnumypos;
|
||||
INT32 amxpos, amypos;
|
||||
|
||||
node_t *bsp = &nodes[numnodes-1];
|
||||
fixed_t maxx, minx, maxy, miny;
|
||||
|
||||
fixed_t mapwidth, mapheight;
|
||||
fixed_t xoffset, yoffset;
|
||||
fixed_t xscale, yscale, zoom;
|
||||
|
||||
maxx = maxy = INT32_MAX;
|
||||
minx = miny = INT32_MIN;
|
||||
minx = bsp->bbox[0][BOXLEFT];
|
||||
maxx = bsp->bbox[0][BOXRIGHT];
|
||||
miny = bsp->bbox[0][BOXBOTTOM];
|
||||
maxy = bsp->bbox[0][BOXTOP];
|
||||
|
||||
if (bsp->bbox[1][BOXLEFT] < minx)
|
||||
minx = bsp->bbox[1][BOXLEFT];
|
||||
if (bsp->bbox[1][BOXRIGHT] > maxx)
|
||||
maxx = bsp->bbox[1][BOXRIGHT];
|
||||
if (bsp->bbox[1][BOXBOTTOM] < miny)
|
||||
miny = bsp->bbox[1][BOXBOTTOM];
|
||||
if (bsp->bbox[1][BOXTOP] > maxy)
|
||||
maxy = bsp->bbox[1][BOXTOP];
|
||||
|
||||
// You might be wondering why these are being bitshift here
|
||||
// it's because mapwidth and height would otherwise overflow for maps larger than half the size possible...
|
||||
// map boundaries and sizes will ALWAYS be whole numbers thankfully
|
||||
// later calculations take into consideration that these are actually not in terms of FRACUNIT though
|
||||
minx >>= FRACBITS;
|
||||
maxx >>= FRACBITS;
|
||||
miny >>= FRACBITS;
|
||||
maxy >>= FRACBITS;
|
||||
|
||||
mapwidth = maxx - minx;
|
||||
mapheight = maxy - miny;
|
||||
|
||||
// These should always be small enough to be bitshift back right now
|
||||
xoffset = (minx + mapwidth/2)<<FRACBITS;
|
||||
yoffset = (miny + mapheight/2)<<FRACBITS;
|
||||
|
||||
xscale = FixedDiv(AutomapPic->width, mapwidth);
|
||||
yscale = FixedDiv(AutomapPic->height, mapheight);
|
||||
zoom = FixedMul(min(xscale, yscale), FRACUNIT-FRACUNIT/20);
|
||||
|
||||
amnumxpos = (FixedMul(objx, zoom) - FixedMul(xoffset, zoom));
|
||||
amnumypos = -(FixedMul(objy, zoom) - FixedMul(yoffset, zoom));
|
||||
|
||||
if (encoremode)
|
||||
amnumxpos = -amnumxpos;
|
||||
|
||||
amxpos = amnumxpos + ((hudx + AutomapPic->width/2 - (icon->width/2))<<FRACBITS);
|
||||
amypos = amnumypos + ((hudy + AutomapPic->height/2 - (icon->height/2))<<FRACBITS);
|
||||
|
||||
// do we want this? it feels unnecessary. easier to just modify the amnumxpos?
|
||||
/*if (encoremode)
|
||||
{
|
||||
flags |= V_FLIP;
|
||||
amxpos = -amnumxpos + ((hudx + AutomapPic->width/2 + (icon->width/2))<<FRACBITS);
|
||||
}*/
|
||||
|
||||
V_DrawFixedPatch(amxpos, amypos, FRACUNIT, flags, icon, colormap);
|
||||
}
|
||||
|
||||
static void K_drawKartMinimap(void)
|
||||
{
|
||||
INT32 lumpnum;
|
||||
patch_t *AutomapPic;
|
||||
INT32 i = 0;
|
||||
INT32 x, y;
|
||||
INT32 minimaptrans, splitflags = (splitscreen == 3 ? 0 : V_SNAPTORIGHT); // flags should only be 0 when it's centered (4p split)
|
||||
UINT8 skin = 0;
|
||||
UINT8 *colormap = NULL;
|
||||
SINT8 localplayers[4];
|
||||
static void K_drawKartMinimapIcon(fixed_t objx, fixed_t objy, INT32 hudx, INT32 hudy, INT32 flags, patch_t *icon, UINT8 *colormap, patch_t *AutomapPic)
|
||||
{
|
||||
// amnum xpos & ypos are the icon's speed around the HUD.
|
||||
// The number being divided by is for how fast it moves.
|
||||
// The higher the number, the slower it moves.
|
||||
|
||||
// am xpos & ypos are the icon's starting position. Withouht
|
||||
// it, they wouldn't 'spawn' on the top-right side of the HUD.
|
||||
|
||||
fixed_t amnumxpos, amnumypos;
|
||||
INT32 amxpos, amypos;
|
||||
|
||||
node_t *bsp = &nodes[numnodes-1];
|
||||
fixed_t maxx, minx, maxy, miny;
|
||||
|
||||
fixed_t mapwidth, mapheight;
|
||||
fixed_t xoffset, yoffset;
|
||||
fixed_t xscale, yscale, zoom;
|
||||
|
||||
maxx = maxy = INT32_MAX;
|
||||
minx = miny = INT32_MIN;
|
||||
minx = bsp->bbox[0][BOXLEFT];
|
||||
maxx = bsp->bbox[0][BOXRIGHT];
|
||||
miny = bsp->bbox[0][BOXBOTTOM];
|
||||
maxy = bsp->bbox[0][BOXTOP];
|
||||
|
||||
if (bsp->bbox[1][BOXLEFT] < minx)
|
||||
minx = bsp->bbox[1][BOXLEFT];
|
||||
if (bsp->bbox[1][BOXRIGHT] > maxx)
|
||||
maxx = bsp->bbox[1][BOXRIGHT];
|
||||
if (bsp->bbox[1][BOXBOTTOM] < miny)
|
||||
miny = bsp->bbox[1][BOXBOTTOM];
|
||||
if (bsp->bbox[1][BOXTOP] > maxy)
|
||||
maxy = bsp->bbox[1][BOXTOP];
|
||||
|
||||
// You might be wondering why these are being bitshift here
|
||||
// it's because mapwidth and height would otherwise overflow for maps larger than half the size possible...
|
||||
// map boundaries and sizes will ALWAYS be whole numbers thankfully
|
||||
// later calculations take into consideration that these are actually not in terms of FRACUNIT though
|
||||
minx >>= FRACBITS;
|
||||
maxx >>= FRACBITS;
|
||||
miny >>= FRACBITS;
|
||||
maxy >>= FRACBITS;
|
||||
|
||||
mapwidth = maxx - minx;
|
||||
mapheight = maxy - miny;
|
||||
|
||||
// These should always be small enough to be bitshift back right now
|
||||
xoffset = (minx + mapwidth/2)<<FRACBITS;
|
||||
yoffset = (miny + mapheight/2)<<FRACBITS;
|
||||
|
||||
xscale = FixedDiv(AutomapPic->width, mapwidth);
|
||||
yscale = FixedDiv(AutomapPic->height, mapheight);
|
||||
zoom = FixedMul(min(xscale, yscale), FRACUNIT-FRACUNIT/20);
|
||||
|
||||
amnumxpos = (FixedMul(objx, zoom) - FixedMul(xoffset, zoom));
|
||||
amnumypos = -(FixedMul(objy, zoom) - FixedMul(yoffset, zoom));
|
||||
|
||||
if (encoremode)
|
||||
amnumxpos = -amnumxpos;
|
||||
|
||||
amxpos = amnumxpos + ((hudx + AutomapPic->width/2 - (icon->width/2))<<FRACBITS);
|
||||
amypos = amnumypos + ((hudy + AutomapPic->height/2 - (icon->height/2))<<FRACBITS);
|
||||
|
||||
// do we want this? it feels unnecessary. easier to just modify the amnumxpos?
|
||||
/*if (encoremode)
|
||||
{
|
||||
flags |= V_FLIP;
|
||||
amxpos = -amnumxpos + ((hudx + AutomapPic->width/2 + (icon->width/2))<<FRACBITS);
|
||||
}*/
|
||||
|
||||
V_DrawFixedPatch(amxpos, amypos, FRACUNIT, flags, icon, colormap);
|
||||
}
|
||||
|
||||
static void K_drawKartMinimap(void)
|
||||
{
|
||||
INT32 lumpnum;
|
||||
patch_t *AutomapPic;
|
||||
INT32 i = 0;
|
||||
INT32 x, y;
|
||||
INT32 minimaptrans, splitflags = (splitscreen == 3 ? 0 : V_SNAPTORIGHT); // flags should only be 0 when it's centered (4p split)
|
||||
UINT8 skin = 0;
|
||||
UINT8 *colormap = NULL;
|
||||
SINT8 localplayers[4];
|
||||
SINT8 numlocalplayers = 0;
|
||||
mobj_t *mobj, *next; // for SPB drawing (or any other item(s) we may wanna draw, I dunno!)
|
||||
|
||||
// Draw the HUD only when playing in a level.
|
||||
// hu_stuff needs this, unlike st_stuff.
|
||||
if (gamestate != GS_LEVEL)
|
||||
return;
|
||||
mobj_t *mobj, *next; // for SPB drawing (or any other item(s) we may wanna draw, I dunno!)
|
||||
|
||||
// Draw the HUD only when playing in a level.
|
||||
// hu_stuff needs this, unlike st_stuff.
|
||||
if (gamestate != GS_LEVEL)
|
||||
return;
|
||||
|
||||
// Only draw for the first player
|
||||
// Maybe move this somewhere else where this won't be a concern?
|
||||
if (stplyr != &players[displayplayers[0]])
|
||||
return;
|
||||
|
||||
lumpnum = W_CheckNumForName(va("%sR", G_BuildMapName(gamemap)));
|
||||
|
||||
if (lumpnum != -1)
|
||||
AutomapPic = W_CachePatchName(va("%sR", G_BuildMapName(gamemap)), PU_HUDGFX);
|
||||
else
|
||||
return; // no pic, just get outta here
|
||||
|
||||
x = MINI_X - (AutomapPic->width/2);
|
||||
y = MINI_Y - (AutomapPic->height/2);
|
||||
|
||||
if (timeinmap > 105)
|
||||
{
|
||||
minimaptrans = cv_kartminimap.value;
|
||||
if (timeinmap <= 113)
|
||||
minimaptrans = ((((INT32)timeinmap) - 105)*minimaptrans)/(113-105);
|
||||
if (!minimaptrans)
|
||||
return;
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
minimaptrans = ((10-minimaptrans)<<FF_TRANSSHIFT);
|
||||
splitflags |= minimaptrans;
|
||||
|
||||
if (encoremode)
|
||||
V_DrawScaledPatch(x+(AutomapPic->width), y, splitflags|V_FLIP, AutomapPic);
|
||||
else
|
||||
V_DrawScaledPatch(x, y, splitflags, AutomapPic);
|
||||
|
||||
if (!(splitscreen == 2))
|
||||
{
|
||||
splitflags &= ~minimaptrans;
|
||||
splitflags |= V_HUDTRANSHALF;
|
||||
}
|
||||
|
||||
// let offsets transfer to the heads, too!
|
||||
if (encoremode)
|
||||
x += SHORT(AutomapPic->leftoffset);
|
||||
else
|
||||
x -= SHORT(AutomapPic->leftoffset);
|
||||
y -= SHORT(AutomapPic->topoffset);
|
||||
|
||||
// Draw the super item in Battle
|
||||
if (G_BattleGametype() && battleovertime.enabled)
|
||||
{
|
||||
if (battleovertime.enabled >= 10*TICRATE || (battleovertime.enabled & 1))
|
||||
{
|
||||
const INT32 prevsplitflags = splitflags;
|
||||
splitflags &= ~V_HUDTRANSHALF;
|
||||
splitflags |= V_HUDTRANS;
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1))), GTC_CACHE);
|
||||
K_drawKartMinimapIcon(battleovertime.x, battleovertime.y, x, y, splitflags, kp_itemminimap, colormap, AutomapPic);
|
||||
splitflags = prevsplitflags;
|
||||
}
|
||||
}
|
||||
|
||||
// initialize
|
||||
for (i = 0; i < 4; i++)
|
||||
localplayers[i] = -1;
|
||||
|
||||
// Player's tiny icons on the Automap. (drawn opposite direction so player 1 is drawn last in splitscreen)
|
||||
if (ghosts)
|
||||
{
|
||||
demoghost *g = ghosts;
|
||||
while (g)
|
||||
{
|
||||
if (g->mo->skin)
|
||||
skin = ((skin_t*)g->mo->skin)-skins;
|
||||
else
|
||||
skin = 0;
|
||||
if (g->mo->color)
|
||||
{
|
||||
if (g->mo->colorized)
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, g->mo->color, GTC_CACHE);
|
||||
else
|
||||
colormap = R_GetTranslationColormap(skin, g->mo->color, GTC_CACHE);
|
||||
}
|
||||
else
|
||||
colormap = NULL;
|
||||
K_drawKartMinimapIcon(g->mo->x, g->mo->y, x, y, splitflags, facemmapprefix[skin], colormap, AutomapPic);
|
||||
g = g->next;
|
||||
}
|
||||
|
||||
if (!stplyr->mo || stplyr->spectator) // do we need the latter..?
|
||||
return;
|
||||
|
||||
localplayers[numlocalplayers] = stplyr-players;
|
||||
numlocalplayers++;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = MAXPLAYERS-1; i >= 0; i--)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
if (!players[i].mo || players[i].spectator)
|
||||
continue;
|
||||
|
||||
if (i != displayplayers[0] || splitscreen)
|
||||
{
|
||||
if (G_BattleGametype() && players[i].kartstuff[k_bumper] <= 0)
|
||||
continue;
|
||||
|
||||
if (players[i].kartstuff[k_hyudorotimer] > 0)
|
||||
{
|
||||
if (!((players[i].kartstuff[k_hyudorotimer] < 1*TICRATE/2
|
||||
|| players[i].kartstuff[k_hyudorotimer] > hyudorotime-(1*TICRATE/2))
|
||||
&& !(leveltime & 1)))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == displayplayers[0] || i == displayplayers[1] || i == displayplayers[2] || i == displayplayers[3])
|
||||
{
|
||||
// Draw display players on top of everything else
|
||||
localplayers[numlocalplayers] = i;
|
||||
numlocalplayers++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (players[i].mo->skin)
|
||||
skin = ((skin_t*)players[i].mo->skin)-skins;
|
||||
else
|
||||
skin = 0;
|
||||
|
||||
if (players[i].mo->color)
|
||||
{
|
||||
if (players[i].mo->colorized)
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, players[i].mo->color, GTC_CACHE);
|
||||
else
|
||||
colormap = R_GetTranslationColormap(skin, players[i].mo->color, GTC_CACHE);
|
||||
}
|
||||
else
|
||||
colormap = NULL;
|
||||
|
||||
K_drawKartMinimapIcon(players[i].mo->x, players[i].mo->y, x, y, splitflags, facemmapprefix[skin], colormap, AutomapPic);
|
||||
// Maybe move this somewhere else where this won't be a concern?
|
||||
if (stplyr != &players[displayplayers[0]])
|
||||
return;
|
||||
|
||||
lumpnum = W_CheckNumForName(va("%sR", G_BuildMapName(gamemap)));
|
||||
|
||||
if (lumpnum != -1)
|
||||
AutomapPic = W_CachePatchName(va("%sR", G_BuildMapName(gamemap)), PU_HUDGFX);
|
||||
else
|
||||
return; // no pic, just get outta here
|
||||
|
||||
x = MINI_X - (AutomapPic->width/2);
|
||||
y = MINI_Y - (AutomapPic->height/2);
|
||||
|
||||
if (timeinmap > 105)
|
||||
{
|
||||
minimaptrans = cv_kartminimap.value;
|
||||
if (timeinmap <= 113)
|
||||
minimaptrans = ((((INT32)timeinmap) - 105)*minimaptrans)/(113-105);
|
||||
if (!minimaptrans)
|
||||
return;
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
minimaptrans = ((10-minimaptrans)<<FF_TRANSSHIFT);
|
||||
splitflags |= minimaptrans;
|
||||
|
||||
if (encoremode)
|
||||
V_DrawScaledPatch(x+(AutomapPic->width), y, splitflags|V_FLIP, AutomapPic);
|
||||
else
|
||||
V_DrawScaledPatch(x, y, splitflags, AutomapPic);
|
||||
|
||||
if (!(splitscreen == 2))
|
||||
{
|
||||
splitflags &= ~minimaptrans;
|
||||
splitflags |= V_HUDTRANSHALF;
|
||||
}
|
||||
|
||||
// let offsets transfer to the heads, too!
|
||||
if (encoremode)
|
||||
x += SHORT(AutomapPic->leftoffset);
|
||||
else
|
||||
x -= SHORT(AutomapPic->leftoffset);
|
||||
y -= SHORT(AutomapPic->topoffset);
|
||||
|
||||
// Draw the super item in Battle
|
||||
if (G_BattleGametype() && battleovertime.enabled)
|
||||
{
|
||||
if (battleovertime.enabled >= 10*TICRATE || (battleovertime.enabled & 1))
|
||||
{
|
||||
const INT32 prevsplitflags = splitflags;
|
||||
splitflags &= ~V_HUDTRANSHALF;
|
||||
splitflags |= V_HUDTRANS;
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1))), GTC_CACHE);
|
||||
K_drawKartMinimapIcon(battleovertime.x, battleovertime.y, x, y, splitflags, kp_itemminimap, colormap, AutomapPic);
|
||||
splitflags = prevsplitflags;
|
||||
}
|
||||
}
|
||||
|
||||
// initialize
|
||||
for (i = 0; i < 4; i++)
|
||||
localplayers[i] = -1;
|
||||
|
||||
// Player's tiny icons on the Automap. (drawn opposite direction so player 1 is drawn last in splitscreen)
|
||||
if (ghosts)
|
||||
{
|
||||
demoghost *g = ghosts;
|
||||
while (g)
|
||||
{
|
||||
if (g->mo->skin)
|
||||
skin = ((skin_t*)g->mo->skin)-skins;
|
||||
else
|
||||
skin = 0;
|
||||
if (g->mo->color)
|
||||
{
|
||||
if (g->mo->colorized)
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, g->mo->color, GTC_CACHE);
|
||||
else
|
||||
colormap = R_GetTranslationColormap(skin, g->mo->color, GTC_CACHE);
|
||||
}
|
||||
else
|
||||
colormap = NULL;
|
||||
K_drawKartMinimapIcon(g->mo->x, g->mo->y, x, y, splitflags, facemmapprefix[skin], colormap, AutomapPic);
|
||||
g = g->next;
|
||||
}
|
||||
|
||||
if (!stplyr->mo || stplyr->spectator) // do we need the latter..?
|
||||
return;
|
||||
|
||||
localplayers[numlocalplayers] = stplyr-players;
|
||||
numlocalplayers++;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = MAXPLAYERS-1; i >= 0; i--)
|
||||
{
|
||||
if (!playeringame[i])
|
||||
continue;
|
||||
if (!players[i].mo || players[i].spectator)
|
||||
continue;
|
||||
|
||||
if (i != displayplayers[0] || splitscreen)
|
||||
{
|
||||
if (G_BattleGametype() && players[i].kartstuff[k_bumper] <= 0)
|
||||
continue;
|
||||
|
||||
if (players[i].kartstuff[k_hyudorotimer] > 0)
|
||||
{
|
||||
if (!((players[i].kartstuff[k_hyudorotimer] < 1*TICRATE/2
|
||||
|| players[i].kartstuff[k_hyudorotimer] > hyudorotime-(1*TICRATE/2))
|
||||
&& !(leveltime & 1)))
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == displayplayers[0] || i == displayplayers[1] || i == displayplayers[2] || i == displayplayers[3])
|
||||
{
|
||||
// Draw display players on top of everything else
|
||||
localplayers[numlocalplayers] = i;
|
||||
numlocalplayers++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (players[i].mo->skin)
|
||||
skin = ((skin_t*)players[i].mo->skin)-skins;
|
||||
else
|
||||
skin = 0;
|
||||
|
||||
if (players[i].mo->color)
|
||||
{
|
||||
if (players[i].mo->colorized)
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, players[i].mo->color, GTC_CACHE);
|
||||
else
|
||||
colormap = R_GetTranslationColormap(skin, players[i].mo->color, GTC_CACHE);
|
||||
}
|
||||
else
|
||||
colormap = NULL;
|
||||
|
||||
K_drawKartMinimapIcon(players[i].mo->x, players[i].mo->y, x, y, splitflags, facemmapprefix[skin], colormap, AutomapPic);
|
||||
// Target reticule
|
||||
if ((G_RaceGametype() && players[i].kartstuff[k_position] == spbplace)
|
||||
|| (G_BattleGametype() && K_IsPlayerWanted(&players[i])))
|
||||
K_drawKartMinimapIcon(players[i].mo->x, players[i].mo->y, x, y, splitflags, kp_wantedreticle, NULL, AutomapPic);
|
||||
}
|
||||
}
|
||||
K_drawKartMinimapIcon(players[i].mo->x, players[i].mo->y, x, y, splitflags, kp_wantedreticle, NULL, AutomapPic);
|
||||
}
|
||||
}
|
||||
|
||||
// draw SPB(s?)
|
||||
for (mobj = kitemcap; mobj; mobj = next)
|
||||
|
|
@ -9943,39 +9949,39 @@ static void K_drawKartMinimap(void)
|
|||
K_drawKartMinimapIcon(mobj->x, mobj->y, x, y, splitflags, kp_spbminimap, colormap, AutomapPic);
|
||||
}
|
||||
}
|
||||
|
||||
// draw our local players here, opaque.
|
||||
splitflags &= ~V_HUDTRANSHALF;
|
||||
splitflags |= V_HUDTRANS;
|
||||
|
||||
for (i = 0; i < numlocalplayers; i++)
|
||||
{
|
||||
if (i == -1)
|
||||
continue; // this doesn't interest us
|
||||
|
||||
if (players[localplayers[i]].mo->skin)
|
||||
skin = ((skin_t*)players[localplayers[i]].mo->skin)-skins;
|
||||
else
|
||||
skin = 0;
|
||||
|
||||
if (players[localplayers[i]].mo->color)
|
||||
{
|
||||
if (players[localplayers[i]].mo->colorized)
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, players[localplayers[i]].mo->color, GTC_CACHE);
|
||||
else
|
||||
colormap = R_GetTranslationColormap(skin, players[localplayers[i]].mo->color, GTC_CACHE);
|
||||
}
|
||||
else
|
||||
colormap = NULL;
|
||||
|
||||
|
||||
// draw our local players here, opaque.
|
||||
splitflags &= ~V_HUDTRANSHALF;
|
||||
splitflags |= V_HUDTRANS;
|
||||
|
||||
for (i = 0; i < numlocalplayers; i++)
|
||||
{
|
||||
if (i == -1)
|
||||
continue; // this doesn't interest us
|
||||
|
||||
if (players[localplayers[i]].mo->skin)
|
||||
skin = ((skin_t*)players[localplayers[i]].mo->skin)-skins;
|
||||
else
|
||||
skin = 0;
|
||||
|
||||
if (players[localplayers[i]].mo->color)
|
||||
{
|
||||
if (players[localplayers[i]].mo->colorized)
|
||||
colormap = R_GetTranslationColormap(TC_RAINBOW, players[localplayers[i]].mo->color, GTC_CACHE);
|
||||
else
|
||||
colormap = R_GetTranslationColormap(skin, players[localplayers[i]].mo->color, GTC_CACHE);
|
||||
}
|
||||
else
|
||||
colormap = NULL;
|
||||
|
||||
K_drawKartMinimapIcon(players[localplayers[i]].mo->x, players[localplayers[i]].mo->y, x, y, splitflags, facemmapprefix[skin], colormap, AutomapPic);
|
||||
|
||||
// Target reticule
|
||||
// Target reticule
|
||||
if ((G_RaceGametype() && players[localplayers[i]].kartstuff[k_position] == spbplace)
|
||||
|| (G_BattleGametype() && K_IsPlayerWanted(&players[localplayers[i]])))
|
||||
K_drawKartMinimapIcon(players[localplayers[i]].mo->x, players[localplayers[i]].mo->y, x, y, splitflags, kp_wantedreticle, NULL, AutomapPic);
|
||||
}
|
||||
}
|
||||
|| (G_BattleGametype() && K_IsPlayerWanted(&players[localplayers[i]])))
|
||||
K_drawKartMinimapIcon(players[localplayers[i]].mo->x, players[localplayers[i]].mo->y, x, y, splitflags, kp_wantedreticle, NULL, AutomapPic);
|
||||
}
|
||||
}
|
||||
|
||||
static void K_drawKartStartCountdown(void)
|
||||
{
|
||||
|
|
@ -10619,6 +10625,7 @@ static void K_DrawWaypointDebugger(void)
|
|||
{
|
||||
if ((cv_kartdebugwaypoints.value != 0) && (stplyr == &players[displayplayers[0]]))
|
||||
{
|
||||
V_DrawString(8, 166, 0, va("'Best' Waypoint ID: %d", K_GetWaypointID(stplyr->nextwaypoint)));
|
||||
V_DrawString(8, 176, 0, va("Finishline Distance: %d", stplyr->distancetofinish));
|
||||
}
|
||||
}
|
||||
|
|
@ -10823,8 +10830,10 @@ void K_drawKartHUD(void)
|
|||
K_drawKartFreePlay(leveltime);
|
||||
}
|
||||
|
||||
if (stplyr->kartstuff[k_wrongway] && ((leveltime / 8) & 1))
|
||||
if (splitscreen == 0 && stplyr->kartstuff[k_wrongway] && ((leveltime / 8) & 1))
|
||||
{
|
||||
V_DrawCenteredString(BASEVIDWIDTH>>1, 176, V_REDMAP|V_SNAPTOBOTTOM, "WRONG WAY");
|
||||
}
|
||||
|
||||
if (cv_kartdebugdistribution.value)
|
||||
K_drawDistributionDebugger();
|
||||
|
|
|
|||
|
|
@ -461,6 +461,9 @@ void K_DebugWaypointsVisualise(void)
|
|||
debugmobj = P_SpawnMobj(waypointmobj->x, waypointmobj->y, waypointmobj->z, MT_SPARK);
|
||||
P_SetMobjState(debugmobj, S_THOK);
|
||||
|
||||
debugmobj->frame &= ~FF_TRANSMASK;
|
||||
debugmobj->frame |= FF_TRANS20;
|
||||
|
||||
// There's a waypoint setup for this mobj! So draw that it's a valid waypoint and draw lines to its connections
|
||||
if (waypoint != NULL)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue