mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-02-11 02:30:44 +00:00
Expose G_ResetView and amend G_ResetViews
(fickle's suggestion.)
This commit is contained in:
parent
ac9356a02b
commit
e52641d15a
4 changed files with 19 additions and 23 deletions
|
@ -2564,7 +2564,7 @@ void CL_RemovePlayer(INT32 playernum, INT32 reason)
|
||||||
if (playernum == displayplayer && !demoplayback)
|
if (playernum == displayplayer && !demoplayback)
|
||||||
displayplayer = consoleplayer; // don't look through someone's view who isn't there
|
displayplayer = consoleplayer; // don't look through someone's view who isn't there
|
||||||
else
|
else
|
||||||
G_ResetViews(0);
|
G_ResetViews();
|
||||||
|
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
LUA_InvalidatePlayer(&players[playernum]);
|
LUA_InvalidatePlayer(&players[playernum]);
|
||||||
|
|
|
@ -1987,7 +1987,7 @@ Command_View_f (void)
|
||||||
|
|
||||||
olddisplayplayer = (*displayplayerp);
|
olddisplayplayer = (*displayplayerp);
|
||||||
(*displayplayerp) = playernum;
|
(*displayplayerp) = playernum;
|
||||||
G_ResetViews(viewnum);
|
G_ResetView(viewnum);
|
||||||
|
|
||||||
/* The player we wanted was corrected to who it already was. */
|
/* The player we wanted was corrected to who it already was. */
|
||||||
if ((*displayplayerp) == olddisplayplayer)
|
if ((*displayplayerp) == olddisplayplayer)
|
||||||
|
|
35
src/g_game.c
35
src/g_game.c
|
@ -1809,7 +1809,7 @@ boolean G_Responder(event_t *ev)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
displayplayer++;
|
displayplayer++;
|
||||||
G_ResetViews(1);
|
G_ResetView(1);
|
||||||
|
|
||||||
// change statusbar also if playing back demo
|
// change statusbar also if playing back demo
|
||||||
if (singledemo)
|
if (singledemo)
|
||||||
|
@ -1824,21 +1824,21 @@ boolean G_Responder(event_t *ev)
|
||||||
if (ev->data1 == gamecontrolbis[gc_viewpoint][0] || ev->data1 == gamecontrolbis[gc_viewpoint][1])
|
if (ev->data1 == gamecontrolbis[gc_viewpoint][0] || ev->data1 == gamecontrolbis[gc_viewpoint][1])
|
||||||
{
|
{
|
||||||
secondarydisplayplayer++;
|
secondarydisplayplayer++;
|
||||||
G_ResetViews(2);
|
G_ResetView(2);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (ev->data1 == gamecontrol3[gc_viewpoint][0] || ev->data1 == gamecontrol3[gc_viewpoint][1])
|
else if (ev->data1 == gamecontrol3[gc_viewpoint][0] || ev->data1 == gamecontrol3[gc_viewpoint][1])
|
||||||
{
|
{
|
||||||
thirddisplayplayer++;
|
thirddisplayplayer++;
|
||||||
G_ResetViews(3);
|
G_ResetView(3);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (ev->data1 == gamecontrol4[gc_viewpoint][0] || ev->data1 == gamecontrol4[gc_viewpoint][1])
|
else if (ev->data1 == gamecontrol4[gc_viewpoint][0] || ev->data1 == gamecontrol4[gc_viewpoint][1])
|
||||||
{
|
{
|
||||||
fourthdisplayplayer++;
|
fourthdisplayplayer++;
|
||||||
G_ResetViews(4);
|
G_ResetView(4);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -2132,8 +2132,10 @@ G_GetDisplayplayerPtr (UINT8 viewnum)
|
||||||
return &displayplayer;
|
return &displayplayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset only one view */
|
/*
|
||||||
static void
|
Ensure a viewpoint is valid.
|
||||||
|
*/
|
||||||
|
void
|
||||||
G_ResetView (UINT8 viewnum)
|
G_ResetView (UINT8 viewnum)
|
||||||
{
|
{
|
||||||
INT32 *displayplayerp;
|
INT32 *displayplayerp;
|
||||||
|
@ -2173,30 +2175,23 @@ G_ResetView (UINT8 viewnum)
|
||||||
(*displayplayerp) = G_FindView((*displayplayerp));
|
(*displayplayerp) = G_FindView((*displayplayerp));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (viewnum == 1 && demoplayback)
|
||||||
|
consoleplayer = displayplayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// G_ResetViews
|
// G_ResetViews
|
||||||
// Ensures all viewpoints are valid
|
// Ensures all viewpoints are valid
|
||||||
//
|
//
|
||||||
void G_ResetViews(UINT8 viewnum)
|
void G_ResetViews(void)
|
||||||
{
|
{
|
||||||
UINT8 splits = splitscreen+1;
|
UINT8 viewnum = splitscreen+1;
|
||||||
|
do
|
||||||
if (viewnum == 0)
|
|
||||||
{
|
|
||||||
while (viewnum++ < splits)
|
|
||||||
{
|
{
|
||||||
G_ResetView(viewnum);
|
G_ResetView(viewnum);
|
||||||
}
|
}
|
||||||
}
|
while (--viewnum > 0) ;
|
||||||
else
|
|
||||||
{
|
|
||||||
G_ResetView(viewnum);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (demoplayback)
|
|
||||||
consoleplayer = displayplayer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -228,7 +228,8 @@ boolean G_Responder(event_t *ev);
|
||||||
|
|
||||||
INT32 * G_GetDisplayplayerPtr (UINT8 viewnum);
|
INT32 * G_GetDisplayplayerPtr (UINT8 viewnum);
|
||||||
|
|
||||||
void G_ResetViews(UINT8 viewnum);
|
void G_ResetViews(void);
|
||||||
|
void G_ResetView (UINT8 viewnum);
|
||||||
|
|
||||||
void G_AddPlayer(INT32 playernum);
|
void G_AddPlayer(INT32 playernum);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue