- more refactoring of AActor coordinate access.
This commit is contained in:
parent
5b610390e1
commit
c611456397
9 changed files with 105 additions and 51 deletions
|
|
@ -356,9 +356,10 @@ static void MakeFountain (AActor *actor, int color1, int color2)
|
|||
angle_t an = M_Random()<<(24-ANGLETOFINESHIFT);
|
||||
fixed_t out = FixedMul (actor->radius, M_Random()<<8);
|
||||
|
||||
particle->x = actor->x + FixedMul (out, finecosine[an]);
|
||||
particle->y = actor->y + FixedMul (out, finesine[an]);
|
||||
particle->z = actor->z + actor->height + FRACUNIT;
|
||||
fixedvec3 pos = actor->Vec3Offset(FixedMul(out, finecosine[an]), FixedMul(out, finesine[an]), actor->height + FRACUNIT);
|
||||
particle->x = pos.x;
|
||||
particle->y = pos.y;
|
||||
particle->z = pos.z;
|
||||
if (out < actor->radius/8)
|
||||
particle->velz += FRACUNIT*10/3;
|
||||
else
|
||||
|
|
@ -395,9 +396,10 @@ void P_RunEffect (AActor *actor, int effects)
|
|||
{
|
||||
// Rocket trail
|
||||
|
||||
fixed_t backx = actor->x - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2);
|
||||
fixed_t backy = actor->y - FixedMul (finesine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2);
|
||||
fixed_t backz = actor->z - (actor->height>>3) * (actor->velz>>16) + (2*actor->height)/3;
|
||||
|
||||
fixed_t backx = - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2);
|
||||
fixed_t backy = - FixedMul (finesine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2);
|
||||
fixed_t backz = - (actor->height>>3) * (actor->velz>>16) + (2*actor->height)/3;
|
||||
|
||||
angle_t an = (moveangle + ANG90) >> ANGLETOFINESHIFT;
|
||||
int speed;
|
||||
|
|
@ -405,9 +407,13 @@ void P_RunEffect (AActor *actor, int effects)
|
|||
particle = JitterParticle (3 + (M_Random() & 31));
|
||||
if (particle) {
|
||||
fixed_t pathdist = M_Random()<<8;
|
||||
particle->x = backx - FixedMul(actor->velx, pathdist);
|
||||
particle->y = backy - FixedMul(actor->vely, pathdist);
|
||||
particle->z = backz - FixedMul(actor->velz, pathdist);
|
||||
fixedvec3 pos = actor->Vec3Offset(
|
||||
backx - FixedMul(actor->velx, pathdist),
|
||||
backy - FixedMul(actor->vely, pathdist),
|
||||
backz - FixedMul(actor->velz, pathdist));
|
||||
particle->x = pos.x;
|
||||
particle->y = pos.y;
|
||||
particle->z = pos.z;
|
||||
speed = (M_Random () - 128) * (FRACUNIT/200);
|
||||
particle->velx += FixedMul (speed, finecosine[an]);
|
||||
particle->vely += FixedMul (speed, finesine[an]);
|
||||
|
|
@ -420,9 +426,13 @@ void P_RunEffect (AActor *actor, int effects)
|
|||
particle_t *particle = JitterParticle (3 + (M_Random() & 31));
|
||||
if (particle) {
|
||||
fixed_t pathdist = M_Random()<<8;
|
||||
particle->x = backx - FixedMul(actor->velx, pathdist);
|
||||
particle->y = backy - FixedMul(actor->vely, pathdist);
|
||||
particle->z = backz - FixedMul(actor->velz, pathdist) + (M_Random() << 10);
|
||||
fixedvec3 pos = actor->Vec3Offset(
|
||||
backx - FixedMul(actor->velx, pathdist),
|
||||
backy - FixedMul(actor->vely, pathdist),
|
||||
backz - FixedMul(actor->velz, pathdist) + (M_Random() << 10);
|
||||
particle->x = pos.x;
|
||||
particle->y = pos.y;
|
||||
particle->z = pos.z;
|
||||
speed = (M_Random () - 128) * (FRACUNIT/200);
|
||||
particle->velx += FixedMul (speed, finecosine[an]);
|
||||
particle->vely += FixedMul (speed, finesine[an]);
|
||||
|
|
@ -441,10 +451,12 @@ void P_RunEffect (AActor *actor, int effects)
|
|||
{
|
||||
// Grenade trail
|
||||
|
||||
P_DrawSplash2 (6,
|
||||
actor->x - FixedMul (finecosine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2),
|
||||
actor->y - FixedMul (finesine[(moveangle)>>ANGLETOFINESHIFT], actor->radius*2),
|
||||
actor->z - (actor->height>>3) * (actor->velz>>16) + (2*actor->height)/3,
|
||||
fixedvec3 pos = actor->Vec3Offset(
|
||||
-FixedMul(finecosine[(moveangle) >> ANGLETOFINESHIFT], actor->radius * 2),
|
||||
-FixedMul(finesine[(moveangle) >> ANGLETOFINESHIFT], actor->radius * 2),
|
||||
-(actor->height >> 3) * (actor->velz >> 16) + (2 * actor->height) / 3);
|
||||
|
||||
P_DrawSplash2 (6, pos.x, pos.y, pos.z,
|
||||
moveangle + ANG180, 2, 2);
|
||||
}
|
||||
if (effects & FX_FOUNTAINMASK)
|
||||
|
|
@ -476,10 +488,11 @@ void P_RunEffect (AActor *actor, int effects)
|
|||
if (particle != NULL)
|
||||
{
|
||||
angle_t ang = M_Random () << (32-ANGLETOFINESHIFT-8);
|
||||
particle->x = actor->x + FixedMul (actor->radius, finecosine[ang]);
|
||||
particle->y = actor->y + FixedMul (actor->radius, finesine[ang]);
|
||||
fixedvec3 pos = actor->Vec3Offset(FixedMul (actor->radius, finecosine[ang]), FixedMul (actor->radius, finesine[ang]), 0);
|
||||
particle->x = pos.x;
|
||||
particle->y = pos.y;
|
||||
particle->z = pos.z;
|
||||
particle->color = *protectColors[M_Random() & 1];
|
||||
particle->z = actor->z;
|
||||
particle->velz = FRACUNIT;
|
||||
particle->accz = M_Random () << 7;
|
||||
particle->size = 1;
|
||||
|
|
@ -832,9 +845,13 @@ void P_DisconnectEffect (AActor *actor)
|
|||
if (!p)
|
||||
break;
|
||||
|
||||
p->x = actor->x + ((M_Random()-128)<<9) * (actor->radius>>FRACBITS);
|
||||
p->y = actor->y + ((M_Random()-128)<<9) * (actor->radius>>FRACBITS);
|
||||
p->z = actor->z + (M_Random()<<8) * (actor->height>>FRACBITS);
|
||||
fixedvec3 pos = actor->Vec3Offset(
|
||||
((M_Random()-128)<<9) * (actor->radius>>FRACBITS),
|
||||
((M_Random()-128)<<9) * (actor->radius>>FRACBITS),
|
||||
(M_Random()<<8) * (actor->height>>FRACBITS));
|
||||
p->x = pos.x;
|
||||
p->y = pos.y;
|
||||
p->z = pos.z;
|
||||
p->accz -= FRACUNIT/4096;
|
||||
p->color = M_Random() < 128 ? maroon1 : maroon2;
|
||||
p->size = 4;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue