Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saturn Style Enemy Transparency #25

Open
RetroGamer02 opened this issue Nov 24, 2021 · 1 comment
Open

Saturn Style Enemy Transparency #25

RetroGamer02 opened this issue Nov 24, 2021 · 1 comment

Comments

@RetroGamer02
Copy link

RetroGamer02 commented Nov 24, 2021

Hi I added FastDoom's Saturn Fuzz effect to my fork and I was wondering if you would like it for GBADoom.
I however have no idea how to do a merge request for just a snip-it of code so Ill post it here.

SaturnStyle Transparency Progress 2

//Code adapted from viti95's FastDoom to the GBA
void R_DrawFuzzColumnSaturn(const draw_column_vars_t *dcvars)
{
int dc_yl = dcvars->yl;
int dc_yh = dcvars->yh;

int count;
byte *dest;
fixed_t frac;
fixed_t fracstep;
int initialdrawpos = 0;

// Adjust borders. Low...
if (dc_yl <= 0)
    dc_yl = 1;

// .. and high.
if (dc_yh >= viewheight-1)
    dc_yh = viewheight - 2;

count = IDiv32((dc_yh - dc_yl), 2) - 1;

// Zero length, column does not exceed a pixel.
if (count <= 0)
    return;

const byte* colormap = &fullcolormap[6*256];

initialdrawpos = dc_yl + dcvars->x;

dest = drawvars.byte_topleft + ScreenYToOffset(dcvars->yl) + dcvars->x;

fracstep = (dcvars->iscale << COLEXTRABITS);
frac = (dcvars->texturemid + (dc_yl - centery)*dcvars->iscale) << COLEXTRABITS;

if (initialdrawpos & 1)
{
    dest += SCREENWIDTH * 2;
    frac += fracstep;
}

fracstep = 2 * (fracstep);

do
{
    *dest = colormap[dcvars->source[frac>>COLBITS]];

    dest += SCREENWIDTH * 4;
    frac += fracstep;
} while (count--);

if ((dc_yh - dc_yl) & 1)
{
    *dest = colormap[dcvars->source[(frac >> COLBITS)]];
}
else
{
    if (!(initialdrawpos & 1))
    {
        *dest = colormap[dcvars->source[(frac >> COLBITS)]];
    }
}

}

@Kippykip
Copy link
Contributor

Heh, a while ago I did a PSXDoom GBA test, it would probably be a cool effect for that if a full version was to ever come out of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants