jacksonmj:
Delete the glass, create the photon, then recreate the glass? (The method the C code uses to create photons on top of glass (e.g. from neutrons passing through glass) doesn't use the create_part function)
Photon colour is set with ctype. Bits 0-11 add blue, bits 9-20 add green, bits 18-29 add red.
So ctype = 0xF would be blue, ctype=0xF000 would be green, 0xF0000F would be purple.
if (pfree == -1)
return;
i = pfree;
pfree = parts[i].life;
if (i>parts_lastActiveIndex) parts_lastActiveIndex = i;
parts[i].type = PT_PHOT;
int x = 0;
*colr = *colg = *colb = 0;
for (x=0; x<12; x++) {
*colr += (cpart->ctype >> (x+18)) & 1;
*colb += (cpart->ctype >> x) & 1;
}
for (x=0; x<12; x++)
*colg += (cpart->ctype >> (x+9)) & 1;
x = 624/(*colr+*colg+*colb+1);
*colr *= x;
*colg *= x;
*colb *= x;