From 72c336296fa714d85cd62aac7fea784109169b3a Mon Sep 17 00:00:00 2001 From: grisenti Date: Mon, 12 Dec 2022 22:07:13 +0100 Subject: [PATCH] HPL1: make Vector2 constructors constexpr --- engines/hpl1/engine/math/Vector2.h | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/engines/hpl1/engine/math/Vector2.h b/engines/hpl1/engine/math/Vector2.h index 2979d6b460a..50f71b28a1c 100644 --- a/engines/hpl1/engine/math/Vector2.h +++ b/engines/hpl1/engine/math/Vector2.h @@ -48,22 +48,16 @@ public: ////////////////////////////////////////// // Constructors ///////////////////////////////////////// - cVector2() { - x = 0; - y = 0; - } - cVector2(T aVal) { - x = aVal; - y = aVal; - } - cVector2(T aX, T aY) { - x = aX; - y = aY; + constexpr cVector2() : x(0), y(0) { } - cVector2(cVector2 const &aVec) { - x = aVec.x; - y = aVec.y; + constexpr cVector2(T aVal) : x(aVal), y(aVal) { + } + + constexpr cVector2(T aX, T aY) : x(aX), y(aY) { + } + + constexpr cVector2(cVector2 const &aVec) : x(aVec.x), y(aVec.y) { } //////////////////////////////////////////