- renamed another set of variables

This commit is contained in:
Christoph Oelckers 2022-09-03 22:42:37 +02:00
parent 85be297a2d
commit aa88eb49e0
4 changed files with 35 additions and 35 deletions

View file

@ -1525,11 +1525,11 @@ struct SECTOR_OBJECT
scale_speed; // speed of scaling
// values for single point scaling
int16_t scale_point_dist[MAX_SO_POINTS], // distance from center
scale_point_speed[MAX_SO_POINTS], // speed of scaling
scale_point_base_speed, // base speed of scaling
scale_point_dist_min, // absolute min
scale_point_dist_max, // absolute max
int16_t _scale_point_dist[MAX_SO_POINTS], // distance from center
_scale_point_speed[MAX_SO_POINTS], // speed of scaling
_scale_point_base_speed, // base speed of scaling
_scale_point_dist_min, // absolute min
_scale_point_dist_max, // absolute max
scale_point_rand_freq, // freqency of direction change - based on rand(1024)
scale_x_mult, // x multiplyer for scaling

View file

@ -255,34 +255,34 @@ DVector2 ScaleRandomPoint(SECTOR_OBJECT* sop, short k, DAngle ang, const DVector
{
int xmul, ymul;
sop->scale_point_dist[k] += sop->scale_point_speed[k];
if (sop->scale_point_dist[k] > sop->scale_point_dist_max)
sop->_scale_point_dist[k] += sop->_scale_point_speed[k];
if (sop->_scale_point_dist[k] > sop->_scale_point_dist_max)
{
sop->scale_point_speed[k] *= -1;
sop->scale_point_dist[k] = sop->scale_point_dist_max;
sop->_scale_point_speed[k] *= -1;
sop->_scale_point_dist[k] = sop->_scale_point_dist_max;
}
else if (sop->scale_point_dist[k] < sop->scale_point_dist_min)
else if (sop->_scale_point_dist[k] < sop->_scale_point_dist_min)
{
sop->scale_point_speed[k] *= -1;
sop->scale_point_dist[k] = sop->scale_point_dist_min;
sop->_scale_point_speed[k] *= -1;
sop->_scale_point_dist[k] = sop->_scale_point_dist_min;
}
if (RANDOM_P2(1024) < sop->scale_point_rand_freq)
{
sop->scale_point_speed[k] *= -1;
sop->_scale_point_speed[k] *= -1;
}
// change up speed at random
if (RANDOM_P2(1024) < (sop->scale_point_rand_freq / 2))
{
//sop->scale_point_speed[k] = SCALE_POINT_SPEED;
short half = sop->scale_point_base_speed / 2;
short quart = sop->scale_point_base_speed / 4;
sop->scale_point_speed[k] = sop->scale_point_base_speed + (RandomRange(half) - quart);
short half = sop->_scale_point_base_speed / 2;
short quart = sop->_scale_point_base_speed / 4;
sop->_scale_point_speed[k] = sop->_scale_point_base_speed + (RandomRange(half) - quart);
}
xmul = (sop->scale_point_dist[k] * sop->scale_x_mult) >> 8;
ymul = (sop->scale_point_dist[k] * sop->scale_y_mult) >> 8;
xmul = (sop->_scale_point_dist[k] * sop->scale_x_mult) >> 8;
ymul = (sop->_scale_point_dist[k] * sop->scale_y_mult) >> 8;
DVector2 mul(xmul / 16., ymul / 16.);
DVector2 ret;

View file

@ -686,11 +686,11 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, SECTOR_OBJECT& w,
.Array("clipbox_dist", w.clipbox_dist, def->clipbox_dist, w.clipbox_num)
.Array("clipbox_ang", w.clipbox_ang, def->clipbox_ang, w.clipbox_num)
.Array("clipbox_vdist", w.clipbox_vdist, def->clipbox_vdist, w.clipbox_num)
.Array("scale_point_dist", w.scale_point_dist, def->scale_point_dist, MAX_SO_POINTS)
.Array("scale_point_speed", w.scale_point_speed, def->scale_point_speed, MAX_SO_POINTS)
("scale_point_base_speed", w.scale_point_base_speed, def->scale_point_base_speed)
("scale_point_dist_min", w.scale_point_dist_min, def->scale_point_dist_min)
("scale_point_dist_max", w.scale_point_dist_max, def->scale_point_dist_max)
.Array("scale_point_dist", w._scale_point_dist, def->_scale_point_dist, MAX_SO_POINTS)
.Array("scale_point_speed", w._scale_point_speed, def->_scale_point_speed, MAX_SO_POINTS)
("scale_point_base_speed", w._scale_point_base_speed, def->_scale_point_base_speed)
("scale_point_dist_min", w._scale_point_dist_min, def->_scale_point_dist_min)
("scale_point_dist_max", w._scale_point_dist_max, def->_scale_point_dist_max)
("scale_point_rand_freq", w.scale_point_rand_freq, def->scale_point_rand_freq)
("scale_x_mult", w.scale_x_mult, def->scale_x_mult)
("scale_y_mult", w.scale_y_mult, def->scale_y_mult)

View file

@ -1012,11 +1012,11 @@ void SetupSectorObject(sectortype* sectp, short tag)
case SO_SCALE_POINT_INFO:
memset(sop->scale_point_dist,0,sizeof(sop->scale_point_dist));
sop->scale_point_base_speed = SP_TAG2(actor);
for (j = 0; j < (int)SIZ(sop->scale_point_speed); j++)
memset(sop->_scale_point_dist,0,sizeof(sop->_scale_point_dist));
sop->_scale_point_base_speed = SP_TAG2(actor);
for (j = 0; j < (int)SIZ(sop->_scale_point_speed); j++)
{
sop->scale_point_speed[j] = SP_TAG2(actor);
sop->_scale_point_speed[j] = SP_TAG2(actor);
}
if (SP_TAG4(actor))
@ -1024,8 +1024,8 @@ void SetupSectorObject(sectortype* sectp, short tag)
else
sop->scale_point_rand_freq = 64;
sop->scale_point_dist_min = -SP_TAG5(actor);
sop->scale_point_dist_max = SP_TAG6(actor);
sop->_scale_point_dist_min = -SP_TAG5(actor);
sop->_scale_point_dist_max = SP_TAG6(actor);
KillActor(actor);
break;
@ -1105,13 +1105,13 @@ void SetupSectorObject(sectortype* sectp, short tag)
sop->scale_type = SO_SCALE_RANDOM_POINT;
sop->PreMoveAnimator = ScaleSectorObject;
memset(sop->scale_point_dist,0,sizeof(sop->scale_point_dist));;
sop->scale_point_base_speed = SCALE_POINT_SPEED;
for (j = 0; j < (int)SIZ(sop->scale_point_speed); j++)
sop->scale_point_speed[j] = SCALE_POINT_SPEED;
memset(sop->_scale_point_dist,0,sizeof(sop->_scale_point_dist));;
sop->_scale_point_base_speed = SCALE_POINT_SPEED;
for (j = 0; j < (int)SIZ(sop->_scale_point_speed); j++)
sop->_scale_point_speed[j] = SCALE_POINT_SPEED;
sop->scale_point_dist_min = -256;
sop->scale_point_dist_max = 256;
sop->_scale_point_dist_min = -256;
sop->_scale_point_dist_max = 256;
sop->scale_point_rand_freq = 32;
KillActor(actor);
break;