- got rid of the int version of GetOffsetAndHeight.

This commit is contained in:
Christoph Oelckers 2022-10-06 00:35:14 +02:00
parent a6fb831894
commit 9d8df61324
3 changed files with 7 additions and 14 deletions

View file

@ -413,7 +413,8 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
case CSTAT_SPRITE_ALIGNMENT_FACING:
if (p1.X >= clipMin.X && p1.X <= clipMax.X && p1.Y >= clipMin.Y && p1.Y <= clipMax.Y)
{
int32_t height, daz = actor->int_pos().Z + actor->GetOffsetAndHeight(height);
double height_, daz_ = actor->spr.pos.Z + actor->GetOffsetAndHeight(height_);
int height = height_ * zworldtoint, daz = daz_ * zworldtoint;
if (pos->Z > daz-height-flordist && pos->Z < daz+ceildist)
{
@ -430,7 +431,8 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
case CSTAT_SPRITE_ALIGNMENT_WALL:
{
int32_t height, daz = actor->int_pos().Z + actor->GetOffsetAndHeight(height);
double height_, daz_ = actor->spr.pos.Z + actor->GetOffsetAndHeight(height_);
int height = height_ * zworldtoint, daz = daz_ * zworldtoint;
if (pos->Z > daz-height-flordist && pos->Z < daz+ceildist)
{

View file

@ -480,20 +480,12 @@ size_t DCoreActor::PropagateMark()
}
int DCoreActor::GetOffsetAndHeight(int& height)
{
int _yrepeat = spr.yrepeat << 2;
height = tileHeight(spr.picnum) * _yrepeat;
int zofs = (spr.cstat & CSTAT_SPRITE_YCENTER)? height >> 1 : 0;
return zofs - tileTopOffset(spr.picnum) * _yrepeat;
}
double DCoreActor::GetOffsetAndHeight(double& height)
{
double _yrepeat = spr.ScaleY();
height = tileHeight(spr.picnum) * _yrepeat;
double yscale = spr.ScaleY();
height = tileHeight(spr.picnum) * yscale;
double zofs = (spr.cstat & CSTAT_SPRITE_YCENTER) ? height * 0.5 : 0;
return zofs - tileTopOffset(spr.picnum) * _yrepeat;
return zofs - tileTopOffset(spr.picnum) * yscale;
}

View file

@ -60,7 +60,6 @@ public:
virtual void BeginPlay() {}
void OnDestroy() override;
size_t PropagateMark() override;
int GetOffsetAndHeight(int& height);
double GetOffsetAndHeight(double& height);
void initFromSprite(spritetype* pspr)