@@ -355,6 +355,12 @@ void HandleSpriteOffsets(Matrix3x4 *mat, const FRotator *HW, FVector2 *offset, b
355
355
356
356
bool HWSprite::CalculateVertices (HWDrawInfo* di, FVector3* v, DVector3* vp)
357
357
{
358
+ float pixelstretch = 1.2 ;
359
+ if (actor && actor->Level )
360
+ pixelstretch = actor->Level ->pixelstretch ;
361
+ else if (particle && particle->subsector && particle->subsector ->sector && particle->subsector ->sector ->Level )
362
+ pixelstretch = particle->subsector ->sector ->Level ->pixelstretch ;
363
+
358
364
FVector3 center = FVector3 ((x1 + x2) * 0.5 , (y1 + y2) * 0.5 , (z1 + z2) * 0.5 );
359
365
const auto & HWAngles = di->Viewpoint .HWAngles ;
360
366
Matrix3x4 mat;
@@ -421,12 +427,6 @@ bool HWSprite::CalculateVertices(HWDrawInfo* di, FVector3* v, DVector3* vp)
421
427
// [Nash] check for special sprite drawing modes
422
428
if (drawWithXYBillboard || isWallSprite)
423
429
{
424
- float pixelstretch = 1.2 ;
425
- if (actor && actor->Level )
426
- pixelstretch = actor->Level ->pixelstretch ;
427
- else if (particle && particle->subsector && particle->subsector ->sector && particle->subsector ->sector ->Level )
428
- pixelstretch = particle->subsector ->sector ->Level ->pixelstretch ;
429
-
430
430
mat.MakeIdentity ();
431
431
mat.Translate (center.X , center.Z , center.Y ); // move to sprite center
432
432
mat.Scale (1.0 , 1.0 /pixelstretch, 1.0 ); // unstretch sprite by level aspect ratio
@@ -509,9 +509,11 @@ bool HWSprite::CalculateVertices(HWDrawInfo* di, FVector3* v, DVector3* vp)
509
509
float rollDegrees = Angles.Roll .Degrees ();
510
510
511
511
mat.Translate (center.X , center.Z , center.Y );
512
+ mat.Scale (1.0 , 1.0 /pixelstretch, 1.0 ); // unstretch sprite by level aspect ratio
512
513
if (useOffsets) mat.Translate (xx, zz, yy);
513
514
mat.Rotate (cos (angleRad), 0 , sin (angleRad), rollDegrees);
514
515
if (useOffsets) mat.Translate (-xx, -zz, -yy);
516
+ mat.Scale (1.0 , pixelstretch, 1.0 ); // stretch sprite by level aspect ratio
515
517
mat.Translate (-center.X , -center.Z , -center.Y );
516
518
}
517
519
0 commit comments