- Reimplemented rgb555 into burn/crossfade in f_wipe.cpp.

This commit is contained in:
Rachael Alexanderson 2016-12-24 12:42:27 -05:00
parent 785b58f57a
commit 9ece249dbb

View file

@ -30,6 +30,8 @@
#include "templates.h"
#include "v_palette.h"
EXTERN_CVAR(Bool, r_blendmethod)
//
// SCREEN WIPE PACKAGE
//
@ -281,6 +283,44 @@ bool wipe_doBurn (int ticks)
fromold = (BYTE *)wipe_scr_start;
fromnew = (BYTE *)wipe_scr_end;
if (!r_blendmethod)
{
for (y = 0, firey = 0; y < SCREENHEIGHT; y++, firey += ystep)
{
for (x = 0, firex = 0; x < SCREENWIDTH; x++, firex += xstep)
{
int fglevel;
fglevel = burnarray[(firex>>SHIFT)+(firey>>SHIFT)*FIREWIDTH] / 2;
if (fglevel >= 63)
{
to[x] = fromnew[x];
}
else if (fglevel == 0)
{
to[x] = fromold[x];
done = false;
}
else
{
int bglevel = 64-fglevel;
DWORD *fg2rgb = Col2RGB8[fglevel];
DWORD *bg2rgb = Col2RGB8[bglevel];
DWORD fg = fg2rgb[fromnew[x]];
DWORD bg = bg2rgb[fromold[x]];
fg = (fg+bg) | 0x1f07c1f;
to[x] = RGB32k.All[fg & (fg>>15)];
done = false;
}
}
fromold += SCREENWIDTH;
fromnew += SCREENWIDTH;
to += SCREENPITCH;
}
}
else
{
for (y = 0, firey = 0; y < SCREENHEIGHT; y++, firey += ystep)
{
for (x = 0, firex = 0; x < SCREENWIDTH; x++, firex += xstep)
@ -316,7 +356,7 @@ bool wipe_doBurn (int ticks)
fromnew += SCREENWIDTH;
to += SCREENPITCH;
}
}
return done || (burntime > 40);
}
@ -346,11 +386,31 @@ bool wipe_doFade (int ticks)
{
int x, y;
int bglevel = 64 - fade;
DWORD *fg2rgb = Col2RGB8[fade];
DWORD *bg2rgb = Col2RGB8[bglevel];
BYTE *fromnew = (BYTE *)wipe_scr_end;
BYTE *fromold = (BYTE *)wipe_scr_start;
BYTE *to = screen->GetBuffer();
const PalEntry *pal = GPalette.BaseColors;
if (!r_blendmethod)
{
for (y = 0; y < SCREENHEIGHT; y++)
{
for (x = 0; x < SCREENWIDTH; x++)
{
DWORD fg = fg2rgb[fromnew[x]];
DWORD bg = bg2rgb[fromold[x]];
fg = (fg+bg) | 0x1f07c1f;
to[x] = RGB32k.All[fg & (fg>>15)];
}
fromnew += SCREENWIDTH;
fromold += SCREENWIDTH;
to += SCREENPITCH;
}
}
else
{
for (y = 0; y < SCREENHEIGHT; y++)
{
for (x = 0; x < SCREENWIDTH; x++)
@ -367,6 +427,7 @@ bool wipe_doFade (int ticks)
to += SCREENPITCH;
}
}
}
return false;
}