- DrawCrosshair(): Factor in Blood's adjustable horizon which defaults to 90.

* Fixes https://forum.zdoom.org/viewtopic.php?f=340&t=69920.
This commit is contained in:
Mitchell Richters 2020-09-22 07:29:52 +10:00
parent 0461acfc8b
commit 9859571ded
6 changed files with 7 additions and 7 deletions

View file

@ -100,7 +100,7 @@ void hudDraw(PLAYER *gView, int nSectnum, int defaultHoriz, double bobx, double
{ {
if (gViewPos == 0) if (gViewPos == 0)
{ {
DrawCrosshair(kCrosshairTile, gView->pXSprite->health >> 4, 0, 2); DrawCrosshair(kCrosshairTile, gView->pXSprite->health >> 4, 0, defaultHoriz - 100, 2);
double cX = 160; double cX = 160;
double cY = 220; double cY = 220;

View file

@ -1394,7 +1394,7 @@ void DrawGenericCrosshair(int num, int phealth, double xdelta)
} }
void DrawCrosshair(int deftile, int health, double xdelta, double scale, PalEntry color) void DrawCrosshair(int deftile, int health, double xdelta, double ydelta, double scale, PalEntry color)
{ {
int type = -1; int type = -1;
if (automapMode == am_off && cl_crosshair) if (automapMode == am_off && cl_crosshair)
@ -1405,7 +1405,7 @@ void DrawCrosshair(int deftile, int health, double xdelta, double scale, PalEntr
if (tile) if (tile)
{ {
double crosshair_scale = cl_crosshairscale * .01 * scale; double crosshair_scale = cl_crosshairscale * .01 * scale;
DrawTexture(twod, tile, 160 + xdelta, 100, DTA_Color, color, DrawTexture(twod, tile, 160 + xdelta, 100 + ydelta, DTA_Color, color,
DTA_FullscreenScale, FSMode_Fit320x200, DTA_ScaleX, crosshair_scale, DTA_ScaleY, crosshair_scale, DTA_CenterOffsetRel, true, DTA_FullscreenScale, FSMode_Fit320x200, DTA_ScaleX, crosshair_scale, DTA_ScaleY, crosshair_scale, DTA_CenterOffsetRel, true,
DTA_ViewportX, windowxy1.x, DTA_ViewportY, windowxy1.y, DTA_ViewportWidth, windowxy2.x - windowxy1.x + 1, DTA_ViewportHeight, windowxy2.y - windowxy1.y + 1, TAG_DONE); DTA_ViewportX, windowxy1.x, DTA_ViewportY, windowxy1.y, DTA_ViewportWidth, windowxy2.x - windowxy1.x + 1, DTA_ViewportHeight, windowxy2.y - windowxy1.y + 1, TAG_DONE);

View file

@ -57,7 +57,7 @@ void CONFIG_ReadCombatMacros();
int GameMain(); int GameMain();
int GetAutomapZoom(int gZoom); int GetAutomapZoom(int gZoom);
void DrawCrosshair(int deftile, int health, double xdelta, double scale, PalEntry color = 0xffffffff); void DrawCrosshair(int deftile, int health, double xdelta, double ydelta, double scale, PalEntry color = 0xffffffff);
void updatePauseStatus(); void updatePauseStatus();
void DeferedStartGame(MapRecord* map, int skill); void DeferedStartGame(MapRecord* map, int skill);
void ChangeLevel(MapRecord* map, int skill); void ChangeLevel(MapRecord* map, int skill);

View file

@ -1002,7 +1002,7 @@ void DrawStatusBar()
} }
DExhumedStatusBar sbar; DExhumedStatusBar sbar;
sbar.Draw(); sbar.Draw();
DrawCrosshair(MAXTILES, PlayerList[nLocalPlayer].nHealth >> 3, 0, 1); DrawCrosshair(MAXTILES, PlayerList[nLocalPlayer].nHealth >> 3, 0, 0, 1);
} }

View file

@ -300,7 +300,7 @@ void drawoverlays(double smoothratio)
if (ps[myconnectindex].newowner == -1 && ud.camerasprite == -1) if (ps[myconnectindex].newowner == -1 && ud.camerasprite == -1)
{ {
DrawCrosshair(TILE_CROSSHAIR, ps[screenpeek].last_extra, -getHalfLookAng(screenpeek, cl_syncinput, smoothratio), isRR() ? 0.5 : 1); DrawCrosshair(TILE_CROSSHAIR, ps[screenpeek].last_extra, -getHalfLookAng(screenpeek, cl_syncinput, smoothratio), 0, isRR() ? 0.5 : 1);
} }
if (paused == 2) if (paused == 2)

View file

@ -1262,7 +1262,7 @@ void DrawCrosshair(PLAYERp pp)
if (!(CameraTestMode) && !TEST(pp->Flags, PF_VIEW_FROM_OUTSIDE)) if (!(CameraTestMode) && !TEST(pp->Flags, PF_VIEW_FROM_OUTSIDE))
{ {
USERp u = User[pp->PlayerSprite]; USERp u = User[pp->PlayerSprite];
::DrawCrosshair(2326, u->Health, 0, 2, shadeToLight(10)); ::DrawCrosshair(2326, u->Health, 0, 0, 2, shadeToLight(10));
} }
} }