super smol refactor minimap head drawer
This commit is contained in:
1 parent
14f030e9a8
commit
8e67e96e6f
2 files changed
+25
-23
No files matched your search
+22
-22
@@ -9991,7 +9991,7 @@ static void K_drawKartMinimap(void)
|
||||
INT32 i = 0;
|
||||
INT32 x, y;
|
||||
INT32 minimaptrans, splitflags;
|
||||
SINT8 localplayers[4];
|
||||
SINT8 localplayers[MAXSPLITSCREENPLAYERS];
|
||||
SINT8 numlocalplayers = 0;
|
||||
|
||||
// Draw the HUD only when playing in a level.
|
||||
@@ -10013,7 +10013,6 @@ static void K_drawKartMinimap(void)
|
||||
y = info.y - (SHORT(minimapinfo.minimap_pic->height)/2);
|
||||
splitflags = info.flags;
|
||||
|
||||
|
||||
if (forceshowhud)
|
||||
minimaptrans = cv_kartminimap.value;
|
||||
else if (timeinmap > 105)
|
||||
@@ -10049,7 +10048,7 @@ static void K_drawKartMinimap(void)
|
||||
y -= SHORT(minimapinfo.minimap_pic->topoffset);
|
||||
|
||||
// initialize
|
||||
for (i = 0; i < 4; i++)
|
||||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
localplayers[i] = -1;
|
||||
|
||||
// Player's tiny icons on the Automap. (drawn opposite direction so player 1 is drawn last in splitscreen)
|
||||
@@ -10065,8 +10064,7 @@ static void K_drawKartMinimap(void)
|
||||
if (!stplyr->mo || stplyr->spectator) // do we need the latter..?
|
||||
return;
|
||||
|
||||
localplayers[numlocalplayers] = stplyr-players;
|
||||
numlocalplayers++;
|
||||
localplayers[numlocalplayers++] = stplyr-players;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -10074,31 +10072,29 @@ static void K_drawKartMinimap(void)
|
||||
{
|
||||
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 (P_IsDisplayPlayer(&players[i]))
|
||||
{
|
||||
// Draw display players on top of everything else
|
||||
localplayers[numlocalplayers] = i;
|
||||
numlocalplayers++;
|
||||
localplayers[numlocalplayers++] = i;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Now we know it's not a display player, handle non-local player exceptions.
|
||||
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;
|
||||
}
|
||||
|
||||
K_drawKartMinimapHead(players[i].mo, x, y, splitflags);
|
||||
}
|
||||
}
|
||||
@@ -10109,8 +10105,12 @@ static void K_drawKartMinimap(void)
|
||||
|
||||
for (i = 0; i < numlocalplayers; i++)
|
||||
{
|
||||
if (i == -1)
|
||||
if (localplayers[i] == -1)
|
||||
continue; // this doesn't interest us
|
||||
|
||||
if ((players[i].kartstuff[k_hyudorotimer] > 0) && (leveltime & 1))
|
||||
continue;
|
||||
|
||||
K_drawKartMinimapHead(players[localplayers[i]].mo, x, y, splitflags);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -2576,6 +2576,7 @@ static void P_InitMinimapInfo(void)
|
||||
INT32 lumpnum;
|
||||
fixed_t a;
|
||||
fixed_t b;
|
||||
|
||||
node_t *bsp = &nodes[numnodes-1];
|
||||
|
||||
minimapinfo.minimap_pic = NULL;
|
||||
@@ -3289,7 +3290,8 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
|
||||
|
||||
// Only exists to make sure there's no way to overwrite partadd_stage externally
|
||||
// unless you really push yourself.
|
||||
SINT8 P_PartialAddGetStage(void) {
|
||||
SINT8 P_PartialAddGetStage(void)
|
||||
{
|
||||
return partadd_stage;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user