Skip to content

Commit

Permalink
- restored initial clamping for blend colors
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Jun 30, 2018
1 parent 43b94d8 commit 0a139e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/v_draw.cpp
Expand Up @@ -1418,7 +1418,11 @@ void DFrameBuffer::DrawBlend(sector_t * viewsector)
V_AddBlend(player->BlendR, player->BlendG, player->BlendB, player->BlendA, blend);
}

screen->Dim(PalEntry(255, uint8_t(blend[0] * 255), uint8_t(blend[1] * 255), uint8_t(blend[2] * 255)), blend[3], 0, 0, screen->GetWidth(), screen->GetHeight());
const float br = clamp(blend[0] * 255.f, 0.f, 255.f);
const float bg = clamp(blend[1] * 255.f, 0.f, 255.f);
const float bb = clamp(blend[2] * 255.f, 0.f, 255.f);
const PalEntry bcolor(255, uint8_t(br), uint8_t(bg), uint8_t(bb));
screen->Dim(bcolor, blend[3], 0, 0, screen->GetWidth(), screen->GetHeight());
}


0 comments on commit 0a139e9

Please sign in to comment.