mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-17 17:24:33 +00:00
refactor(Core): apply clang-tidy modernize-use-default-member-init (#3827)
This commit is contained in:
@@ -352,22 +352,19 @@ protected:
|
||||
class BuildStats
|
||||
{
|
||||
private:
|
||||
int numNodes;
|
||||
int numLeaves;
|
||||
int sumObjects;
|
||||
int minObjects;
|
||||
int maxObjects;
|
||||
int sumDepth;
|
||||
int minDepth;
|
||||
int maxDepth;
|
||||
int numNodes{0};
|
||||
int numLeaves{0};
|
||||
int sumObjects{0};
|
||||
int minObjects{0x0FFFFFFF};
|
||||
int maxObjects{-1}; // 0xFFFFFFFF
|
||||
int sumDepth{0};
|
||||
int minDepth{0x0FFFFFFF};
|
||||
int maxDepth{-1}; // 0xFFFFFFFF
|
||||
int numLeavesN[6];
|
||||
int numBVH2;
|
||||
int numBVH2{0};
|
||||
|
||||
public:
|
||||
BuildStats():
|
||||
numNodes(0), numLeaves(0), sumObjects(0), minObjects(0x0FFFFFFF),
|
||||
maxObjects(0xFFFFFFFF), sumDepth(0), minDepth(0x0FFFFFFF),
|
||||
maxDepth(0xFFFFFFFF), numBVH2(0)
|
||||
BuildStats()
|
||||
{
|
||||
for (int & i : numLeavesN) i = 0;
|
||||
}
|
||||
|
||||
@@ -33,11 +33,11 @@ namespace VMAP
|
||||
class IVMapManager
|
||||
{
|
||||
private:
|
||||
bool iEnableLineOfSightCalc;
|
||||
bool iEnableHeightCalc;
|
||||
bool iEnableLineOfSightCalc{true};
|
||||
bool iEnableHeightCalc{true};
|
||||
|
||||
public:
|
||||
IVMapManager() : iEnableLineOfSightCalc(true), iEnableHeightCalc(true) { }
|
||||
IVMapManager() { }
|
||||
|
||||
virtual ~IVMapManager() = default;
|
||||
|
||||
|
||||
@@ -52,14 +52,14 @@ namespace VMAP
|
||||
class ManagedModel
|
||||
{
|
||||
public:
|
||||
ManagedModel() : iModel(nullptr), iRefCount(0) { }
|
||||
ManagedModel() { }
|
||||
void setModel(WorldModel* model) { iModel = model; }
|
||||
WorldModel* getModel() { return iModel; }
|
||||
void incRefCount() { ++iRefCount; }
|
||||
int decRefCount() { return --iRefCount; }
|
||||
protected:
|
||||
WorldModel* iModel;
|
||||
int iRefCount;
|
||||
WorldModel* iModel{nullptr};
|
||||
int iRefCount{0};
|
||||
};
|
||||
|
||||
typedef std::unordered_map<uint32, StaticMapTree*> InstanceTreeMap;
|
||||
|
||||
@@ -19,9 +19,9 @@ namespace VMAP
|
||||
|
||||
struct LocationInfo
|
||||
{
|
||||
LocationInfo(): hitInstance(nullptr), hitModel(nullptr), ground_Z(-G3D::inf()) { }
|
||||
const ModelInstance* hitInstance;
|
||||
const GroupModel* hitModel;
|
||||
LocationInfo(): ground_Z(-G3D::inf()) { }
|
||||
const ModelInstance* hitInstance{nullptr};
|
||||
const GroupModel* hitModel{nullptr};
|
||||
float ground_Z;
|
||||
};
|
||||
|
||||
@@ -73,14 +73,13 @@ namespace VMAP
|
||||
|
||||
struct AreaInfo
|
||||
{
|
||||
AreaInfo(): result(false), ground_Z(-G3D::inf()), flags(0), adtId(0),
|
||||
rootId(0), groupId(0) { }
|
||||
bool result;
|
||||
AreaInfo(): ground_Z(-G3D::inf()) { }
|
||||
bool result{false};
|
||||
float ground_Z;
|
||||
uint32 flags;
|
||||
int32 adtId;
|
||||
int32 rootId;
|
||||
int32 groupId;
|
||||
uint32 flags{0};
|
||||
int32 adtId{0};
|
||||
int32 rootId{0};
|
||||
int32 groupId{0};
|
||||
};
|
||||
} // VMAP
|
||||
|
||||
|
||||
@@ -28,10 +28,10 @@ namespace VMAP
|
||||
private:
|
||||
G3D::Matrix3 iRotation;
|
||||
public:
|
||||
ModelPosition(): iScale(0.0f) { }
|
||||
ModelPosition() { }
|
||||
G3D::Vector3 iPos;
|
||||
G3D::Vector3 iDir;
|
||||
float iScale;
|
||||
float iScale{0.0f};
|
||||
void init()
|
||||
{
|
||||
iRotation = G3D::Matrix3::fromEulerAnglesZYX(G3D::pif() * iDir.y / 180.f, G3D::pif() * iDir.x / 180.f, G3D::pif() * iDir.z / 180.f);
|
||||
@@ -54,17 +54,18 @@ namespace VMAP
|
||||
|
||||
struct GroupModel_Raw
|
||||
{
|
||||
uint32 mogpflags;
|
||||
uint32 GroupWMOID;
|
||||
uint32 mogpflags{0};
|
||||
uint32 GroupWMOID{0};
|
||||
|
||||
G3D::AABox bounds;
|
||||
uint32 liquidflags;
|
||||
uint32 liquidflags{0};
|
||||
std::vector<MeshTriangle> triangles;
|
||||
std::vector<G3D::Vector3> vertexArray;
|
||||
class WmoLiquid* liquid;
|
||||
|
||||
GroupModel_Raw() : mogpflags(0), GroupWMOID(0), liquidflags(0),
|
||||
liquid(nullptr) { }
|
||||
|
||||
GroupModel_Raw() : liquid(nullptr) { }
|
||||
|
||||
~GroupModel_Raw();
|
||||
|
||||
bool Read(FILE* f);
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -22,7 +22,7 @@ class Transaction
|
||||
friend class DatabaseWorkerPool;
|
||||
|
||||
public:
|
||||
Transaction() : _cleanedUp(false) { }
|
||||
Transaction() { }
|
||||
~Transaction() { Cleanup(); }
|
||||
|
||||
void Append(PreparedStatement* statement);
|
||||
@@ -36,7 +36,7 @@ protected:
|
||||
std::list<SQLElementData> m_queries;
|
||||
|
||||
private:
|
||||
bool _cleanedUp;
|
||||
bool _cleanedUp{false};
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<Transaction> SQLTransaction;
|
||||
|
||||
@@ -73,9 +73,9 @@ class LinkedListHead
|
||||
private:
|
||||
LinkedListElement iFirst;
|
||||
LinkedListElement iLast;
|
||||
uint32 iSize;
|
||||
uint32 iSize{0};
|
||||
public:
|
||||
LinkedListHead(): iSize(0)
|
||||
LinkedListHead()
|
||||
{
|
||||
// create empty list
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
const static size_t DEFAULT_SIZE = 0x1000;
|
||||
|
||||
// constructor
|
||||
ByteBuffer() : _rpos(0), _wpos(0)
|
||||
ByteBuffer()
|
||||
{
|
||||
_storage.reserve(DEFAULT_SIZE);
|
||||
}
|
||||
@@ -503,7 +503,7 @@ public:
|
||||
void hexlike(bool outString = false) const;
|
||||
|
||||
protected:
|
||||
size_t _rpos, _wpos;
|
||||
size_t _rpos{0}, _wpos{0};
|
||||
std::vector<uint8> _storage;
|
||||
};
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ class WorldPacket : public ByteBuffer
|
||||
{
|
||||
public:
|
||||
// just container for later use
|
||||
WorldPacket() : ByteBuffer(0), m_opcode(0)
|
||||
WorldPacket() : ByteBuffer(0)
|
||||
{
|
||||
}
|
||||
explicit WorldPacket(uint16 opcode, size_t res = 200) : ByteBuffer(res), m_opcode(opcode) { }
|
||||
@@ -40,6 +40,6 @@ public:
|
||||
void SetOpcode(uint16 opcode) { m_opcode = opcode; }
|
||||
|
||||
protected:
|
||||
uint16 m_opcode;
|
||||
uint16 m_opcode{0};
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -25,13 +25,13 @@ namespace ACE_Based
|
||||
StorageType _queue;
|
||||
|
||||
//! Cancellation flag.
|
||||
volatile bool _canceled;
|
||||
volatile bool _canceled{false};
|
||||
|
||||
public:
|
||||
|
||||
//! Create a LockedQueue.
|
||||
LockedQueue()
|
||||
: _canceled(false)
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ struct IntervalTimer
|
||||
public:
|
||||
|
||||
IntervalTimer()
|
||||
: _interval(0), _current(0)
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
@@ -97,8 +97,8 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
time_t _interval;
|
||||
time_t _current;
|
||||
time_t _interval{0};
|
||||
time_t _current{0};
|
||||
};
|
||||
|
||||
struct TimeTracker
|
||||
|
||||
@@ -578,7 +578,7 @@ class EventMap
|
||||
typedef std::multimap<uint32, uint32> EventStore;
|
||||
|
||||
public:
|
||||
EventMap() : _time(0), _phase(0), _lastEvent(0) { }
|
||||
EventMap() { }
|
||||
|
||||
/**
|
||||
* @name Reset
|
||||
@@ -908,9 +908,9 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _time;
|
||||
uint32 _phase;
|
||||
uint32 _lastEvent;
|
||||
uint32 _time{0};
|
||||
uint32 _phase{0};
|
||||
uint32 _lastEvent{0};
|
||||
|
||||
EventStore _eventMap;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user