refactor(Core): apply clang-tidy modernize-use-default-member-init (#3827)

This commit is contained in:
Francesco Borzì
2020-12-07 20:34:06 +01:00
committed by GitHub
parent 1cf39b3d22
commit c5a35efd7b
47 changed files with 352 additions and 366 deletions

View File

@@ -24,17 +24,18 @@ struct GameObjectDisplayInfoEntry;
class GameObjectModel /*, public Intersectable*/
{
uint32 phasemask;
uint32 phasemask{0};
G3D::AABox iBound;
G3D::Matrix3 iInvRot;
G3D::Vector3 iPos;
//G3D::Vector3 iRot;
float iInvScale;
float iScale;
float iInvScale{0};
float iScale{0};
VMAP::WorldModel* iModel;
GameObject const* owner;
GameObjectModel() : phasemask(0), iInvScale(0), iScale(0), iModel(nullptr), owner(nullptr) { }
GameObjectModel() : iModel(nullptr), owner(nullptr) { }
bool initialize(const GameObject& go, const GameObjectDisplayInfoEntry& info);
public:

View File

@@ -51,7 +51,7 @@ namespace VMAP
class ModelInstance: public ModelSpawn
{
public:
ModelInstance(): iInvScale(0.0f), iModel(nullptr) { }
ModelInstance() { }
ModelInstance(const ModelSpawn& spawn, WorldModel* model);
void setUnloaded() { iModel = nullptr; }
bool intersectRay(const G3D::Ray& pRay, float& pMaxDist, bool StopAtFirstHit) const;
@@ -60,8 +60,8 @@ namespace VMAP
bool GetLiquidLevel(const G3D::Vector3& p, LocationInfo& info, float& liqHeight) const;
protected:
G3D::Matrix3 iInvRot;
float iInvScale;
WorldModel* iModel;
float iInvScale{0.0f};
WorldModel* iModel{nullptr};
public:
WorldModel* getWorldModel();
};

View File

@@ -24,12 +24,12 @@ namespace VMAP
class MeshTriangle
{
public:
MeshTriangle() : idx0(0), idx1(0), idx2(0) { }
MeshTriangle() { }
MeshTriangle(uint32 na, uint32 nb, uint32 nc): idx0(na), idx1(nb), idx2(nc) { }
uint32 idx0;
uint32 idx1;
uint32 idx2;
uint32 idx0{0};
uint32 idx1{0};
uint32 idx2{0};
};
class WmoLiquid
@@ -47,13 +47,13 @@ namespace VMAP
bool writeToFile(FILE* wf);
static bool readFromFile(FILE* rf, WmoLiquid*& liquid);
private:
WmoLiquid(): iTilesX(0), iTilesY(0), iType(0), iHeight(nullptr), iFlags(nullptr) { }
uint32 iTilesX; //!< number of tiles in x direction, each
uint32 iTilesY;
G3D::Vector3 iCorner; //!< the lower corner
uint32 iType; //!< liquid type
float* iHeight; //!< (tilesX + 1)*(tilesY + 1) height values
uint8* iFlags; //!< info if liquid tile is used
WmoLiquid() { }
uint32 iTilesX{0}; //!< number of tiles in x direction, each
uint32 iTilesY{0};
G3D::Vector3 iCorner; //!< the lower corner
uint32 iType{0}; //!< liquid type
float* iHeight{nullptr}; //!< (tilesX + 1)*(tilesY + 1) height values
uint8* iFlags{nullptr}; //!< info if liquid tile is used
public:
void getPosInfo(uint32& tilesX, uint32& tilesY, G3D::Vector3& corner) const;
};
@@ -62,7 +62,7 @@ namespace VMAP
class GroupModel
{
public:
GroupModel(): iMogpFlags(0), iGroupWMOID(0), iLiquid(nullptr) { }
GroupModel() { }
GroupModel(const GroupModel& other);
GroupModel(uint32 mogpFlags, uint32 groupWMOID, const G3D::AABox& bound):
iBound(bound), iMogpFlags(mogpFlags), iGroupWMOID(groupWMOID), iLiquid(nullptr) { }
@@ -82,12 +82,12 @@ namespace VMAP
[[nodiscard]] uint32 GetWmoID() const { return iGroupWMOID; }
protected:
G3D::AABox iBound;
uint32 iMogpFlags;// 0x8 outdor; 0x2000 indoor
uint32 iGroupWMOID;
uint32 iMogpFlags{0};// 0x8 outdor; 0x2000 indoor
uint32 iGroupWMOID{0};
std::vector<G3D::Vector3> vertices;
std::vector<MeshTriangle> triangles;
BIH meshTree;
WmoLiquid* iLiquid;
WmoLiquid* iLiquid{nullptr};
public:
void getMeshData(std::vector<G3D::Vector3>& vertices, std::vector<MeshTriangle>& triangles, WmoLiquid*& liquid);
};
@@ -95,7 +95,7 @@ namespace VMAP
class WorldModel
{
public:
WorldModel(): RootWMOID(0) { }
WorldModel() { }
//! pass group models to WorldModel and create BIH. Passed vector is swapped with old geometry!
void setGroupModels(std::vector<GroupModel>& models);
@@ -106,7 +106,7 @@ namespace VMAP
bool writeFile(const std::string& filename);
bool readFile(const std::string& filename);
protected:
uint32 RootWMOID;
uint32 RootWMOID{0};
std::vector<GroupModel> groupModels;
BIH groupTree;
public: