change director toggling handling

- now not changable over console anymore, bind only!
- it doesent save anymore so its always disabled at game start
- moving while in spec state will disable director when active so stand still
- disable it in splitscreen completely
- only adjust view when toggling it on
This commit is contained in:
Alug committed 2025-01-06 22:40:36 +01:00
1 parent 65b5415216
commit 50593dbfc2
6 files changed
+14 -18

No files matched your search

+2 -1
View File
@@ -572,7 +572,8 @@ 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};
// only there to better keep track of it globally
consvar_t cv_director = {"director", "Off", CV_HIDEN, 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_showdirectorhud = {"showdirectorhud", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
+5 -12
View File
@@ -336,11 +336,6 @@ boolean precache = true; // if true, load all graphics at start
INT16 prevmap, nextmap;
// save if director is enabled
// so demos can disable it by default and restore it after
static int directorstate = 0;
tic_t directortoggletimer = 0;
static CV_PossibleValue_t recordmultiplayerdemos_cons_t[] = {{0, "Disabled"}, {1, "Manual Save"}, {2, "Auto Save"}, {0, NULL}};
consvar_t cv_recordmultiplayerdemos = {"netdemo_record", "Manual Save", CV_SAVE, recordmultiplayerdemos_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
@@ -886,6 +881,9 @@ static void G_BuildLocalTiccmd(ticcmd_t *cmd, UINT8 ssplayer, boolean freecam)
if ((moveinput || cmd->buttons)
&& displayplayers[0] != consoleplayer && ssplayer == 1)
{
if (cv_director.value)
CV_SetValue(&cv_director, 0);
displayplayers[0] = consoleplayer;
R_ResetViewInterpolation(0);
camera[0].reset_aiming = true;
@@ -7362,8 +7360,8 @@ post_compat:
players[i].kartweight = kartweight[i];
}
directorstate = cv_director.value;
CV_SetValue(&cv_director, 0);
if (cv_director.value)
CV_SetValue(&cv_director, 0);
demo.deferstart = true;
}
@@ -7928,11 +7926,6 @@ void G_StopDemo(void)
{
Z_Free(demobuf.buffer);
demobuf.buffer = NULL;
if (demo.playback)
{
CV_SetValue(&cv_director, directorstate);
directorstate = 0;
}
demo.playback = false;
if (demo.title)
modeattacking = false;
-2
View File
@@ -226,8 +226,6 @@ extern angle_t localangle[MAXSPLITSCREENPLAYERS];
extern INT32 localaiming[MAXSPLITSCREENPLAYERS]; // should be an angle_t but signed
extern boolean camspin[MAXSPLITSCREENPLAYERS]; // SRB2Kart
extern tic_t directortoggletimer;
//
// GAME
//
+2 -3
View File
@@ -73,7 +73,7 @@ static fixed_t ScaleFromMap(fixed_t n, fixed_t scale)
boolean K_DirectorIsAvailable(void)
{
if ((demo.playback && demo.title) || modeattacking)
if (splitscreen || (demo.playback && demo.title) || modeattacking)
return false;
return ((gamestate == GS_LEVEL) && ((demo.playback && !camera[0].freecam) || (players[consoleplayer].spectator && !K_DirectorIsPlayerAlone())));
}
@@ -424,10 +424,9 @@ void K_ToggleDirector(void)
if (!K_DirectorIsAvailable())
return;
G_AdjustView(1, 1, true);
if (!K_DirectorIsEnabled())
{
G_AdjustView(1, 1, true);
directorinfo.cooldown = 0; // switch immediately
}
+3
View File
@@ -53,6 +53,9 @@
UINT16 objectsdrawn = 0;
// dumb fade thing for director toggle
tic_t directortoggletimer = 0;
//
// STATUS BAR DATA
//
+2
View File
@@ -23,6 +23,8 @@
// STATUS BAR
//
extern tic_t directortoggletimer;
// Called by main loop.
void ST_Ticker(void);