- renamed some variables

This commit is contained in:
Christoph Oelckers 2022-09-03 19:48:58 +02:00
parent e5b2a0f0a6
commit 30104fca50
4 changed files with 86 additions and 86 deletions

View file

@ -1472,9 +1472,9 @@ struct SECTOR_OBJECT
bob_diff, // bobbing difference for the frame
floor_loz, // floor low z
floor_hiz, // floor hi z
morph_z, // morphing point z
morph_z_min, // morphing point z min
morph_z_max,
_morph_z, // morphing point z
_morph_z_min, // morphing point z min
_morph_z_max,
bob_amt, // bob amount max in z coord
// end of must floatify
@ -1541,14 +1541,14 @@ struct SECTOR_OBJECT
scale_y_mult, // y multiplyer for scaling
// Used for center point movement
morph_ang, // angle moving from CENTER
morph_speed, // speed of movement
morph_dist_max, // radius boundry
_morph_ang, // angle moving from CENTER
_morph_speed, // speed of movement
_morph_dist_max, // radius boundry
morph_rand_freq, // freq of dir change
morph_dist, // dist from CENTER
morph_z_speed, // z speed for morph point
morph_xoff, // save xoff from center
morph_yoff; // save yoff from center
_morph_dist, // dist from CENTER
_morph_z_speed, // z speed for morph point
_morph_xoff, // save xoff from center
_morph_yoff; // save yoff from center
//scale_rand_reverse; // random at random interval
// limit rotation angle

View file

