- Allow passing angle through when drawing the generic crosshair.

This commit is contained in:
Mitchell Richters 2022-12-01 10:26:43 +11:00 committed by Christoph Oelckers
parent e972818db5
commit 318ff64f36
3 changed files with 6 additions and 5 deletions

View file

@ -124,7 +124,7 @@ void ST_UnloadCrosshair()
//
//---------------------------------------------------------------------------
void ST_DrawCrosshair(int phealth, double xpos, double ypos, double scale)
void ST_DrawCrosshair(int phealth, double xpos, double ypos, double scale, DAngle angle)
{
uint32_t color;
double size;
@ -207,6 +207,7 @@ void ST_DrawCrosshair(int phealth, double xpos, double ypos, double scale)
xpos, ypos,
DTA_DestWidth, w,
DTA_DestHeight, h,
DTA_Rotate, angle.Degrees(),
DTA_AlphaChannel, true,
DTA_FillColor, color & 0xFFFFFF,
TAG_DONE);

View file

@ -10,7 +10,7 @@ class FFont;
extern FGameTexture* CrosshairImage;
void ST_LoadCrosshair(int num, bool alwaysload);
void ST_UnloadCrosshair();
void ST_DrawCrosshair(int phealth, double xpos, double ypos, double scale);
void ST_DrawCrosshair(int phealth, double xpos, double ypos, double scale, DAngle angle = nullAngle);
enum DI_Flags

View file

@ -1387,7 +1387,7 @@ void GameInterface::FreeLevelData()
//
//---------------------------------------------------------------------------
void ST_DrawCrosshair(int phealth, double xpos, double ypos, double scale);
void ST_DrawCrosshair(int phealth, double xpos, double ypos, double scale, DAngle angle);
//void DrawGenericCrosshair(int num, int phealth, double xdelta);
void ST_LoadCrosshair(int num, bool alwaysload);
CVAR(Int, crosshair, 0, CVAR_ARCHIVE)
@ -1414,8 +1414,8 @@ void DrawCrosshair(int deftile, int health, double xdelta, double ydelta, double
ST_LoadCrosshair(crosshair == 0 ? 2 : *crosshair, false);
double xpos = viewport3d.Width() * 0.5 + xdelta * viewport3d.Height() / 240.;
double ypos = viewport3d.Height() * 0.5;
ST_DrawCrosshair(health, xpos, ypos, 1);
double ypos = viewport3d.Height() * 0.5 + ydelta * viewport3d.Width() / 320.;
ST_DrawCrosshair(health, xpos, ypos, 1, angle);
}
}
//---------------------------------------------------------------------------