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 orig_speed; // original speed - vel jacks with speed
|
||||||
int vel; // velocity adjuments
|
int vel; // velocity adjuments
|
||||||
|
|
||||||
TArray<int> origX;
|
TArray<DVector2> orig;
|
||||||
TArray<int> origY;
|
|
||||||
|
|
||||||
void SetNumWalls(int num)
|
void SetNumWalls(int num)
|
||||||
{
|
{
|
||||||
origX.Resize(num);
|
orig.Resize(num);
|
||||||
origY.Resize(num);
|
memset(orig.Data(), 0, num * sizeof(DVector2));
|
||||||
memset(origX.Data(), 0, num * sizeof(int));
|
|
||||||
memset(origY.Data(), 0, num * sizeof(int));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClearWalls()
|
void ClearWalls()
|
||||||
{
|
{
|
||||||
origX.Reset();
|
orig.Reset();
|
||||||
origY.Reset();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -300,7 +300,6 @@ int DoRotator(DSWActor* actor)
|
||||||
ROTATOR* r;
|
ROTATOR* r;
|
||||||
short ndx,w,startwall,endwall;
|
short ndx,w,startwall,endwall;
|
||||||
DSWActor* pivot = nullptr;
|
DSWActor* pivot = nullptr;
|
||||||
vec2_t nxy;
|
|
||||||
bool kill = false;
|
bool kill = false;
|
||||||
|
|
||||||
r = actor->user.rotator.Data();
|
r = actor->user.rotator.Data();
|
||||||
|
@ -397,10 +396,9 @@ int DoRotator(DSWActor* actor)
|
||||||
ndx = 0;
|
ndx = 0;
|
||||||
for(auto& wal : wallsofsector(actor->sector()))
|
for(auto& wal : wallsofsector(actor->sector()))
|
||||||
{
|
{
|
||||||
vec2_t const orig = { r->origX[ndx], r->origY[ndx] };
|
auto nxy = rotatepoint(pivot->spr.pos, r->orig[ndx], DAngle::fromBuild(r->pos));
|
||||||
rotatepoint(pivot->int_pos().vec2, orig, r->pos, &nxy);
|
|
||||||
|
|
||||||
dragpoint(&wal, nxy.X, nxy.Y);
|
dragpoint(&wal, nxy);
|
||||||
ndx++;
|
ndx++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -727,8 +727,7 @@ FSerializer& Serialize(FSerializer& arc, const char* keyname, ROTATOR& w, ROTATO
|
||||||
("speed", w.speed)
|
("speed", w.speed)
|
||||||
("orig_speed", w.orig_speed)
|
("orig_speed", w.orig_speed)
|
||||||
("vel", w.vel)
|
("vel", w.vel)
|
||||||
("origx", w.origX)
|
("orig", w.orig)
|
||||||
("origy", w.origY)
|
|
||||||
.EndObject();
|
.EndObject();
|
||||||
}
|
}
|
||||||
return arc;
|
return arc;
|
||||||
|
|
|
@ -2121,8 +2121,7 @@ void SpriteSetup(void)
|
||||||
wallcount = 0;
|
wallcount = 0;
|
||||||
for(auto& wal : wallsofsector(actor->sector()))
|
for(auto& wal : wallsofsector(actor->sector()))
|
||||||
{
|
{
|
||||||
actor->user.rotator->origX[wallcount] = wal.wall_int_pos().X;
|
actor->user.rotator->orig[wallcount] = wal.pos;
|
||||||
actor->user.rotator->origY[wallcount] = wal.wall_int_pos().Y;
|
|
||||||
wallcount++;
|
wallcount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue