Skip to content

Commit

Permalink
fix: global fade not applied if starting level with +map or +warp
Browse files Browse the repository at this point in the history
The global fade values are set too late and shader is compiled without these values applied, mStreamData need to be prepared before calling state.Draw

(cherry picked from commit 57582c9)
  • Loading branch information
emawind84 committed Apr 12, 2024
1 parent 47c9548 commit 29464b2
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion src/common/rendering/hwrenderer/hw_draw2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void Draw2D(F2DDrawer* drawer, FRenderState& state, int x, int y, int width, int
state.SetColor(1, 1, 1, 1, cmd.mDesaturate);
if (cmd.mFlags & F2DDrawer::DTF_Indexed) state.SetSoftLightLevel(cmd.mLightLevel);
state.SetLightParms(0, 0);

state.ResetFadeColor();
state.AlphaFunc(Alpha_Greater, 0.f);

if (cmd.useTransform)
Expand Down
1 change: 0 additions & 1 deletion src/rendering/hwrenderer/hw_entrypoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ void CollectLights(FLevelLocals* Level)
sector_t* RenderViewpoint(FRenderViewpoint& mainvp, AActor* camera, IntRect* bounds, float fov, float ratio, float fovratio, bool mainview, bool toscreen)
{
auto& RenderState = *screen->RenderState();
RenderState.ResetFadeColor();

R_SetupFrame(mainvp, r_viewwindow, camera);

Expand Down
1 change: 0 additions & 1 deletion src/rendering/hwrenderer/scene/hw_drawinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,6 @@ void HWDrawInfo::DrawCoronas(FRenderState& state)

void HWDrawInfo::EndDrawScene(sector_t * viewsector, FRenderState &state)
{
state.ResetFadeColor();
HWSkyInfo skyinfo;
skyinfo.init(this, viewsector->sky, viewsector->Colormap.FadeColor);
if (skyinfo.texture[0])
Expand Down

0 comments on commit 29464b2

Please sign in to comment.