Glowing BRAY

This commit is contained in:
Simon Robertshaw 2012-04-05 23:17:24 +01:00
parent 95c40d9d1e
commit 2976936cfd
2 changed files with 16 additions and 15 deletions

View File

@ -321,7 +321,7 @@ int graphics_BRAY(GRAPHICS_FUNC_ARGS)
}
*cola = trans;
*pixel_mode &= ~PMODE;
*pixel_mode |= PMODE_BLEND;
*pixel_mode |= PMODE_BLEND | PMODE_GLOW;
return 0;
}
int graphics_SWCH(GRAPHICS_FUNC_ARGS)

View File

@ -1877,7 +1877,7 @@ void render_parts(pixel *vid)
if(pixel_mode & PMODE_BLUR && !(render_mode & PMODE_BLUR))
pixel_mode |= PMODE_FLAT;
if(pixel_mode & PMODE_GLOW && !(render_mode & PMODE_GLOW))
pixel_mode |= PMODE_FLAT;
pixel_mode |= PMODE_BLEND;
if (render_mode & PMODE_BLOB)
pixel_mode |= PMODE_BLOB;
@ -2150,6 +2150,7 @@ void render_parts(pixel *vid)
}
if(pixel_mode & PMODE_GLOW)
{
int cola1 = (5*cola)/255;
#ifdef OGLR
glowV[cglowV++] = nx;
glowV[cglowV++] = ny;
@ -2159,24 +2160,24 @@ void render_parts(pixel *vid)
glowC[cglowC++] = 1.0f;
cglow++;
#else
addpixel(vid, nx, ny, colr, colg, colb, 192);
addpixel(vid, nx+1, ny, colr, colg, colb, 96);
addpixel(vid, nx-1, ny, colr, colg, colb, 96);
addpixel(vid, nx, ny+1, colr, colg, colb, 96);
addpixel(vid, nx, ny-1, colr, colg, colb, 96);
addpixel(vid, nx, ny, colr, colg, colb, (192*cola)/255);
addpixel(vid, nx+1, ny, colr, colg, colb, (96*cola)/255);
addpixel(vid, nx-1, ny, colr, colg, colb, (96*cola)/255);
addpixel(vid, nx, ny+1, colr, colg, colb, (96*cola)/255);
addpixel(vid, nx, ny-1, colr, colg, colb, (96*cola)/255);
for (x = 1; x < 6; x++) {
addpixel(vid, nx, ny-x, colr, colg, colb, 5);
addpixel(vid, nx, ny+x, colr, colg, colb, 5);
addpixel(vid, nx-x, ny, colr, colg, colb, 5);
addpixel(vid, nx+x, ny, colr, colg, colb, 5);
addpixel(vid, nx, ny-x, colr, colg, colb, cola1);
addpixel(vid, nx, ny+x, colr, colg, colb, cola1);
addpixel(vid, nx-x, ny, colr, colg, colb, cola1);
addpixel(vid, nx+x, ny, colr, colg, colb, cola1);
for (y = 1; y < 6; y++) {
if(x + y > 7)
continue;
addpixel(vid, nx+x, ny-y, colr, colg, colb, 5);
addpixel(vid, nx-x, ny+y, colr, colg, colb, 5);
addpixel(vid, nx+x, ny+y, colr, colg, colb, 5);
addpixel(vid, nx-x, ny-y, colr, colg, colb, 5);
addpixel(vid, nx+x, ny-y, colr, colg, colb, cola1);
addpixel(vid, nx-x, ny+y, colr, colg, colb, cola1);
addpixel(vid, nx+x, ny+y, colr, colg, colb, cola1);
addpixel(vid, nx-x, ny-y, colr, colg, colb, cola1);
}
}
#endif