- fixed rendering on narrow screens with an aspect ratio less than 4:3 and removed some parts that are no longer needed.

This commit is contained in:
Christoph Oelckers 2020-08-14 21:01:27 +02:00
parent a5d9886aa9
commit 66cb7f61a4
22 changed files with 166 additions and 193 deletions

View file

@ -533,25 +533,27 @@ void precacheMarkedTiles()
}
}
void hud_drawsprite(double sx, double sy, int z, double a, int picnum, int dashade, int dapalnum, int dastat)
void hud_drawsprite(double sx, double sy, int z, double a, int picnum, int dashade, int dapalnum, int dastat, double alpha)
{
double dz = z / 65536.;
int light = Scale(numshades - clamp(dashade, 0, numshades - 1), 255, numshades);
PalEntry pe(255, light, light, light);
alpha *= (dastat & RS_TRANS1)? glblend[0].def[!!(dastat & RS_TRANS2)].alpha : 1.;
DrawTexture(&twodpsp, tileGetTexture(picnum, true), sx, sy,
DTA_ScaleX, dz, DTA_ScaleY, dz,
DTA_Color, pe,
DTA_Color, shadeToLight(dashade),
DTA_TranslationIndex, TRANSLATION(Translation_Remap + curbasepal, dapalnum),
DTA_ViewportX, windowxy1.x, DTA_ViewportY, windowxy1.y,
DTA_ViewportWidth, windowxy2.x - windowxy1.x + 1, DTA_ViewportHeight, windowxy2.y - windowxy1.y + 1,
DTA_FullscreenScale, (dastat & RS_STRETCH)? 4: 3, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200,
DTA_FullscreenScale, (dastat & RS_STRETCH)? FSMode_ScaleToScreen: FSMode_ScaleToHeight, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200,
DTA_CenterOffsetRel, !(dastat & (RS_TOPLEFT | RS_CENTER)),
DTA_TopLeft, !!(dastat & RS_TOPLEFT),
DTA_CenterOffset, !!(dastat & RS_CENTER),
DTA_FlipX, !!(dastat & RS_YFLIP), // the weapon drawer uses y-flip+180° rotation for x-flip but no other transformation.
DTA_FlipX, !!(dastat & RS_XFLIPHUD),
DTA_FlipY, !!(dastat & RS_YFLIPHUD),
DTA_Pin, (dastat & RS_ALIGN_R) ? 1 : (dastat & RS_ALIGN_L) ? -1 : 0,
DTA_Rotate, a * (-360./2048),
DTA_FlipOffsets, !(dastat & (/*RS_TOPLEFT |*/ RS_CENTER)),
DTA_Alpha, alpha,
TAG_DONE);
}