From cec88d182b9f36248c06862b014d4d5443098b7f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sun, 14 Jun 2020 19:13:32 -0400 Subject: [PATCH] CLightNode: Mark member functions as const where applicable Several functions don't modify internal member state. --- src/Core/Scene/CLightNode.cpp | 7 +------ src/Core/Scene/CLightNode.h | 5 +++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Core/Scene/CLightNode.cpp b/src/Core/Scene/CLightNode.cpp index ed350678..e42fcfcd 100644 --- a/src/Core/Scene/CLightNode.cpp +++ b/src/Core/Scene/CLightNode.cpp @@ -138,12 +138,7 @@ void CLightNode::PropertyModified(IProperty* pProperty) SetPosition( mpLight->Position() ); } -CLight* CLightNode::Light() -{ - return mpLight; -} - -CVector2f CLightNode::BillboardScale() +CVector2f CLightNode::BillboardScale() const { return AbsoluteScale().XZ() * 0.75f; } diff --git a/src/Core/Scene/CLightNode.h b/src/Core/Scene/CLightNode.h index 686dcec7..24b0468e 100644 --- a/src/Core/Scene/CLightNode.h +++ b/src/Core/Scene/CLightNode.h @@ -18,8 +18,9 @@ public: CStructRef GetProperties() const override; void PropertyModified(IProperty* pProperty) override; bool AllowsRotate() const override { return false; } - CLight* Light(); - CVector2f BillboardScale(); + CLight* Light() { return mpLight; } + const CLight* Light() const { return mpLight; } + CVector2f BillboardScale() const; protected: void CalculateTransform(CTransform4f& rOut) const override;