- got rid of most REPEAT_SCALE factors.

This commit is contained in:
Christoph Oelckers 2022-10-05 20:18:19 +02:00
parent 8c308c8d3e
commit e60fafec52
25 changed files with 54 additions and 48 deletions

View file

@ -645,7 +645,7 @@ void DrawAutomapAlignmentFacing(const spritetype& spr, const DVector2& bpos, con
void DrawAutomapAlignmentWall(const spritetype& spr, const DVector2& bpos, const DVector2& cangvect, const double czoom, const DVector2& xydim, const PalEntry& col)
{
auto xrep = spr.xrepeat * REPEAT_SCALE;
auto xrep = spr.ScaleX();
auto xspan = tileWidth(spr.picnum);
auto xoff = tileLeftOffset(spr.picnum) + spr.xoffset;
@ -671,7 +671,7 @@ void DrawAutomapAlignmentWall(const spritetype& spr, const DVector2& bpos, const
void DrawAutomapAlignmentFloor(const spritetype& spr, const DVector2& bpos, const DVector2& cangvect, const double czoom, const DVector2& xydim, const PalEntry& col)
{
auto xrep = spr.xrepeat * REPEAT_SCALE;
auto xrep = spr.ScaleX();
auto yrep = spr.ScaleY();
auto xspan = tileWidth(spr.picnum);
auto yspan = tileHeight(spr.picnum);

View file

@ -227,7 +227,7 @@ void GetWallSpritePosition(const spritetypebase* spr, const DVector2& pos, DVect
xoffset = tex->GetDisplayLeftOffset() + spr->xoffset;
}
auto p = spr->angle.ToVector().Rotated90CW() * spr->xrepeat * REPEAT_SCALE;
auto p = spr->angle.ToVector().Rotated90CW() * spr->ScaleX();
if (spr->cstat & CSTAT_SPRITE_XFLIP) xoffset = -xoffset;
double origin = (width * 0.5) + xoffset;
@ -249,7 +249,7 @@ void TGetFlatSpritePosition(const spritetypebase* spr, const DVector2& pos, DVec
double width, height, leftofs, topofs;
double sloperatio = sqrt(heinum * heinum + SLOPEVAL_FACTOR * SLOPEVAL_FACTOR) * (1. / SLOPEVAL_FACTOR);
double xrepeat = spr->xrepeat * REPEAT_SCALE;
double xrepeat = spr->ScaleX();
double yrepeat = spr->ScaleY();
int xo = heinum ? 0 : spr->xoffset;
@ -572,7 +572,8 @@ double intersectSprite(DCoreActor* actor, const DVector3& start, const DVector3&
double factor = NearestPointOnLineFast(actor->spr.pos.X, actor->spr.pos.Y, start.X, start.Y, end.X, end.Y);
if (factor < 0 || factor > maxfactor) return -1;
auto sprwidth = tileWidth(actor->spr.picnum) * actor->spr.xrepeat * (REPEAT_SCALE * 0.5);
auto sprwidth = tileWidth(actor->spr.picnum) * actor->spr.ScaleX() * 0.5;
auto point = start + direction * factor;
// Using proper distance here, Build originally used the sum of x- and y-distance

View file

@ -480,6 +480,11 @@ struct spritetypebase
yrepeat = uint8_t(y * (1 / REPEAT_SCALE));
}
double ScaleX() const
{
return xrepeat * REPEAT_SCALE;
}
double ScaleY() const
{
return yrepeat * REPEAT_SCALE;

View file

@ -2573,7 +2573,7 @@ static void ConcussSprite(DBloodActor* source, DBloodActor* actor, const DVector
if (mass > 0)
{
double size = (tileWidth(actor->spr.picnum) * actor->spr.xrepeat * REPEAT_SCALE * tileHeight(actor->spr.picnum) * actor->spr.ScaleY()) / 0x20000;
double size = (tileWidth(actor->spr.picnum) * actor->spr.ScaleX() * tileHeight(actor->spr.picnum) * actor->spr.ScaleY()) / 0x20000;
actor->vel += vect * Scale(damage, size, mass);
}
}

View file

@ -921,7 +921,7 @@ void aiSetTarget(DBloodActor* actor, DBloodActor* target)
{
actor->SetTarget(target);
DUDEINFO* pDudeInfo = getDudeInfo(target->spr.type);
double eyeHeight = (pDudeInfo->eyeHeight * target->spr.yrepeat) * REPEAT_SCALE;
double eyeHeight = (pDudeInfo->eyeHeight * target->spr.ScaleY());
actor->xspr.TargetPos = target->spr.pos.plusZ(-eyeHeight);
}
}

View file

@ -167,7 +167,7 @@ static void batThinkPonder(DBloodActor* actor)
{
DAngle nDeltaAngle = absangle(actor->spr.angle, dvec.Angle());
double height = (pDudeInfo->eyeHeight * actor->spr.ScaleY());
double height2 = (getDudeInfo(pTarget->spr.type)->eyeHeight * pTarget->spr.yrepeat) * REPEAT_SCALE;
double height2 = (getDudeInfo(pTarget->spr.type)->eyeHeight * pTarget->spr.ScaleY());
double top, bottom;
GetActorExtents(actor, &top, &bottom);
if (cansee(pTarget->spr.pos, pTarget->sector(), actor->spr.pos.plusZ(-height), actor->sector()))

View file

@ -182,7 +182,7 @@ static void eelThinkPonder(DBloodActor* actor)
{
DAngle nDeltaAngle = absangle(actor->spr.angle, nAngle);
double height = (pDudeInfo->eyeHeight * actor->spr.ScaleY());
double height2 = (getDudeInfo(target->spr.type)->eyeHeight * target->spr.yrepeat) * REPEAT_SCALE;
double height2 = (getDudeInfo(target->spr.type)->eyeHeight * target->spr.ScaleY());
double top, bottom;
GetActorExtents(actor, &top, &bottom);
if (cansee(target->spr.pos, target->sector(), actor->spr.pos.plusZ(-height), actor->sector()))

View file

@ -181,7 +181,7 @@ void cerberusBurnSeqCallback2(int, DBloodActor* actor)
if (nDeltaAngle <= DAngle45)
{
DUDEINFO* pDudeInfo2 = getDudeInfo(actor2->spr.type);
double height1 = (pDudeInfo2->aimHeight * actor2->spr.yrepeat) * REPEAT_SCALE;
double height1 = (pDudeInfo2->aimHeight * actor2->spr.ScaleY());
double tz1 = actor2->spr.pos.Z - height - actor->spr.pos.Z;
if (cansee(pos, actor->sector(), pos2, actor2->sector()))

View file

@ -104,7 +104,7 @@ void BlastSSeqCallback(int, DBloodActor* actor)
wrand(); // ???
if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget();
double height = (actor->spr.yrepeat * getDudeInfo(actor->spr.type)->eyeHeight) * REPEAT_SCALE;
double height = (actor->spr.ScaleY() * getDudeInfo(actor->spr.type)->eyeHeight);
DVector3 pos(actor->spr.pos.XY(), height);
DVector3 Aim(actor->spr.angle.ToVector(), actor->dudeSlope);

View file

@ -91,7 +91,7 @@ void ghostBlastSeqCallback(int, DBloodActor* actor)
wrand(); // ???
if (!actor->ValidateTarget(__FUNCTION__)) return;
auto target = actor->GetTarget();
double height = (actor->spr.yrepeat * getDudeInfo(actor->spr.type)->eyeHeight) * REPEAT_SCALE;
double height = (actor->spr.ScaleY() * getDudeInfo(actor->spr.type)->eyeHeight);
DVector3 pos(actor->spr.pos.XY(), height);
DVector3 Aim(actor->spr.angle.ToVector(), actor->dudeSlope);

View file

@ -61,7 +61,7 @@ void sub_71A90(int, DBloodActor* actor)
void tchernobogBurnSeqCallback(int, DBloodActor* actor)
{
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
double height = actor->spr.yrepeat * pDudeInfo->eyeHeight * REPEAT_SCALE * 0.25;
double height = actor->spr.ScaleY() * pDudeInfo->eyeHeight * 0.25;
if (!actor->ValidateTarget(__FUNCTION__)) return;
DVector3 pos(actor->spr.pos.XY(), height);
@ -120,7 +120,7 @@ void tchernobogBurnSeqCallback2(int, DBloodActor* actor)
if (!actor->ValidateTarget(__FUNCTION__)) return;
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
double height = actor->spr.yrepeat * pDudeInfo->eyeHeight * REPEAT_SCALE * 0.25;
double height = actor->spr.ScaleY() * pDudeInfo->eyeHeight * 0.25;
DVector3 pos(actor->spr.pos.XY(), height);
DVector3 Aim(actor->spr.angle.ToVector(), -actor->dudeSlope);

View file

@ -1797,7 +1797,7 @@ void dudeLeechOperate(DBloodActor* actor, const EVENT& event)
actor->spr.angle = (atpos - actor->spr.pos.XY()).Angle();
DVector3 dv;
dv.XY() = actor->spr.angle.ToVector() * 64;
double tz = actTarget->spr.pos.Z - (actTarget->spr.yrepeat * pDudeInfo->aimHeight) * REPEAT_SCALE;
double tz = actTarget->spr.pos.Z - (actTarget->spr.ScaleY() * pDudeInfo->aimHeight);
double dz = (tz - top - 1) / nDist * 4;
int nMissileType = kMissileLifeLeechAltNormal + (actor->xspr.data3 ? 1 : 0);
int t2;

View file

@ -43,7 +43,7 @@ void fxFlameLick(DBloodActor* actor, sectortype*) // 0
GetActorExtents(actor, &top, &bottom);
for (int i = 0; i < 3; i++)
{
double nDist = (actor->spr.xrepeat * tileWidth(actor->spr.picnum)) * (REPEAT_SCALE / 4);
double nDist = (actor->spr.ScaleX() * tileWidth(actor->spr.picnum)) * (1. / 4);
DAngle nAngle = RandomAngle();
DVector2 dv = nAngle.ToVector() * nDist;
DVector2 pos = actor->spr.pos.XY() + dv;
@ -223,7 +223,7 @@ void fxDynPuff(DBloodActor* actor, sectortype*) // 8
if (!actor) return;
if (actor->vel.Z)
{
double nDist = (actor->spr.xrepeat * tileWidth(actor->spr.picnum)) * (REPEAT_SCALE / 2);
double nDist = (actor->spr.ScaleX() * tileWidth(actor->spr.picnum)) * (1. / 2);
DVector3 pos = actor->spr.pos + (actor->spr.angle - DAngle90).ToVector() * nDist;
auto pFX = gFX.fxSpawnActor(FX_7, actor->sector(), pos);
if (pFX)
@ -342,7 +342,7 @@ void PlayerBubble(DBloodActor* actor, sectortype*) // 10
GetActorExtents(actor, &top, &bottom);
for (int i = 0; i < (pPlayer->bubbleTime >> 6); i++)
{
double nDist = (actor->spr.xrepeat * tileWidth(actor->spr.picnum)) * (REPEAT_SCALE / 2);
double nDist = (actor->spr.ScaleX() * tileWidth(actor->spr.picnum)) * (1. / 2);
DVector2 pos = actor->spr.pos.XY() + actor->spr.angle.ToVector() * nDist;
double z = bottom - RandomD(bottom - top, 8);
auto pFX = gFX.fxSpawnActor((FX_ID)(FX_23 + Random(3)), actor->sector(), DVector3(pos, z));
@ -371,7 +371,7 @@ void EnemyBubble(DBloodActor* actor, sectortype*) // 11
for (int i = 0; i < int(abs(actor->vel.Z) * 0.25); i++)
{
auto nAngle = RandomAngle();
double nDist = (actor->spr.xrepeat * tileWidth(actor->spr.picnum)) * (REPEAT_SCALE / 2);
double nDist = (actor->spr.ScaleX() * tileWidth(actor->spr.picnum)) * (1. / 2);
DVector2 pos = actor->spr.pos.XY() + nAngle.ToVector() * nDist;
double z = bottom - RandomD(bottom - top, 8);

View file

@ -276,14 +276,14 @@ int VectorScan(DBloodActor* actor, double nOffset, double nZOffset, const DVecto
if (tileWidth(nPicnum) == 0 || tileHeight(nPicnum) == 0)
return SS_SPRITE;
double height = (tileHeight(nPicnum) * other->spr.yrepeat) * REPEAT_SCALE;
double height = (tileHeight(nPicnum) * other->spr.ScaleY());
double otherZ = other->spr.pos.Z;
if (other->spr.cstat & CSTAT_SPRITE_YCENTER)
otherZ += height / 2;
int nTopOfs = tileTopOffset(nPicnum);
if (nTopOfs)
otherZ -= (nTopOfs * other->spr.yrepeat) * REPEAT_SCALE;
otherZ -= (nTopOfs * other->spr.ScaleY());
assert(height > 0);
double height2 = (otherZ - gHitInfo.hitpos.Z) * tileHeight(nPicnum) / height;
@ -292,7 +292,7 @@ int VectorScan(DBloodActor* actor, double nOffset, double nZOffset, const DVecto
if (height2 >= 0 && height2 < tileHeight(nPicnum))
{
double width = (tileWidth(nPicnum) * other->spr.xrepeat) * REPEAT_SCALE * 0.75; // should actually be 0.8 to match the renderer!
double width = (tileWidth(nPicnum) * other->spr.ScaleX()) * 0.75; // should actually be 0.8 to match the renderer!
double check1 = ((pos.Y - other->spr.pos.Y) * vel.X - (pos.X - other->spr.pos.X) * vel.Y) / vel.XY().Length();
assert(width > 0);

View file

@ -1605,7 +1605,7 @@ void debrisBubble(DBloodActor* actor)
GetActorExtents(actor, &top, &bottom);
for (unsigned int i = 0; i < 1 + Random(5); i++) {
double nDist = actor->spr.xrepeat * tileWidth(actor->spr.picnum) * (REPEAT_SCALE * 0.5); // original code ended with * 8 which is 1/2 map unit.
double nDist = actor->spr.ScaleX() * tileWidth(actor->spr.picnum) * 0.5; // original code ended with * 8 which is 1/2 map unit.
DAngle nAngle = RandomAngle();
DVector3 pos;
pos.XY() = actor->spr.pos.XY() + nAngle.ToVector() * nDist;
@ -4436,7 +4436,7 @@ bool condCheckDude(DBloodActor* aCond, int cmpOp, bool PUSH)
condError(aCond, "Dude #%d has no target!", objActor->GetIndex());
DUDEINFO* pInfo = getDudeInfo(objActor->spr.type);
double height = (pInfo->eyeHeight * objActor->spr.yrepeat) * REPEAT_SCALE;
double height = (pInfo->eyeHeight * objActor->spr.ScaleY());
auto delta = targ->spr.pos.XY() - objActor->spr.pos.XY();
@ -5154,7 +5154,7 @@ bool aiFightDudeCanSeeTarget(DBloodActor* dudeactor, DUDEINFO* pDudeInfo, DBlood
// check target
if (dv.Length() < pDudeInfo->SeeDist())
{
double height = (pDudeInfo->eyeHeight * dudeactor->spr.yrepeat) * REPEAT_SCALE;
double height = (pDudeInfo->eyeHeight * dudeactor->spr.ScaleY());
// is there a line of sight to the target?
if (cansee(dudeactor->spr.pos, dudeactor->sector(), targetactor->spr.pos.plusZ(-height), targetactor->sector()))
@ -8234,7 +8234,7 @@ void aiPatrolAlarmLite(DBloodActor* actor, DBloodActor* targetactor)
if (dudeactor->xspr.health <= 0)
continue;
double eaz2 = (getDudeInfo(targetactor->spr.type)->eyeHeight * targetactor->spr.yrepeat) * REPEAT_SCALE;
double eaz2 = (getDudeInfo(targetactor->spr.type)->eyeHeight * targetactor->spr.ScaleY());
double nDist = (dudeactor->spr.pos.XY() - actor->spr.pos.XY()).LengthSquared();
if (nDist >= kPatrolAlarmSeeDistSq || !cansee(DVector3(actor->spr.pos, zt1), actor->sector(), dudeactor->spr.pos.plusZ(-eaz2), dudeactor->sector()))
{
@ -8266,7 +8266,7 @@ void aiPatrolAlarmFull(DBloodActor* actor, DBloodActor* targetactor, bool chain)
if (actor->xspr.health <= 0)
return;
double eaz2 = (getDudeInfo(actor->spr.type)->eyeHeight * actor->spr.yrepeat) * REPEAT_SCALE;
double eaz2 = (getDudeInfo(actor->spr.type)->eyeHeight * actor->spr.ScaleY());
auto pos2 = actor->spr.pos.plusZ(-eaz2);
auto pSect2 = actor->sector();
@ -8286,7 +8286,7 @@ void aiPatrolAlarmFull(DBloodActor* actor, DBloodActor* targetactor, bool chain)
if (dudeactor->xspr.health <= 0)
continue;
double eaz1 = (getDudeInfo(dudeactor->spr.type)->eyeHeight * dudeactor->spr.yrepeat) * REPEAT_SCALE;
double eaz1 = (getDudeInfo(dudeactor->spr.type)->eyeHeight * dudeactor->spr.ScaleY());
auto pos1 = dudeactor->spr.pos.plusZ(-eaz1);
auto pSect1 = dudeactor->sector();

View file

@ -273,7 +273,7 @@ void LifeLeechOperate(DBloodActor* actor, EVENT event)
pos.XY() += target->vel.XY() * nDist * (65536. / 0x1aaaaa);
auto angBak = actor->spr.angle;
actor->spr.angle = (pos.XY() - actor->spr.pos.XY()).Angle();
double tz = target->spr.pos.Z - (target->spr.yrepeat * pDudeInfo->aimHeight) * REPEAT_SCALE;
double tz = target->spr.pos.Z - (target->spr.ScaleY() * pDudeInfo->aimHeight);
auto dvec = DVector3(actor->spr.angle.ToVector(), ((tz - top - 1) / nDist) * (1. / 16.));
int nMissileType = kMissileLifeLeechAltNormal + (actor->xspr.data3 ? 1 : 0);
if (auto missile = actFireMissile(actor, 0, (top - actor->spr.pos.Z) - 1, dvec, nMissileType))

View file

@ -494,7 +494,7 @@ void UpdateAimVector(PLAYER* pPlayer)
DUDEINFO* pDudeInfo = getDudeInfo(actor->spr.type);
if (cansee(pos, plActor->sector(), pos2, actor->sector()))
{
double center = (actor->spr.yrepeat * pDudeInfo->aimHeight) * REPEAT_SCALE;
double center = (actor->spr.ScaleY() * pDudeInfo->aimHeight);
double dzCenter = (pos2.Z - center) - pos.Z;
nClosest = nDist2;

View file

@ -450,7 +450,7 @@ int movesprite_ex_d(DDukeActor* actor, const DVector3& change, unsigned int clip
auto dasectp = actor->sector();
auto ppos = actor->spr.pos;
ppos.Z -= (tileHeight(actor->spr.picnum) * actor->spr.yrepeat) * REPEAT_SCALE * 0.5;
ppos.Z -= (tileHeight(actor->spr.picnum) * actor->spr.ScaleY()) * 0.5;
if (bg)
{

View file

@ -378,7 +378,7 @@ int movesprite_ex_r(DDukeActor* actor, const DVector3& change, unsigned int clip
auto dasectp = actor->sector();
auto ppos = actor->spr.pos;
ppos.Z -= (tileHeight(actor->spr.picnum) * actor->spr.yrepeat) * REPEAT_SCALE * 0.5;
ppos.Z -= (tileHeight(actor->spr.picnum) * actor->spr.ScaleY()) * 0.5;
if (bg)
{

View file

@ -391,7 +391,7 @@ void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
{
double v = h->spr.pos.Z - ps[p].GetActor()->floorz + 3;
if (v > 4 && h->spr.yrepeat > 32 && h->spr.extra > 0)
h->spr.yoffset = (int8_t)(v * (1/REPEAT_SCALE) / h->spr.yrepeat);
h->spr.yoffset = (int8_t)(v / h->spr.ScaleY());
else h->spr.yoffset = 0;
}

View file

@ -432,7 +432,7 @@ void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle vi
{
double v = h->spr.pos.Z - ps[p].GetActor()->floorz + 3;
if (v > 4 && h->spr.yrepeat > 32 && h->spr.extra > 0)
h->spr.yoffset = (int8_t)(v * (1 / REPEAT_SCALE) / h->spr.yrepeat);
h->spr.yoffset = (int8_t)(v / h->spr.ScaleY());
else h->spr.yoffset = 0;
}

View file

@ -339,7 +339,7 @@ static void shootweapon(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int
if (aimed)
{
double dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) * REPEAT_SCALE * 0.5) + 5;
double dal = ((aimed->spr.ScaleX() * tileHeight(aimed->spr.picnum)) * 0.5) + 5;
switch (aimed->spr.picnum)
{
case GREENSLIME:
@ -597,7 +597,7 @@ static void shootstuff(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int a
if (aimed)
{
double dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) * REPEAT_SCALE * 0.5) - 12;
double dal = ((aimed->spr.ScaleX() * tileHeight(aimed->spr.picnum)) * 0.5) - 12;
double dist = (ps[p].GetActor()->spr.pos.XY() - aimed->spr.pos.XY()).Length();
zvel = ((aimed->spr.pos.Z - pos.Z - dal) * vel) / dist;
@ -708,7 +708,7 @@ static void shootrpg(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int atw
aimed = aim(actor, AUTO_AIM_ANGLE);
if (aimed)
{
double dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) * REPEAT_SCALE * 0.5) + 8;
double dal = ((aimed->spr.ScaleX() * tileHeight(aimed->spr.picnum)) * 0.5) + 8;
double dist = (ps[p].GetActor()->spr.pos.XY() - aimed->spr.pos.XY()).Length();
zvel = ((aimed->spr.pos.Z - pos.Z - dal) * vel) / dist;
if (aimed->spr.picnum != RECON)
@ -934,7 +934,7 @@ static void shootgrowspark(DDukeActor* actor, int p, DVector3 pos, DAngle ang)
auto aimed = aim(actor, AUTO_AIM_ANGLE);
if (aimed)
{
double dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) * REPEAT_SCALE * 0.5) + 5;
double dal = ((aimed->spr.ScaleX() * tileHeight(aimed->spr.picnum)) * 0.5) + 5;
switch (aimed->spr.picnum)
{
case GREENSLIME:
@ -1043,7 +1043,7 @@ static void shootshrinker(DDukeActor* actor, int p, const DVector3& pos, DAngle
auto aimed = isNamWW2GI() ? nullptr : aim(actor, AUTO_AIM_ANGLE);
if (aimed)
{
double dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) * REPEAT_SCALE * 0.5);
double dal = ((aimed->spr.ScaleX() * tileHeight(aimed->spr.picnum)) * 0.5);
double dist = (ps[p].GetActor()->spr.pos.XY() - aimed->spr.pos.XY()).Length();
zvel = ((aimed->spr.pos.Z - pos.Z - dal - 4) * 48) / dist;
ang = (aimed->spr.pos.XY() - pos.XY()).Angle();
@ -1113,7 +1113,7 @@ void shoot_d(DDukeActor* actor, int atwith)
else
{
sang = actor->spr.angle;
spos = actor->spr.pos.plusZ(-(actor->spr.yrepeat * tileHeight(actor->spr.picnum) * REPEAT_SCALE * 0.5) + 4);
spos = actor->spr.pos.plusZ(-(actor->spr.ScaleY() * tileHeight(actor->spr.picnum) * 0.5) + 4);
if (actor->spr.picnum != ROTATEGUN)
{

View file

@ -213,7 +213,7 @@ static void shootweapon(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int
auto aimed = aim(actor, AUTO_AIM_ANGLE);
if (aimed)
{
double dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) * REPEAT_SCALE * 0.5) + 5;
double dal = ((aimed->spr.ScaleX() * tileHeight(aimed->spr.picnum)) * 0.5) + 5;
double dist = (ps[p].GetActor()->spr.pos.XY() - aimed->spr.pos.XY()).Length();
zvel = ((aimed->spr.pos.Z - pos.Z - dal) * 16) / dist;
ang = (aimed->spr.pos - pos).Angle();
@ -504,7 +504,7 @@ static void shootstuff(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int a
if (aimed)
{
double dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) * REPEAT_SCALE * 0.5) - 12;
double dal = ((aimed->spr.ScaleX() * tileHeight(aimed->spr.picnum)) * 0.5) - 12;
double dist = (ps[p].GetActor()->spr.pos.XY() - aimed->spr.pos.XY()).Length();
zvel = ((aimed->spr.pos.Z - pos.Z - dal) * vel) / dist;
@ -621,7 +621,7 @@ static void shootrpg(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int atw
else
act90 = aimed;
}
double dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) * REPEAT_SCALE * 0.5) + 8;
double dal = ((aimed->spr.ScaleX() * tileHeight(aimed->spr.picnum)) * 0.5) + 8;
double dist = (ps[p].GetActor()->spr.pos.XY() - aimed->spr.pos.XY()).Length();
zvel = ((aimed->spr.pos.Z - pos.Z - dal) * vel) / dist;
if (aimed->spr.picnum != RECON)
@ -775,7 +775,7 @@ static void shootwhip(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int at
if (aimed)
{
double dal = ((aimed->spr.xrepeat * tileHeight(aimed->spr.picnum)) * REPEAT_SCALE * 0.5) -12;
double dal = ((aimed->spr.ScaleX() * tileHeight(aimed->spr.picnum)) * 0.5) -12;
double dist = (ps[p].GetActor()->spr.pos.XY() - aimed->spr.pos.XY()).Length();
zvel = ((aimed->spr.pos.Z - pos.Z - dal) * vel) / dist;
ang = (aimed->spr.pos.XY() - pos.XY()).Angle();
@ -872,7 +872,7 @@ void shoot_r(DDukeActor* actor, int atwith)
{
p = -1;
sang = actor->spr.angle;
spos = actor->spr.pos.plusZ(-(actor->spr.yrepeat * tileHeight(actor->spr.picnum) * REPEAT_SCALE * 0.5) - 3);
spos = actor->spr.pos.plusZ(-(actor->spr.ScaleY() * tileHeight(actor->spr.picnum) * 0.5) - 3);
if (badguy(actor))
{

View file

@ -105,7 +105,7 @@ static void analyzesprites(tspriteArray& tsprites, const DVector3& view, double
if ((pTSprite->picnum == kTorch1 || pTSprite->picnum == kTorch2) && (pTSprite->cstat & CSTAT_SPRITE_YCENTER) == 0)
{
pTSprite->cstat |= CSTAT_SPRITE_YCENTER;
double nTileY = (tileHeight(pTSprite->picnum) * pTSprite->yrepeat) * REPEAT_SCALE * 0.5;
double nTileY = (tileHeight(pTSprite->picnum) * pTSprite->ScaleY()) * 0.5;
pTSprite->pos.Z -= nTileY;
}

View file

@ -204,7 +204,7 @@ int StdRandomRange(int range);
inline double GetSpriteSizeZ(const spritetypebase* sp)
{
return (tileHeight(sp->picnum) * sp->yrepeat) * REPEAT_SCALE;
return (tileHeight(sp->picnum) * sp->ScaleY());
}
@ -1989,7 +1989,7 @@ inline DVector3 ActorVectOfMiddle(DSWActor* actor)
inline double ActorSizeZ(DSWActor* actor)
{
return (tileHeight(actor->spr.picnum) * actor->spr.yrepeat) * REPEAT_SCALE;
return (tileHeight(actor->spr.picnum) * actor->spr.ScaleY());
}
inline double ActorUpperZ(DSWActor* actor)