Skip to content

Commit

Permalink
- fixed new renderer's use of fog on skies: The palette value from th…
Browse files Browse the repository at this point in the history
…e wall was used instead of the one from the sky plane.
  • Loading branch information
coelckers committed May 29, 2021
1 parent 8fae793 commit 2e9732c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions source/core/rendering/scene/hw_sky.cpp
Expand Up @@ -40,7 +40,7 @@ FGameTexture* SkyboxReplacement(FTextureID picnum, int palnum);
//
//==========================================================================

void initSkyInfo(HWDrawInfo *di, HWSkyInfo* sky, sectortype* sector, int plane, PalEntry FadeColor)
void initSkyInfo(HWDrawInfo *di, HWSkyInfo* sky, sectortype* sector, int plane)
{
int picnum = plane == plane_ceiling ? sector->ceilingpicnum : sector->floorpicnum;
tileUpdatePicnum(&picnum, 0, 0);
Expand Down Expand Up @@ -80,7 +80,11 @@ void initSkyInfo(HWDrawInfo *di, HWSkyInfo* sky, sectortype* sector, int plane,
sky->y_offset = ypanning;
sky->x_offset = 2 * xpanning / (1 << (realskybits - dapskybits));
}
sky->fadecolor = FadeColor;

PalEntry pe = GlobalMapFog ? GlobalMapFog : lookups.getFade(palette);
pe.a = 230;

sky->fadecolor = pe;
sky->shade = 0;// clamp(plane == plane_ceiling ? sector->ceilingshade : sector->floorshade, 0, numshades - 1);
sky->texture = skytex;
}
Expand Down Expand Up @@ -114,9 +118,7 @@ void HWWall::SkyPlane(HWDrawInfo *di, sectortype *sector, int plane, bool allowr
{
ptype = PORTALTYPE_SKY;
HWSkyInfo skyinfo;
PalEntry pe = GlobalMapFog? GlobalMapFog : fade;
pe.a = 230;
initSkyInfo(di, &skyinfo, sector, plane, pe);
initSkyInfo(di, &skyinfo, sector, plane);
ptype = PORTALTYPE_SKY;
sky = &skyinfo;
PutPortal(di, ptype, plane);
Expand Down

0 comments on commit 2e9732c

Please sign in to comment.