[Scummvm-git-logs] scummvm master -> 9130534e268b8de0f5e2929602415e8be9c8209d
grisenti
noreply at scummvm.org
Mon Jan 30 21:31:16 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
9130534e26 HPL1: make constant value constexpr
Commit: 9130534e268b8de0f5e2929602415e8be9c8209d
https://github.com/scummvm/scummvm/commit/9130534e268b8de0f5e2929602415e8be9c8209d
Author: grisenti (emanuele at grisenti.net)
Date: 2023-01-30T22:31:00+01:00
Commit Message:
HPL1: make constant value constexpr
Changed paths:
engines/hpl1/engine/libraries/newton/core/dgSphere.cpp
engines/hpl1/engine/libraries/newton/core/dgSphere.h
diff --git a/engines/hpl1/engine/libraries/newton/core/dgSphere.cpp b/engines/hpl1/engine/libraries/newton/core/dgSphere.cpp
index c975cf98f0f..8337b8fcac5 100644
--- a/engines/hpl1/engine/libraries/newton/core/dgSphere.cpp
+++ b/engines/hpl1/engine/libraries/newton/core/dgSphere.cpp
@@ -25,7 +25,7 @@
#include "dgSphere.h"
#include "dgMatrix.h"
-static dgSphere identitySphere;
+constexpr static dgSphere identitySphere;
const dgSphere &GetIdentitySphere() {
return identitySphere;
}
@@ -356,12 +356,6 @@ static void Statistics(dgSphere &sphere, dgVector &eigenValues,
*/
}
-dgSphere::dgSphere() :
- dgMatrix(dgGetIdentityMatrix()), m_size(0, 0, 0, 0) {
-// NEWTON_ASSERT (0);
-// planeTest = FrontTest;
-}
-
dgSphere::dgSphere(const dgQuaternion &quat, const dgVector &position,
const dgVector &dim) :
dgMatrix(quat, position) {
diff --git a/engines/hpl1/engine/libraries/newton/core/dgSphere.h b/engines/hpl1/engine/libraries/newton/core/dgSphere.h
index b6c3848bd8c..45b9520e68b 100644
--- a/engines/hpl1/engine/libraries/newton/core/dgSphere.h
+++ b/engines/hpl1/engine/libraries/newton/core/dgSphere.h
@@ -36,7 +36,17 @@ class dgPlane;
DG_MSC_VECTOR_ALIGMENT
class dgSphere: public dgMatrix {
public:
- dgSphere();
+ constexpr dgSphere() : dgMatrix(
+ dgVector(dgFloat32(1.0f), dgFloat32(0.0f), dgFloat32(0.0f),
+ dgFloat32(0.0f)),
+ dgVector(dgFloat32(0.0f), dgFloat32(1.0f), dgFloat32(0.0f),
+ dgFloat32(0.0f)),
+ dgVector(dgFloat32(0.0f), dgFloat32(0.0f), dgFloat32(1.0f),
+ dgFloat32(0.0f)),
+ dgVector(dgFloat32(0.0f), dgFloat32(0.0f), dgFloat32(0.0f),
+ dgFloat32(1.0f))),
+ m_size(0, 0, 0, 0) {
+ }
// dgSphere (const dgQuaternion &quat, const dgVector &position, const dgVector dim = dgVector(0, 0, 0, 0));
// dgSphere (const dgMatrix &matrix, const dgVector dim = dgVector(0, 0, 0, 0));
More information about the Scummvm-git-logs
mailing list