mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 12:11:25 +00:00
- make roll and flat sprites square
This commit is contained in:
parent
bcad040fd3
commit
7ef6fa97a7
1 changed files with 15 additions and 5 deletions
|
@ -355,11 +355,7 @@ void HandleSpriteOffsets(Matrix3x4 *mat, const FRotator *HW, FVector2 *offset, b
|
|||
|
||||
bool HWSprite::CalculateVertices(HWDrawInfo* di, FVector3* v, DVector3* vp)
|
||||
{
|
||||
float pixelstretch = 1.2;
|
||||
if (actor && actor->Level)
|
||||
pixelstretch = actor->Level->pixelstretch;
|
||||
else if (particle && particle->subsector && particle->subsector->sector && particle->subsector->sector->Level)
|
||||
pixelstretch = particle->subsector->sector->Level->pixelstretch;
|
||||
float pixelstretch = di->Level->pixelstretch;
|
||||
|
||||
FVector3 center = FVector3((x1 + x2) * 0.5, (y1 + y2) * 0.5, (z1 + z2) * 0.5);
|
||||
const auto& HWAngles = di->Viewpoint.HWAngles;
|
||||
|
@ -1005,6 +1001,13 @@ void HWSprite::Process(HWDrawInfo *di, AActor* thing, sector_t * sector, area_t
|
|||
|
||||
r.Scale(sprscale.X, isSpriteShadow ? sprscale.Y * 0.15 : sprscale.Y);
|
||||
|
||||
if (thing->renderflags & (RF_ROLLSPRITE|RF_FLATSPRITE))
|
||||
{
|
||||
double ps = di->Level->pixelstretch;
|
||||
double mult = 2 * ps / (ps * ps + 1); // shrink slightly
|
||||
r.Scale(mult * ps, mult);
|
||||
}
|
||||
|
||||
float rightfac = -r.left;
|
||||
float leftfac = rightfac - r.width;
|
||||
z1 = z - r.top;
|
||||
|
@ -1521,6 +1524,13 @@ void HWSprite::AdjustVisualThinker(HWDrawInfo* di, DVisualThinker* spr, sector_t
|
|||
auto r = spi.GetSpriteRect();
|
||||
r.Scale(spr->Scale.X, spr->Scale.Y);
|
||||
|
||||
if (spr->PT.flags & SPF_ROLL)
|
||||
{
|
||||
double ps = di->Level->pixelstretch;
|
||||
double mult = 2 * ps / (ps * ps + 1); // shrink slightly
|
||||
r.Scale(mult * ps, mult);
|
||||
}
|
||||
|
||||
if (spr->bXFlip)
|
||||
{
|
||||
std::swap(ul,ur);
|
||||
|
|
Loading…
Reference in a new issue