mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
- renamed some variables
This commit is contained in:
parent
e5b2a0f0a6
commit
30104fca50
4 changed files with 86 additions and 86 deletions
|
@ -1472,9 +1472,9 @@ struct SECTOR_OBJECT
|
||||||
bob_diff, // bobbing difference for the frame
|
bob_diff, // bobbing difference for the frame
|
||||||
floor_loz, // floor low z
|
floor_loz, // floor low z
|
||||||
floor_hiz, // floor hi z
|
floor_hiz, // floor hi z
|
||||||
morph_z, // morphing point z
|
_morph_z, // morphing point z
|
||||||
morph_z_min, // morphing point z min
|
_morph_z_min, // morphing point z min
|
||||||
morph_z_max,
|
_morph_z_max,
|
||||||
bob_amt, // bob amount max in z coord
|
bob_amt, // bob amount max in z coord
|
||||||
// end of must floatify
|
// end of must floatify
|
||||||
|
|
||||||
|
@ -1541,14 +1541,14 @@ struct SECTOR_OBJECT
|
||||||
scale_y_mult, // y multiplyer for scaling
|
scale_y_mult, // y multiplyer for scaling
|
||||||
|
|
||||||
// Used for center point movement
|
// Used for center point movement
|
||||||
morph_ang, // angle moving from CENTER
|
_morph_ang, // angle moving from CENTER
|
||||||
morph_speed, // speed of movement
|
_morph_speed, // speed of movement
|
||||||
morph_dist_max, // radius boundry
|
_morph_dist_max, // radius boundry
|
||||||
morph_rand_freq, // freq of dir change
|
morph_rand_freq, // freq of dir change
|
||||||
morph_dist, // dist from CENTER
|
_morph_dist, // dist from CENTER
|
||||||
morph_z_speed, // z speed for morph point
|
_morph_z_speed, // z speed for morph point
|
||||||
morph_xoff, // save xoff from center
|
_morph_xoff, // save xoff from center
|
||||||
morph_yoff; // save yoff from center
|
_morph_yoff; // save yoff from center
|
||||||
|
|
||||||
//scale_rand_reverse; // random at random interval
|
//scale_rand_reverse; // random at random interval
|
||||||
// limit rotation angle
|
// limit rotation angle
|
||||||
|
|
|
@ -303,45 +303,45 @@ void MorphTornado(SECTOR_OBJECT* sop)
|
||||||
|
|
||||||
// z direction
|
// z direction
|
||||||
ASSERT(sop->op_main_sector != nullptr);
|
ASSERT(sop->op_main_sector != nullptr);
|
||||||
sop->morph_z += Z(sop->morph_z_speed);
|
sop->_morph_z += Z(sop->_morph_z_speed);
|
||||||
|
|
||||||
// move vector
|
// move vector
|
||||||
if (sop->morph_wall_point == nullptr)
|
if (sop->morph_wall_point == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// place at correct x,y offset from center
|
// place at correct x,y offset from center
|
||||||
x = sop->int_pmid().X - sop->morph_xoff;
|
x = sop->int_pmid().X - sop->_morph_xoff;
|
||||||
y = sop->int_pmid().Y - sop->morph_yoff;
|
y = sop->int_pmid().Y - sop->_morph_yoff;
|
||||||
|
|
||||||
sx = x;
|
sx = x;
|
||||||
sy = y;
|
sy = y;
|
||||||
|
|
||||||
// move it from last x,y
|
// move it from last x,y
|
||||||
mx = x + MulScale(sop->morph_speed, bcos(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);
|
my = y + MulScale(sop->_morph_speed, bsin(sop->_morph_ang), 14);
|
||||||
|
|
||||||
// bound check radius
|
// 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
|
// 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
|
// 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
|
// move back some from last point
|
||||||
mx = sx + MulScale(sop->morph_speed << 1, bcos(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);
|
my = sy + MulScale(sop->_morph_speed << 1, bsin(sop->_morph_ang), 14);
|
||||||
|
|
||||||
sop->morph_xoff = sop->int_pmid().X - mx;
|
sop->_morph_xoff = sop->int_pmid().X - mx;
|
||||||
sop->morph_yoff = sop->int_pmid().Y - my;
|
sop->_morph_yoff = sop->int_pmid().Y - my;
|
||||||
}
|
}
|
||||||
|
|
||||||
// save x,y back as offset info
|
// save x,y back as offset info
|
||||||
sop->morph_xoff = sop->int_pmid().X - mx;
|
sop->_morph_xoff = sop->int_pmid().X - mx;
|
||||||
sop->morph_yoff = sop->int_pmid().Y - my;
|
sop->_morph_yoff = sop->int_pmid().Y - my;
|
||||||
|
|
||||||
if ((RANDOM_P2(1024<<4)>>4) < sop->morph_rand_freq)
|
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
|
// move it x,y
|
||||||
dragpoint(sop->morph_wall_point, mx, my);
|
dragpoint(sop->morph_wall_point, mx, my);
|
||||||
|
@ -356,18 +356,18 @@ void MorphTornado(SECTOR_OBJECT* sop)
|
||||||
((*sectp)->flags & SECTFU_SO_SLOPE_CEILING_TO_POINT))
|
((*sectp)->flags & SECTFU_SO_SLOPE_CEILING_TO_POINT))
|
||||||
{
|
{
|
||||||
#define TOR_LOW (florz)
|
#define TOR_LOW (florz)
|
||||||
if (sop->morph_z > TOR_LOW)
|
if (sop->_morph_z > TOR_LOW)
|
||||||
{
|
{
|
||||||
sop->morph_z_speed *= -1;
|
sop->_morph_z_speed *= -1;
|
||||||
sop->morph_z = TOR_LOW;
|
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_speed *= -1;
|
||||||
sop->morph_z = ceilz;
|
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
|
// z direction
|
||||||
ASSERT(sop->op_main_sector != nullptr);
|
ASSERT(sop->op_main_sector != nullptr);
|
||||||
sop->morph_z -= Z(sop->morph_z_speed);
|
sop->_morph_z -= Z(sop->_morph_z_speed);
|
||||||
|
|
||||||
// move vector
|
// move vector
|
||||||
if (sop->morph_wall_point == nullptr)
|
if (sop->morph_wall_point == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// place at correct x,y offset from center
|
// place at correct x,y offset from center
|
||||||
x = sop->int_pmid().X - sop->morph_xoff;
|
x = sop->int_pmid().X - sop->_morph_xoff;
|
||||||
y = sop->int_pmid().Y - sop->morph_yoff;
|
y = sop->int_pmid().Y - sop->_morph_yoff;
|
||||||
|
|
||||||
// move it from last x,y
|
// move it from last x,y
|
||||||
mx = x + MulScale(sop->morph_speed, bcos(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);
|
my = y + MulScale(sop->_morph_speed, bsin(sop->_morph_ang), 14);
|
||||||
|
|
||||||
// save x,y back as offset info
|
// save x,y back as offset info
|
||||||
sop->morph_xoff = sop->int_pmid().X - mx;
|
sop->_morph_xoff = sop->int_pmid().X - mx;
|
||||||
sop->morph_yoff = sop->int_pmid().Y - my;
|
sop->_morph_yoff = sop->int_pmid().Y - my;
|
||||||
|
|
||||||
// bound check radius
|
// 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
|
// go in the other direction
|
||||||
//sop->morph_speed *= -1;
|
//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
|
// back it up and save it off
|
||||||
mx = x + MulScale(sop->morph_speed, bcos(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);
|
my = y + MulScale(sop->_morph_speed, bsin(sop->_morph_ang), 14);
|
||||||
sop->morph_xoff = sop->int_pmid().X - mx;
|
sop->_morph_xoff = sop->int_pmid().X - mx;
|
||||||
sop->morph_yoff = sop->int_pmid().Y - my;
|
sop->_morph_yoff = sop->int_pmid().Y - my;
|
||||||
|
|
||||||
// turn it all the way around and then do a random -512 to 512 from there
|
// 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));
|
//sop->morph_ang = NORM_ANGLE(sop->morph_ang + 1024 + (RANDOM_P2(1024) - 512));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((RANDOM_P2(1024<<4)>>4) < sop->morph_rand_freq)
|
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"
|
// move x,y point "just like in build"
|
||||||
dragpoint(sop->morph_wall_point, mx, my);
|
dragpoint(sop->morph_wall_point, mx, my);
|
||||||
|
@ -429,17 +429,17 @@ void MorphFloor(SECTOR_OBJECT* sop)
|
||||||
|
|
||||||
#define MORPH_FLOOR_ZRANGE Z(300)
|
#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_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_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++)
|
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
|
||||||
|
@ -447,7 +447,7 @@ void MorphFloor(SECTOR_OBJECT* sop)
|
||||||
if ((*sectp)->hasU() &&
|
if ((*sectp)->hasU() &&
|
||||||
((*sectp)->flags & SECTFU_SO_SLOPE_CEILING_TO_POINT))
|
((*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
|
// z direction
|
||||||
ASSERT(sop->op_main_sector != nullptr);
|
ASSERT(sop->op_main_sector != nullptr);
|
||||||
sop->morph_z -= Z(sop->morph_z_speed);
|
sop->_morph_z -= Z(sop->_morph_z_speed);
|
||||||
|
|
||||||
// move vector
|
// move vector
|
||||||
if (sop->morph_wall_point == nullptr)
|
if (sop->morph_wall_point == nullptr)
|
||||||
|
@ -496,24 +496,24 @@ void SpikeFloor(SECTOR_OBJECT* sop)
|
||||||
DVector3 pos;
|
DVector3 pos;
|
||||||
|
|
||||||
// place at correct x,y offset from center
|
// place at correct x,y offset from center
|
||||||
pos.X = sop->pmid.X - sop->morph_xoff * inttoworld;
|
pos.X = sop->pmid.X - sop->_morph_xoff * inttoworld;
|
||||||
pos.Y = sop->pmid.Y - sop->morph_yoff * inttoworld;
|
pos.Y = sop->pmid.Y - sop->_morph_yoff * inttoworld;
|
||||||
|
|
||||||
// bound the Z
|
// bound the Z
|
||||||
|
|
||||||
#define MORPH_FLOOR_ZRANGE Z(300)
|
#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_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_z_speed *= -1;
|
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);
|
SOBJ_AlignFloorToPoint(sop, pos);
|
||||||
}
|
}
|
||||||
|
|
|
@ -642,9 +642,9 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, SECTOR_OBJECT& w,
|
||||||
("target_dist", w.target_dist, def->target_dist)
|
("target_dist", w.target_dist, def->target_dist)
|
||||||
("floor_loz", w.floor_loz, def->floor_loz)
|
("floor_loz", w.floor_loz, def->floor_loz)
|
||||||
("floor_hiz", w.floor_hiz, def->floor_hiz)
|
("floor_hiz", w.floor_hiz, def->floor_hiz)
|
||||||
("morph_z", w.morph_z, def->morph_z)
|
("morph_z", w._morph_z, def->_morph_z)
|
||||||
("morph_z_min", w.morph_z_min, def->morph_z_min)
|
("morph_z_min", w._morph_z_min, def->_morph_z_min)
|
||||||
("morph_z_max", w.morph_z_max, def->morph_z_max)
|
("morph_z_max", w._morph_z_max, def->_morph_z_max)
|
||||||
("bob_amt", w.bob_amt, def->bob_amt)
|
("bob_amt", w.bob_amt, def->bob_amt)
|
||||||
("drive_angspeed", w.drive_angspeed, def->drive_angspeed)
|
("drive_angspeed", w.drive_angspeed, def->drive_angspeed)
|
||||||
("drive_angslide", w.drive_angslide, def->drive_angslide)
|
("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_x_mult", w.scale_x_mult, def->scale_x_mult)
|
||||||
("scale_y_mult", w.scale_y_mult, def->scale_y_mult)
|
("scale_y_mult", w.scale_y_mult, def->scale_y_mult)
|
||||||
("morph_wall_point", w.morph_wall_point, def->morph_wall_point)
|
("morph_wall_point", w.morph_wall_point, def->morph_wall_point)
|
||||||
("morph_ang", w.morph_ang, def->morph_ang)
|
("morph_ang", w._morph_ang, def->_morph_ang)
|
||||||
("morph_speed", w.morph_speed, def->morph_speed)
|
("morph_speed", w._morph_speed, def->_morph_speed)
|
||||||
("morph_dist_max", w.morph_dist_max, def->morph_dist_max)
|
("morph_dist_max", w._morph_dist_max, def->_morph_dist_max)
|
||||||
("morph_rand_freq", w.morph_rand_freq, def->morph_rand_freq)
|
("morph_rand_freq", w.morph_rand_freq, def->morph_rand_freq)
|
||||||
("morph_dist", w.morph_dist, def->morph_dist)
|
("morph_dist", w._morph_dist, def->_morph_dist)
|
||||||
("morph_z_speed", w.morph_z_speed, def->morph_z_speed)
|
("morph_z_speed", w._morph_z_speed, def->_morph_z_speed)
|
||||||
("morph_xoff", w.morph_xoff, def->morph_xoff)
|
("morph_xoff", w._morph_xoff, def->_morph_xoff)
|
||||||
("morph_yoff", w.morph_yoff, def->morph_yoff)
|
("morph_yoff", w._morph_yoff, def->_morph_yoff)
|
||||||
("limit_ang_center", w.limit_ang_center, def->limit_ang_center)
|
("limit_ang_center", w.limit_ang_center, def->limit_ang_center)
|
||||||
("limit_ang_delta", w.limit_ang_delta, def->limit_ang_delta);
|
("limit_ang_delta", w.limit_ang_delta, def->limit_ang_delta);
|
||||||
|
|
||||||
|
|
|
@ -968,14 +968,14 @@ void SetupSectorObject(sectortype* sectp, short tag)
|
||||||
sop->scale_x_mult = 256;
|
sop->scale_x_mult = 256;
|
||||||
sop->scale_y_mult = 256;
|
sop->scale_y_mult = 256;
|
||||||
|
|
||||||
sop->morph_ang = RANDOM_P2(2048);
|
sop->_morph_ang = RANDOM_P2(2048);
|
||||||
sop->morph_z_speed = 20;
|
sop->_morph_z_speed = 20;
|
||||||
sop->morph_speed = 32;
|
sop->_morph_speed = 32;
|
||||||
sop->morph_dist_max = 1024;
|
sop->_morph_dist_max = 1024;
|
||||||
sop->morph_rand_freq = 64;
|
sop->morph_rand_freq = 64;
|
||||||
sop->morph_dist = 0;
|
sop->_morph_dist = 0;
|
||||||
sop->morph_xoff = 0;
|
sop->_morph_xoff = 0;
|
||||||
sop->morph_yoff = 0;
|
sop->_morph_yoff = 0;
|
||||||
|
|
||||||
sop->PreMoveAnimator = nullptr;
|
sop->PreMoveAnimator = nullptr;
|
||||||
sop->PostMoveAnimator = nullptr;
|
sop->PostMoveAnimator = nullptr;
|
||||||
|
@ -1084,9 +1084,9 @@ void SetupSectorObject(sectortype* sectp, short tag)
|
||||||
// clip
|
// clip
|
||||||
sop->clipdist = 2500;
|
sop->clipdist = 2500;
|
||||||
// morph point
|
// morph point
|
||||||
sop->morph_speed = 16;
|
sop->_morph_speed = 16;
|
||||||
sop->morph_z_speed = 6;
|
sop->_morph_z_speed = 6;
|
||||||
sop->morph_dist_max = 1024;
|
sop->_morph_dist_max = 1024;
|
||||||
sop->morph_rand_freq = 8;
|
sop->morph_rand_freq = 8;
|
||||||
sop->scale_dist_min = -768;
|
sop->scale_dist_min = -768;
|
||||||
KillActor(actor);
|
KillActor(actor);
|
||||||
|
@ -1095,10 +1095,10 @@ void SetupSectorObject(sectortype* sectp, short tag)
|
||||||
if (SW_SHAREWARE) break;
|
if (SW_SHAREWARE) break;
|
||||||
sop->flags |= (SOBJ_DYNAMIC);
|
sop->flags |= (SOBJ_DYNAMIC);
|
||||||
sop->scale_type = SO_SCALE_NONE;
|
sop->scale_type = SO_SCALE_NONE;
|
||||||
sop->morph_speed = 120;
|
sop->_morph_speed = 120;
|
||||||
sop->morph_z_speed = 7;
|
sop->_morph_z_speed = 7;
|
||||||
sop->PostMoveAnimator = MorphFloor;
|
sop->PostMoveAnimator = MorphFloor;
|
||||||
sop->morph_dist_max = 4000;
|
sop->_morph_dist_max = 4000;
|
||||||
sop->morph_rand_freq = 8;
|
sop->morph_rand_freq = 8;
|
||||||
KillActor(actor);
|
KillActor(actor);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue