diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2011-10-28 21:36:37 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-10-28 21:36:37 (GMT) |
| commit | 7413654b9f1d6c0cde622d1b3129378a8e6c30d2 (patch) | |
| tree | 97b44bfb8fe17e4bf792d3336f61b840b327962b /src/elements | |
| parent | 41448e92bf0ea299250a1319204aeab0f7ef3bcc (diff) | |
| download | powder-7413654b9f1d6c0cde622d1b3129378a8e6c30d2.zip powder-7413654b9f1d6c0cde622d1b3129378a8e6c30d2.tar.gz | |
Fix Blob mode, Sprk, Firw, Fwrk and others
Diffstat (limited to 'src/elements')
| -rw-r--r-- | src/elements/newgraphics.c | 52 | ||||
| -rw-r--r-- | src/elements/sprk.c | 5 |
2 files changed, 34 insertions, 23 deletions
diff --git a/src/elements/newgraphics.c b/src/elements/newgraphics.c index c6bc3ce..c3ff414 100644 --- a/src/elements/newgraphics.c +++ b/src/elements/newgraphics.c @@ -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,27 +445,36 @@ 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); - *colr = (unsigned char)firw_data[caddress]; - *colg = (unsigned char)firw_data[caddress+1]; - *colb = (unsigned char)firw_data[caddress+2]; - - if (decorations_enable && cpart->dcolour) + if(cpart->tmp>=3) { - int a = (cpart->dcolour>>24)&0xFF; - *colr = (a*((cpart->dcolour>>16)&0xFF) + (255-a)**colr) >> 8; - *colg = (a*((cpart->dcolour>>8)&0xFF) + (255-a)**colg) >> 8; - *colb = (a*((cpart->dcolour)&0xFF) + (255-a)**colb) >> 8; + 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]; + + if (decorations_enable && cpart->dcolour) + { + int a = (cpart->dcolour>>24)&0xFF; + *colr = (a*((cpart->dcolour>>16)&0xFF) + (255-a)**colr) >> 8; + *colg = (a*((cpart->dcolour>>8)&0xFF) + (255-a)**colg) >> 8; + *colb = (a*((cpart->dcolour)&0xFF) + (255-a)**colb) >> 8; + } + + *firea = cpart->life*4; + if(*firea > 240) + *firea = 240; + *firer = *colr; + *fireg = *colg; + *fireb = *colb; + + *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; } - - *firea = 255; - *firer = *colr; - *fireg = *colg; - *fireb = *colb; - - *pixel_mode = PMODE_NONE; //Clear default, don't draw pixel - *pixel_mode |= FIRE_ADD; - //Returning 0 means dynamic, do not cache return 0; } int graphics_BOMB(GRAPHICS_FUNC_ARGS) diff --git a/src/elements/sprk.c b/src/elements/sprk.c index fdbdb2d..93b0b40 100644 --- a/src/elements/sprk.c +++ b/src/elements/sprk.c @@ -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; |
