From a3c2c97a7561179baf1d342ac88dd70c9ce8ed02 Mon Sep 17 00:00:00 2001 From: james Date: Wed, 13 Feb 2019 16:33:45 -0800 Subject: [PATCH] Add setviews command --- src/d_netcmd.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 7376bc8c8..bb10afd9f 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -130,6 +130,7 @@ static void Command_Map_f(void); static void Command_ResetCamera_f(void); static void Command_View_f (void); +static void Command_SetViews_f(void); static void Command_Addfile(void); static void Command_ListWADS_f(void); @@ -719,6 +720,8 @@ void D_RegisterClientCommands(void) COM_AddCommand("view3", Command_View_f); COM_AddCommand("view4", Command_View_f); + COM_AddCommand("setviews", Command_SetViews_f); + COM_AddCommand("setcontrol", Command_Setcontrol_f); COM_AddCommand("setcontrol2", Command_Setcontrol2_f); COM_AddCommand("setcontrol3", Command_Setcontrol3_f); @@ -1993,6 +1996,37 @@ static void Command_View_f(void) } #undef PRINTVIEWPOINT +static void Command_SetViews_f(void) +{ + UINT8 splits; + UINT8 newsplits; + + if (!( demoplayback && multiplayer )) + { + CONS_Alert(CONS_NOTICE, + "You must be viewing a multiplayer replay to use this.\n"); + return; + } + + if (COM_Argc() != 2) + { + CONS_Printf("setviews : set the number of split screens\n"); + return; + } + + splits = splitscreen+1; + + newsplits = atoi(COM_Argv(1)); + newsplits = min(max(newsplits, 1), 4); + if (newsplits > splits) + G_AdjustView(newsplits, 0); + else + { + splitscreen = newsplits-1; + R_ExecuteSetViewSize(); + } +} + // ======================================================================== // play a demo, add .lmp for external demos