mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +00:00
- floatified ROTATOR
This commit is contained in:
parent
b53e4b824e
commit
3bd8a02c3f
4 changed files with 8 additions and 16 deletions
|
@ -870,21 +870,17 @@ struct ROTATOR
|
|||
int orig_speed; // original speed - vel jacks with speed
|
||||
int vel; // velocity adjuments
|
||||
|
||||
TArray<int> origX;
|
||||
TArray<int> origY;
|
||||
TArray<DVector2> orig;
|
||||
|
||||
void SetNumWalls(int num)
|
||||
{
|
||||
origX.Resize(num);
|
||||
origY.Resize(num);
|
||||
memset(origX.Data(), 0, num * sizeof(int));
|
||||
memset(origY.Data(), 0, num * sizeof(int));
|
||||
orig.Resize(num);
|
||||
memset(orig.Data(), 0, num * sizeof(DVector2));
|
||||
}
|
||||
|
||||
void ClearWalls()
|
||||
{
|
||||
origX.Reset();
|
||||
origY.Reset();
|
||||
orig.Reset();
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
@ -300,7 +300,6 @@ int DoRotator(DSWActor* actor)
|
|||
ROTATOR* r;
|
||||
short ndx,w,startwall,endwall;
|
||||
DSWActor* pivot = nullptr;
|
||||
vec2_t nxy;
|
||||
bool kill = false;
|
||||
|
||||
r = actor->user.rotator.Data();
|
||||
|
@ -397,10 +396,9 @@ int DoRotator(DSWActor* actor)
|
|||
ndx = 0;
|
||||
for(auto& wal : wallsofsector(actor->sector()))
|
||||
{
|
||||
vec2_t const orig = { r->origX[ndx], r->origY[ndx] };
|
||||
rotatepoint(pivot->int_pos().vec2, orig, r->pos, &nxy);
|
||||
auto nxy = rotatepoint(pivot->spr.pos, r->orig[ndx], DAngle::fromBuild(r->pos));
|
||||
|
||||
dragpoint(&wal, nxy.X, nxy.Y);
|
||||
dragpoint(&wal, nxy);
|
||||
ndx++;
|
||||
}
|
||||
|
||||
|
|
|
@ -727,8 +727,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, ROTATOR& w, ROTATO
|
|||
("speed", w.speed)
|
||||
("orig_speed", w.orig_speed)
|
||||
("vel", w.vel)
|
||||
("origx", w.origX)
|
||||
("origy", w.origY)
|
||||
("orig", w.orig)
|
||||
.EndObject();
|
||||
}
|
||||
return arc;
|
||||
|
|
|
@ -2121,8 +2121,7 @@ void SpriteSetup(void)
|
|||
wallcount = 0;
|
||||
for(auto& wal : wallsofsector(actor->sector()))
|
||||
{
|
||||
actor->user.rotator->origX[wallcount] = wal.wall_int_pos().X;
|
||||
actor->user.rotator->origY[wallcount] = wal.wall_int_pos().Y;
|
||||
actor->user.rotator->orig[wallcount] = wal.pos;
|
||||
wallcount++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue