mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-30 13:10:55 +00:00
Fix player 1 and player 2 affecting whether the other can see skyboxes or not
This commit is contained in:
parent
1e50691e08
commit
b4cf7fbc97
3 changed files with 16 additions and 1 deletions
|
@ -2838,7 +2838,7 @@ boolean P_SetupLevel(boolean skipprecip)
|
||||||
savedata.lives = 0;
|
savedata.lives = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
skyVisible = true; // assume the skybox is visible on level load.
|
skyVisible = skyVisible1 = skyVisible2 = true; // assume the skybox is visible on level load.
|
||||||
if (loadprecip) // uglier hack
|
if (loadprecip) // uglier hack
|
||||||
{ // to make a newly loaded level start on the second frame.
|
{ // to make a newly loaded level start on the second frame.
|
||||||
INT32 buf = gametic % BACKUPTICS;
|
INT32 buf = gametic % BACKUPTICS;
|
||||||
|
|
14
src/r_main.c
14
src/r_main.c
|
@ -67,6 +67,7 @@ fixed_t viewx, viewy, viewz;
|
||||||
angle_t viewangle, aimingangle;
|
angle_t viewangle, aimingangle;
|
||||||
fixed_t viewcos, viewsin;
|
fixed_t viewcos, viewsin;
|
||||||
boolean viewsky, skyVisible;
|
boolean viewsky, skyVisible;
|
||||||
|
boolean skyVisible1, skyVisible2; // saved values of skyVisible for P1 and P2, for splitscreen
|
||||||
sector_t *viewsector;
|
sector_t *viewsector;
|
||||||
player_t *viewplayer;
|
player_t *viewplayer;
|
||||||
|
|
||||||
|
@ -1301,6 +1302,12 @@ void R_RenderPlayerView(player_t *player)
|
||||||
V_DrawFill(0, 0, vid.width, vid.height, 128+(timeinmap&15));
|
V_DrawFill(0, 0, vid.width, vid.height, 128+(timeinmap&15));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// load previous saved value of skyVisible for the player
|
||||||
|
if (splitscreen && player == &players[secondarydisplayplayer])
|
||||||
|
skyVisible = skyVisible2;
|
||||||
|
else
|
||||||
|
skyVisible = skyVisible1;
|
||||||
|
|
||||||
portalrender = 0;
|
portalrender = 0;
|
||||||
portal_base = portal_cap = NULL;
|
portal_base = portal_cap = NULL;
|
||||||
|
|
||||||
|
@ -1398,6 +1405,13 @@ void R_RenderPlayerView(player_t *player)
|
||||||
|
|
||||||
// Check for new console commands.
|
// Check for new console commands.
|
||||||
NetUpdate();
|
NetUpdate();
|
||||||
|
|
||||||
|
// save value to skyVisible1 or skyVisible2
|
||||||
|
// this is so that P1 can't affect whether P2 can see a skybox or not, or vice versa
|
||||||
|
if (splitscreen && player == &players[secondarydisplayplayer])
|
||||||
|
skyVisible2 = skyVisible;
|
||||||
|
else
|
||||||
|
skyVisible1 = skyVisible;
|
||||||
}
|
}
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
|
@ -85,6 +85,7 @@ extern side_t *sides;
|
||||||
extern fixed_t viewx, viewy, viewz;
|
extern fixed_t viewx, viewy, viewz;
|
||||||
extern angle_t viewangle, aimingangle;
|
extern angle_t viewangle, aimingangle;
|
||||||
extern boolean viewsky, skyVisible;
|
extern boolean viewsky, skyVisible;
|
||||||
|
extern boolean skyVisible1, skyVisible2; // saved values of skyVisible for P1 and P2, for splitscreen
|
||||||
extern sector_t *viewsector;
|
extern sector_t *viewsector;
|
||||||
extern player_t *viewplayer;
|
extern player_t *viewplayer;
|
||||||
extern UINT8 portalrender;
|
extern UINT8 portalrender;
|
||||||
|
|
Loading…
Reference in a new issue