- Added endsize parameter and SPF_NOTIMEFREEZE for A_SpawnParticle.
SPF_NOTIMEFREEZE processes particles with this flag regardless of time freeze. The endsize parameter changes the scale of the particle to that size throughout its lifetime linearly.
This commit is contained in:
parent
c4d8950a7f
commit
f787056198
7 changed files with 36 additions and 21 deletions
|
|
@ -3147,6 +3147,7 @@ enum SPFflag
|
|||
SPF_RELVEL = 1 << 2,
|
||||
SPF_RELACCEL = 1 << 3,
|
||||
SPF_RELANG = 1 << 4,
|
||||
SPF_NOTIMEFREEZE = 1 << 5,
|
||||
};
|
||||
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnParticle)
|
||||
|
|
@ -3155,7 +3156,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnParticle)
|
|||
PARAM_COLOR (color);
|
||||
PARAM_INT_OPT (flags) { flags = 0; }
|
||||
PARAM_INT_OPT (lifetime) { lifetime = 35; }
|
||||
PARAM_INT_OPT (size) { size = 1; }
|
||||
PARAM_FLOAT_OPT (size) { size = 1.; }
|
||||
PARAM_ANGLE_OPT (angle) { angle = 0.; }
|
||||
PARAM_FLOAT_OPT (xoff) { xoff = 0; }
|
||||
PARAM_FLOAT_OPT (yoff) { yoff = 0; }
|
||||
|
|
@ -3168,11 +3169,11 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnParticle)
|
|||
PARAM_FLOAT_OPT (accelz) { accelz = 0; }
|
||||
PARAM_FLOAT_OPT (startalpha) { startalpha = 1.; }
|
||||
PARAM_FLOAT_OPT (fadestep) { fadestep = -1.; }
|
||||
PARAM_FLOAT_OPT (endsize) { endsize = -1.; }
|
||||
|
||||
startalpha = clamp(startalpha, 0., 1.);
|
||||
if (fadestep > 0) fadestep = clamp(fadestep, 0., 1.);
|
||||
size = clamp<int>(size, 0, 65535); // Clamp to word
|
||||
|
||||
size = fabs(size);
|
||||
if (lifetime != 0)
|
||||
{
|
||||
if (flags & SPF_RELANG) angle += self->Angles.Yaw;
|
||||
|
|
@ -3199,7 +3200,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnParticle)
|
|||
acc.X = accelx * c + accely * s;
|
||||
acc.Y = accelx * s - accely * c;
|
||||
}
|
||||
P_SpawnParticle(self->Vec3Offset(pos), vel, acc, color, !!(flags & SPF_FULLBRIGHT), startalpha, lifetime, size, fadestep);
|
||||
P_SpawnParticle(self->Vec3Offset(pos), vel, acc, color, startalpha, lifetime, size, fadestep, endsize, flags);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue