mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
Particles can now scale up to 65535.
This commit is contained in:
parent
cf43eb6c6d
commit
0be09f54bd
4 changed files with 9 additions and 10 deletions
|
@ -6009,10 +6009,10 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
|
|||
int startalpha = argCount > 13 ? args[13] : 0xFF; // Byte trans
|
||||
int fadestep = argCount > 14 ? args[14] : -1;
|
||||
|
||||
startalpha = clamp<int>(startalpha, 0, 0xFF); // Clamp to byte
|
||||
lifetime = clamp<int>(lifetime, 0, 0xFF); // Clamp to byte
|
||||
fadestep = clamp<int>(fadestep, -1, 0xFF); // Clamp to byte inc. -1 (indicating automatic)
|
||||
size = clamp<int>(size, 0, 127); // Clamp to byte
|
||||
startalpha = clamp<int>(startalpha, 0, 255); // Clamp to byte
|
||||
lifetime = clamp<int>(lifetime, 0, 255); // Clamp to byte
|
||||
fadestep = clamp<int>(fadestep, -1, 255); // Clamp to byte inc. -1 (indicating automatic)
|
||||
size = clamp<int>(size, 0, 65535); // Clamp to word
|
||||
|
||||
if (lifetime != 0)
|
||||
P_SpawnParticle(x, y, z, xvel, yvel, zvel, color, fullbright, startalpha, lifetime, size, fadestep, accelx, accely, accelz);
|
||||
|
|
|
@ -284,7 +284,7 @@ void P_ThinkParticles ()
|
|||
}
|
||||
}
|
||||
|
||||
void P_SpawnParticle(fixed_t x, fixed_t y, fixed_t z, fixed_t velx, fixed_t vely, fixed_t velz, PalEntry color, bool fullbright, BYTE startalpha, BYTE lifetime, BYTE size, int fadestep, fixed_t accelx, fixed_t accely, fixed_t accelz)
|
||||
void P_SpawnParticle(fixed_t x, fixed_t y, fixed_t z, fixed_t velx, fixed_t vely, fixed_t velz, PalEntry color, bool fullbright, BYTE startalpha, BYTE lifetime, WORD size, int fadestep, fixed_t accelx, fixed_t accely, fixed_t accelz)
|
||||
{
|
||||
particle_t *particle = NewParticle();
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ struct particle_t
|
|||
fixed_t accx,accy,accz;
|
||||
BYTE ttl;
|
||||
BYTE trans;
|
||||
BYTE size:7;
|
||||
WORD size;
|
||||
BYTE bright:1;
|
||||
BYTE fade;
|
||||
int color;
|
||||
|
@ -83,7 +83,7 @@ particle_t *JitterParticle (int ttl);
|
|||
particle_t *JitterParticle (int ttl, float drift);
|
||||
|
||||
void P_ThinkParticles (void);
|
||||
void P_SpawnParticle(fixed_t x, fixed_t y, fixed_t z, fixed_t velx, fixed_t vely, fixed_t velz, PalEntry color, bool fullbright, BYTE startalpha, BYTE lifetime, BYTE size, int fadestep, fixed_t accelx, fixed_t accely, fixed_t accelz);
|
||||
void P_SpawnParticle(fixed_t x, fixed_t y, fixed_t z, fixed_t velx, fixed_t vely, fixed_t velz, PalEntry color, bool fullbright, BYTE startalpha, BYTE lifetime, WORD size, int fadestep, fixed_t accelx, fixed_t accely, fixed_t accelz);
|
||||
void P_InitEffects (void);
|
||||
void P_RunEffects (void);
|
||||
|
||||
|
|
|
@ -2644,7 +2644,6 @@ enum SPFflag
|
|||
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnParticle)
|
||||
{
|
||||
//(color color1, int flags = 0, int lifetime = 35, int size = 1, float angle = 0, float xoff = 0, float yoff = 0, float zoff = 0, float velx = 0, float vely = 0, float velz = 0, float accelx = 0, float accely = 0, float accelz = 0, float startalphaf = 1, float fadestepf = -1);
|
||||
ACTION_PARAM_START(15);
|
||||
ACTION_PARAM_COLOR(color, 0);
|
||||
ACTION_PARAM_INT(flags, 1);
|
||||
|
@ -2665,8 +2664,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnParticle)
|
|||
|
||||
BYTE startalpha = (BYTE)Scale(clamp(startalphaf, 0, FRACUNIT), 255, FRACUNIT);
|
||||
int fadestep = fadestepf < 0? -1 : Scale(clamp(fadestepf, 0, FRACUNIT), 255, FRACUNIT);
|
||||
lifetime = clamp<int>(lifetime, 0, 0xFF); // Clamp to byte
|
||||
size = clamp<int>(size, 0, 0xFF); // Clamp to byte
|
||||
lifetime = clamp<int>(lifetime, 0, 255); // Clamp to byte
|
||||
size = clamp<int>(size, 0, 65535); // Clamp to word
|
||||
|
||||
if (lifetime != 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue