- Screenblend fixes.

This commit is contained in:
Christoph Oelckers 2020-08-07 22:00:43 +02:00
parent f8c65839f0
commit 596367f10f
2 changed files with 3 additions and 2 deletions

View File

@ -564,6 +564,7 @@ ScreenJobRunner *runner;
void RunScreenJob(JobDesc* jobs, int count, CompletionFunc completion, bool clearbefore, bool blockingui)
{
assert(completion != nullptr);
videoclearFade();
if (count)
{
runner = new ScreenJobRunner(jobs, count, completion, clearbefore);

View File

@ -257,8 +257,8 @@ void displayrest(double smoothratio)
if (blend[3])
{
// result must be multiplied by 4 and normalised to 255. (4*255 = 1020)
auto comp = [&](int i) { return clamp(int(blend[i] * 1020), 0, 255); };
videoFadePalette(comp(0), comp(1), comp(2), comp(3));
auto comp = [&](int i, int maxv=255) { return clamp(int(blend[i] * 1020), 0, maxv); };
videoFadePalette(comp(0), comp(1), comp(2), comp(3, 192)); // Never fully saturate the alpha channel
}
else
videoclearFade();