@ -303,45 +303,45 @@ void MorphTornado(SECTOR_OBJECT* sop)
// z direction
ASSERT(sop->op_main_sector != nullptr);
sop->morph_z += Z(sop->morph_z_speed);
sop->_morph_z += Z(sop->_morph_z_speed);
// move vector
if (sop->morph_wall_point == nullptr)
return;
// place at correct x,y offset from center
x = sop->int_pmid().X - sop->morph_xoff;
y = sop->int_pmid().Y - sop->morph_yoff;
x = sop->int_pmid().X - sop->_morph_xoff;
y = sop->int_pmid().Y - sop->_morph_yoff;
sx = x;
sy = y;
// move it from last x,y
mx = x + MulScale(sop->morph_speed, bcos(sop->morph_ang), 14);
my = y + MulScale(sop->morph_speed, bsin(sop->morph_ang), 14);
mx = x + MulScale(sop->_morph_speed, bcos(sop->_morph_ang), 14);
my = y + MulScale(sop->_morph_speed, bsin(sop->_morph_ang), 14);
// bound check radius
if (ksqrt(SQ(sop->int_pmid().X - mx) + SQ(sop->int_pmid().Y - my)) > sop->morph_dist_max + sop->scale_dist)
if (ksqrt(SQ(sop->int_pmid().X - mx) + SQ(sop->int_pmid().Y - my)) > sop->_morph_dist_max + sop->scale_dist)
{
// find angle
sop->morph_ang = NORM_ANGLE(getangle(mx - sop->int_pmid().X, my - sop->int_pmid().Y));
sop->_morph_ang = NORM_ANGLE(getangle(mx - sop->int_pmid().X, my - sop->int_pmid().Y));
// reverse angle
sop->morph_ang = NORM_ANGLE(sop->morph_ang + 1024);
sop->_morph_ang = NORM_ANGLE(sop->_morph_ang + 1024);
// move back some from last point
mx = sx + MulScale(sop->morph_speed << 1, bcos(sop->morph_ang), 14);
my = sy + MulScale(sop->morph_speed << 1, bsin(sop->morph_ang), 14);
mx = sx + MulScale(sop->_morph_speed << 1, bcos(sop->_morph_ang), 14);
my = sy + MulScale(sop->_morph_speed << 1, bsin(sop->_morph_ang), 14);
sop->morph_xoff = sop->int_pmid().X - mx;
sop->morph_yoff = sop->int_pmid().Y - my;
sop->_morph_xoff = sop->int_pmid().X - mx;
sop->_morph_yoff = sop->int_pmid().Y - my;
}
// save x,y back as offset info
sop->morph_xoff = sop->int_pmid().X - mx;
sop->morph_yoff = sop->int_pmid().Y - my;
sop->_morph_xoff = sop->int_pmid().X - mx;
sop->_morph_yoff = sop->int_pmid().Y - my;
if ((RANDOM_P2(1024<<4)>>4) < sop->morph_rand_freq)
sop->morph_ang = RANDOM_P2(2048);
sop->_morph_ang = RANDOM_P2(2048);
// move it x,y
dragpoint(sop->morph_wall_point, mx, my);
@ -356,18 +356,18 @@ void MorphTornado(SECTOR_OBJECT* sop)
((*sectp)->flags & SECTFU_SO_SLOPE_CEILING_TO_POINT))
{
#define TOR_LOW (florz)
if (sop->morph_z > TOR_LOW)
if (sop->_morph_z > TOR_LOW)
{
sop->morph_z_speed *= -1;
sop->morph_z = TOR_LOW;
sop->_morph_z_speed *= -1;
sop->_morph_z = TOR_LOW;
}
else if (sop->morph_z < ceilz)
else if (sop->_morph_z < ceilz)
{
sop->morph_z_speed *= -1;
sop->morph_z = ceilz;
sop->_morph_z_speed *= -1;
sop->_morph_z = ceilz;
}
alignceilslope(*sectp, mx, my, sop->morph_z);
alignceilslope(*sectp, mx, my, sop->_morph_z);
}
}
}
@ -383,43 +383,43 @@ void MorphFloor(SECTOR_OBJECT* sop)
// z direction
ASSERT(sop->op_main_sector != nullptr);
sop->morph_z -= Z(sop->morph_z_speed);
sop->_morph_z -= Z(sop->_morph_z_speed);
// move vector
if (sop->morph_wall_point == nullptr)
return;
// place at correct x,y offset from center
x = sop->int_pmid().X - sop->morph_xoff;
y = sop->int_pmid().Y - sop->morph_yoff;
x = sop->int_pmid().X - sop->_morph_xoff;
y = sop->int_pmid().Y - sop->_morph_yoff;
// move it from last x,y
mx = x + MulScale(sop->morph_speed, bcos(sop->morph_ang), 14);
my = y + MulScale(sop->morph_speed, bsin(sop->morph_ang), 14);
mx = x + MulScale(sop->_morph_speed, bcos(sop->_morph_ang), 14);
my = y + MulScale(sop->_morph_speed, bsin(sop->_morph_ang), 14);
// save x,y back as offset info
sop->morph_xoff = sop->int_pmid().X - mx;
sop->morph_yoff = sop->int_pmid().Y - my;
sop->_morph_xoff = sop->int_pmid().X - mx;
sop->_morph_yoff = sop->int_pmid().Y - my;
// bound check radius
if (Distance(sop->int_pmid().X, sop->int_pmid().Y, mx, my) > sop->morph_dist_max)
if (Distance(sop->int_pmid().X, sop->int_pmid().Y, mx, my) > sop->_morph_dist_max)
{
// go in the other direction
//sop->morph_speed *= -1;
sop->morph_ang = NORM_ANGLE(sop->morph_ang + 1024);
sop->_morph_ang = NORM_ANGLE(sop->_morph_ang + 1024);
// back it up and save it off
mx = x + MulScale(sop->morph_speed, bcos(sop->morph_ang), 14);
my = y + MulScale(sop->morph_speed, bsin(sop->morph_ang), 14);
sop->morph_xoff = sop->int_pmid().X - mx;
sop->morph_yoff = sop->int_pmid().Y - my;
mx = x + MulScale(sop->_morph_speed, bcos(sop->_morph_ang), 14);
my = y + MulScale(sop->_morph_speed, bsin(sop->_morph_ang), 14);
sop->_morph_xoff = sop->int_pmid().X - mx;
sop->_morph_yoff = sop->int_pmid().Y - my;
// turn it all the way around and then do a random -512 to 512 from there
//sop->morph_ang = NORM_ANGLE(sop->morph_ang + 1024 + (RANDOM_P2(1024) - 512));
}
if ((RANDOM_P2(1024<<4)>>4) < sop->morph_rand_freq)
sop->morph_ang = RANDOM_P2(2048);
sop->_morph_ang = RANDOM_P2(2048);
// move x,y point "just like in build"
dragpoint(sop->morph_wall_point, mx, my);
@ -429,17 +429,17 @@ void MorphFloor(SECTOR_OBJECT* sop)
#define MORPH_FLOOR_ZRANGE Z(300)
if (sop->morph_z > MORPH_FLOOR_ZRANGE)
if (sop->_morph_z > MORPH_FLOOR_ZRANGE)
{
sop->morph_z = MORPH_FLOOR_ZRANGE;
sop->_morph_z = MORPH_FLOOR_ZRANGE;
//sop->morph_ang = NORM_ANGLE(sop->morph_ang + 1024);
sop->morph_z_speed *= -1;
sop->_morph_z_speed *= -1;
}
else if (sop->morph_z < -MORPH_FLOOR_ZRANGE)
else if (sop->_morph_z < -MORPH_FLOOR_ZRANGE)
{
sop->morph_z = -MORPH_FLOOR_ZRANGE;
sop->_morph_z = -MORPH_FLOOR_ZRANGE;
//sop->morph_ang = NORM_ANGLE(sop->morph_ang + 1024);
sop->morph_z_speed *= -1;
sop->_morph_z_speed *= -1;
}
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
@ -447,7 +447,7 @@ void MorphFloor(SECTOR_OBJECT* sop)
if ((*sectp)->hasU() &&
((*sectp)->flags & SECTFU_SO_SLOPE_CEILING_TO_POINT))
{
alignflorslope(*sectp, mx, my, florz + sop->morph_z);
alignflorslope(*sectp, mx, my, florz + sop->_morph_z);
}
}
}
@ -487,7 +487,7 @@ void SpikeFloor(SECTOR_OBJECT* sop)
{
// z direction
ASSERT(sop->op_main_sector != nullptr);
sop->morph_z -= Z(sop->morph_z_speed);
sop->_morph_z -= Z(sop->_morph_z_speed);
// move vector
if (sop->morph_wall_point == nullptr)
@ -496,24 +496,24 @@ void SpikeFloor(SECTOR_OBJECT* sop)
DVector3 pos;
// place at correct x,y offset from center
pos.X = sop->pmid.X - sop->morph_xoff * inttoworld;
pos.Y = sop->pmid.Y - sop->morph_yoff * inttoworld;
pos.X = sop->pmid.X - sop->_morph_xoff * inttoworld;
pos.Y = sop->pmid.Y - sop->_morph_yoff * inttoworld;
// bound the Z
#define MORPH_FLOOR_ZRANGE Z(300)
if (sop->morph_z > MORPH_FLOOR_ZRANGE)
if (sop->_morph_z > MORPH_FLOOR_ZRANGE)
{
sop->morph_z = MORPH_FLOOR_ZRANGE;
sop->morph_z_speed *= -1;
sop->_morph_z = MORPH_FLOOR_ZRANGE;
sop->_morph_z_speed *= -1;
}
else if (sop->morph_z < -MORPH_FLOOR_ZRANGE)
else if (sop->_morph_z < -MORPH_FLOOR_ZRANGE)
{
sop->morph_z = -MORPH_FLOOR_ZRANGE;
sop->morph_z_speed *= -1;
sop->_morph_z = -MORPH_FLOOR_ZRANGE;
sop->_morph_z_speed *= -1;
}
pos.Z = sop->op_main_sector->floorz + sop->morph_z * inttoworld;
pos.Z = sop->op_main_sector->floorz + sop->_morph_z * inttoworld;
SOBJ_AlignFloorToPoint(sop, pos);
}

