mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-08 01:39:36 +00:00
Replace empty constructors with default constructors #88
This commit is contained in:
+33
-35
@@ -70,7 +70,17 @@ public:
|
||||
vec_t x, y, z;
|
||||
|
||||
// Construction/destruction:
|
||||
Vector(void);
|
||||
|
||||
#if defined (_DEBUG) && defined (VECTOR_PARANOIA)
|
||||
Vector(void)
|
||||
{
|
||||
// Initialize to NAN to catch errors
|
||||
x = y = z = VEC_T_NAN;
|
||||
}
|
||||
#else
|
||||
Vector(void) = default;
|
||||
#endif
|
||||
|
||||
Vector(vec_t X, vec_t Y, vec_t Z);
|
||||
explicit Vector(vec_t XYZ); ///< broadcast initialize
|
||||
|
||||
@@ -373,7 +383,7 @@ public:
|
||||
class ALIGN16 VectorAligned : public Vector
|
||||
{
|
||||
public:
|
||||
inline VectorAligned(void) {};
|
||||
inline VectorAligned(void) = default;
|
||||
inline VectorAligned(vec_t X, vec_t Y, vec_t Z)
|
||||
{
|
||||
Init(X,Y,Z);
|
||||
@@ -497,19 +507,6 @@ float RandomVectorInUnitCircle( Vector2D *pVector );
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// constructors
|
||||
//-----------------------------------------------------------------------------
|
||||
inline Vector::Vector(void)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
#ifdef VECTOR_PARANOIA
|
||||
// Initialize to NAN to catch errors
|
||||
x = y = z = VEC_T_NAN;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
inline Vector::Vector(vec_t X, vec_t Y, vec_t Z)
|
||||
{
|
||||
x = X; y = Y; z = Z;
|
||||
@@ -1542,15 +1539,16 @@ class RadianEuler;
|
||||
class Quaternion // same data-layout as engine's vec4_t,
|
||||
{ // which is a vec_t[4]
|
||||
public:
|
||||
inline Quaternion(void) {
|
||||
|
||||
// Initialize to NAN to catch errors
|
||||
#ifdef _DEBUG
|
||||
#ifdef VECTOR_PARANOIA
|
||||
#if defined (_DEBUG) && defined VECTOR_PARANOIA
|
||||
inline Quaternion(void)
|
||||
{
|
||||
// Initialize to NAN to catch errors
|
||||
x = y = z = w = VEC_T_NAN;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
Quaternion(void) = default;
|
||||
#endif
|
||||
|
||||
inline Quaternion(vec_t ix, vec_t iy, vec_t iz, vec_t iw) : x(ix), y(iy), z(iz), w(iw) { }
|
||||
inline Quaternion(RadianEuler const &angle); // evil auto type promotion!!!
|
||||
|
||||
@@ -1624,7 +1622,7 @@ inline bool QuaternionsAreEqual( const Quaternion& src1, const Quaternion& src2,
|
||||
class ALIGN16 QuaternionAligned : public Quaternion
|
||||
{
|
||||
public:
|
||||
inline QuaternionAligned(void) {};
|
||||
inline QuaternionAligned(void) = default;
|
||||
inline QuaternionAligned(vec_t X, vec_t Y, vec_t Z, vec_t W)
|
||||
{
|
||||
Init(X,Y,Z,W);
|
||||
@@ -1661,7 +1659,7 @@ class QAngle;
|
||||
class RadianEuler
|
||||
{
|
||||
public:
|
||||
inline RadianEuler(void) { }
|
||||
inline RadianEuler(void) = default;
|
||||
inline RadianEuler(vec_t X, vec_t Y, vec_t Z) { x = X; y = Y; z = Z; }
|
||||
inline RadianEuler(Quaternion const &q); // evil auto type promotion!!!
|
||||
inline RadianEuler(QAngle const &angles); // evil auto type promotion!!!
|
||||
@@ -1771,7 +1769,17 @@ public:
|
||||
vec_t x, y, z;
|
||||
|
||||
// Construction/destruction
|
||||
QAngle(void);
|
||||
|
||||
#if defined (_DEBUG) && defined (VECTOR_PARANOIA)
|
||||
inline QAngle(void)
|
||||
{
|
||||
// Initialize to NAN to catch errors
|
||||
x = y = z = VEC_T_NAN;
|
||||
}
|
||||
#else
|
||||
QAngle(void) = default;
|
||||
#endif
|
||||
|
||||
QAngle(vec_t X, vec_t Y, vec_t Z);
|
||||
// QAngle(RadianEuler const &angles); // evil auto type promotion!!!
|
||||
|
||||
@@ -1871,16 +1879,6 @@ inline void VectorMA( const QAngle &start, float scale, const QAngle &direction,
|
||||
//-----------------------------------------------------------------------------
|
||||
// constructors
|
||||
//-----------------------------------------------------------------------------
|
||||
inline QAngle::QAngle(void)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
#ifdef VECTOR_PARANOIA
|
||||
// Initialize to NAN to catch errors
|
||||
x = y = z = VEC_T_NAN;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
inline QAngle::QAngle(vec_t X, vec_t Y, vec_t Z)
|
||||
{
|
||||
x = X; y = Y; z = Z;
|
||||
|
||||
Reference in New Issue
Block a user