mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-27 19:50:51 +00:00
Partially port newer sky rendering
Not the cause of the black sky bug, but doing this helped me diagnose it & it's cleaner
This commit is contained in:
parent
c35985d595
commit
bf2b8490ea
2 changed files with 52 additions and 47 deletions
|
@ -69,7 +69,7 @@ fixed_t viewx, viewy, viewz;
|
||||||
angle_t viewangle, aimingangle;
|
angle_t viewangle, aimingangle;
|
||||||
UINT8 viewssnum;
|
UINT8 viewssnum;
|
||||||
fixed_t viewcos, viewsin;
|
fixed_t viewcos, viewsin;
|
||||||
boolean viewsky, skyVisible;
|
boolean skyVisible;
|
||||||
boolean skyVisiblePerPlayer[MAXSPLITSCREENPLAYERS]; // saved values of skyVisible for each splitscreen player
|
boolean skyVisiblePerPlayer[MAXSPLITSCREENPLAYERS]; // saved values of skyVisible for each splitscreen player
|
||||||
sector_t *viewsector;
|
sector_t *viewsector;
|
||||||
player_t *viewplayer;
|
player_t *viewplayer;
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#include "w_wad.h"
|
#include "w_wad.h"
|
||||||
#include "z_zone.h"
|
#include "z_zone.h"
|
||||||
#include "p_tick.h"
|
#include "p_tick.h"
|
||||||
|
#include "r_fps.h"
|
||||||
|
|
||||||
#ifdef TIMING
|
#ifdef TIMING
|
||||||
#include "p5prof.h"
|
#include "p5prof.h"
|
||||||
|
@ -678,8 +679,6 @@ void R_MakeSpans(INT32 x, INT32 t1, INT32 b1, INT32 t2, INT32 b2)
|
||||||
void R_DrawPlanes(void)
|
void R_DrawPlanes(void)
|
||||||
{
|
{
|
||||||
visplane_t *pl;
|
visplane_t *pl;
|
||||||
INT32 x;
|
|
||||||
INT32 angle;
|
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
||||||
spanfunc = basespanfunc;
|
spanfunc = basespanfunc;
|
||||||
|
@ -689,18 +688,33 @@ void R_DrawPlanes(void)
|
||||||
{
|
{
|
||||||
for (pl = visplanes[i]; pl; pl = pl->next)
|
for (pl = visplanes[i]; pl; pl = pl->next)
|
||||||
{
|
{
|
||||||
// sky flat
|
if (pl->ffloor != NULL || pl->polyobj != NULL)
|
||||||
if (pl->picnum == skyflatnum)
|
continue;
|
||||||
{
|
|
||||||
if (!viewsky)
|
R_DrawSinglePlane(pl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#ifndef NOWATER
|
||||||
|
waterofs = (leveltime & 1)*16384;
|
||||||
|
wtofs = leveltime * 140;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static void R_DrawSkyPlane(visplane_t *pl)
|
||||||
|
{
|
||||||
|
INT32 x;
|
||||||
|
INT32 angle;
|
||||||
|
|
||||||
|
if (!newview->sky)
|
||||||
{
|
{
|
||||||
skyVisible = true;
|
skyVisible = true;
|
||||||
continue;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wallcolfunc = walldrawerfunc;
|
||||||
|
|
||||||
// use correct aspect ratio scale
|
// use correct aspect ratio scale
|
||||||
dc_iscale = skyscale;
|
dc_iscale = skyscale;
|
||||||
|
|
||||||
// Sky is always drawn full bright,
|
// Sky is always drawn full bright,
|
||||||
// i.e. colormaps[0] is used.
|
// i.e. colormaps[0] is used.
|
||||||
// Because of this hack, sky is not affected
|
// Because of this hack, sky is not affected
|
||||||
|
@ -715,7 +729,6 @@ void R_DrawPlanes(void)
|
||||||
{
|
{
|
||||||
dc_yl = pl->top[x];
|
dc_yl = pl->top[x];
|
||||||
dc_yh = pl->bottom[x];
|
dc_yh = pl->bottom[x];
|
||||||
|
|
||||||
if (dc_yl <= dc_yh)
|
if (dc_yl <= dc_yh)
|
||||||
{
|
{
|
||||||
angle = (pl->viewangle + xtoviewangle[x])>>ANGLETOSKYSHIFT;
|
angle = (pl->viewangle + xtoviewangle[x])>>ANGLETOSKYSHIFT;
|
||||||
|
@ -727,21 +740,6 @@ void R_DrawPlanes(void)
|
||||||
wallcolfunc();
|
wallcolfunc();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pl->ffloor != NULL
|
|
||||||
|| pl->polyobj != NULL
|
|
||||||
)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
R_DrawSinglePlane(pl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#ifndef NOWATER
|
|
||||||
waterofs = (leveltime & 1)*16384;
|
|
||||||
wtofs = leveltime * 140;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void R_DrawSinglePlane(visplane_t *pl)
|
void R_DrawSinglePlane(visplane_t *pl)
|
||||||
|
@ -755,6 +753,13 @@ void R_DrawSinglePlane(visplane_t *pl)
|
||||||
if (!(pl->minx <= pl->maxx))
|
if (!(pl->minx <= pl->maxx))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// sky flat
|
||||||
|
if (pl->picnum == skyflatnum)
|
||||||
|
{
|
||||||
|
R_DrawSkyPlane(pl);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef NOWATER
|
#ifndef NOWATER
|
||||||
itswater = false;
|
itswater = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue