mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-10 02:41:49 +00:00
k_director.h: remove directorinfo extern, add K_DirectorIsEnabled
This commit is contained in:
parent
c72a2cf94a
commit
17b7a2f16d
3 changed files with 20 additions and 15 deletions
|
|
@ -20,7 +20,18 @@
|
||||||
#define WALKBACKDIST 600 // how close should a trailing player be before we switch?
|
#define WALKBACKDIST 600 // how close should a trailing player be before we switch?
|
||||||
#define PINCHDIST 30000 // how close should the leader be to be considered "end of race"?
|
#define PINCHDIST 30000 // how close should the leader be to be considered "end of race"?
|
||||||
|
|
||||||
struct directorinfo directorinfo;
|
struct directorinfo
|
||||||
|
{
|
||||||
|
boolean active; // is view point switching enabled?
|
||||||
|
tic_t cooldown; // how long has it been since we last switched?
|
||||||
|
tic_t freeze; // when nonzero, fixed switch pending, freeze logic!
|
||||||
|
INT32 attacker; // who to switch to when freeze delay elapses
|
||||||
|
INT32 maxdist; // how far is the closest player from finishing?
|
||||||
|
|
||||||
|
INT32 sortedplayers[MAXPLAYERS]; // position-1 goes in, player index comes out.
|
||||||
|
INT32 gap[MAXPLAYERS]; // gap between a given position and their closest pursuer
|
||||||
|
INT32 boredom[MAXPLAYERS]; // how long has a given position had no credible attackers?
|
||||||
|
} directorinfo;
|
||||||
|
|
||||||
void K_InitDirector(void)
|
void K_InitDirector(void)
|
||||||
{
|
{
|
||||||
|
|
@ -324,6 +335,12 @@ void K_ToggleDirector(boolean active)
|
||||||
directorinfo.active = active;
|
directorinfo.active = active;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean K_DirectorIsEnabled(UINT8 viewnum)
|
||||||
|
{
|
||||||
|
(void)viewnum;
|
||||||
|
return directorinfo.active;
|
||||||
|
}
|
||||||
|
|
||||||
boolean K_DirectorIsAvailable(UINT8 viewnum)
|
boolean K_DirectorIsAvailable(UINT8 viewnum)
|
||||||
{
|
{
|
||||||
return viewnum <= r_splitscreen && viewnum < G_PartySize(consoleplayer) &&
|
return viewnum <= r_splitscreen && viewnum < G_PartySize(consoleplayer) &&
|
||||||
|
|
|
||||||
|
|
@ -10,24 +10,12 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern struct directorinfo
|
|
||||||
{
|
|
||||||
boolean active; // is view point switching enabled?
|
|
||||||
tic_t cooldown; // how long has it been since we last switched?
|
|
||||||
tic_t freeze; // when nonzero, fixed switch pending, freeze logic!
|
|
||||||
INT32 attacker; // who to switch to when freeze delay elapses
|
|
||||||
INT32 maxdist; // how far is the closest player from finishing?
|
|
||||||
|
|
||||||
INT32 sortedplayers[MAXPLAYERS]; // position-1 goes in, player index comes out.
|
|
||||||
INT32 gap[MAXPLAYERS]; // gap between a given position and their closest pursuer
|
|
||||||
INT32 boredom[MAXPLAYERS]; // how long has a given position had no credible attackers?
|
|
||||||
} directorinfo;
|
|
||||||
|
|
||||||
void K_InitDirector(void);
|
void K_InitDirector(void);
|
||||||
void K_UpdateDirector(void);
|
void K_UpdateDirector(void);
|
||||||
void K_DrawDirectorDebugger(void);
|
void K_DrawDirectorDebugger(void);
|
||||||
void K_DirectorFollowAttack(player_t *player, mobj_t *inflictor, mobj_t *source);
|
void K_DirectorFollowAttack(player_t *player, mobj_t *inflictor, mobj_t *source);
|
||||||
void K_ToggleDirector(boolean active);
|
void K_ToggleDirector(boolean active);
|
||||||
|
boolean K_DirectorIsEnabled(UINT8 viewnum);
|
||||||
boolean K_DirectorIsAvailable(UINT8 viewnum);
|
boolean K_DirectorIsAvailable(UINT8 viewnum);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
||||||
|
|
@ -5225,7 +5225,7 @@ static void K_drawDirectorHUD(void)
|
||||||
|
|
||||||
// TODO: this is too close to the screen bottom
|
// TODO: this is too close to the screen bottom
|
||||||
K_DrawDirectorButton(offs + 2, "Director", kp_button_r,
|
K_DrawDirectorButton(offs + 2, "Director", kp_button_r,
|
||||||
(directorinfo.active ? V_YELLOWMAP : 0));
|
(K_DirectorIsEnabled(viewnum) ? V_YELLOWMAP : 0));
|
||||||
|
|
||||||
if (players[p].flashing)
|
if (players[p].flashing)
|
||||||
itemtxt = ". . .";
|
itemtxt = ". . .";
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue