From 4e0bef35c06d98c8487ef6fa4a1075ecc72341d1 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Fri, 21 Aug 2020 16:23:44 +1000 Subject: [PATCH] - simplify some of my math in the the fullscreen HUD drawers. May no one ever see the original code again... :S --- source/games/duke/src/sbar_d.cpp | 3 +-- source/games/duke/src/sbar_r.cpp | 3 +-- source/sw/src/sbar.cpp | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/source/games/duke/src/sbar_d.cpp b/source/games/duke/src/sbar_d.cpp index e6ca1c203..8920922b1 100644 --- a/source/games/duke/src/sbar_d.cpp +++ b/source/games/duke/src/sbar_d.cpp @@ -167,8 +167,7 @@ public: auto strlen = format.Len(); if (strlen > 1) { - auto scaler = strlen - 1; - imgX += ((imgX / 2.) * scaler) + ((imgX / (10. * scale)) * scaler); + imgX += (imgX * 0.6) * (strlen - 1); } DrawGraphic(imgWeap, -imgX, -1.5, DI_ITEM_RIGHT_BOTTOM, 1, -1, -1, weapScale, weapScale); } diff --git a/source/games/duke/src/sbar_r.cpp b/source/games/duke/src/sbar_r.cpp index c5a17bf86..abb781125 100644 --- a/source/games/duke/src/sbar_r.cpp +++ b/source/games/duke/src/sbar_r.cpp @@ -153,8 +153,7 @@ public: auto strlen = format.Len(); if (strlen > 1) { - auto scaler = strlen - 1; - imgX += ((imgX / 2.) * scaler) + ((imgX / (7.8125 * scale)) * scaler); + imgX += (imgX * 0.755) * (strlen - 1); } DrawGraphic(imgWeap, -imgX, -2, DI_ITEM_RIGHT_BOTTOM, 1, -1, -1, weapScale, weapScale); } diff --git a/source/sw/src/sbar.cpp b/source/sw/src/sbar.cpp index 5d9c2f251..7c04a2aaa 100644 --- a/source/sw/src/sbar.cpp +++ b/source/sw/src/sbar.cpp @@ -810,8 +810,7 @@ private: auto strlen = format.Len(); if (strlen > 1) { - auto scaler = strlen - 1; - imgX += ((imgX / 2.) * scaler) + ((imgX / 2.85) * scaler); + imgX += (imgX * 0.855) * (strlen - 1); } DrawGraphic(imgWeap, -imgX, -1, DI_ITEM_RIGHT_BOTTOM, 1, -1, -1, weapScale, weapScale); }