mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-08-03 12:47:01 -04:00
Merge branch 'master' of github.com:fabiangreffrath/woof into dc_ds
This commit is contained in:
commit
5936570515
@ -405,7 +405,6 @@ static void DrawSkyTex(visplane_t *pl, sky_t *sky, skytex_t *skytex)
|
||||
{
|
||||
const side_t * const side = sky->side;
|
||||
const int texture = texturetranslation[skytex->texture];
|
||||
boolean vertically_scrolling = false;
|
||||
dc->texheight = textureheight[texture] >> FRACBITS;
|
||||
dc->iscale = FixedMul(skyiscale, skytex->scaley);
|
||||
|
||||
@ -415,13 +414,11 @@ static void DrawSkyTex(visplane_t *pl, sky_t *sky, skytex_t *skytex)
|
||||
deltay = LerpFixed(skytex->prevy, skytex->curry);
|
||||
deltax = LerpFixed(skytex->prevx, skytex->currx) << (ANGLETOSKYSHIFT - FRACBITS);
|
||||
dc->texturemid = skytex->mid + deltay;
|
||||
vertically_scrolling = skytex->scrolly;
|
||||
|
||||
if (side)
|
||||
{
|
||||
deltax += LerpFixed(side->oldtextureoffset, side->basetextureoffset);
|
||||
dc->texturemid += side->baserowoffset;
|
||||
vertically_scrolling += (side->baserowoffset - side->oldrowoffset);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -429,13 +426,11 @@ static void DrawSkyTex(visplane_t *pl, sky_t *sky, skytex_t *skytex)
|
||||
deltay = skytex->curry;
|
||||
deltax = skytex->currx << (ANGLETOSKYSHIFT - FRACBITS);
|
||||
dc->texturemid = skytex->mid + deltay;
|
||||
vertically_scrolling = skytex->scrolly;
|
||||
|
||||
if (side)
|
||||
{
|
||||
deltax += side->textureoffset;
|
||||
dc->texturemid += side->baserowoffset;
|
||||
vertically_scrolling += (side->baserowoffset - side->oldrowoffset);
|
||||
}
|
||||
}
|
||||
|
||||
@ -448,7 +443,14 @@ static void DrawSkyTex(visplane_t *pl, sky_t *sky, skytex_t *skytex)
|
||||
|
||||
angle_t an = viewangle + deltax;
|
||||
|
||||
if (colfunc != R_DrawTLColumn && !vertically_scrolling && dc->texheight >= 128)
|
||||
if (sky->texturemid_tic != gametic)
|
||||
{
|
||||
sky->vertically_scrolling = (sky->old_texturemid != dc->texturemid);
|
||||
sky->old_texturemid = dc->texturemid;
|
||||
sky->texturemid_tic = gametic;
|
||||
}
|
||||
|
||||
if (colfunc != R_DrawTLColumn && !sky->vertically_scrolling && dc->texheight >= 128)
|
||||
{
|
||||
// Make sure the fade-to-color effect doesn't happen too early
|
||||
fixed_t diff = dc->texturemid - SCREENHEIGHT / 2 * FRACUNIT;
|
||||
|
@ -311,6 +311,8 @@ static skyindex_t AddLevelsky(int texture, side_t *side)
|
||||
R_InitFireSky(&new_sky);
|
||||
}
|
||||
|
||||
new_sky.texturemid_tic = -1;
|
||||
|
||||
const int skyheight = textureheight[new_sky.background.texture] >> FRACBITS;
|
||||
new_sky.stretchable = true;
|
||||
|
||||
|
@ -60,6 +60,10 @@ typedef struct sky_s
|
||||
|
||||
// Plain levelskies, flatmap
|
||||
boolean stretchable;
|
||||
|
||||
boolean vertically_scrolling;
|
||||
int old_texturemid;
|
||||
int texturemid_tic;
|
||||
} sky_t;
|
||||
|
||||
typedef struct
|
||||
|
Loading…
x
Reference in New Issue
Block a user