mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-20 10:32:27 +00:00
- map all clipmove calls to the version with a full float interface.
This commit is contained in:
parent
63c8960769
commit
600c2a0243
15 changed files with 61 additions and 113 deletions
|
@ -450,41 +450,16 @@ void InitSpriteLists();
|
|||
void SetActorZ(DCoreActor* actor, const DVector3& newpos);
|
||||
void SetActor(DCoreActor* actor, const DVector3& newpos);
|
||||
|
||||
inline int clipmove(vec3_t& pos, sectortype** const sect, int xvect, int yvect,
|
||||
int const walldist, int const ceildist, int const flordist, unsigned const cliptype, CollisionBase& result, int clipmoveboxtracenum = 3)
|
||||
{
|
||||
int sectno = *sect ? sector.IndexOf(*sect) : -1;
|
||||
result = clipmove_(&pos, §no, xvect, yvect, walldist, ceildist, flordist, cliptype, clipmoveboxtracenum);
|
||||
*sect = sectno == -1 ? nullptr : §or[sectno];
|
||||
return result.type;
|
||||
}
|
||||
|
||||
inline int clipmove(DVector3& pos, sectortype** const sect, int xvect, int yvect,
|
||||
int const walldist, int const ceildist, int const flordist, unsigned const cliptype, CollisionBase& result, int clipmoveboxtracenum = 3)
|
||||
{
|
||||
auto vect = vec3_t(pos.X * worldtoint, pos.Y * worldtoint, pos.Z * zworldtoint);
|
||||
int res = clipmove(vect, sect, xvect, yvect, walldist, ceildist, flordist, cliptype, result, clipmoveboxtracenum);
|
||||
pos = { vect.X * inttoworld, vect.Y * inttoworld, vect.Z * zinttoworld };
|
||||
return res;
|
||||
}
|
||||
|
||||
inline int clipmove(DVector3& pos, sectortype** const sect, int xvect, int yvect,
|
||||
int const walldist, double const ceildist, double const flordist, unsigned const cliptype, CollisionBase& result, int clipmoveboxtracenum = 3)
|
||||
{
|
||||
auto vect = vec3_t(pos.X * worldtoint, pos.Y * worldtoint, pos.Z * zworldtoint);
|
||||
int res = clipmove(vect, sect, xvect, yvect, walldist, int(ceildist * zworldtoint), int(flordist * zworldtoint), cliptype, result, clipmoveboxtracenum);
|
||||
pos = { vect.X * inttoworld, vect.Y * inttoworld, vect.Z * zinttoworld };
|
||||
return res;
|
||||
}
|
||||
|
||||
// this one should be the final version everything needs to migrate to
|
||||
inline int clipmove(DVector3& pos, sectortype** const sect, const DVector2& mvec,
|
||||
double const walldist, double const ceildist, double const flordist, unsigned const cliptype, CollisionBase& result, int clipmoveboxtracenum = 3)
|
||||
{
|
||||
auto vect = vec3_t(pos.X * worldtoint, pos.Y * worldtoint, pos.Z * zworldtoint);
|
||||
int res = clipmove(vect, sect, FloatToFixed<18>(mvec.X), FloatToFixed<18>(mvec.Y), int(walldist * worldtoint), int(ceildist * zworldtoint), int(flordist * zworldtoint), cliptype, result, clipmoveboxtracenum);
|
||||
int sectno = *sect ? sector.IndexOf(*sect) : -1;
|
||||
result = clipmove_(&vect, §no, FloatToFixed<18>(mvec.X), FloatToFixed<18>(mvec.Y), int(walldist * worldtoint), int(ceildist * zworldtoint), int(flordist * zworldtoint), cliptype, clipmoveboxtracenum);
|
||||
pos = { vect.X * inttoworld, vect.Y * inttoworld, vect.Z * zinttoworld };
|
||||
return res;
|
||||
*sect = sectno == -1 ? nullptr : §or[sectno];
|
||||
return result.type;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -510,11 +510,18 @@ void GetZRangeAtXYZ(const DVector3& pos, sectortype* pSector, double* ceilZ, Col
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void ClipMove(vec3_t& pos, sectortype** pSector, int xv, int yv, int wd, int cd, int fd, unsigned int nMask, CollisionBase& hit, int tracecount)
|
||||
void ClipMove(DVector3& pos, sectortype** pSector, const DVector2& vect, int wd, double cd, double fd, unsigned int nMask, CollisionBase& hit, int tracecount)
|
||||
{
|
||||
auto opos = pos;
|
||||
sectortype* bakSect = *pSector;
|
||||
clipmove(pos, &bakSect, xv << 14, yv << 14, wd, cd, fd, nMask, hit, tracecount);
|
||||
|
||||
// Due to the low precision of original Build coordinates this code is susceptible to shifts from negative values being off by one,
|
||||
// so we have to replicate the imprecision here. Gross...
|
||||
DVector2 vel;
|
||||
vel.X = (FloatToFixed(vect.X) >> 12) / 16.;
|
||||
vel.Y = (FloatToFixed(vect.Y) >> 12) / 16.;
|
||||
|
||||
clipmove(pos, &bakSect, vel, wd * inttoworld, cd, fd, nMask, hit, tracecount);
|
||||
if (bakSect == nullptr)
|
||||
{
|
||||
pos = opos;
|
||||
|
|
|
@ -39,21 +39,7 @@ int VectorScan(DBloodActor* pSprite, double nOffset, double nZOffset, const DVec
|
|||
void GetZRange(DBloodActor* pSprite, double* ceilZ, Collision* ceilHit, double* floorZ, Collision* floorHit, double nDist, unsigned int nMask, unsigned int nClipParallax = 0);
|
||||
void GetZRangeAtXYZ(const DVector3& pos, sectortype* pSector, double* ceilZ, Collision* ceilHit, double* floorZ, Collision* floorHit, double nDist, unsigned int nMask, unsigned int nClipParallax = 0);
|
||||
|
||||
[[deprecated]] // take care of this together with the engines clipmove.
|
||||
void ClipMove(vec3_t& pos, sectortype** pSector, int xv, int yv, int wd, int cd, int fd, unsigned int nMask, CollisionBase& hit, int tracecount = 3);
|
||||
void ClipMove(DVector3& pos, sectortype** pSector, const DVector2& vect, int wd, double cd, double fd, unsigned int nMask, CollisionBase& hit, int tracecount = 3)
|
||||
{
|
||||
// this uses floats only partially.
|
||||
vec3_t ipos = { int(pos.X * worldtoint), int(pos.Y * worldtoint), int(pos.Z * zworldtoint)};
|
||||
// Due to the low precision of original Build coordinates this code is susceptible to shifts from negative values being off by one,
|
||||
// so we have to replicate the imprecision here. Gross...
|
||||
DVector2 vel;
|
||||
vel.X = (FloatToFixed(vect.X) >> 12) / 16.;
|
||||
vel.Y = (FloatToFixed(vect.Y) >> 12) / 16.;
|
||||
|
||||
ClipMove(ipos, pSector, int(vel.X * worldtoint), int(vel.Y * worldtoint), wd, int(cd * zworldtoint), int(fd * zworldtoint), nMask, hit, tracecount);
|
||||
pos = { ipos.X * inttoworld, ipos.Y * inttoworld, ipos.Z * zinttoworld };
|
||||
}
|
||||
void ClipMove(DVector3& pos, sectortype** pSector, const DVector2& vect, int wd, double cd, double fd, unsigned int nMask, CollisionBase& hit, int tracecount = 3);
|
||||
BitArray GetClosestSpriteSectors(sectortype* pSector, const DVector2& pos, int nDist, TArray<walltype*>* pWalls, bool newSectCheckMethod = false);
|
||||
int picWidth(int nPic, int repeat);
|
||||
int picHeight(int nPic, int repeat);
|
||||
|
|
|
@ -1460,8 +1460,7 @@ bool queball(DDukeActor *actor, int pocket, int queball, int stripeball)
|
|||
auto sect = actor->sector();
|
||||
auto pos = actor->spr.pos;
|
||||
auto move = actor->spr.angle.ToVector() * actor->vel.X * 0.5;
|
||||
int j = clipmove(pos, §, FloatToFixed<18>(move.X), FloatToFixed<18>(move.Y),
|
||||
24, (4 << 8), (4 << 8), CLIPMASK1, coll);
|
||||
int j = clipmove(pos, §, move, 1.5, 4., 4., CLIPMASK1, coll);
|
||||
actor->spr.pos = pos;;
|
||||
actor->setsector(sect);
|
||||
|
||||
|
|
|
@ -437,7 +437,6 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
|
|||
|
||||
int movesprite_ex_d(DDukeActor* actor, const DVector3& change, unsigned int cliptype, Collision &result)
|
||||
{
|
||||
int clipdist;
|
||||
int bg = badguy(actor);
|
||||
|
||||
if (actor->spr.statnum == STAT_MISC || (bg && actor->spr.xrepeat < 4))
|
||||
|
@ -456,17 +455,18 @@ int movesprite_ex_d(DDukeActor* actor, const DVector3& change, unsigned int clip
|
|||
if (bg)
|
||||
{
|
||||
if (actor->spr.xrepeat > 60)
|
||||
clipmove(ppos, &dasectp, FloatToFixed<18>(change.X * 0.5), FloatToFixed<18>(change.Y * 0.5), 1024, (4 << 8), (4 << 8), cliptype, result);
|
||||
clipmove(ppos, &dasectp, change * 0.5, 64., 4., 4., cliptype, result);
|
||||
else
|
||||
{
|
||||
double clipdist;
|
||||
if (actor->spr.picnum == LIZMAN)
|
||||
clipdist = 292;
|
||||
clipdist = 18.25;
|
||||
else if (actorflag(actor, SFLAG_BADGUY))
|
||||
clipdist = actor->int_clipdist();
|
||||
clipdist = actor->fClipdist();
|
||||
else
|
||||
clipdist = 192;
|
||||
clipdist = 12;
|
||||
|
||||
clipmove(ppos, &dasectp, FloatToFixed<18>(change.X * 0.5), FloatToFixed<18>(change.Y * 0.5), clipdist, (4 << 8), (4 << 8), cliptype, result);
|
||||
clipmove(ppos, &dasectp, change * 0.5, clipdist, 4., 4., cliptype, result);
|
||||
}
|
||||
|
||||
// conditional code from hell...
|
||||
|
@ -491,9 +491,9 @@ int movesprite_ex_d(DDukeActor* actor, const DVector3& change, unsigned int clip
|
|||
else
|
||||
{
|
||||
if (actor->spr.statnum == STAT_PROJECTILE)
|
||||
clipmove(ppos, &dasectp, FloatToFixed<18>(change.X * 0.5), FloatToFixed<18>(change.Y * 0.5), 8, (4 << 8), (4 << 8), cliptype, result);
|
||||
clipmove(ppos, &dasectp, change * 0.5, 0.5, 4., 4., cliptype, result);
|
||||
else
|
||||
clipmove(ppos, &dasectp, FloatToFixed<18>(change.X * 0.5), FloatToFixed<18>(change.Y * 0.5), (int)(actor->int_clipdist()), (4 << 8), (4 << 8), cliptype, result);
|
||||
clipmove(ppos, &dasectp, change * 0.5, actor->fClipdist(), 4., 4., cliptype, result);
|
||||
}
|
||||
actor->spr.pos.XY() = ppos.XY();
|
||||
|
||||
|
|
|
@ -365,7 +365,6 @@ void hitradius_r(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
|
|||
|
||||
int movesprite_ex_r(DDukeActor* actor, const DVector3& change, unsigned int cliptype, Collision &result)
|
||||
{
|
||||
int clipdist;
|
||||
int bg = badguy(actor);
|
||||
|
||||
if (actor->spr.statnum == 5 || (bg && actor->spr.xrepeat < 4))
|
||||
|
@ -384,11 +383,10 @@ int movesprite_ex_r(DDukeActor* actor, const DVector3& change, unsigned int clip
|
|||
if (bg)
|
||||
{
|
||||
if (actor->spr.xrepeat > 60)
|
||||
clipmove(ppos, &dasectp, FloatToFixed<18>(change.X * 0.5), FloatToFixed<18>(change.Y * 0.5), 1024, (4 << 8), (4 << 8), cliptype, result);
|
||||
clipmove(ppos, &dasectp, change * 0.5, 64., 4., 4., cliptype, result);
|
||||
else
|
||||
{
|
||||
clipdist = 192;
|
||||
clipmove(ppos, &dasectp, FloatToFixed<18>(change.X * 0.5), FloatToFixed<18>(change.Y * 0.5), clipdist, (4 << 8), (4 << 8), cliptype, result);
|
||||
clipmove(ppos, &dasectp, change * 0.5, 12., 4., 4., cliptype, result);
|
||||
}
|
||||
|
||||
if (dasectp == nullptr || (dasectp != nullptr && actor->actorstayput != nullptr && actor->actorstayput != dasectp))
|
||||
|
@ -406,9 +404,9 @@ int movesprite_ex_r(DDukeActor* actor, const DVector3& change, unsigned int clip
|
|||
else
|
||||
{
|
||||
if (actor->spr.statnum == STAT_PROJECTILE)
|
||||
clipmove(ppos, &dasectp, FloatToFixed<18>(change.X * 0.5), FloatToFixed<18>(change.Y * 0.5), 8, (4 << 8), (4 << 8), cliptype, result);
|
||||
clipmove(ppos, &dasectp, change * 0.5, 0.5, 4., 4., cliptype, result);
|
||||
else
|
||||
clipmove(ppos, &dasectp, FloatToFixed<18>(change.X * 0.5), FloatToFixed<18>(change.Y * 0.5), (int)(actor->int_clipdist()), (4 << 8), (4 << 8), cliptype, result);
|
||||
clipmove(ppos, &dasectp, change * 0.5, actor->fClipdist(), 4., 4., cliptype, result);
|
||||
}
|
||||
actor->spr.pos.XY() = ppos.XY();
|
||||
|
||||
|
|
|
@ -614,7 +614,7 @@ void playerisdead(int snum, int psectlotag, double floorz, double ceilingz)
|
|||
}
|
||||
|
||||
Collision coll;
|
||||
clipmove(p->pos, &p->cursector, 0, 0, 164, (4 << 8), (4 << 8), CLIPMASK0, coll);
|
||||
clipmove(p->pos, &p->cursector, DVector2( 0, 0), 10.25, 4., 4., CLIPMASK0, coll);
|
||||
}
|
||||
|
||||
backupplayer(p);
|
||||
|
@ -624,7 +624,7 @@ void playerisdead(int snum, int psectlotag, double floorz, double ceilingz)
|
|||
updatesector(p->pos, &p->cursector);
|
||||
|
||||
pushmove(p->pos, &p->cursector, 128, (4 << 8), (20 << 8), CLIPMASK0);
|
||||
|
||||
|
||||
if (floorz > ceilingz + 16 && actor->spr.pal != 1)
|
||||
p->angle.rotscrnang = DAngle::fromBuild(p->dead_flag + ((floorz + p->pos.Z) * 2));
|
||||
|
||||
|
|
|
@ -2887,7 +2887,7 @@ void processinput_d(int snum)
|
|||
doubvel = TICSPERFRAME;
|
||||
|
||||
checklook(snum,actions);
|
||||
int ii = 40;
|
||||
double iif = 2.5;
|
||||
auto oldpos = p->opos;
|
||||
|
||||
if (p->on_crane != nullptr)
|
||||
|
@ -3052,8 +3052,8 @@ void processinput_d(int snum)
|
|||
|
||||
HORIZONLY:
|
||||
|
||||
if (psectlotag == 1 || p->spritebridge == 1) ii = (4L << 8);
|
||||
else ii = (20L << 8);
|
||||
if (psectlotag == 1 || p->spritebridge == 1) iif = 4;
|
||||
else iif = 20;
|
||||
|
||||
if (p->insector() && p->cursector->lotag == 2) k = 0;
|
||||
else k = 1;
|
||||
|
@ -3066,7 +3066,7 @@ HORIZONLY:
|
|||
ChangeActorSect(pact, p->cursector);
|
||||
}
|
||||
else
|
||||
clipmove(p->pos, &p->cursector, FloatToFixed<18>(p->vel.X), FloatToFixed<18>(p->vel.Y), 164, (4 << 8), ii, CLIPMASK0, clip);
|
||||
clipmove(p->pos, &p->cursector, p->vel, 10.25, 4., iif, CLIPMASK0, clip);
|
||||
|
||||
if (p->jetpack_on == 0 && psectlotag != 2 && psectlotag != 1 && shrunk)
|
||||
p->pos.Z += 32;
|
||||
|
|
|
@ -3332,7 +3332,7 @@ static void processweapon(int snum, ESyncBits actions, sectortype* psectp)
|
|||
|
||||
void processinput_r(int snum)
|
||||
{
|
||||
int i, k, doubvel;
|
||||
int k, doubvel;
|
||||
Collision chz, clz;
|
||||
bool shrunk;
|
||||
int psectlotag;
|
||||
|
@ -3583,8 +3583,6 @@ void processinput_r(int snum)
|
|||
|
||||
// Shrinking code
|
||||
|
||||
i = 40;
|
||||
|
||||
if (psectlotag == ST_17_PLATFORM_UP || (isRRRA() && psectlotag == ST_18_ELEVATOR_DOWN))
|
||||
{
|
||||
int tmp;
|
||||
|
@ -3772,9 +3770,10 @@ void processinput_r(int snum)
|
|||
}
|
||||
|
||||
HORIZONLY:
|
||||
double iif = 40;
|
||||
|
||||
if (psectlotag == 1 || p->spritebridge == 1) i = (4L << 8);
|
||||
else i = (20L << 8);
|
||||
if (psectlotag == 1 || p->spritebridge == 1) iif = 4;
|
||||
else iif = 20;
|
||||
|
||||
if (p->insector() && p->cursector->lotag == 2) k = 0;
|
||||
else k = 1;
|
||||
|
@ -3787,7 +3786,7 @@ HORIZONLY:
|
|||
ChangeActorSect(pact, p->cursector);
|
||||
}
|
||||
else
|
||||
clipmove(p->pos, &p->cursector, FloatToFixed<18>(p->vel.X), FloatToFixed<18>(p->vel.Y), 164, (4 << 8), i, CLIPMASK0, clip);
|
||||
clipmove(p->pos, &p->cursector, p->vel, 10.25, 4., iif, CLIPMASK0, clip);
|
||||
|
||||
if (p->jetpack_on == 0 && psectlotag != 2 && psectlotag != 1 && shrunk)
|
||||
p->pos.Z += 32;
|
||||
|
|
|
@ -456,7 +456,7 @@ Collision movesprite(DExhumedActor* pActor, DVector2 vect, double dz, double flo
|
|||
}
|
||||
|
||||
Collision coll;
|
||||
clipmove(pActor->spr.pos, &pSector, FloatToFixed<18>(vect.X), FloatToFixed<18>(vect.Y), pActor->int_clipdist(), int(nSpriteHeight * zworldtoint), int(flordist * zworldtoint), clipmask, coll);
|
||||
clipmove(pActor->spr.pos, &pSector, vect, pActor->fClipdist(), nSpriteHeight, flordist, clipmask, coll);
|
||||
if (coll.type != kHitNone) // originally this or'ed the two values which can create unpredictable bad values in some edge cases.
|
||||
{
|
||||
coll.exbits = nRet.exbits;
|
||||
|
@ -812,7 +812,7 @@ void MoveSector(sectortype* pSector, DAngle nAngle, DVector2& nVel)
|
|||
|
||||
auto pSectorB = pSector;
|
||||
Collision scratch;
|
||||
clipmove(pos, &pSectorB, FloatToFixed<18>(nVect.X), FloatToFixed<18>(nVect.Y), pBlockInfo->mindist, 0, 0, CLIPMASK1, scratch);
|
||||
clipmove(pos, &pSectorB, nVect, pBlockInfo->mindist, 0., 0., CLIPMASK1, scratch);
|
||||
|
||||
auto vect = pos.XY() - b_pos;
|
||||
|
||||
|
@ -827,7 +827,7 @@ void MoveSector(sectortype* pSector, DAngle nAngle, DVector2& nVel)
|
|||
pos.XY() = b_pos;
|
||||
pos.Z = nZVal;
|
||||
|
||||
clipmove(pos, &pSectorB, FloatToFixed<18>(nVect.X), FloatToFixed<18>(nVect.Y), pBlockInfo->mindist, 0, 0, CLIPMASK1, scratch);
|
||||
clipmove(pos, &pSectorB, nVect, pBlockInfo->mindist, 0., 0., CLIPMASK1, scratch);
|
||||
|
||||
auto delta = pos.XY() - b_pos;
|
||||
|
||||
|
@ -864,7 +864,7 @@ void MoveSector(sectortype* pSector, DAngle nAngle, DVector2& nVel)
|
|||
|
||||
// The vector that got passed in here originally was Q28.4, while clipmove expects Q14.18, effectively resulting in actual zero movement
|
||||
// because the resulting offset would be far below the coordinate's precision.
|
||||
clipmove(pos, &pSectorB, FloatToFixed<18>(-vect.X / 16384.), FloatToFixed<18>(-vect.Y / 16384), pActor->int_clipdist(), 0, 0, CLIPMASK0, scratch);
|
||||
clipmove(pos, &pSectorB, -vect / 16384., pActor->fClipdist(), 0., 0., CLIPMASK0, scratch);
|
||||
|
||||
if (pSectorB) {
|
||||
ChangeActorSect(pActor, pSectorB);
|
||||
|
@ -884,8 +884,7 @@ void MoveSector(sectortype* pSector, DAngle nAngle, DVector2& nVel)
|
|||
// vect was added unscaled, essentially nullifying its effect entirely.
|
||||
auto vect2 = -nAngle.ToVector() * pActor->fClipdist()/* - vect*/;
|
||||
|
||||
clipmove(pos, &pSectorB, FloatToFixed<18>(vect2.X), FloatToFixed<18>(vect2.Y), pActor->int_clipdist(), 0, 0, CLIPMASK0, scratch);
|
||||
|
||||
clipmove(pos, &pSectorB, -vect / 16384., pActor->fClipdist(), 0., 0., CLIPMASK0, scratch);
|
||||
|
||||
if (pSectorB != pNextSector && (pSectorB == pSector || pNextSector == pSector))
|
||||
{
|
||||
|
@ -923,7 +922,7 @@ void MoveSector(sectortype* pSector, DAngle nAngle, DVector2& nVel)
|
|||
if (pActor->spr.statnum >= 99 && nZVal == pActor->spr.pos.Z && !(pActor->spr.cstat & CSTAT_SPRITE_INVISIBLE))
|
||||
{
|
||||
pSectorB = pSector;
|
||||
clipmove(pActor->spr.pos, &pSectorB, FloatToFixed<18>(vect.X), FloatToFixed<18>(vect.Y), pActor->int_clipdist(), 5120, -5120, CLIPMASK0, scratch);
|
||||
clipmove(pActor->spr.pos, &pSectorB, vect, pActor->fClipdist(), 20, -20, CLIPMASK0, scratch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1058,7 +1057,7 @@ DVector3 WheresMyMouth(int nPlayer, sectortype **sectnum)
|
|||
auto vect = pActor->spr.angle.ToVector() * 8;
|
||||
|
||||
Collision scratch;
|
||||
clipmove(pos, sectnum, FloatToFixed<18>(vect.X), FloatToFixed<18>(vect.Y), 5120, 1280, 1280, CLIPMASK1, scratch);
|
||||
clipmove(pos, sectnum, vect, 320, 5., 5., CLIPMASK1, scratch);
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
|
|
@ -65,9 +65,7 @@ Collision MultiClipMove(PLAYER* pp, double zz, double floordist)
|
|||
DVector2 vect = ang.ToVector() * 1024 * sop->clipbox_vdist[i];
|
||||
Collision coll;
|
||||
|
||||
int xvect = vect.X * 16 * worldtoint; // note: this means clipmove input is Q18.14!
|
||||
int yvect = vect.Y * 16 * worldtoint;
|
||||
clipmove(spos, &pp->cursector, xvect, yvect, (int)sop->clipbox_dist[i], 4., floordist, CLIPMASK_PLAYER, coll, 1);
|
||||
clipmove(spos, &pp->cursector, vect, sop->clipbox_dist[i] * inttoworld, 4., floordist, CLIPMASK_PLAYER, coll, 1);
|
||||
|
||||
if (coll.type != kHitNone)
|
||||
{
|
||||
|
@ -98,7 +96,7 @@ Collision MultiClipMove(PLAYER* pp, double zz, double floordist)
|
|||
pos[i].Z = zz;
|
||||
|
||||
// move the box
|
||||
clipmove(pos[i], &pp->cursector, FloatToFixed<18>(pp->vect.X), FloatToFixed<18>(pp->vect.Y), (int)sop->clipbox_dist[i], 4., floordist, CLIPMASK_PLAYER, coll);
|
||||
clipmove(pos[i], &pp->cursector, pp->vect, sop->clipbox_dist[i] * inttoworld, 4., floordist, CLIPMASK_PLAYER, coll);
|
||||
|
||||
// save the dist moved
|
||||
dist = (pos[i].XY() - opos[i].XY()).Length();
|
||||
|
@ -140,7 +138,7 @@ int MultiClipTurn(PLAYER* pp, DAngle new_ang, double zz, double floordist)
|
|||
DVector2 vect = ang.ToVector() * 1024 * sop->clipbox_vdist[i];
|
||||
Collision coll;
|
||||
|
||||
clipmove(spos, &cursect, FloatToFixed<18>(vect.X), FixedToFloat<18>(vect.Y), (int)sop->clipbox_dist[i], 4., floordist, CLIPMASK_PLAYER, coll);
|
||||
clipmove(spos, &cursect, vect, sop->clipbox_dist[i] * inttoworld, 4., floordist, CLIPMASK_PLAYER, coll);
|
||||
|
||||
ASSERT(cursect);
|
||||
|
||||
|
|
|
@ -2023,7 +2023,7 @@ void DoPlayerSlide(PLAYER* pp)
|
|||
return;
|
||||
}
|
||||
Collision coll;
|
||||
clipmove(pp->pos, &pp->cursector, FloatToFixed<18>(pp->slide_vect.X), FloatToFixed<18>(pp->slide_vect.Y), ((int)actor->int_clipdist()), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER, coll);
|
||||
clipmove(pp->pos, &pp->cursector, pp->slide_vect, actor->fClipdist(), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER, coll);
|
||||
|
||||
PlayerCheckValidMove(pp);
|
||||
push_ret = pushmove(pp->pos, &pp->cursector, ((int)actor->int_clipdist()), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER);
|
||||
|
@ -2195,7 +2195,7 @@ void DoPlayerMove(PLAYER* pp)
|
|||
actor->spr.cstat &= ~(CSTAT_SPRITE_BLOCK);
|
||||
Collision coll;
|
||||
updatesector(pp->pos, &pp->cursector);
|
||||
clipmove(pp->pos, &pp->cursector, FloatToFixed<18>(pp->vect.X), FloatToFixed<18>(pp->vect.Y), ((int)actor->int_clipdist()), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER, coll);
|
||||
clipmove(pp->pos, &pp->cursector, pp->vect, actor->fClipdist(), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER, coll);
|
||||
|
||||
actor->spr.cstat = save_cstat;
|
||||
PlayerCheckValidMove(pp);
|
||||
|
@ -2784,7 +2784,7 @@ void DoPlayerMoveVehicle(PLAYER* pp)
|
|||
if (pp->sop->clipdist)
|
||||
{
|
||||
Collision coll;
|
||||
clipmove(pp->pos, &pp->cursector, FloatToFixed<18>(pp->vect.X), FloatToFixed<18>(pp->vect.Y), (int)pp->sop->clipdist, 4., floordist, CLIPMASK_PLAYER, actor->user.coll);
|
||||
clipmove(pp->pos, &pp->cursector, pp->vect, pp->sop->clipdist * inttoworld, 4., floordist, CLIPMASK_PLAYER, actor->user.coll);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -4828,9 +4828,7 @@ void DoPlayerCurrent(PLAYER* pp)
|
|||
if (!sectu)
|
||||
return;
|
||||
|
||||
auto vect = sectu->angle.ToVector() * 1024; // 16384 >> 4 - Beware of clipmove's odd format for vect!
|
||||
xvect = sectu->speed * synctics * vect.X;
|
||||
yvect = sectu->speed * synctics * vect.Y;
|
||||
auto vect = sectu->angle.ToVector() / 256. * sectu->speed * synctics; // 16384 >> 4 - Beware of clipmove's odd format for vect!
|
||||
|
||||
push_ret = pushmove(pp->pos, &pp->cursector, ((int)pp->actor->int_clipdist()), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER);
|
||||
if (push_ret < 0)
|
||||
|
@ -4848,7 +4846,7 @@ void DoPlayerCurrent(PLAYER* pp)
|
|||
return;
|
||||
}
|
||||
Collision coll;
|
||||
clipmove(pp->pos, &pp->cursector, xvect, yvect, ((int)pp->actor->int_clipdist()), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER, coll);
|
||||
clipmove(pp->pos, &pp->cursector, vect, pp->actor->fClipdist(), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER, coll);
|
||||
|
||||
PlayerCheckValidMove(pp);
|
||||
pushmove(pp->pos, &pp->cursector, ((int)pp->actor->int_clipdist()), pp->p_ceiling_dist, pp->p_floor_dist, CLIPMASK_PLAYER);
|
||||
|
|
|
@ -6362,11 +6362,7 @@ Collision move_sprite(DSWActor* actor, const DVector3& change, double ceildist,
|
|||
}
|
||||
|
||||
|
||||
// ASSERT(inside(actor->spr.x,actor->spr.y,dasectnum));
|
||||
int xchange = change.X * worldtoint, ychange = change.Y * worldtoint;
|
||||
clipmove(clip_pos, &dasect,
|
||||
((xchange * numtics) << 11), ((ychange * numtics) << 11),
|
||||
actor->int_clipdist(), ceildist, flordist, cliptype, retval, 1);
|
||||
clipmove(clip_pos, &dasect, change * numtics * 0.125, actor->fClipdist(), ceildist, flordist, cliptype, retval, 1);
|
||||
|
||||
|
||||
actor->spr.pos.XY() = clip_pos.XY();
|
||||
|
@ -6586,9 +6582,7 @@ Collision move_missile(DSWActor* actor, const DVector3& change, double ceil_dist
|
|||
|
||||
|
||||
int xchange = change.X * worldtoint, ychange = change.Y * worldtoint;
|
||||
clipmove(clip_pos, &dasect,
|
||||
((xchange * numtics) << 11), ((ychange * numtics) << 11),
|
||||
actor->int_clipdist(), ceil_dist, flor_dist, cliptype, retval, 1);
|
||||
clipmove(clip_pos, &dasect, change * numtics * 0.125, actor->fClipdist(), ceil_dist, flor_dist, cliptype, retval, 1);
|
||||
actor->spr.pos.XY() = clip_pos.XY();
|
||||
|
||||
if (dasect == nullptr)
|
||||
|
@ -6737,10 +6731,7 @@ Collision move_ground_missile(DSWActor* actor, const DVector2& change, double ce
|
|||
lastsect = dasect;
|
||||
opos = actor->spr.pos;
|
||||
opos.Z = daz;
|
||||
int xchange = change.X * worldtoint, ychange = change.Y * worldtoint;
|
||||
clipmove(opos, &dasect,
|
||||
((xchange * numtics) << 11), ((ychange * numtics) << 11),
|
||||
actor->int_clipdist(), ceildist, flordist, cliptype, retval, 1);
|
||||
clipmove(opos, &dasect, change * numtics * 0.125, actor->fClipdist(), ceildist, flordist, cliptype, retval, 1);
|
||||
actor->spr.pos.XY() = opos.XY();
|
||||
}
|
||||
|
||||
|
|
|
@ -2649,10 +2649,8 @@ void DoTornadoObject(SECTOR_OBJECT* sop)
|
|||
PlaceSectorObject(sop, {MAXSO, MAXSO});
|
||||
Collision coll;
|
||||
|
||||
auto vect = ang.ToVector() * sop->vel; // vel is still in Build coordinates.
|
||||
int xvect = vect.X * 16384;
|
||||
int yvect = vect.Y * 16384;
|
||||
clipmove(pos, &cursect, xvect, yvect, (int)sop->clipdist, 0., floor_dist, CLIPMASK_ACTOR, coll);
|
||||
auto vect = ang.ToVector() * sop->vel * inttoworld; // vel is still in Build coordinates.
|
||||
clipmove(pos, &cursect, vect, sop->clipdist * inttoworld, 0., floor_dist, CLIPMASK_ACTOR, coll);
|
||||
|
||||
if (coll.type != kHitNone)
|
||||
{
|
||||
|
|
|
@ -15566,7 +15566,7 @@ bool HitscanSpriteAdjust(DSWActor* actor, walltype* hit_wall)
|
|||
auto sect = actor->sector();
|
||||
|
||||
Collision coll;
|
||||
clipmove(actor->spr.pos, §, FloatToFixed<18>(vect.X), FloatToFixed<18>(vect.Y), 4, 4., 4., CLIPMASK_MISSILE, coll);
|
||||
clipmove(actor->spr.pos, §, vect, 4, 4., 4., CLIPMASK_MISSILE, coll);
|
||||
|
||||
if (actor->sector() != sect)
|
||||
ChangeActorSect(actor, sect);
|
||||
|
@ -17974,7 +17974,7 @@ void QueueHole(sectortype* hit_sect, walltype* hit_wall, const DVector3& pos)
|
|||
auto sect = spawnedActor->sector();
|
||||
|
||||
Collision coll;
|
||||
clipmove(spawnedActor->spr.pos, §, FloatToFixed<18>(vec.X), FloatToFixed<18>(vec.Y), 0, 0, 0, CLIPMASK_MISSILE, coll, 1);
|
||||
clipmove(spawnedActor->spr.pos, §, vec, 0., 0., 0., CLIPMASK_MISSILE, coll, 1);
|
||||
|
||||
if (spawnedActor->sector() != sect)
|
||||
ChangeActorSect(spawnedActor, sect);
|
||||
|
@ -18316,7 +18316,7 @@ DSWActor* QueueWallBlood(DSWActor* actor, DAngle bang)
|
|||
auto sect = spawnedActor->sector();
|
||||
|
||||
Collision coll;
|
||||
clipmove(spawnedActor->spr.pos, §, FloatToFixed<18>(vec.X), FloatToFixed<18>(vec.Y), 0, 0, 0, CLIPMASK_MISSILE, coll, 1);
|
||||
clipmove(spawnedActor->spr.pos, §, vec, 0., 0., 0., CLIPMASK_MISSILE, coll, 1);
|
||||
|
||||
if (spawnedActor->sector() != sect)
|
||||
ChangeActorSect(spawnedActor, sect);
|
||||
|
|
Loading…
Reference in a new issue