Fix nothing display and LCRY with decoration
This commit is contained in:
parent
f4b6cbf34d
commit
3daf9e1e29
@ -356,17 +356,17 @@ int graphics_GLOW(GRAPHICS_FUNC_ARGS)
|
||||
int graphics_LCRY(GRAPHICS_FUNC_ARGS)
|
||||
{
|
||||
int lifemod = ((cpart->life>10?10:cpart->life)*10);
|
||||
if(cpart->dcolour && cpart->dcolour&0xFF000000)
|
||||
{
|
||||
*colr += (lifemod * (255-(cpart->dcolour>>16)&0xFF))>>8;
|
||||
*colg += (lifemod * (255-(cpart->dcolour>>8)&0xFF))>>8;
|
||||
*colb += (lifemod * (255-(cpart->dcolour)&0xFF))>>8;
|
||||
}
|
||||
else
|
||||
{
|
||||
*colr += lifemod;
|
||||
*colg += lifemod;
|
||||
*colb += lifemod;
|
||||
if(cpart->dcolour && cpart->dcolour&0xFF000000)
|
||||
{
|
||||
lifemod *= 2.5f;
|
||||
if(lifemod < 40)
|
||||
lifemod = 40;
|
||||
*colr = (lifemod*((cpart->dcolour>>16)&0xFF) + (255-lifemod)**colr) >> 8;
|
||||
*colg = (lifemod*((cpart->dcolour>>8)&0xFF) + (255-lifemod)**colg) >> 8;
|
||||
*colb = (lifemod*((cpart->dcolour)&0xFF) + (255-lifemod)**colb) >> 8;
|
||||
}
|
||||
*pixel_mode |= NO_DECO;
|
||||
return 0;
|
||||
|
@ -1673,6 +1673,28 @@ void render_parts(pixel *vid)
|
||||
decg = (parts[i].dcolour>>8)&0xFF;
|
||||
decb = (parts[i].dcolour)&0xFF;
|
||||
|
||||
if(cmode == CM_NOTHING)
|
||||
{
|
||||
if(decorations_enable)
|
||||
{
|
||||
colr = (deca*decr + (255-deca)*colr) >> 8;
|
||||
colg = (deca*decg + (255-deca)*colg) >> 8;
|
||||
colb = (deca*decb + (255-deca)*colb) >> 8;
|
||||
}
|
||||
#ifdef OGLR
|
||||
flatV[cflatV++] = nx;
|
||||
flatV[cflatV++] = ny;
|
||||
flatC[cflatC++] = ((float)colr)/255.0f;
|
||||
flatC[cflatC++] = ((float)colg)/255.0f;
|
||||
flatC[cflatC++] = ((float)colb)/255.0f;
|
||||
flatC[cflatC++] = 1.0f;
|
||||
cflat++;
|
||||
#else
|
||||
vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(colr,colg,colb);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
if (graphicscache[t].isready)
|
||||
{
|
||||
pixel_mode = graphicscache[t].pixel_mode;
|
||||
@ -1771,14 +1793,14 @@ void render_parts(pixel *vid)
|
||||
}
|
||||
|
||||
//Apply decoration colour
|
||||
if(cmode != CM_NOTHING && cmode != CM_HEAT && decorations_enable)
|
||||
if(!(pixel_mode & NO_DECO) && cmode != CM_HEAT && decorations_enable)
|
||||
{
|
||||
colr = (deca*decr + (255-deca)*colr) >> 8;
|
||||
colg = (deca*decg + (255-deca)*colg) >> 8;
|
||||
colb = (deca*decb + (255-deca)*colb) >> 8;
|
||||
}
|
||||
|
||||
#ifndef OGLR
|
||||
#ifndef OGLR
|
||||
//All colours are now set, check ranges
|
||||
if(colr>255) colr = 255;
|
||||
else if(colr<0) colr = 0;
|
||||
@ -1788,24 +1810,8 @@ void render_parts(pixel *vid)
|
||||
else if(colb<0) colb = 0;
|
||||
if(cola>255) cola = 255;
|
||||
else if(cola<0) cola = 0;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if(cmode == CM_NOTHING)
|
||||
{
|
||||
#ifdef OGLR
|
||||
flatV[cflatV++] = nx;
|
||||
flatV[cflatV++] = ny;
|
||||
flatC[cflatC++] = ((float)colr)/255.0f;
|
||||
flatC[cflatC++] = ((float)colg)/255.0f;
|
||||
flatC[cflatC++] = ((float)colb)/255.0f;
|
||||
flatC[cflatC++] = 1.0f;
|
||||
cflat++;
|
||||
#else
|
||||
vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(colr,colg,colb);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
//Pixel rendering
|
||||
if(pixel_mode & PSPEC_STICKMAN)
|
||||
{
|
||||
|
Reference in New Issue
Block a user