undo = default; constructors, they allow zero initialization, unlike constructors with empty body

This commit is contained in:
Garux
2025-10-30 00:19:03 +05:00
parent c25a3e3635
commit 7111e78f24
9 changed files with 23 additions and 12 deletions
+2 -1
View File
@@ -50,7 +50,8 @@ public:
vec_t DistanceToPoint( const vec3_t pnt ) const;
DPlane( const vec3_t va, const vec3_t vb, const vec3_t vc, const _QERFaceData* texData );
DPlane() = default;
DPlane(){
}
bool m_bChkOk;
_QERFaceData texInfo;
+6 -3
View File
@@ -8,7 +8,8 @@ class BasicVector2
{
Element m_elements[2];
public:
BasicVector2() = default;
BasicVector2(){
}
template<typename OtherElement>
BasicVector2( const BasicVector2<OtherElement>& other ){
x() = static_cast<Element>( other.x() );
@@ -54,7 +55,8 @@ class BasicVector3
Element m_elements[3];
public:
BasicVector3() = default;
BasicVector3(){
}
template<typename OtherElement>
BasicVector3( const BasicVector3<OtherElement>& other ){
x() = static_cast<Element>( other.x() );
@@ -124,7 +126,8 @@ class BasicVector4
Element m_elements[4];
public:
BasicVector4() = default;
BasicVector4(){
}
BasicVector4( Element x_, Element y_, Element z_, Element w_ ){
x() = x_;
y() = y_;
+2 -1
View File
@@ -38,7 +38,8 @@ class Matrix4
{
float m_elements[16];
public:
Matrix4() = default;
Matrix4(){
}
Matrix4( float xx_, float xy_, float xz_, float xw_,
float yx_, float yy_, float yz_, float yw_,
float zx_, float zy_, float zz_, float zw_,
+2 -1
View File
@@ -32,7 +32,8 @@ class Plane3___
public:
T a, b, c, d;
Plane3___() = default;
Plane3___(){
}
Plane3___( double _a, double _b, double _c, double _d )
: a( _a ), b( _b ), c( _c ), d( _d ){
}
+2 -1
View File
@@ -277,7 +277,8 @@ struct Colour4b
{
unsigned char r, g, b, a;
Colour4b() = default;
Colour4b(){
}
Colour4b( unsigned char _r, unsigned char _g, unsigned char _b, unsigned char _a )
: r( _r ), g( _g ), b( _b ), a( _a ){
+2 -1
View File
@@ -79,7 +79,8 @@ struct Skew
std::size_t index;
float amount;
Skew() = default;
Skew(){
}
Skew( std::size_t index_, float amount_ ) : index( index_ ), amount( amount_ ){
}
bool operator!= ( const Skew& other ) const {
+2 -1
View File
@@ -271,7 +271,8 @@ typedef ReferencePair<FaceShaderObserver> FaceShaderObserverPair;
class ContentsFlagsValue
{
public:
ContentsFlagsValue() = default;
ContentsFlagsValue(){
}
ContentsFlagsValue( int surfaceFlags, int contentFlags, int value, bool specified ) :
m_surfaceFlags( surfaceFlags ),
m_contentFlags( contentFlags ),
+2 -1
View File
@@ -59,7 +59,8 @@ class ESide
{
bool m_value;
public:
ESide() = default;
ESide(){
}
ESide( bool value ) : m_value( value ){}
operator bool() const {
return m_value;
+3 -2
View File
@@ -386,7 +386,8 @@ struct image_t
int width, height;
byte *pixels = nullptr;
image_t() = default;
image_t(){
}
image_t( const char *name, const char *filename, int width, int height, byte *pixels ) :
name( name ),
filename( filename ),
@@ -720,7 +721,7 @@ struct brush_t
int lightmapSampleSize; /* jal : entity based _lightmapsamplesize */
float lightmapScale;
float shadeAngleDegrees; /* jal : entity based _shadeangle */
Vector3 ambientColor;
Vector3 ambientColor{ 0 };
MinMax eMinmax;
indexMap_t *im;