From 80529930ea3bc874c8da22c66343745ff6fdd45b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 24 Feb 2024 00:10:27 +0000 Subject: Simplify vector addition/subtraction with differnt types Automatically applies correct rounding with float to int operations, adjusts test expectations accordingly. --- game/geoData.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'game/geoData.h') diff --git a/game/geoData.h b/game/geoData.h index e234bfe..15143e8 100644 --- a/game/geoData.h +++ b/game/geoData.h @@ -65,8 +65,7 @@ public: operator*(BaryPosition bari) const { const auto & t {*this}; - return t[0] + GlobalPosition(RelativePosition(t[1] - t[0]) * bari.x) - + GlobalPosition(RelativePosition(t[2] - t[1]) * bari.y); + return t[0] + (RelativePosition(t[1] - t[0]) * bari.x) + (RelativePosition(t[2] - t[1]) * bari.y); } }; -- cgit v1.2.3