View file

@ -642,9 +642,9 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, SECTOR_OBJECT& w,
("target_dist", w.target_dist, def->target_dist)
("floor_loz", w.floor_loz, def->floor_loz)
("floor_hiz", w.floor_hiz, def->floor_hiz)
("morph_z", w.morph_z, def->morph_z)
("morph_z_min", w.morph_z_min, def->morph_z_min)
("morph_z_max", w.morph_z_max, def->morph_z_max)
("morph_z", w._morph_z, def->_morph_z)
("morph_z_min", w._morph_z_min, def->_morph_z_min)
("morph_z_max", w._morph_z_max, def->_morph_z_max)
("bob_amt", w.bob_amt, def->bob_amt)
("drive_angspeed", w.drive_angspeed, def->drive_angspeed)
("drive_angslide", w.drive_angslide, def->drive_angslide)
@ -698,14 +698,14 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, SECTOR_OBJECT& w,
("scale_x_mult", w.scale_x_mult, def->scale_x_mult)
("scale_y_mult", w.scale_y_mult, def->scale_y_mult)
("morph_wall_point", w.morph_wall_point, def->morph_wall_point)
("morph_ang", w.morph_ang, def->morph_ang)
("morph_speed", w.morph_speed, def->morph_speed)
("morph_dist_max", w.morph_dist_max, def->morph_dist_max)
("morph_ang", w._morph_ang, def->_morph_ang)
("morph_speed", w._morph_speed, def->_morph_speed)
("morph_dist_max", w._morph_dist_max, def->_morph_dist_max)
("morph_rand_freq", w.morph_rand_freq, def->morph_rand_freq)
("morph_dist", w.morph_dist, def->morph_dist)
("morph_z_speed", w.morph_z_speed, def->morph_z_speed)
("morph_xoff", w.morph_xoff, def->morph_xoff)
("morph_yoff", w.morph_yoff, def->morph_yoff)
("morph_dist", w._morph_dist, def->_morph_dist)
("morph_z_speed", w._morph_z_speed, def->_morph_z_speed)
("morph_xoff", w._morph_xoff, def->_morph_xoff)
("morph_yoff", w._morph_yoff, def->_morph_yoff)
("limit_ang_center", w.limit_ang_center, def->limit_ang_center)
("limit_ang_delta", w.limit_ang_delta, def->limit_ang_delta);

