mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-20 16:10:52 +00:00
- SW: renamed SECTOR_OBJECT::pmid
This commit is contained in:
parent
eef7802111
commit
819297a409
10 changed files with 96 additions and 96 deletions
|
@ -1440,7 +1440,7 @@ void drawscreen(PLAYER* pp, double smoothratio, bool sceneonly)
|
|||
if (TEST_BOOL1(ractor))
|
||||
tang = ractor->spr.angle;
|
||||
else
|
||||
tang = VecToAngle(pp->sop_remote->pmid.X - tx, pp->sop_remote->pmid.Y - ty);
|
||||
tang = VecToAngle(pp->sop_remote->__int_pmid.X - tx, pp->sop_remote->__int_pmid.Y - ty);
|
||||
}
|
||||
|
||||
if (pp->Flags & (PF_VIEW_FROM_OUTSIDE))
|
||||
|
|
|
@ -1412,7 +1412,7 @@ struct SECTOR_OBJECT
|
|||
|
||||
TObjPtr<DSWActor*> sp_child; // child sprite that holds info for the sector object
|
||||
|
||||
vec3_t pmid; // midpoints of the sector object
|
||||
vec3_t __int_pmid; // midpoints of the sector object
|
||||
|
||||
TObjPtr<DSWActor*> so_actors[MAX_SO_SPRITE]; // hold the actors of the object
|
||||
TObjPtr<DSWActor*> match_event_actor; // spritenum of the match event sprite
|
||||
|
@ -1566,7 +1566,7 @@ enum
|
|||
MAXSO = INT32_MAX / 2
|
||||
};
|
||||
|
||||
inline bool SO_EMPTY(SECTOR_OBJECT* sop) { return (sop->pmid.X == MAXSO); }
|
||||
inline bool SO_EMPTY(SECTOR_OBJECT* sop) { return (sop->__int_pmid.X == MAXSO); }
|
||||
|
||||
extern SECTOR_OBJECT SectorObject[MAX_SECTOR_OBJECTS];
|
||||
|
||||
|
@ -2131,7 +2131,7 @@ struct ANIM
|
|||
case ANIM_Floorz:
|
||||
return sector[animindex].int_floorz();
|
||||
case ANIM_SopZ:
|
||||
return SectorObject[animindex].pmid.Z;
|
||||
return SectorObject[animindex].__int_pmid.Z;
|
||||
case ANIM_Spritez:
|
||||
if (animactor == nullptr) return 0;
|
||||
return animactor->spr.int_pos().Z;
|
||||
|
@ -2153,7 +2153,7 @@ struct ANIM
|
|||
sector[animindex].set_int_floorz(value);
|
||||
break;
|
||||
case ANIM_SopZ:
|
||||
SectorObject[animindex].pmid.Z = value;
|
||||
SectorObject[animindex].__int_pmid.Z = value;
|
||||
break;
|
||||
case ANIM_Spritez:
|
||||
if (animactor == nullptr) return;
|
||||
|
|
|
@ -103,11 +103,11 @@ static double getvalue(so_interp::interp_data& element)
|
|||
case soi_floor:
|
||||
return sector[index].floorz;
|
||||
case soi_sox:
|
||||
return SectorObject[index].pmid.X;
|
||||
return SectorObject[index].__int_pmid.X;
|
||||
case soi_soy:
|
||||
return SectorObject[index].pmid.Y;
|
||||
return SectorObject[index].__int_pmid.Y;
|
||||
case soi_soz:
|
||||
return SectorObject[index].pmid.Z;
|
||||
return SectorObject[index].__int_pmid.Z;
|
||||
case soi_sprx:
|
||||
if (element.actorofang)
|
||||
return element.actorofang->spr.pos.X;
|
||||
|
@ -147,13 +147,13 @@ static void setvalue(so_interp::interp_data& element, double value)
|
|||
sector[index].setfloorz(value);
|
||||
break;
|
||||
case soi_sox:
|
||||
SectorObject[index].pmid.X = (int)value;
|
||||
SectorObject[index].__int_pmid.X = (int)value;
|
||||
break;
|
||||
case soi_soy:
|
||||
SectorObject[index].pmid.Y = (int)value;
|
||||
SectorObject[index].__int_pmid.Y = (int)value;
|
||||
break;
|
||||
case soi_soz:
|
||||
SectorObject[index].pmid.Z = (int)value;
|
||||
SectorObject[index].__int_pmid.Z = (int)value;
|
||||
break;
|
||||
case soi_sprx:
|
||||
if (element.actorofang)
|
||||
|
|
|
@ -310,8 +310,8 @@ void MorphTornado(SECTOR_OBJECT* sop)
|
|||
return;
|
||||
|
||||
// place at correct x,y offset from center
|
||||
x = sop->pmid.X - sop->morph_xoff;
|
||||
y = sop->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;
|
||||
|
@ -321,10 +321,10 @@ void MorphTornado(SECTOR_OBJECT* sop)
|
|||
my = y + MulScale(sop->morph_speed, bsin(sop->morph_ang), 14);
|
||||
|
||||
// bound check radius
|
||||
if (ksqrt(SQ(sop->pmid.X - mx) + SQ(sop->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->pmid.X, my - sop->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);
|
||||
|
||||
|
@ -332,13 +332,13 @@ void MorphTornado(SECTOR_OBJECT* sop)
|
|||
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->pmid.X - mx;
|
||||
sop->morph_yoff = sop->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->pmid.X - mx;
|
||||
sop->morph_yoff = sop->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);
|
||||
|
@ -390,19 +390,19 @@ void MorphFloor(SECTOR_OBJECT* sop)
|
|||
return;
|
||||
|
||||
// place at correct x,y offset from center
|
||||
x = sop->pmid.X - sop->morph_xoff;
|
||||
y = sop->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);
|
||||
|
||||
// save x,y back as offset info
|
||||
sop->morph_xoff = sop->pmid.X - mx;
|
||||
sop->morph_yoff = sop->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->pmid.X, sop->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;
|
||||
|
@ -411,8 +411,8 @@ void MorphFloor(SECTOR_OBJECT* sop)
|
|||
// 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->pmid.X - mx;
|
||||
sop->morph_yoff = sop->pmid.Y - my;
|
||||
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));
|
||||
|
@ -514,8 +514,8 @@ void SpikeFloor(SECTOR_OBJECT* sop)
|
|||
return;
|
||||
|
||||
// place at correct x,y offset from center
|
||||
x = sop->pmid.X - sop->morph_xoff;
|
||||
y = sop->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;
|
||||
|
|
|
@ -1566,7 +1566,7 @@ void DoPlayerTurnTurret(PLAYER* pp, float avel)
|
|||
pp->actor->set_int_ang(pp->angle.ang.Buildang());
|
||||
}
|
||||
|
||||
OperateSectorObject(pp->sop, pp->angle.ang.Buildang(), pp->sop->pmid.X, pp->sop->pmid.Y);
|
||||
OperateSectorObject(pp->sop, pp->angle.ang.Buildang(), pp->sop->__int_pmid.X, pp->sop->__int_pmid.Y);
|
||||
}
|
||||
|
||||
void SlipSlope(PLAYER* pp)
|
||||
|
@ -2567,8 +2567,8 @@ void DoPlayerMoveVehicle(PLAYER* pp)
|
|||
x[count] = wal.wall_int_pos().X;
|
||||
y[count] = wal.wall_int_pos().Y;
|
||||
|
||||
ox[count] = sop->pmid.X - sop->xorig[wallcount];
|
||||
oy[count] = sop->pmid.Y - sop->yorig[wallcount];
|
||||
ox[count] = sop->__int_pmid.X - sop->xorig[wallcount];
|
||||
oy[count] = sop->__int_pmid.Y - sop->yorig[wallcount];
|
||||
|
||||
count++;
|
||||
}
|
||||
|
@ -4821,15 +4821,15 @@ void FindMainSector(SECTOR_OBJECT* sop)
|
|||
// find the main sector - only do this once for each sector object
|
||||
if (sop->op_main_sector == nullptr)
|
||||
{
|
||||
int sx = sop->pmid.X;
|
||||
int sy = sop->pmid.Y;
|
||||
int sx = sop->__int_pmid.X;
|
||||
int sy = sop->__int_pmid.Y;
|
||||
|
||||
PlaceSectorObject(sop, MAXSO, MAXSO);
|
||||
|
||||
// set it to something valid
|
||||
sop->op_main_sector = §or[0];
|
||||
|
||||
updatesectorz(sx, sy, sop->pmid.Z, &sop->op_main_sector);
|
||||
updatesectorz(sx, sy, sop->__int_pmid.Z, &sop->op_main_sector);
|
||||
|
||||
PlaceSectorObject(sop, sx, sy);
|
||||
}
|
||||
|
@ -4902,8 +4902,8 @@ void DoPlayerBeginOperate(PLAYER* pp)
|
|||
sop->controller = pp->actor;
|
||||
|
||||
pp->angle.oang = pp->angle.ang = DAngle::fromBuild(sop->ang);
|
||||
pp->pos.X = sop->pmid.X;
|
||||
pp->pos.Y = sop->pmid.Y;
|
||||
pp->pos.X = sop->__int_pmid.X;
|
||||
pp->pos.Y = sop->__int_pmid.Y;
|
||||
updatesector(pp->pos.X, pp->pos.Y, &pp->cursector);
|
||||
getzsofslopeptr(pp->cursector, pp->pos.X, pp->pos.Y, &cz, &fz);
|
||||
pp->pos.Z = fz - PLAYER_HEIGHT;
|
||||
|
@ -4987,8 +4987,8 @@ void DoPlayerBeginRemoteOperate(PLAYER* pp, SECTOR_OBJECT* sop)
|
|||
auto save_sect = pp->cursector;
|
||||
|
||||
pp->angle.oang = pp->angle.ang = DAngle::fromBuild(sop->ang);
|
||||
pp->pos.X = sop->pmid.X;
|
||||
pp->pos.Y = sop->pmid.Y;
|
||||
pp->pos.X = sop->__int_pmid.X;
|
||||
pp->pos.Y = sop->__int_pmid.Y;
|
||||
updatesector(pp->pos.X, pp->pos.Y, &pp->cursector);
|
||||
getzsofslopeptr(pp->cursector, pp->pos.X, pp->pos.Y, &cz, &fz);
|
||||
pp->pos.Z = fz - PLAYER_HEIGHT;
|
||||
|
@ -5111,7 +5111,7 @@ void DoPlayerStopOperate(PLAYER* pp)
|
|||
if (TEST_BOOL1(rsp))
|
||||
pp->angle.ang = pp->angle.oang = rsp->spr.angle;
|
||||
else
|
||||
pp->angle.ang = pp->angle.oang = VecToAngle(pp->sop_remote->pmid.X - pp->pos.X, pp->sop_remote->pmid.Y - pp->pos.Y);
|
||||
pp->angle.ang = pp->angle.oang = VecToAngle(pp->sop_remote->__int_pmid.X - pp->pos.X, pp->sop_remote->__int_pmid.Y - pp->pos.Y);
|
||||
}
|
||||
|
||||
if (pp->sop_control)
|
||||
|
|
|
@ -637,9 +637,9 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, SECTOR_OBJECT& w,
|
|||
.Array("yorig", w.yorig, def->yorig, w.num_walls)
|
||||
("controller", w.controller, def->controller)
|
||||
("child", w.sp_child, def->sp_child)
|
||||
("xmid", w.pmid.X, def->pmid.X)
|
||||
("ymid", w.pmid.Y, def->pmid.Y)
|
||||
("zmid", w.pmid.Z, def->pmid.Z)
|
||||
("xmid", w.__int_pmid.X, def->__int_pmid.X)
|
||||
("ymid", w.__int_pmid.Y, def->__int_pmid.Y)
|
||||
("zmid", w.__int_pmid.Z, def->__int_pmid.Z)
|
||||
("vel", w.vel, def->vel)
|
||||
("vel_tgt", w.vel_tgt, def->vel_tgt)
|
||||
("player_xoff", w.player_xoff, def->player_xoff)
|
||||
|
|
|
@ -379,7 +379,7 @@ void SectorSetup(void)
|
|||
SectorObject[ndx].mid_sector = nullptr;
|
||||
SectorObject[ndx].op_main_sector = nullptr;
|
||||
SectorObject[ndx].morph_wall_point = nullptr;
|
||||
SectorObject[ndx].pmid.X = MAXSO;
|
||||
SectorObject[ndx].__int_pmid.X = MAXSO;
|
||||
}
|
||||
|
||||
memset(SineWaveFloor, 0, sizeof(SineWaveFloor));
|
||||
|
@ -1066,7 +1066,7 @@ bool TestKillSectorObject(SECTOR_OBJECT* sop)
|
|||
{
|
||||
KillMatchingCrackSprites(sop->match_event);
|
||||
// get new sectnums
|
||||
CollapseSectorObject(sop, sop->pmid.X, sop->pmid.Y);
|
||||
CollapseSectorObject(sop, sop->__int_pmid.X, sop->__int_pmid.Y);
|
||||
DoSpawnSpotsForKill(sop->match_event);
|
||||
KillSectorObjectSprites(sop);
|
||||
return true;
|
||||
|
@ -2665,7 +2665,7 @@ void DoSector(void)
|
|||
}
|
||||
else
|
||||
{
|
||||
DISTANCE(pp->pos.X, pp->pos.Y, sop->pmid.X, sop->pmid.Y, dist, a, b, c);
|
||||
DISTANCE(pp->pos.X, pp->pos.Y, sop->__int_pmid.X, sop->__int_pmid.Y, dist, a, b, c);
|
||||
if (dist < min_dist)
|
||||
min_dist = dist;
|
||||
}
|
||||
|
|
|
@ -605,7 +605,7 @@ void GameInterface::UpdateSounds(void)
|
|||
if (TEST_BOOL1(rsp))
|
||||
tang = rsp->spr.angle;
|
||||
else
|
||||
tang = VecToAngle(pp->sop_remote->pmid.X - pp->pos.X, pp->sop_remote->pmid.Y - pp->pos.Y);
|
||||
tang = VecToAngle(pp->sop_remote->__int_pmid.X - pp->pos.X, pp->sop_remote->__int_pmid.Y - pp->pos.Y);
|
||||
}
|
||||
else tang = pp->angle.ang;
|
||||
|
||||
|
|
|
@ -707,9 +707,9 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
|
|||
BoundActor = FindBoundSprite(SECT_SO_CENTER);
|
||||
if (BoundActor)
|
||||
{
|
||||
sop->pmid.X = BoundActor->int_pos().X;
|
||||
sop->pmid.Y = BoundActor->int_pos().Y;
|
||||
sop->pmid.Z = BoundActor->int_pos().Z;
|
||||
sop->__int_pmid.X = BoundActor->int_pos().X;
|
||||
sop->__int_pmid.Y = BoundActor->int_pos().Y;
|
||||
sop->__int_pmid.Z = BoundActor->int_pos().Z;
|
||||
KillActor(BoundActor);
|
||||
}
|
||||
|
||||
|
@ -846,12 +846,12 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
|
|||
short ang2;
|
||||
sop->clipdist = 0;
|
||||
sop->clipbox_dist[sop->clipbox_num] = itActor->spr.lotag;
|
||||
sop->clipbox_xoff[sop->clipbox_num] = sop->pmid.X - itActor->int_pos().X;
|
||||
sop->clipbox_yoff[sop->clipbox_num] = sop->pmid.Y - itActor->int_pos().Y;
|
||||
sop->clipbox_xoff[sop->clipbox_num] = sop->__int_pmid.X - itActor->int_pos().X;
|
||||
sop->clipbox_yoff[sop->clipbox_num] = sop->__int_pmid.Y - itActor->int_pos().Y;
|
||||
|
||||
sop->clipbox_vdist[sop->clipbox_num] = ksqrt(SQ(sop->pmid.X - itActor->int_pos().X) + SQ(sop->pmid.Y - itActor->int_pos().Y));
|
||||
sop->clipbox_vdist[sop->clipbox_num] = ksqrt(SQ(sop->__int_pmid.X - itActor->int_pos().X) + SQ(sop->__int_pmid.Y - itActor->int_pos().Y));
|
||||
|
||||
ang2 = getangle(itActor->int_pos().X - sop->pmid.X, itActor->int_pos().Y - sop->pmid.Y);
|
||||
ang2 = getangle(itActor->int_pos().X - sop->__int_pmid.X, itActor->int_pos().Y - sop->__int_pmid.Y);
|
||||
sop->clipbox_ang[sop->clipbox_num] = getincangle(ang2, sop->ang);
|
||||
|
||||
sop->clipbox_num++;
|
||||
|
@ -872,8 +872,8 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
|
|||
}
|
||||
|
||||
|
||||
itActor->user.pos.X = sop->pmid.X - itActor->int_pos().X;
|
||||
itActor->user.pos.Y = sop->pmid.Y - itActor->int_pos().Y;
|
||||
itActor->user.pos.X = sop->__int_pmid.X - itActor->int_pos().X;
|
||||
itActor->user.pos.Y = sop->__int_pmid.Y - itActor->int_pos().Y;
|
||||
itActor->user.pos.Z = sop->mid_sector->int_floorz() - itActor->int_pos().Z;
|
||||
|
||||
itActor->user.Flags |= (SPR_SO_ATTACHED);
|
||||
|
@ -934,12 +934,12 @@ cont:
|
|||
|
||||
ASSERT(zmid != -9999999);
|
||||
|
||||
sop->pmid.Z = zmid;
|
||||
sop->__int_pmid.Z = zmid;
|
||||
|
||||
for (i = 0; sop->so_actors[i] != nullptr; i++)
|
||||
{
|
||||
auto actor = sop->so_actors[i];
|
||||
actor->user.pos.Z = sop->pmid.Z - actor->int_pos().Z;
|
||||
actor->user.pos.Z = sop->__int_pmid.Z - actor->int_pos().Z;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1028,14 +1028,14 @@ void SetupSectorObject(sectortype* sectp, short tag)
|
|||
case TAG_OBJECT_CENTER - 500:
|
||||
|
||||
sop->mid_sector = sectp;
|
||||
SectorMidPoint(sectp, &sop->pmid.X, &sop->pmid.Y, &sop->pmid.Z);
|
||||
SectorMidPoint(sectp, &sop->__int_pmid.X, &sop->__int_pmid.Y, &sop->__int_pmid.Z);
|
||||
|
||||
sop->dir = 1;
|
||||
sop->track = sectp->hitag;
|
||||
|
||||
// spawn a sprite to make it easier to integrate with sprite routines
|
||||
auto actorNew = SpawnActor(STAT_SO_SP_CHILD, 0, nullptr, sectp,
|
||||
sop->pmid.X, sop->pmid.Y, sop->pmid.Z, 0, 0);
|
||||
sop->__int_pmid.X, sop->__int_pmid.Y, sop->__int_pmid.Z, 0, 0);
|
||||
sop->sp_child = actorNew;
|
||||
actorNew->user.sop_parent = sop;
|
||||
actorNew->user.Flags2 |= (SPR2_SPRITE_FAKE_BLOCK); // for damage test
|
||||
|
@ -1391,8 +1391,8 @@ void PlaceSectorObjectsOnTracks(void)
|
|||
// move all walls in sectors
|
||||
for (auto& wal : wallsofsector(sop->sectp[j]))
|
||||
{
|
||||
sop->xorig[sop->num_walls] = sop->pmid.X - wal.wall_int_pos().X;
|
||||
sop->yorig[sop->num_walls] = sop->pmid.Y - wal.wall_int_pos().Y;
|
||||
sop->xorig[sop->num_walls] = sop->__int_pmid.X - wal.wall_int_pos().X;
|
||||
sop->yorig[sop->num_walls] = sop->__int_pmid.Y - wal.wall_int_pos().Y;
|
||||
sop->num_walls++;
|
||||
}
|
||||
}
|
||||
|
@ -1411,7 +1411,7 @@ void PlaceSectorObjectsOnTracks(void)
|
|||
{
|
||||
tpoint = Track[sop->track].TrackPoint;
|
||||
|
||||
dist = Distance((tpoint + j)->x, (tpoint + j)->y, sop->pmid.X, sop->pmid.Y);
|
||||
dist = Distance((tpoint + j)->x, (tpoint + j)->y, sop->__int_pmid.X, sop->__int_pmid.Y);
|
||||
|
||||
if (dist < low_dist)
|
||||
{
|
||||
|
@ -1429,7 +1429,7 @@ void PlaceSectorObjectsOnTracks(void)
|
|||
|
||||
NextTrackPoint(sop);
|
||||
|
||||
sop->ang = getangle((tpoint + sop->point)->x - sop->pmid.X, (tpoint + sop->point)->y - sop->pmid.Y);
|
||||
sop->ang = getangle((tpoint + sop->point)->x - sop->__int_pmid.X, (tpoint + sop->point)->y - sop->__int_pmid.Y);
|
||||
|
||||
sop->ang_moving = sop->ang_tgt = sop->ang;
|
||||
}
|
||||
|
@ -1560,7 +1560,7 @@ void MovePlayer(PLAYER* pp, SECTOR_OBJECT* sop, int nx, int ny)
|
|||
// increment Players delta angle
|
||||
pp->RevolveDeltaAng = (pp->RevolveDeltaAng + GlobSpeedSO).Normalized360();
|
||||
|
||||
rotatepoint(sop->pmid.vec2, *(vec2_t *)&pp->Revolve.X, pp->RevolveDeltaAng.Buildang(), &pp->pos.vec2);
|
||||
rotatepoint(sop->__int_pmid.vec2, *(vec2_t *)&pp->Revolve.X, pp->RevolveDeltaAng.Buildang(), &pp->pos.vec2);
|
||||
|
||||
// THIS WAS CAUSING PROLEMS!!!!
|
||||
// Sectors are still being manipulated so you can end up in a void (-1) sector
|
||||
|
@ -1582,25 +1582,25 @@ void MovePoints(SECTOR_OBJECT* sop, short delta_ang, int nx, int ny)
|
|||
int i, rot_ang;
|
||||
bool PlayerMove = true;
|
||||
|
||||
if (sop->pmid.X >= MAXSO)
|
||||
if (sop->__int_pmid.X >= MAXSO)
|
||||
PlayerMove = false;
|
||||
|
||||
// move along little midpoint
|
||||
sop->pmid.X += nx;
|
||||
sop->pmid.Y += ny;
|
||||
sop->__int_pmid.X += nx;
|
||||
sop->__int_pmid.Y += ny;
|
||||
|
||||
if (sop->pmid.X >= MAXSO)
|
||||
if (sop->__int_pmid.X >= MAXSO)
|
||||
PlayerMove = false;
|
||||
|
||||
// move child sprite along also
|
||||
sop->sp_child->set_int_xy(sop->pmid.X, sop->pmid.Y);
|
||||
sop->sp_child->set_int_xy(sop->__int_pmid.X, sop->__int_pmid.Y);
|
||||
|
||||
|
||||
// setting floor z if need be
|
||||
if ((sop->flags & SOBJ_ZMID_FLOOR))
|
||||
sop->pmid.Z = sop->mid_sector->int_floorz();
|
||||
sop->__int_pmid.Z = sop->mid_sector->int_floorz();
|
||||
|
||||
DVector2 pivot = { sop->pmid.X * inttoworld, sop->pmid.Y * inttoworld };
|
||||
DVector2 pivot = { sop->__int_pmid.X * inttoworld, sop->__int_pmid.Y * inttoworld };
|
||||
DVector2 move = { nx * inttoworld, ny * inttoworld };
|
||||
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
|
||||
{
|
||||
|
@ -1693,13 +1693,13 @@ PlayerPart:
|
|||
}
|
||||
}
|
||||
|
||||
actor->set_int_xy(sop->pmid.X - actor->user.pos.X, sop->pmid.Y - actor->user.pos.Y);
|
||||
actor->set_int_xy(sop->__int_pmid.X - actor->user.pos.X, sop->__int_pmid.Y - actor->user.pos.Y);
|
||||
|
||||
// sprites z update
|
||||
if ((sop->flags & SOBJ_SPRITE_OBJ))
|
||||
{
|
||||
// Sprite Objects follow zmid
|
||||
actor->set_int_z(sop->pmid.Z - actor->user.pos.Z);
|
||||
actor->set_int_z(sop->__int_pmid.Z - actor->user.pos.Z);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1732,12 +1732,12 @@ PlayerPart:
|
|||
auto pos = actor->int_pos();
|
||||
if ((actor->sector()->firstWall()->extra & WALLFX_LOOP_REVERSE_SPIN))
|
||||
{
|
||||
rotatepoint(sop->pmid.vec2, actor->int_pos().vec2, -delta_ang, &pos.vec2);
|
||||
rotatepoint(sop->__int_pmid.vec2, actor->int_pos().vec2, -delta_ang, &pos.vec2);
|
||||
actor->set_int_ang(NORM_ANGLE(actor->int_ang() - delta_ang));
|
||||
}
|
||||
else
|
||||
{
|
||||
rotatepoint(sop->pmid.vec2, actor->int_pos().vec2, delta_ang, &pos.vec2);
|
||||
rotatepoint(sop->__int_pmid.vec2, actor->int_pos().vec2, delta_ang, &pos.vec2);
|
||||
actor->set_int_ang(NORM_ANGLE(actor->int_ang() + delta_ang));
|
||||
}
|
||||
actor->set_int_pos(pos);
|
||||
|
@ -1749,14 +1749,14 @@ PlayerPart:
|
|||
{
|
||||
// NOT part of a sector - independant of any sector
|
||||
auto pos = actor->int_pos();
|
||||
rotatepoint(sop->pmid.vec2, actor->int_pos().vec2, delta_ang, &pos.vec2);
|
||||
rotatepoint(sop->__int_pmid.vec2, actor->int_pos().vec2, delta_ang, &pos.vec2);
|
||||
actor->set_int_ang(NORM_ANGLE(actor->int_ang() + delta_ang));
|
||||
actor->set_int_pos(pos);
|
||||
}
|
||||
|
||||
// Does not necessarily move with the sector so must accout for
|
||||
// moving across sectors
|
||||
if (sop->pmid.X < MAXSO) // special case for operating SO's
|
||||
if (sop->__int_pmid.X < MAXSO) // special case for operating SO's
|
||||
SetActorZ(sop->so_actors[i], actor->int_pos());
|
||||
}
|
||||
|
||||
|
@ -1833,14 +1833,14 @@ void RefreshPoints(SECTOR_OBJECT* sop, int nx, int ny, bool dynamic)
|
|||
{
|
||||
if (!(wal.extra && (wal.extra & WALLFX_DONT_MOVE)))
|
||||
{
|
||||
dx = x = sop->pmid.X - sop->xorig[wallcount];
|
||||
dy = y = sop->pmid.Y - sop->yorig[wallcount];
|
||||
dx = x = sop->__int_pmid.X - sop->xorig[wallcount];
|
||||
dy = y = sop->__int_pmid.Y - sop->yorig[wallcount];
|
||||
|
||||
if (dynamic && sop->scale_type)
|
||||
{
|
||||
if (!(wal.extra & WALLFX_DONT_SCALE))
|
||||
{
|
||||
ang = NORM_ANGLE(getangle(x - sop->pmid.X, y - sop->pmid.Y));
|
||||
ang = NORM_ANGLE(getangle(x - sop->__int_pmid.X, y - sop->__int_pmid.Y));
|
||||
|
||||
if (sop->scale_type == SO_SCALE_RANDOM_POINT)
|
||||
{
|
||||
|
@ -2242,7 +2242,7 @@ void DoTrack(SECTOR_OBJECT* sop, short locktics, int *nx, int *ny)
|
|||
// calculate an angle to the target
|
||||
|
||||
if (sop->vel)
|
||||
sop->ang_moving = sop->ang_tgt = getangle(tpoint->x - sop->pmid.X, tpoint->y - sop->pmid.Y);
|
||||
sop->ang_moving = sop->ang_tgt = getangle(tpoint->x - sop->__int_pmid.X, tpoint->y - sop->__int_pmid.Y);
|
||||
|
||||
// NOTE: Jittery ride - try new value out here
|
||||
// NOTE: Put a loop around this (locktics) to make it more acuruate
|
||||
|
@ -2498,10 +2498,10 @@ void DoTrack(SECTOR_OBJECT* sop, short locktics, int *nx, int *ny)
|
|||
tpoint = Track[sop->track].TrackPoint + sop->point;
|
||||
|
||||
// calculate distance to target poing
|
||||
sop->target_dist = Distance(sop->pmid.X, sop->pmid.Y, tpoint->x, tpoint->y);
|
||||
sop->target_dist = Distance(sop->__int_pmid.X, sop->__int_pmid.Y, tpoint->x, tpoint->y);
|
||||
|
||||
// calculate a new angle to the target
|
||||
sop->ang_moving = sop->ang_tgt = getangle(tpoint->x - sop->pmid.X, tpoint->y - sop->pmid.Y);
|
||||
sop->ang_moving = sop->ang_tgt = getangle(tpoint->x - sop->__int_pmid.X, tpoint->y - sop->__int_pmid.Y);
|
||||
|
||||
if ((sop->flags & SOBJ_ZDIFF_MODE))
|
||||
{
|
||||
|
@ -2513,11 +2513,11 @@ void DoTrack(SECTOR_OBJECT* sop, short locktics, int *nx, int *ny)
|
|||
dz = tpoint->z - sop->zdelta;
|
||||
|
||||
// find the distance to the target (player)
|
||||
dist = DIST(dx, dy, sop->pmid.X, sop->pmid.Y);
|
||||
dist = DIST(dx, dy, sop->__int_pmid.X, sop->__int_pmid.Y);
|
||||
|
||||
// (velocity * difference between the target and the object)
|
||||
// / distance
|
||||
sop->z_rate = (sop->vel * (sop->pmid.Z - dz)) / dist;
|
||||
sop->z_rate = (sop->vel * (sop->__int_pmid.Z - dz)) / dist;
|
||||
|
||||
// take absolute value and convert to pixels (divide by 256)
|
||||
sop->z_rate = PIXZ(labs(sop->z_rate));
|
||||
|
@ -2565,7 +2565,7 @@ void DoTrack(SECTOR_OBJECT* sop, short locktics, int *nx, int *ny)
|
|||
*nx = ((sop->vel) >> 8) * locktics * bcos(sop->ang_moving) >> 14;
|
||||
*ny = ((sop->vel) >> 8) * locktics * bsin(sop->ang_moving) >> 14;
|
||||
|
||||
dist = Distance(sop->pmid.X, sop->pmid.Y, sop->pmid.X + *nx, sop->pmid.Y + *ny);
|
||||
dist = Distance(sop->__int_pmid.X, sop->__int_pmid.Y, sop->__int_pmid.X + *nx, sop->__int_pmid.Y + *ny);
|
||||
sop->target_dist -= dist;
|
||||
}
|
||||
}
|
||||
|
@ -2607,7 +2607,7 @@ void OperateSectorObjectForTics(SECTOR_OBJECT* sop, short newang, int newx, int
|
|||
sop->spin_ang = 0;
|
||||
sop->ang = newang;
|
||||
|
||||
RefreshPoints(sop, newx - sop->pmid.X, newy - sop->pmid.Y, false);
|
||||
RefreshPoints(sop, newx - sop->__int_pmid.X, newy - sop->__int_pmid.Y, false);
|
||||
}
|
||||
|
||||
void OperateSectorObject(SECTOR_OBJECT* sop, short newang, int newx, int newy)
|
||||
|
@ -2618,7 +2618,7 @@ void OperateSectorObject(SECTOR_OBJECT* sop, short newang, int newx, int newy)
|
|||
void PlaceSectorObject(SECTOR_OBJECT* sop, int newx, int newy)
|
||||
{
|
||||
so_setinterpolationtics(sop, synctics);
|
||||
RefreshPoints(sop, newx - sop->pmid.X, newy - sop->pmid.Y, false);
|
||||
RefreshPoints(sop, newx - sop->__int_pmid.X, newy - sop->__int_pmid.Y, false);
|
||||
}
|
||||
|
||||
void VehicleSetSmoke(SECTOR_OBJECT* sop, ANIMATOR* animator)
|
||||
|
@ -2706,8 +2706,8 @@ void DoTornadoObject(SECTOR_OBJECT* sop)
|
|||
|
||||
auto cursect = sop->op_main_sector; // for sop->vel
|
||||
floor_dist = (abs(cursect->int_ceilingz() - cursect->int_floorz())) >> 2;
|
||||
pos.X = sop->pmid.X;
|
||||
pos.Y = sop->pmid.Y;
|
||||
pos.X = sop->__int_pmid.X;
|
||||
pos.Y = sop->__int_pmid.Y;
|
||||
pos.Z = floor_dist;
|
||||
|
||||
PlaceSectorObject(sop, MAXSO, MAXSO);
|
||||
|
@ -2720,7 +2720,7 @@ void DoTornadoObject(SECTOR_OBJECT* sop)
|
|||
}
|
||||
|
||||
TornadoSpin(sop);
|
||||
RefreshPoints(sop, pos.X - sop->pmid.X, pos.Y - sop->pmid.Y, true);
|
||||
RefreshPoints(sop, pos.X - sop->__int_pmid.X, pos.Y - sop->__int_pmid.Y, true);
|
||||
}
|
||||
|
||||
void DoAutoTurretObject(SECTOR_OBJECT* sop)
|
||||
|
@ -2790,7 +2790,7 @@ void DoAutoTurretObject(SECTOR_OBJECT* sop)
|
|||
}
|
||||
}
|
||||
|
||||
sop->ang_tgt = getangle(actor->user.targetActor->int_pos().X - sop->pmid.X, actor->user.targetActor->int_pos().Y - sop->pmid.Y);
|
||||
sop->ang_tgt = getangle(actor->user.targetActor->int_pos().X - sop->__int_pmid.X, actor->user.targetActor->int_pos().Y - sop->__int_pmid.Y);
|
||||
|
||||
// get delta to target angle
|
||||
delta_ang = getincangle(sop->ang, sop->ang_tgt);
|
||||
|
@ -2813,7 +2813,7 @@ void DoAutoTurretObject(SECTOR_OBJECT* sop)
|
|||
}
|
||||
}
|
||||
|
||||
OperateSectorObjectForTics(sop, sop->ang, sop->pmid.X, sop->pmid.Y, 2*synctics);
|
||||
OperateSectorObjectForTics(sop, sop->ang, sop->__int_pmid.X, sop->__int_pmid.Y, 2*synctics);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -10210,8 +10210,8 @@ void AddSpriteToSectorObject(DSWActor* actor, SECTOR_OBJECT* sop)
|
|||
|
||||
actor->user.Flags |= (SPR_ON_SO_SECTOR|SPR_SO_ATTACHED);
|
||||
|
||||
actor->user.pos.X = sop->pmid.X - actor->int_pos().X;
|
||||
actor->user.pos.Y = sop->pmid.Y - actor->int_pos().Y;
|
||||
actor->user.pos.X = sop->__int_pmid.X - actor->int_pos().X;
|
||||
actor->user.pos.Y = sop->__int_pmid.Y - actor->int_pos().Y;
|
||||
actor->user.pos.Z = sop->mid_sector->int_floorz() - actor->int_pos().Z;
|
||||
|
||||
actor->user.sang = actor->int_ang();
|
||||
|
@ -15957,7 +15957,7 @@ int InitTurretMgun(SECTOR_OBJECT* sop)
|
|||
short delta;
|
||||
int xvect,yvect,zvect;
|
||||
|
||||
PlaySound(DIGI_BOATFIRE, &sop->pmid, v3df_dontpan|v3df_doppler);
|
||||
PlaySound(DIGI_BOATFIRE, &sop->__int_pmid, v3df_dontpan|v3df_doppler);
|
||||
|
||||
for (i = 0; sop->so_actors[i] != nullptr; i++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue