From 84028f52d82bd2a08c152c89fa3d1557d1b29f82 Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 19 Feb 2025 11:10:27 +0100 Subject: [PATCH] few instances of int float conversions i forgor --- src/hardware/hw_draw.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/hardware/hw_draw.c b/src/hardware/hw_draw.c index a5d3a1c1a..b6daad7b6 100644 --- a/src/hardware/hw_draw.c +++ b/src/hardware/hw_draw.c @@ -268,8 +268,8 @@ void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t cy = 1.0f - (cy / (vid.height / 2.0f)); // fwidth and fheight are similar - fwidth /= fvw / 2; - fheight /= fvh / 2; + fwidth /= fvw / 2.0f; + fheight /= fvh / 2.0f; // set the polygon vertices to the right positions v[0].x = v[3].x = cx; @@ -444,8 +444,8 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal cy = 1.0f - (cy / (vid.height / 2.0f)); // fwidth and fheight are similar - fwidth /= fvw / 2; - fheight /= fvh / 2; + fwidth /= fvw / 2.0f; + fheight /= fvh / 2.0f; // set the polygon vertices to the right positions v[0].x = v[3].x = cx; @@ -884,8 +884,8 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color) fx = -1.0f + fx / (vid.width / 2.0f); fy = 1.0f - fy / (vid.height / 2.0f); - fw = fw / (fvw / 2); - fh = fh / (fvh / 2); + fw = fw / (fvw / 2.0f); + fh = fh / (fvh / 2.0f); v[0].x = v[3].x = fx; v[2].x = v[1].x = fx + fw; @@ -997,8 +997,8 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32 fx = -1.0f + fx / (vid.width / 2.0f); fy = 1.0f - fy / (vid.height / 2.0f); - fw = fw / (fvw / 2); - fh = fh / (fvh / 2); + fw = fw / (fvw / 2.0f); + fh = fh / (fvh / 2.0f); v[0].x = v[3].x = fx; v[2].x = v[1].x = fx + fw; @@ -1086,7 +1086,6 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color) fy += (FLOATBASEVIDHEIGHT * dupy)/2; if (color & V_HORZSCREEN) fx += (FLOATBASEVIDWIDTH * dupx)/2; - } if (fx >= vid.width || fy >= vid.height) @@ -1111,8 +1110,8 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color) fx = -1.0f + fx / (vid.width / 2.0f); fy = 1.0f - fy / (vid.height / 2.0f); - fw = fw / (fvw / 2); - fh = fh / (fvh / 2); + fw = fw / (fvw / 2.0f); + fh = fh / (fvh / 2.0f); v[0].x = v[3].x = fx; v[2].x = v[1].x = fx + fw;