View file

@ -968,14 +968,14 @@ void SetupSectorObject(sectortype* sectp, short tag)
sop->scale_x_mult = 256;
sop->scale_y_mult = 256;
sop->morph_ang = RANDOM_P2(2048);
sop->morph_z_speed = 20;
sop->morph_speed = 32;
sop->morph_dist_max = 1024;
sop->_morph_ang = RANDOM_P2(2048);
sop->_morph_z_speed = 20;
sop->_morph_speed = 32;
sop->_morph_dist_max = 1024;
sop->morph_rand_freq = 64;
sop->morph_dist = 0;
sop->morph_xoff = 0;
sop->morph_yoff = 0;
sop->_morph_dist = 0;
sop->_morph_xoff = 0;
sop->_morph_yoff = 0;
sop->PreMoveAnimator = nullptr;
sop->PostMoveAnimator = nullptr;
@ -1084,9 +1084,9 @@ void SetupSectorObject(sectortype* sectp, short tag)
// clip
sop->clipdist = 2500;
// morph point
sop->morph_speed = 16;
sop->morph_z_speed = 6;
sop->morph_dist_max = 1024;
sop->_morph_speed = 16;
sop->_morph_z_speed = 6;
sop->_morph_dist_max = 1024;
sop->morph_rand_freq = 8;
sop->scale_dist_min = -768;
KillActor(actor);
@ -1095,10 +1095,10 @@ void SetupSectorObject(sectortype* sectp, short tag)
if (SW_SHAREWARE) break;
sop->flags |= (SOBJ_DYNAMIC);
sop->scale_type = SO_SCALE_NONE;
sop->morph_speed = 120;
sop->morph_z_speed = 7;
sop->_morph_speed = 120;
sop->_morph_z_speed = 7;
sop->PostMoveAnimator = MorphFloor;
sop->morph_dist_max = 4000;
sop->_morph_dist_max = 4000;
sop->morph_rand_freq = 8;
KillActor(actor);
break;