Merge branch 'rrdirectorport' into Saturn-Next
This commit is contained in:
commit
eec069b4e8
14 files changed
+474
No files matched your search
@@ -167,6 +167,7 @@ set(SRB2_CORE_GAME_SOURCES
|
||||
p_telept.c
|
||||
p_tick.c
|
||||
p_user.c
|
||||
k_director.c
|
||||
k_kart.c
|
||||
i_time.c
|
||||
|
||||
@@ -180,6 +181,7 @@ set(SRB2_CORE_GAME_SOURCES
|
||||
p_slopes.h
|
||||
p_spec.h
|
||||
p_tick.h
|
||||
k_director.h
|
||||
k_kart.h
|
||||
)
|
||||
|
||||
|
||||
@@ -494,6 +494,7 @@ OBJS:=$(i_main_o) \
|
||||
$(OBJDIR)/hu_stuff.o \
|
||||
$(OBJDIR)/y_inter.o \
|
||||
$(OBJDIR)/st_stuff.o \
|
||||
$(OBJDIR)/k_director.o \
|
||||
$(OBJDIR)/k_kart.o \
|
||||
$(OBJDIR)/m_aatree.o \
|
||||
$(OBJDIR)/m_anigif.o \
|
||||
|
||||
@@ -561,6 +561,9 @@ static CV_PossibleValue_t ps_descriptor_cons_t[] = {
|
||||
{1, "Average"}, {2, "SD"}, {3, "Minimum"}, {4, "Maximum"}, {0, NULL}};
|
||||
consvar_t cv_ps_descriptor = {"ps_descriptor", "Average", 0, ps_descriptor_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_director = {"director", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_kartdebugdirector = {"debugdirector", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_showtrackaddon = {"showtrackaddon", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static CV_PossibleValue_t skinselectmenu_t[] = {{SKINMENUTYPE_SCROLL, "Scroll"}, {SKINMENUTYPE_2D, "2d"}, {SKINMENUTYPE_GRID, "Grid"}, {SKINMENUTYPE_EXTENDED, "Extended"}, {0, NULL}};
|
||||
@@ -979,6 +982,9 @@ void D_RegisterClientCommands(void)
|
||||
CV_RegisterVar(&cv_showtrackaddon);
|
||||
CV_RegisterVar(&cv_showviewpointtext);
|
||||
|
||||
CV_RegisterVar(&cv_director);
|
||||
CV_RegisterVar(&cv_kartdebugdirector);
|
||||
|
||||
CV_RegisterVar(&cv_luaimmersion);
|
||||
CV_RegisterVar(&cv_fakelocalskin);
|
||||
|
||||
|
||||
@@ -201,6 +201,8 @@ extern consvar_t cv_ps_thinkframe_page;
|
||||
extern consvar_t cv_ps_samplesize;
|
||||
extern consvar_t cv_ps_descriptor;
|
||||
|
||||
extern consvar_t cv_director, cv_kartdebugdirector;
|
||||
|
||||
extern consvar_t cv_showtrackaddon;
|
||||
|
||||
extern consvar_t cv_showspecstuff;
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "b_bot.h"
|
||||
#include "m_cond.h" // condition sets
|
||||
#include "md5.h" // demo checksums
|
||||
#include "k_director.h" // SRB2kart
|
||||
#include "k_kart.h" // SRB2kart
|
||||
#include "r_fps.h" // frame interpolation/uncapped
|
||||
|
||||
@@ -1935,6 +1936,11 @@ boolean G_Responder(event_t *ev)
|
||||
COM_ImmedExecute("changeteam4 spectator");
|
||||
}
|
||||
}
|
||||
if (ev->data1 == gamecontrol[gc_director][0]
|
||||
|| ev->data1 == gamecontrol[gc_director][1])
|
||||
{
|
||||
K_ToggleDirector();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
|
||||
@@ -812,6 +812,7 @@ static const char *gamecontrolname[num_gamecontrols] =
|
||||
"custom1",
|
||||
"custom2",
|
||||
"custom3",
|
||||
"director",
|
||||
};
|
||||
|
||||
#define NUMKEYNAMES (sizeof (keynames)/sizeof (keyname_t))
|
||||
|
||||
@@ -98,6 +98,7 @@ typedef enum
|
||||
gc_custom1, // Lua scriptable
|
||||
gc_custom2, // Lua scriptable
|
||||
gc_custom3, // Lua scriptable
|
||||
gc_director,
|
||||
num_gamecontrols
|
||||
} gamecontrols_e;
|
||||
|
||||
|
||||
@@ -0,0 +1,404 @@
|
||||
// SONIC ROBO BLAST 2 KART
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2024 by AJ "Tyron" Martinez.
|
||||
// Copyright (C) 2024 by James Robert Roman.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
// See the 'LICENSE' file for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file k_director.c
|
||||
/// \brief SRB2kart automatic spectator camera.
|
||||
|
||||
//#include "k_kart.h"
|
||||
#include "doomdef.h"
|
||||
#include "g_game.h"
|
||||
#include "v_video.h"
|
||||
#include "k_director.h"
|
||||
#include "d_netcmd.h"
|
||||
#include "p_local.h"
|
||||
|
||||
#define SWITCHTIME TICRATE * 5 // cooldown between unforced switches
|
||||
#define BOREDOMTIME 3 * TICRATE / 2 // how long until players considered far apart?
|
||||
#define TRANSFERTIME TICRATE // how long to delay reaction shots?
|
||||
#define BREAKAWAYDIST 4000 // how *far* until players considered far apart?
|
||||
#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"?
|
||||
|
||||
struct directorinfo directorinfo;
|
||||
|
||||
static boolean race_rules()
|
||||
{
|
||||
return gametype = GT_RACE;
|
||||
}
|
||||
|
||||
static fixed_t P_ScaleFromMap(fixed_t n, fixed_t scale)
|
||||
{
|
||||
return FixedMul(n, FixedDiv(scale, mapobjectscale));
|
||||
}
|
||||
|
||||
static boolean K_DirectorIsEnabled(void)
|
||||
{
|
||||
return cv_director.value && (gamestate == GS_LEVEL && (!playeringame[consoleplayer] || players[consoleplayer].spectator || demo.playback));
|
||||
}
|
||||
|
||||
void K_InitDirector(void)
|
||||
{
|
||||
INT32 playernum;
|
||||
|
||||
directorinfo.cooldown = SWITCHTIME;
|
||||
directorinfo.freeze = 0;
|
||||
directorinfo.attacker = 0;
|
||||
directorinfo.maxdist = 0;
|
||||
|
||||
for (playernum = 0; playernum < MAXPLAYERS; playernum++)
|
||||
{
|
||||
directorinfo.sortedplayers[playernum] = -1;
|
||||
directorinfo.gap[playernum] = INT32_MAX;
|
||||
directorinfo.boredom[playernum] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*static fixed_t K_GetFinishGap(INT32 leader, INT32 follower)
|
||||
{
|
||||
fixed_t dista = players[follower].distancetofinish;
|
||||
fixed_t distb = players[leader].distancetofinish;
|
||||
|
||||
if (players[follower].position < players[leader].position)
|
||||
{
|
||||
return distb - dista;
|
||||
}
|
||||
else
|
||||
{
|
||||
return dista - distb;
|
||||
}
|
||||
}*/
|
||||
|
||||
static fixed_t K_GetDistanceToFinish(player_t player)
|
||||
{
|
||||
mobj_t *mo;
|
||||
fixed_t dist = 0;
|
||||
int maxMoveCount = -1;
|
||||
int maxAngle = -1;
|
||||
|
||||
if (!(mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE))
|
||||
{
|
||||
for (mo = waypointcap; mo != NULL; mo = mo->tracer)
|
||||
{
|
||||
if (mo->spawnpoint->angle != 0)
|
||||
continue;
|
||||
|
||||
dist = P_AproxDistance(P_AproxDistance(mo->x - player.mo->x,
|
||||
mo->y - player.mo->y),
|
||||
mo->z - player.mo->z) / FRACUNIT;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (mo = waypointcap; mo != NULL; mo = mo->tracer)
|
||||
{
|
||||
if (mo->movecount > maxMoveCount)
|
||||
maxMoveCount = mo->movecount;
|
||||
if (mo->spawnpoint->angle > maxAngle)
|
||||
maxAngle = mo->spawnpoint->angle;
|
||||
|
||||
if (!(mo->movecount == maxMoveCount && mo->spawnpoint->angle == maxAngle)) // sprint maps finishline waypoint is the one with highest movecount AND angle
|
||||
continue;
|
||||
|
||||
dist = P_AproxDistance(P_AproxDistance(mo->x - player.mo->x,
|
||||
mo->y - player.mo->y),
|
||||
mo->z - player.mo->z) / FRACUNIT;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return dist;
|
||||
}
|
||||
|
||||
static fixed_t K_GetFinishGap(INT32 leader, INT32 follower)
|
||||
{
|
||||
fixed_t dista = K_GetDistanceToFinish(players[follower]);
|
||||
fixed_t distb = K_GetDistanceToFinish(players[leader]);
|
||||
|
||||
if (players[follower].kartstuff[k_position] < players[leader].kartstuff[k_position])
|
||||
{
|
||||
return distb - dista;
|
||||
}
|
||||
else
|
||||
{
|
||||
return dista - distb;
|
||||
}
|
||||
}
|
||||
|
||||
static void K_UpdateDirectorPositions(void)
|
||||
{
|
||||
INT32 playernum;
|
||||
INT32 position;
|
||||
player_t* target;
|
||||
|
||||
memset(directorinfo.sortedplayers, -1, sizeof(directorinfo.sortedplayers));
|
||||
|
||||
for (playernum = 0; playernum < MAXPLAYERS; playernum++)
|
||||
{
|
||||
target = &players[playernum];
|
||||
|
||||
if (playeringame[playernum] && !target->spectator && target->kartstuff[k_position] > 0)
|
||||
{
|
||||
directorinfo.sortedplayers[target->kartstuff[k_position] - 1] = playernum;
|
||||
}
|
||||
}
|
||||
|
||||
for (position = 0; position < MAXPLAYERS - 1; position++)
|
||||
{
|
||||
directorinfo.gap[position] = INT32_MAX;
|
||||
|
||||
if (directorinfo.sortedplayers[position] == -1 || directorinfo.sortedplayers[position + 1] == -1)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
directorinfo.gap[position] = P_ScaleFromMap(K_GetFinishGap(directorinfo.sortedplayers[position], directorinfo.sortedplayers[position + 1]), FRACUNIT);
|
||||
|
||||
if (directorinfo.gap[position] >= BREAKAWAYDIST)
|
||||
{
|
||||
directorinfo.boredom[position] = min(BOREDOMTIME * 2, directorinfo.boredom[position] + 1);
|
||||
}
|
||||
else if (directorinfo.boredom[position] > 0)
|
||||
{
|
||||
directorinfo.boredom[position]--;
|
||||
}
|
||||
}
|
||||
|
||||
if (directorinfo.sortedplayers[0] == -1)
|
||||
{
|
||||
directorinfo.maxdist = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
directorinfo.maxdist = P_ScaleFromMap(K_GetDistanceToFinish(players[directorinfo.sortedplayers[0]]), FRACUNIT);
|
||||
}
|
||||
|
||||
static boolean K_CanSwitchDirector(void)
|
||||
{
|
||||
/*INT32 *displayplayerp = &displayplayers[0];
|
||||
|
||||
if (players[*displayplayerp].trickpanel > 0)
|
||||
{
|
||||
return false;
|
||||
}*/
|
||||
|
||||
if (directorinfo.cooldown > 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void K_DirectorSwitch(INT32 player, boolean force)
|
||||
{
|
||||
if (P_IsDisplayPlayer(&players[player]))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (players[player].exiting)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!force && !K_CanSwitchDirector())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
G_ResetView(1, player, true);
|
||||
directorinfo.cooldown = SWITCHTIME;
|
||||
}
|
||||
|
||||
static void K_DirectorForceSwitch(INT32 player, INT32 time)
|
||||
{
|
||||
if (players[player].exiting)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
directorinfo.attacker = player;
|
||||
directorinfo.freeze = time;
|
||||
}
|
||||
|
||||
void K_DirectorFollowAttack(player_t *player, mobj_t *inflictor, mobj_t *source)
|
||||
{
|
||||
if (!K_DirectorIsEnabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!P_IsDisplayPlayer(player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (inflictor && inflictor->player)
|
||||
{
|
||||
K_DirectorForceSwitch(inflictor->player - players, TRANSFERTIME);
|
||||
}
|
||||
else if (source && source->player)
|
||||
{
|
||||
K_DirectorForceSwitch(source->player - players, TRANSFERTIME);
|
||||
}
|
||||
}
|
||||
|
||||
void K_DrawDirectorDebugger(void)
|
||||
{
|
||||
INT32 position;
|
||||
INT32 leader;
|
||||
INT32 follower;
|
||||
INT32 ytxt;
|
||||
|
||||
if (!cv_kartdebugdirector.value)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
V_DrawThinString(10, 0, V_70TRANS, va("PLACE"));
|
||||
V_DrawThinString(40, 0, V_70TRANS, va("CONF?"));
|
||||
V_DrawThinString(80, 0, V_70TRANS, va("GAP"));
|
||||
V_DrawThinString(120, 0, V_70TRANS, va("BORED"));
|
||||
V_DrawThinString(150, 0, V_70TRANS, va("COOLDOWN: %d", directorinfo.cooldown));
|
||||
V_DrawThinString(230, 0, V_70TRANS, va("MAXDIST: %d", directorinfo.maxdist));
|
||||
|
||||
for (position = 0; position < MAXPLAYERS - 1; position++)
|
||||
{
|
||||
ytxt = 10 * (position + 1);
|
||||
leader = directorinfo.sortedplayers[position];
|
||||
follower = directorinfo.sortedplayers[position + 1];
|
||||
|
||||
if (leader == -1 || follower == -1)
|
||||
break;
|
||||
|
||||
V_DrawThinString(10, ytxt, V_70TRANS, va("%d", position));
|
||||
V_DrawThinString(20, ytxt, V_70TRANS, va("%d", position + 1));
|
||||
|
||||
/*if (players[leader].positiondelay)
|
||||
{
|
||||
V_DrawThinString(40, ytxt, V_70TRANS, va("NG"));
|
||||
}*/
|
||||
|
||||
V_DrawThinString(80, ytxt, V_70TRANS, va("%d", directorinfo.gap[position]));
|
||||
|
||||
if (directorinfo.boredom[position] >= BOREDOMTIME)
|
||||
{
|
||||
V_DrawThinString(120, ytxt, V_70TRANS, va("BORED"));
|
||||
}
|
||||
else
|
||||
{
|
||||
V_DrawThinString(120, ytxt, V_70TRANS, va("%d", directorinfo.boredom[position]));
|
||||
}
|
||||
|
||||
V_DrawThinString(150, ytxt, V_70TRANS, va("%s", player_names[leader]));
|
||||
V_DrawThinString(230, ytxt, V_70TRANS, va("%s", player_names[follower]));
|
||||
}
|
||||
}
|
||||
|
||||
void K_UpdateDirector(void)
|
||||
{
|
||||
INT32 *displayplayerp = &displayplayers[0];
|
||||
INT32 targetposition;
|
||||
|
||||
if (!K_DirectorIsEnabled())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
K_UpdateDirectorPositions();
|
||||
|
||||
if (directorinfo.cooldown > 0) {
|
||||
directorinfo.cooldown--;
|
||||
}
|
||||
|
||||
// handle pending forced switches
|
||||
if (directorinfo.freeze > 0)
|
||||
{
|
||||
if (!(--directorinfo.freeze))
|
||||
K_DirectorSwitch(directorinfo.attacker, true);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// if there's only one player left in the list, just switch to that player
|
||||
if (directorinfo.sortedplayers[0] != -1 && (directorinfo.sortedplayers[1] == -1 ||
|
||||
// TODO: Battle; I just threw this together quick. Focus on leader.
|
||||
!race_rules()))
|
||||
{
|
||||
K_DirectorSwitch(directorinfo.sortedplayers[0], false);
|
||||
return;
|
||||
}
|
||||
|
||||
// aaight, time to walk through the standings to find the first interesting pair
|
||||
// NB: targetposition/sortedplayers is 0-indexed, aiming at the "back half" of a given pair by default.
|
||||
// we adjust for this when comparing to player->position or when looking at the leading player, Don't Freak Out
|
||||
for (targetposition = 1; targetposition < MAXPLAYERS; targetposition++)
|
||||
{
|
||||
INT32 target;
|
||||
|
||||
// you are out of players, try again
|
||||
if (directorinfo.sortedplayers[targetposition] == -1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
// pair too far apart? try the next one
|
||||
if (directorinfo.boredom[targetposition - 1] >= BOREDOMTIME)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// pair finished? try the next one
|
||||
if (players[directorinfo.sortedplayers[targetposition]].exiting)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// don't risk switching away from forward pairs at race end, might miss something!
|
||||
if (directorinfo.maxdist > PINCHDIST)
|
||||
{
|
||||
// if the "next" player is close enough, they should be able to see everyone fine!
|
||||
// walk back through the standings to find a vantage that gets everyone in frame.
|
||||
// (also creates a pretty cool effect w/ overtakes at speed)
|
||||
while (targetposition < MAXPLAYERS && directorinfo.gap[targetposition] < WALKBACKDIST)
|
||||
{
|
||||
targetposition++;
|
||||
}
|
||||
}
|
||||
|
||||
target = directorinfo.sortedplayers[targetposition];
|
||||
|
||||
// if we're certain the back half of the pair is actually in this position, try to switch
|
||||
if (*displayplayerp != target /*&& !players[target].positiondelay*/)
|
||||
{
|
||||
K_DirectorSwitch(target, false);
|
||||
}
|
||||
|
||||
// even if we're not certain, if we're certain we're watching the WRONG player, try to switch
|
||||
if (players[*displayplayerp].kartstuff[k_position] != targetposition+1 /*&& !players[target].positiondelay*/)
|
||||
{
|
||||
K_DirectorSwitch(target, false);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void K_ToggleDirector(void)
|
||||
{
|
||||
if (!K_DirectorIsEnabled())
|
||||
{
|
||||
directorinfo.cooldown = 0; // switch immediately
|
||||
}
|
||||
|
||||
COM_ImmedExecute("add director 1");
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// SONIC ROBO BLAST 2 KART
|
||||
//-----------------------------------------------------------------------------
|
||||
// Copyright (C) 2024 by AJ "Tyron" Martinez.
|
||||
// Copyright (C) 2024 by James Robert Roman.
|
||||
//
|
||||
// This program is free software distributed under the
|
||||
// terms of the GNU General Public License, version 2.
|
||||
// See the 'LICENSE' file for more details.
|
||||
//-----------------------------------------------------------------------------
|
||||
/// \file k_director.h
|
||||
/// \brief SRB2kart automatic spectator camera.
|
||||
|
||||
extern struct directorinfo
|
||||
{
|
||||
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_UpdateDirector(void);
|
||||
void K_DrawDirectorDebugger(void);
|
||||
void K_DirectorFollowAttack(player_t *player, mobj_t *inflictor, mobj_t *source);
|
||||
void K_ToggleDirector(void);
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "z_zone.h"
|
||||
#include "m_misc.h"
|
||||
#include "m_cond.h"
|
||||
#include "k_director.h"
|
||||
#include "k_kart.h"
|
||||
#include "f_finale.h"
|
||||
#include "lua_hud.h" // For Lua hud checks
|
||||
@@ -2237,6 +2238,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, mobj_t *inflicto
|
||||
// PS: Inflictor is unused for all purposes here and is actually only ever relevant to Lua. It may be nil too.
|
||||
boolean force = false; // Used to check if Lua ShouldSpin should get us damaged reguardless of flashtics or heck knows what.
|
||||
UINT8 shouldForce = LUAh_ShouldSpin(player, inflictor, source);
|
||||
|
||||
if (P_MobjWasRemoved(player->mo))
|
||||
return; // mobj was removed (in theory that shouldn't happen)
|
||||
if (shouldForce == 1)
|
||||
@@ -2244,6 +2246,8 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, mobj_t *inflicto
|
||||
else if (shouldForce == 2)
|
||||
return;
|
||||
|
||||
K_DirectorFollowAttack(player, inflictor, source);
|
||||
|
||||
if (!trapitem && G_BattleGametype())
|
||||
{
|
||||
if (K_IsPlayerWanted(player))
|
||||
@@ -2494,6 +2498,8 @@ void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor) // A b
|
||||
else if (shouldForce == 2)
|
||||
return;
|
||||
|
||||
K_DirectorFollowAttack(player, inflictor, source);
|
||||
|
||||
if (G_BattleGametype())
|
||||
{
|
||||
if (K_IsPlayerWanted(player))
|
||||
|
||||
@@ -1198,6 +1198,7 @@ static menuitem_t OP_AllControlsMenu[] =
|
||||
{IT_CONTROL, NULL, "Look Up", M_ChangeControl, gc_lookup },
|
||||
{IT_CONTROL, NULL, "Look Down", M_ChangeControl, gc_lookdown },
|
||||
{IT_CONTROL, NULL, "Center View", M_ChangeControl, gc_centerview },
|
||||
{IT_CONTROL, NULL, "Toggle Director", M_ChangeControl, gc_director },
|
||||
{IT_HEADER, NULL, "Custom Lua Actions", NULL, 0},
|
||||
{IT_SPACE, NULL, NULL, NULL, 0},
|
||||
{IT_CONTROL, NULL, "Custom Action 1", M_ChangeControl, gc_custom1 },
|
||||
|
||||
@@ -82,6 +82,7 @@
|
||||
#include "p_slopes.h"
|
||||
|
||||
// SRB2Kart
|
||||
#include "k_director.h" // K_InitDirector
|
||||
#include "k_kart.h"
|
||||
|
||||
//
|
||||
@@ -2887,6 +2888,8 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||
G_BeginRecording(); //this has to move here, since dedicated servers dont run got_mapcmd
|
||||
}
|
||||
|
||||
K_InitDirector();
|
||||
|
||||
wantedcalcdelay = wantedfrequency*2;
|
||||
indirectitemcooldown = 0;
|
||||
hyubgone = 0;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "m_random.h"
|
||||
#include "lua_script.h"
|
||||
#include "lua_hook.h"
|
||||
#include "k_director.h"
|
||||
#include "k_kart.h"
|
||||
#include "i_system.h"
|
||||
#include "r_main.h"
|
||||
@@ -589,6 +590,8 @@ void P_Ticker(boolean run)
|
||||
PS_STOP_TIMING(ps_lua_postthinkframe_time);
|
||||
}
|
||||
|
||||
K_UpdateDirector();
|
||||
|
||||
// Always move the camera.
|
||||
P_RunChaseCameras();
|
||||
|
||||
|
||||
@@ -660,6 +660,15 @@ static void ST_overlayDrawer(void)
|
||||
// Countdown timer for Race Mode
|
||||
// ...moved to k_kart.c so we can take advantage of the LAPS_Y value
|
||||
|
||||
if (demo.playback || !P_IsLocalPlayer(stplyr))
|
||||
{
|
||||
char directortext[20] = {0};
|
||||
|
||||
snprintf(directortext, 20, "Director: %s", cv_director.value ? "On" : "Off");
|
||||
|
||||
V_DrawString(1, BASEVIDHEIGHT-8-1, V_SNAPTOLEFT|V_SNAPTOBOTTOM|V_HUDTRANSHALF|V_ALLOWLOWERCASE, directortext);
|
||||
}
|
||||
|
||||
if (cv_showviewpointtext.value)
|
||||
{
|
||||
if (!(multiplayer && demo.playback))
|
||||
|
||||
Reference in new issue
Block a user