From 9859571ded6f91b6d2bd09fe917e8c1f39ccc92a Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Tue, 22 Sep 2020 07:29:52 +1000 Subject: [PATCH] - DrawCrosshair(): Factor in Blood's adjustable horizon which defaults to 90. * Fixes https://forum.zdoom.org/viewtopic.php?f=340&t=69920. --- source/blood/src/hudsprites.cpp | 2 +- source/core/gamecontrol.cpp | 4 ++-- source/core/gamecontrol.h | 2 +- source/exhumed/src/status.cpp | 2 +- source/games/duke/src/game_misc.cpp | 2 +- source/sw/src/draw.cpp | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/blood/src/hudsprites.cpp b/source/blood/src/hudsprites.cpp index 130c2f1a4..384b2b7f0 100644 --- a/source/blood/src/hudsprites.cpp +++ b/source/blood/src/hudsprites.cpp @@ -100,7 +100,7 @@ void hudDraw(PLAYER *gView, int nSectnum, int defaultHoriz, double bobx, double { 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 cY = 220; diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index e2a242c37..b0f9aba90 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -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; if (automapMode == am_off && cl_crosshair) @@ -1405,7 +1405,7 @@ void DrawCrosshair(int deftile, int health, double xdelta, double scale, PalEntr if (tile) { 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_ViewportX, windowxy1.x, DTA_ViewportY, windowxy1.y, DTA_ViewportWidth, windowxy2.x - windowxy1.x + 1, DTA_ViewportHeight, windowxy2.y - windowxy1.y + 1, TAG_DONE); diff --git a/source/core/gamecontrol.h b/source/core/gamecontrol.h index 244e077ce..9632dd40e 100644 --- a/source/core/gamecontrol.h +++ b/source/core/gamecontrol.h @@ -57,7 +57,7 @@ void CONFIG_ReadCombatMacros(); int GameMain(); 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 DeferedStartGame(MapRecord* map, int skill); void ChangeLevel(MapRecord* map, int skill); diff --git a/source/exhumed/src/status.cpp b/source/exhumed/src/status.cpp index 930b0c86b..7bed57d37 100644 --- a/source/exhumed/src/status.cpp +++ b/source/exhumed/src/status.cpp @@ -1002,7 +1002,7 @@ void DrawStatusBar() } DExhumedStatusBar sbar; sbar.Draw(); - DrawCrosshair(MAXTILES, PlayerList[nLocalPlayer].nHealth >> 3, 0, 1); + DrawCrosshair(MAXTILES, PlayerList[nLocalPlayer].nHealth >> 3, 0, 0, 1); } diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index 229bc2a43..999a09524 100644 --- a/source/games/duke/src/game_misc.cpp +++ b/source/games/duke/src/game_misc.cpp @@ -300,7 +300,7 @@ void drawoverlays(double smoothratio) 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) diff --git a/source/sw/src/draw.cpp b/source/sw/src/draw.cpp index 06bb98c05..43e68c6aa 100644 --- a/source/sw/src/draw.cpp +++ b/source/sw/src/draw.cpp @@ -1262,7 +1262,7 @@ void DrawCrosshair(PLAYERp pp) if (!(CameraTestMode) && !TEST(pp->Flags, PF_VIEW_FROM_OUTSIDE)) { USERp u = User[pp->PlayerSprite]; - ::DrawCrosshair(2326, u->Health, 0, 2, shadeToLight(10)); + ::DrawCrosshair(2326, u->Health, 0, 0, 2, shadeToLight(10)); } }