Fix Blob mode, Sprk, Firw, Fwrk and others

This commit is contained in:
Simon Robertshaw 2011-10-28 22:36:37 +01:00
parent 41448e92bf
commit 7413654b9f
3 changed files with 42 additions and 26 deletions

View File

@ -116,10 +116,11 @@ int graphics_DUST(GRAPHICS_FUNC_ARGS)
*colg = (a*((cpart->dcolour>>8)&0xFF) + (255-a)**colg) >> 8;
*colb = (a*((cpart->dcolour)&0xFF) + (255-a)**colb) >> 8;
}
*firea = 255;
*pixel_mode |= PMODE_GLOW;
/**firea = 255;
*firer = *colr;
*fireg = *colg;
*fireb = *colb;
*fireb = *colb;*/
}
return 0;
}
@ -444,7 +445,9 @@ int graphics_HFLM(GRAPHICS_FUNC_ARGS)
}
int graphics_FIRW(GRAPHICS_FUNC_ARGS)
{
int caddress = restrict_flt(restrict_flt((float)((int)(cpart->life/2)), 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
if(cpart->tmp>=3)
{
int caddress = restrict_flt(restrict_flt((float)(cpart->tmp-4), 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
*colr = (unsigned char)firw_data[caddress];
*colg = (unsigned char)firw_data[caddress+1];
*colb = (unsigned char)firw_data[caddress+2];
@ -457,7 +460,9 @@ int graphics_FIRW(GRAPHICS_FUNC_ARGS)
*colb = (a*((cpart->dcolour)&0xFF) + (255-a)**colb) >> 8;
}
*firea = 255;
*firea = cpart->life*4;
if(*firea > 240)
*firea = 240;
*firer = *colr;
*fireg = *colg;
*fireb = *colb;
@ -465,6 +470,11 @@ int graphics_FIRW(GRAPHICS_FUNC_ARGS)
*pixel_mode = PMODE_NONE; //Clear default, don't draw pixel
*pixel_mode |= FIRE_ADD;
//Returning 0 means dynamic, do not cache
}
else if(cpart->tmp > 0)
{
*pixel_mode |= PMODE_GLOW;
}
return 0;
}
int graphics_BOMB(GRAPHICS_FUNC_ARGS)

View File

@ -218,8 +218,9 @@ int graphics_SPRK(GRAPHICS_FUNC_ARGS)
//*firer = *colr*0.5;
//*fireg = *colg;
//*fireb = *colb*2;
*colr *= 0.5;
*colb *= 2;
*colr = 170;
*colg = 200;
*colb = 220;
//*pixel_mode |= FIRE_ADD;
*pixel_mode |= PMODE_GLOW;
return 1;

View File

@ -1769,9 +1769,12 @@ void render_parts(pixel *vid)
}
//Apply decoration colour
if(cmode != CM_NOTHING && decorations_enable)
{
colr = (deca*decr + (255-deca)*colr) >> 8;
colg = (deca*decg + (255-deca)*colg) >> 8;
colb = (deca*decb + (255-deca)*colb) >> 8;
}
//All colours are now set, check ranges
if(colr>255) colr = 255;
@ -1873,6 +1876,8 @@ void render_parts(pixel *vid)
blobC[cblobC++] = 1.0f;
cblob++;
#else
vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(colr,colg,colb);
blendpixel(vid, nx+1, ny, colr, colg, colb, 223);
blendpixel(vid, nx-1, ny, colr, colg, colb, 223);
blendpixel(vid, nx, ny+1, colr, colg, colb, 223);