From 1d03d3d6a2387786596a7126ff8e97bd2461f6a6 Mon Sep 17 00:00:00 2001
From: Christoph Oelckers <coelckers@users.noreply.github.com>
Date: Mon, 10 Aug 2020 23:06:24 +0200
Subject: [PATCH] - fixed HUD meter and crosshair default size.

Fixes #137
---
 source/blood/src/hudsprites.cpp | 2 +-
 source/blood/src/sbar.cpp       | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/source/blood/src/hudsprites.cpp b/source/blood/src/hudsprites.cpp
index fad623326..dd9070d20 100644
--- a/source/blood/src/hudsprites.cpp
+++ b/source/blood/src/hudsprites.cpp
@@ -101,7 +101,7 @@ void hudDraw(PLAYER *gView, int nSectnum, int defaultHoriz, double bobx, double
 	{
 		if (cl_crosshair)
 		{
-			double crosshair_scale = cl_crosshairscale * .01;
+			double crosshair_scale = cl_crosshairscale * .02;
 			DrawTexture(twod, tileGetTexture(kCrosshairTile), 160, defaultHoriz,
 				DTA_FullscreenScale, 3, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200, 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/blood/src/sbar.cpp b/source/blood/src/sbar.cpp
index b8da06427..11d4c5507 100644
--- a/source/blood/src/sbar.cpp
+++ b/source/blood/src/sbar.cpp
@@ -172,7 +172,9 @@ private:
     void TileHGauge(int nTile, double x, double y, int nMult, int nDiv, int nStat = 0, int nScale = 65536)
     {
         int bx = scale(mulscale16(tilesiz[nTile].x, nScale), nMult, nDiv) + x;
-        DrawStatSprite(nTile, x, y, 0, 0, nStat|RS_TOPLEFT, nScale);
+        double scale = double(bx - x) / tileWidth(nTile);
+        double sc = nScale / 65536.;
+        DrawGraphic(tileGetTexture(nTile, true), x, y, DI_ITEM_LEFT_TOP, 1., -1, -1, scale*sc, sc, 0xffffffff, 0, 0);
     }
 
 
@@ -646,6 +648,7 @@ private:
             TileHGauge(2208, 250-320, 191 - 200, pPlayer->armor[2], 3200);
             DrawStatNumber("%3d", pPlayer->armor[2] >> 4, 2230, 255-320, 194 - 200, 0, 0);
         }
+
         DrawPackItemInStatusBar(pPlayer, 286-320, 186 - 200, 302-320, 183 - 200);
 
         for (int i = 0; i < 6; i++)
@@ -718,7 +721,7 @@ private:
 
         BeginStatusBar(320, 200, 28);
         if (pPlayer->throwPower)
-            TileHGauge(2260, 124, 175 - 210, pPlayer->throwPower, 65536);
+            TileHGauge(2260, 124, 175, pPlayer->throwPower, 65536);
         else
             drawInventory(pPlayer, 166, 200-tilesiz[2201].y / 2 - 30);
         PrintLevelStats(pPlayer, 28);