TPT: Glowing BRAY 2976936cfd

This commit is contained in:
Simon Robertshaw 2012-04-18 21:00:43 +01:00
parent 94e7123791
commit 1681429d7f
2 changed files with 16 additions and 15 deletions

View File

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

View File

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