I simply used this:
if ((r&0xFF)==PT_FIRE) {
parts[r>>8].ctype =PT_PTSM;
}
That seems to work
ptsm.c:
#include
int update_PTSM(UPDATE_FUNC_ARGS) {
int r, rx, ry, trade, np;
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
if (x+rx>=0 && y+ry>0 && x+rx {
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_FIRE) {
parts[r>>8].ctype =PT_PTSM;
}
}
return 0;
}
#include
int graphics_FIRE(GRAPHICS_FUNC_ARGS)
{
int caddress = restrict_flt(restrict_flt((float)cpart->life, 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
if (cpart->ctype == PT_PTSM){
*firea = 255;
*firer = (unsigned char)flm_data[caddress+1];
*fireg = (unsigned char)flm_data[caddress+2];
*fireb = (unsigned char)flm_data[caddress+1];
}
else {
*firea = 255;
*firer = (unsigned char)flm_data[caddress];
*fireg = (unsigned char)flm_data[caddress+1];
*fireb = (unsigned char)flm_data[caddress+2];}
*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;
}
Ok! Thanks!