Add missing file from previous commit

This commit is contained in:
Simon Robertshaw 2011-10-10 23:59:44 +01:00
parent 2901eefa32
commit fd71675b69

19
src/elements/fire.c Normal file
View File

@ -0,0 +1,19 @@
#include <element.h>
int graphics_FIRE(GRAPHICS_FUNC_ARGS)
{
int caddress = restrict_flt(restrict_flt((float)((int)(parts[i].life/2)), 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
*colr = (unsigned char)flm_data[caddress];
*colg = (unsigned char)flm_data[caddress+1];
*colb = (unsigned char)flm_data[caddress+2];
*firea = 255;
*firer = *colr/8;
*fireg = *colg/8;
*fireb = *colb/8;
*pixel_mode = PMODE_NONE; //Clear default, don't draw pixel
*pixel_mode |= FIRE_ADD;
//Returning 0 means dynamic, do not cache
return 0;
}