Implement stplyrnum and refactor K_drawBattleFullscreen to use it
Thanks Saturn and GHG as per usual
This commit is contained in:
parent
4cae11d307
commit
f5de319fae
5 changed files with 12 additions and 14 deletions
15
src/k_hud.c
15
src/k_hud.c
|
|
@ -3767,9 +3767,7 @@ static void K_drawBattleFullscreen(void)
|
|||
|
||||
if (r_splitscreen)
|
||||
{
|
||||
if ((r_splitscreen == 1 && stplyr == &players[displayplayers[1]])
|
||||
|| (r_splitscreen > 1 && (stplyr == &players[displayplayers[2]]
|
||||
|| (stplyr == &players[displayplayers[3]] && r_splitscreen > 2))))
|
||||
if ((splitscreen == 1 && stplyrnum == 1) || (splitscreen > 1 && stplyrnum & 2))
|
||||
{
|
||||
y = 232-(stplyr->karthud[khud_cardanimation]/2);
|
||||
splitflags = V_SNAPTOBOTTOM;
|
||||
|
|
@ -3781,8 +3779,7 @@ static void K_drawBattleFullscreen(void)
|
|||
{
|
||||
scale /= 2;
|
||||
|
||||
if (stplyr == &players[displayplayers[1]]
|
||||
|| (stplyr == &players[displayplayers[3]] && r_splitscreen > 2))
|
||||
if (stplyrnum & 1)
|
||||
x = 3*BASEVIDWIDTH/4;
|
||||
else
|
||||
x = BASEVIDWIDTH/4;
|
||||
|
|
@ -3791,7 +3788,7 @@ static void K_drawBattleFullscreen(void)
|
|||
{
|
||||
if (stplyr->exiting)
|
||||
{
|
||||
if (stplyr == &players[displayplayers[1]])
|
||||
if (stplyrnum & 1)
|
||||
x = BASEVIDWIDTH-96;
|
||||
else
|
||||
x = 96;
|
||||
|
|
@ -3803,7 +3800,7 @@ static void K_drawBattleFullscreen(void)
|
|||
|
||||
if (stplyr->exiting)
|
||||
{
|
||||
if (stplyr == &players[displayplayers[0]])
|
||||
if (stplyrnum == 0)
|
||||
V_DrawFadeScreen(0xFF00, 16);
|
||||
if (stplyr->exiting < 6*TICRATE && !stplyr->spectator)
|
||||
{
|
||||
|
|
@ -3837,9 +3834,7 @@ static void K_drawBattleFullscreen(void)
|
|||
{
|
||||
if (r_splitscreen > 1)
|
||||
ty = (BASEVIDHEIGHT/4)+33;
|
||||
if ((r_splitscreen == 1 && stplyr == &players[displayplayers[1]])
|
||||
|| (stplyr == &players[displayplayers[2]] && r_splitscreen > 1)
|
||||
|| (stplyr == &players[displayplayers[3]] && r_splitscreen > 2))
|
||||
if ((splitscreen == 1 && stplyrnum == 1) || (splitscreen > 1 && stplyrnum & 2))
|
||||
ty += (BASEVIDHEIGHT/2);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@
|
|||
|
||||
boolean LUA_CallAction(enum actionnum actionnum, mobj_t *actor);
|
||||
|
||||
player_t *stplyr;
|
||||
INT32 var1;
|
||||
INT32 var2;
|
||||
INT32 modulothing;
|
||||
|
|
|
|||
|
|
@ -370,9 +370,6 @@ void P_FlashPal(player_t *pl, UINT16 type, UINT16 duration);
|
|||
// P_ENEMY
|
||||
//
|
||||
|
||||
// main player in game
|
||||
extern player_t *stplyr; // for splitscreen correct palette changes and overlay
|
||||
|
||||
// Is there a better place for these?
|
||||
extern INT32 var1;
|
||||
extern INT32 var2;
|
||||
|
|
|
|||
|
|
@ -83,6 +83,10 @@ static patch_t *hud_tv2;
|
|||
static patch_t *envelope;
|
||||
#endif
|
||||
|
||||
// current player for overlay drawing
|
||||
player_t *stplyr;
|
||||
UINT8 stplyrnum;
|
||||
|
||||
static huddrawlist_h luahuddrawlist_game[MAXSPLITSCREENPLAYERS];
|
||||
static huddrawlist_h luahuddrawlist_titlecard;
|
||||
|
||||
|
|
@ -912,6 +916,7 @@ void ST_Drawer(void)
|
|||
for (i = 0; i <= r_splitscreen; i++)
|
||||
{
|
||||
stplyr = &players[displayplayers[i]];
|
||||
stplyrnum = i;
|
||||
R_SetViewContext(VIEWCONTEXT_PLAYER1 + i);
|
||||
R_InterpolateView(rendertimefrac); // to assist with object tracking
|
||||
ST_overlayDrawer(i);
|
||||
|
|
|
|||
|
|
@ -81,6 +81,8 @@ boolean ST_SameTeam(player_t *a, player_t *b);
|
|||
|
||||
extern boolean st_overlay; // sb overlay on or off when fullscreen
|
||||
extern INT32 st_palette; // 0 is default, any others are special palettes.
|
||||
extern player_t *stplyr; // for splitscreen correct palette changes and overlay
|
||||
extern UINT8 stplyrnum;
|
||||
extern UINT32 st_translucency;
|
||||
|
||||
extern lumpnum_t st_borderpatchnum;
|
||||
|
|
|
|||
Loading…
Reference in a new issue