allow particle type names in md2emit and md3emit

md[2|3]emit <tag name> <particle type> <attrib1> <attrib2>

  particle type may now be numeric 0..19 or one of SPARK, SMOKE, ECLOSEST,
  BLOOD, DEMOTRACK, FIREBALL, SHOTLINE, BULLETHOLE, BLOODSTAIN, SCORCH,
  HUDMUZZLEFLASH, MUZZLEFLASH, ELIGHT, ESPAWN, EAMMO, EPICKUP, EMODEL,
  ECARROT, ELADDER, EFLAG

also: cleanup

DOCREF md2emit md3emit
This commit is contained in:
ac-stef
2017-05-16 17:50:00 +02:00
parent 6f03d1819b
commit 6bafdb0037
18 changed files with 42 additions and 38 deletions
+4 -3
View File
@@ -184,8 +184,6 @@ void cleanupexplosion()
}
}
#define MAXPARTYPES 20
struct particle { vec o, d; int fade, type; int millis; particle *next; };
particle *parlist[MAXPARTYPES], *parempty = NULL;
@@ -248,7 +246,10 @@ void newparticle(const vec &o, const vec &d, int fade, int type)
parlist[type] = p;
}
static struct parttype { int type; float r, g, b; int gr, tex; float sz; } parttypes[] =
const char *particletypenames[MAXPARTYPES + 1] = { "SPARK", "SMOKE", "ECLOSEST", "BLOOD", "DEMOTRACK", "FIREBALL", "SHOTLINE", "BULLETHOLE", "BLOODSTAIN", "SCORCH", // 0..9
"HUDMUZZLEFLASH", "MUZZLEFLASH", "ELIGHT", "ESPAWN", "EAMMO", "EPICKUP", "EMODEL", "ECARROT", "ELADDER", "EFLAG", "" }; // 10..19
static struct parttype { int type; float r, g, b; int gr, tex; float sz; } parttypes[MAXPARTYPES] =
{
{ PT_PART, 0.4f, 0.4f, 0.4f, 2, 0, 0.06f }, // yellow: sparks
{ PT_PART, 1.0f, 1.0f, 1.0f, 20, 1, 0.15f }, // grey: small smoke