From cc27d3dd5474420877d54121fc7c91309a470ad2 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Mon, 17 Jun 2019 18:35:32 +0200 Subject: [PATCH] Use default member initializer to simplify ctors --- code/Ragl/graph_vs.h | 10 +- code/Ratl/map_vs.h | 8 +- code/Ratl/pool_vs.h | 6 +- code/Ratl/queue_vs.h | 10 +- code/Ratl/stack_vs.h | 6 +- code/Ratl/string_vs.h | 6 +- code/Ratl/vector_vs.h | 14 +-- code/cgame/FxScheduler.h | 10 +- code/game/ghoul2_shared.h | 166 +++++++++------------------ code/qcommon/cm_test.cpp | 8 +- code/qcommon/ojk_saved_game.cpp | 14 +-- code/qcommon/ojk_saved_game.h | 12 +- code/rd-vanilla/tr_local.h | 25 ++-- code/rd-vanilla/tr_quicksprite.cpp | 9 +- code/rd-vanilla/tr_quicksprite.h | 12 +- codeJK2/cgame/FxScheduler.h | 10 +- codemp/Ratl/vector_vs.h | 14 +-- codemp/client/FxPrimitives.cpp | 9 +- codemp/client/FxPrimitives.h | 23 ++-- codemp/client/FxScheduler.h | 27 ++--- codemp/client/FxSystem.cpp | 9 +- codemp/client/FxSystem.h | 10 +- codemp/ghoul2/ghoul2_shared.h | 160 +++++++++----------------- codemp/qcommon/GenericParser2.cpp | 27 +---- codemp/qcommon/GenericParser2.h | 18 +-- codemp/rd-dedicated/tr_local.h | 25 ++-- codemp/rd-vanilla/tr_local.h | 25 ++-- codemp/rd-vanilla/tr_quicksprite.cpp | 9 +- codemp/rd-vanilla/tr_quicksprite.h | 12 +- codemp/server/NPCNav/navigator.h | 10 +- 30 files changed, 254 insertions(+), 450 deletions(-) diff --git a/code/Ragl/graph_vs.h b/code/Ragl/graph_vs.h index 3f486b7aa3..a3b7bba300 100644 --- a/code/Ragl/graph_vs.h +++ b/code/Ragl/graph_vs.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -1145,9 +1145,7 @@ class graph_vs : public ratl::ratl_base //////////////////////////////////////////////////////////////////////////////// search_node(int Node=-1, int Parent=-1) : mNode(Node), - mParentVisit(Parent), - mCostToGoal(-1), - mCostFromStart(0) + mParentVisit(Parent) {} search_node(const search_node& t) : mNode(t.mNode), @@ -1197,8 +1195,8 @@ class graph_vs : public ratl::ratl_base int mNode; // Which Node Is This (Index To Pool mNodes) int mParentVisit; // Which Search Node (In Visited) - float mCostToGoal; // How Far From The Start Of The Search Are We? - float mCostFromStart; // How Far From The End Of The Search Are We? + float mCostToGoal{-1}; // How Far From The Start Of The Search Are We? + float mCostFromStart{0}; // How Far From The End Of The Search Are We? }; diff --git a/code/Ratl/map_vs.h b/code/Ratl/map_vs.h index 0d9b11f9a3..daaef2d257 100644 --- a/code/Ratl/map_vs.h +++ b/code/Ratl/map_vs.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -129,8 +129,8 @@ class tree_base private: pool_base mPool; // The Allocation Data Pool - int mRoot; - int mLastAdd; + int mRoot{tree_node::NULL_NODE}; + int mLastAdd{-1}; void link_left(int node,int left) @@ -716,7 +716,7 @@ class tree_base //////////////////////////////////////////////////////////////////////////////////// // Constructor //////////////////////////////////////////////////////////////////////////////////// - tree_base() : mRoot(tree_node::NULL_NODE), mLastAdd(-1) + tree_base() { } diff --git a/code/Ratl/pool_vs.h b/code/Ratl/pool_vs.h index 62fab4ba0a..b536f63f6a 100644 --- a/code/Ratl/pool_vs.h +++ b/code/Ratl/pool_vs.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -75,7 +75,7 @@ class pool_root : public ratl_base array_base mData; queue_vs mFree; bits_base mUsed; - int mSize; + int mSize{0}; void FillFreeList() @@ -105,7 +105,7 @@ class pool_root : public ratl_base //////////////////////////////////////////////////////////////////////////////////// // Constructor //////////////////////////////////////////////////////////////////////////////////// - pool_root() : mSize(0) + pool_root() { FillFreeList(); } diff --git a/code/Ratl/queue_vs.h b/code/Ratl/queue_vs.h index cd0d2853da..ae49c1abc0 100644 --- a/code/Ratl/queue_vs.h +++ b/code/Ratl/queue_vs.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -74,9 +74,9 @@ class queue_base : public ratl_base // Data //////////////////////////////////////////////////////////////////////////////////// array_base mData; // The Memory - int mPush; // Address Of Next Add Location - int mPop; // Address Of Next Remove Location - int mSize; + int mPush{0}; // Address Of Next Add Location + int mPop{0}; // Address Of Next Remove Location + int mSize{0}; int push_low() @@ -104,7 +104,7 @@ class queue_base : public ratl_base //////////////////////////////////////////////////////////////////////////////////// // Constructor //////////////////////////////////////////////////////////////////////////////////// - queue_base() : mPush(0), mPop(0), mSize(0) + queue_base() { } diff --git a/code/Ratl/stack_vs.h b/code/Ratl/stack_vs.h index 69d06dc738..79a4f4b279 100644 --- a/code/Ratl/stack_vs.h +++ b/code/Ratl/stack_vs.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -69,14 +69,14 @@ class stack_base : public ratl_base // Data //////////////////////////////////////////////////////////////////////////////////// array_base mData; // The Memory - int mSize; + int mSize{0}; public: //////////////////////////////////////////////////////////////////////////////////// // Constructor //////////////////////////////////////////////////////////////////////////////////// - stack_base() : mSize(0) + stack_base() { } diff --git a/code/Ratl/string_vs.h b/code/Ratl/string_vs.h index 068787dc32..4bac7e9a64 100644 --- a/code/Ratl/string_vs.h +++ b/code/Ratl/string_vs.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -307,7 +307,7 @@ class string_vs : public ratl_base public: // Constructors //-------------- - tokenizer() : mLoc(0) + tokenizer() {} tokenizer(const char* t, const char* gap) { @@ -352,7 +352,7 @@ class string_vs : public ratl_base // Data //------ private: - char* mLoc; + char* mLoc{0}; char mGap[TOKEN_GAP_LEN]; }; diff --git a/code/Ratl/vector_vs.h b/code/Ratl/vector_vs.h index 1d5e4ebf58..dbdb62dfa5 100644 --- a/code/Ratl/vector_vs.h +++ b/code/Ratl/vector_vs.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -466,13 +466,13 @@ class vector_base : public ratl_base friend class const_iterator; // Data //------ - int mLoc; - vector_base* mOwner; + int mLoc{0}; + vector_base* mOwner{0}; public: // Constructors //-------------- - iterator() : mOwner(0), mLoc(0) + iterator() {} iterator(vector_base* p, int t) : mOwner(p), mLoc(t) {} @@ -551,13 +551,13 @@ class vector_base : public ratl_base { friend class vector_base; - int mLoc; - const vector_base* mOwner; + int mLoc{0}; + const vector_base* mOwner{0}; public: // Constructors //-------------- - const_iterator() : mOwner(0), mLoc(0) + const_iterator() {} const_iterator(const vector_base* p, int t) : mOwner(p), mLoc(t) {} diff --git a/code/cgame/FxScheduler.h b/code/cgame/FxScheduler.h index 7bf78398e7..34d3046b27 100644 --- a/code/cgame/FxScheduler.h +++ b/code/cgame/FxScheduler.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -396,7 +396,6 @@ class PoolAllocator : pool (new T[N]) , freeAndAllocated (new int[N]) , numFree (N) - , highWatermark (0) { for ( int i = 0; i < N; i++ ) { @@ -486,7 +485,7 @@ class PoolAllocator int *freeAndAllocated; int numFree; - int highWatermark; + int highWatermark{0}; }; template @@ -494,8 +493,7 @@ class PagedPoolAllocator { public: PagedPoolAllocator () - : numPages (1) - , pages (new PoolAllocator[1]()) + : pages (new PoolAllocator[1]()) { } @@ -559,7 +557,7 @@ class PagedPoolAllocator } private: - int numPages; + int numPages{1}; PoolAllocator *pages; }; diff --git a/code/game/ghoul2_shared.h b/code/game/ghoul2_shared.h index 3427e78694..d5789a550e 100644 --- a/code/game/ghoul2_shared.h +++ b/code/game/ghoul2_shared.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -42,23 +42,16 @@ int G2API_GetTime(int argTime); // this may or may not return arg depending on // we save the whole surfaceInfo_t struct struct surfaceInfo_t { - int offFlags; // what the flags are for this model - int surface; // index into array held inside the model definition of pointers to the actual surface data loaded in - used by both client and game - float genBarycentricJ; // point 0 barycentric coors - float genBarycentricI; // point 1 barycentric coors - point 2 is 1 - point0 - point1 - int genPolySurfaceIndex; // used to point back to the original surface and poly if this is a generated surface - int genLod; // used to determine original lod of original surface and poly hit location - -surfaceInfo_t(): - offFlags(0), - surface(0), - genBarycentricJ(0), - genBarycentricI(0), - genPolySurfaceIndex(0), - genLod(0) + int offFlags{0}; // what the flags are for this model + int surface{0}; // index into array held inside the model definition of pointers to the actual surface data loaded in - used by both client and game + float genBarycentricJ{0}; // point 0 barycentric coors + float genBarycentricI{0}; // point 1 barycentric coors - point 2 is 1 - point0 - point1 + int genPolySurfaceIndex{0}; // used to point back to the original surface and poly if this is a generated surface + int genLod{0}; // used to determine original lod of original surface and poly hit location + +surfaceInfo_t() {} - void sg_export( ojk::SavedGameHelper& saved_game) const { @@ -111,20 +104,20 @@ typedef struct { // we save the whole structure here. struct boneInfo_t { - int boneNumber; // what bone are we overriding? + int boneNumber{-1}; // what bone are we overriding? mdxaBone_t matrix; // details of bone angle overrides - some are pre-done on the server, some in ghoul2 - int flags; // flags for override - int startFrame; // start frame for animation - int endFrame; // end frame for animation NOTE anim actually ends on endFrame+1 - int startTime; // time we started this animation - int pauseTime; // time we paused this animation - 0 if not paused - float animSpeed; // speed at which this anim runs. 1.0f means full speed of animation incoming - ie if anim is 20hrtz, we run at 20hrts. If 5hrts, we run at 5 hrts - float blendFrame; // frame PLUS LERP value to blend from - int blendLerpFrame; // frame to lerp the blend frame with. - int blendTime; // Duration time for blending - used to calc amount each frame of new anim is blended with last frame of the last anim - int blendStart; // Time when blending starts - not necessarily the same as startTime since we might start half way through an anim - int boneBlendTime; // time for duration of bone angle blend with normal animation - int boneBlendStart; // time bone angle blend with normal animation began + int flags{0}; // flags for override + int startFrame{0}; // start frame for animation + int endFrame{0}; // end frame for animation NOTE anim actually ends on endFrame+1 + int startTime{0}; // time we started this animation + int pauseTime{0}; // time we paused this animation - 0 if not paused + float animSpeed{0}; // speed at which this anim runs. 1.0f means full speed of animation incoming - ie if anim is 20hrtz, we run at 20hrts. If 5hrts, we run at 5 hrts + float blendFrame{0}; // frame PLUS LERP value to blend from + int blendLerpFrame{0}; // frame to lerp the blend frame with. + int blendTime{0}; // Duration time for blending - used to calc amount each frame of new anim is blended with last frame of the last anim + int blendStart{0}; // Time when blending starts - not necessarily the same as startTime since we might start half way through an anim + int boneBlendTime{0}; // time for duration of bone angle blend with normal animation + int boneBlendStart{0}; // time bone angle blend with normal animation began mdxaBone_t newMatrix; // This is the lerped matrix that Ghoul2 uses on the client side - does not go across the network //rww - RAGDOLL_BEGIN @@ -192,21 +185,8 @@ struct boneInfo_t int airTime; //base is in air, be more quick and sensitive about collisions //rww - RAGDOLL_END -boneInfo_t(): - boneNumber(-1), - flags(0), - startFrame(0), - endFrame(0), - startTime(0), - pauseTime(0), - animSpeed(0), - blendFrame(0), - blendLerpFrame(0), - blendTime(0), - blendStart(0), - boneBlendTime(0), - boneBlendStart(0) - { +boneInfo_t() + { matrix.matrix[0][0] = matrix.matrix[0][1] = matrix.matrix[0][2] = matrix.matrix[0][3] = matrix.matrix[1][0] = matrix.matrix[1][1] = matrix.matrix[1][2] = matrix.matrix[1][3] = matrix.matrix[2][0] = matrix.matrix[2][1] = matrix.matrix[2][2] = matrix.matrix[2][3] = 0.0f; @@ -367,15 +347,11 @@ boneInfo_t(): }; //we save from top to boltUsed here. Don't bother saving the position, it gets rebuilt every frame anyway struct boltInfo_t{ - int boneNumber; // bone number bolt attaches to - int surfaceNumber; // surface number bolt attaches to - int surfaceType; // if we attach to a surface, this tells us if it is an original surface or a generated one - doesn't go across the network - int boltUsed; // nor does this - boltInfo_t(): - boneNumber(-1), - surfaceNumber(-1), - surfaceType(0), - boltUsed(0) + int boneNumber{-1}; // bone number bolt attaches to + int surfaceNumber{-1}; // surface number bolt attaches to + int surfaceType{0}; // if we attach to a surface, this tells us if it is an original surface or a generated one - doesn't go across the network + int boltUsed{0}; // nor does this + boltInfo_t() {} @@ -448,66 +424,41 @@ class CGhoul2Info boneInfo_v mBlist; // save from here (do not put any ptrs etc within this save block unless you adds special handlers to G2_SaveGhoul2Models / G2_LoadGhoul2Models!!!!!!!!!!!! #define BSAVE_START_FIELD mModelindex // this is the start point for loadsave, keep it up to date it you change anything - int mModelindex; - int animModelIndexOffset; - qhandle_t mCustomShader; - qhandle_t mCustomSkin; - int mModelBoltLink; - int mSurfaceRoot; - int mLodBias; - int mNewOrigin; // this contains the bolt index of the new origin for this model + int mModelindex{-1}; + int animModelIndexOffset{0}; + qhandle_t mCustomShader{0}; + qhandle_t mCustomSkin{0}; + int mModelBoltLink{0}; + int mSurfaceRoot{0}; + int mLodBias{0}; + int mNewOrigin{-1}; // this contains the bolt index of the new origin for this model #ifdef _G2_GORE - int mGoreSetTag; + int mGoreSetTag{0}; #endif - qhandle_t mModel; // this and the next entries do NOT go across the network. They are for gameside access ONLY + qhandle_t mModel{0}; // this and the next entries do NOT go across the network. They are for gameside access ONLY char mFileName[MAX_QPATH]; - int mAnimFrameDefault; - int mSkelFrameNum; - int mMeshFrameNum; - int mFlags; // used for determining whether to do full collision detection against this object + int mAnimFrameDefault{0}; + int mSkelFrameNum{-1}; + int mMeshFrameNum{-1}; + int mFlags{0}; // used for determining whether to do full collision detection against this object // to here #define BSAVE_END_FIELD mTransformedVertsArray // this is the end point for loadsave, keep it up to date it you change anything - intptr_t *mTransformedVertsArray; // used to create an array of pointers to transformed verts per surface for collision detection - CBoneCache *mBoneCache; - int mSkin; + intptr_t *mTransformedVertsArray{0}; // used to create an array of pointers to transformed verts per surface for collision detection + CBoneCache *mBoneCache{0}; + int mSkin{0}; // these occasionally are not valid (like after a vid_restart) // call the questionably efficient G2_SetupModelPointers(this) to insure validity - bool mValid; // all the below are proper and valid - const model_s *currentModel; - int currentModelSize; - const model_s *animModel; - int currentAnimModelSize; - const mdxaHeader_t *aHeader; - - CGhoul2Info(): - mModelindex(-1), - animModelIndexOffset(0), - mCustomShader(0), - mCustomSkin(0), - mModelBoltLink(0), - mSurfaceRoot(0), - mLodBias(0), - mNewOrigin(-1), -#ifdef _G2_GORE - mGoreSetTag(0), -#endif - mModel(0), - mAnimFrameDefault(0), - mSkelFrameNum(-1), - mMeshFrameNum(-1), - mFlags(0), - mTransformedVertsArray(0), - mBoneCache(0), - mSkin(0), - mValid(false), - currentModel(0), - currentModelSize(0), - animModel(0), - currentAnimModelSize(0), - aHeader(0) + bool mValid{false}; // all the below are proper and valid + const model_s *currentModel{0}; + int currentModelSize{0}; + const model_s *animModel{0}; + int currentAnimModelSize{0}; + const mdxaHeader_t *aHeader{0}; + + CGhoul2Info() { mFileName[0] = 0; } @@ -742,8 +693,8 @@ class CGhoul2Info_v class CCollisionRecord { public: - float mDistance; - int mEntityNum; + float mDistance{100000}; + int mEntityNum{-1}; int mModelIndex; int mPolyIndex; int mSurfaceIndex; @@ -755,12 +706,9 @@ class CCollisionRecord float mBarycentricI; // two barycentic coodinates for the hit point float mBarycentricJ; // K = 1-I-J - CCollisionRecord(): - mDistance(100000), - mEntityNum(-1) + CCollisionRecord() {} - void sg_export( ojk::SavedGameHelper& saved_game) const { diff --git a/code/qcommon/cm_test.cpp b/code/qcommon/cm_test.cpp index 77a2265f81..2dbae29573 100644 --- a/code/qcommon/cm_test.cpp +++ b/code/qcommon/cm_test.cpp @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 1999 - 2005, Id Software, Inc. Copyright (C) 2000 - 2013, Raven Software, Inc. @@ -48,10 +48,10 @@ class CPointComparator struct PointAndLeaf { // Default constructor for array construction below - PointAndLeaf() : point(0, 0, 0), leaf(0) { } + PointAndLeaf() {} - CPoint point; - int leaf; + CPoint point{0, 0, 0}; + int leaf{0}; }; // I think it is a patholoically bad idea to do a 64 item linear search for a cache, diff --git a/code/qcommon/ojk_saved_game.cpp b/code/qcommon/ojk_saved_game.cpp index d58e23221a..098b20d6c2 100644 --- a/code/qcommon/ojk_saved_game.cpp +++ b/code/qcommon/ojk_saved_game.cpp @@ -1,4 +1,4 @@ -// +// // Saved game. // @@ -15,17 +15,7 @@ namespace ojk { -SavedGame::SavedGame() : - error_message_(), - file_handle_(), - io_buffer_(), - saved_io_buffer_(), - io_buffer_offset_(), - saved_io_buffer_offset_(), - rle_buffer_(), - is_readable_(), - is_writable_(), - is_failed_() +SavedGame::SavedGame() { } diff --git a/code/qcommon/ojk_saved_game.h b/code/qcommon/ojk_saved_game.h index ea9f88bb89..2b2fd57923 100644 --- a/code/qcommon/ojk_saved_game.h +++ b/code/qcommon/ojk_saved_game.h @@ -137,7 +137,7 @@ class SavedGame : std::string error_message_; // A handle to a file. - int32_t file_handle_; + int32_t file_handle_{}; // I/O buffer. Buffer io_buffer_; @@ -146,22 +146,22 @@ class SavedGame : Buffer saved_io_buffer_; // A current offset inside the I/O buffer. - BufferOffset io_buffer_offset_; + BufferOffset io_buffer_offset_{}; // Saved I/O buffer offset. - BufferOffset saved_io_buffer_offset_; + BufferOffset saved_io_buffer_offset_{}; // RLE codec buffer. Buffer rle_buffer_; // True if saved game opened for reading. - bool is_readable_; + bool is_readable_{}; // True if saved game opened for writing. - bool is_writable_; + bool is_writable_{}; // Error flag. - bool is_failed_; + bool is_failed_{}; // Compresses data. diff --git a/code/rd-vanilla/tr_local.h b/code/rd-vanilla/tr_local.h index 27cb88fe7d..c317ce26d5 100644 --- a/code/rd-vanilla/tr_local.h +++ b/code/rd-vanilla/tr_local.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 1999 - 2005, Id Software, Inc. Copyright (C) 2000 - 2013, Raven Software, Inc. @@ -1581,15 +1581,15 @@ class CRenderableSurface { public: #ifdef _G2_GORE - int ident; + int ident{SF_MDX}; #else - const int ident; // ident of this surface - required so the materials renderer knows what sort of surface this refers to + const int ident{SF_MDX}; // ident of this surface - required so the materials renderer knows what sort of surface this refers to #endif - CBoneCache *boneCache; // pointer to transformed bone list for this surf - mdxmSurface_t *surfaceData; // pointer to surface data loaded into file - only used by client renderer DO NOT USE IN GAME SIDE - if there is a vid restart this will be out of wack on the game + CBoneCache *boneCache{0}; // pointer to transformed bone list for this surf + mdxmSurface_t *surfaceData{0}; // pointer to surface data loaded into file - only used by client renderer DO NOT USE IN GAME SIDE - if there is a vid restart this will be out of wack on the game #ifdef _G2_GORE - float *alternateTex; // alternate texture coordinates. - void *goreChain; + float *alternateTex{0}; // alternate texture coordinates. + void *goreChain{0}; float scale; float fade; @@ -1609,16 +1609,7 @@ class CRenderableSurface } #endif -CRenderableSurface(): - ident(SF_MDX), - boneCache(0), -#ifdef _G2_GORE - surfaceData(0), - alternateTex(0), - goreChain(0) -#else - surfaceData(0) -#endif +CRenderableSurface() {} void Init() diff --git a/code/rd-vanilla/tr_quicksprite.cpp b/code/rd-vanilla/tr_quicksprite.cpp index 9a0a02e1ac..f0708454ae 100644 --- a/code/rd-vanilla/tr_quicksprite.cpp +++ b/code/rd-vanilla/tr_quicksprite.cpp @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 1999 - 2005, Id Software, Inc. Copyright (C) 2000 - 2013, Raven Software, Inc. @@ -40,12 +40,7 @@ CQuickSpriteSystem SQuickSprite; // Construction/Destruction ////////////////////////////////////////////////////////////////////// -CQuickSpriteSystem::CQuickSpriteSystem() : - mTexBundle(NULL), - mGLStateBits(0), - mFogIndex(-1), - mUseFog(qfalse), - mNextVert(0) +CQuickSpriteSystem::CQuickSpriteSystem() { int i; diff --git a/code/rd-vanilla/tr_quicksprite.h b/code/rd-vanilla/tr_quicksprite.h index 29778a6ee8..87389c2d21 100644 --- a/code/rd-vanilla/tr_quicksprite.h +++ b/code/rd-vanilla/tr_quicksprite.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 1999 - 2005, Id Software, Inc. Copyright (C) 2000 - 2013, Raven Software, Inc. @@ -32,15 +32,15 @@ along with this program; if not, see . class CQuickSpriteSystem { private: - textureBundle_t *mTexBundle; - uint32_t mGLStateBits; - int mFogIndex; - qboolean mUseFog; + textureBundle_t *mTexBundle = nullptr; + uint32_t mGLStateBits{0}; + int mFogIndex{-1}; + qboolean mUseFog{qfalse}; vec4_t mVerts[SHADER_MAX_VERTEXES]; vec2_t mTextureCoords[SHADER_MAX_VERTEXES]; // Ideally this would be static, cause it never changes vec2_t mFogTextureCoords[SHADER_MAX_VERTEXES]; uint32_t mColors[SHADER_MAX_VERTEXES]; - int mNextVert; + int mNextVert{0}; qboolean mTurnCullBackOn; void Flush(void); diff --git a/codeJK2/cgame/FxScheduler.h b/codeJK2/cgame/FxScheduler.h index 6d6e0c8e4f..b0d8182b4d 100644 --- a/codeJK2/cgame/FxScheduler.h +++ b/codeJK2/cgame/FxScheduler.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -392,7 +392,6 @@ class PoolAllocator : pool (new T[N]) , freeAndAllocated (new int[N]) , numFree (N) - , highWatermark (0) { for ( int i = 0; i < N; i++ ) { @@ -482,7 +481,7 @@ class PoolAllocator int *freeAndAllocated; int numFree; - int highWatermark; + int highWatermark{0}; }; template @@ -490,8 +489,7 @@ class PagedPoolAllocator { public: PagedPoolAllocator () - : numPages (1) - , pages (new PoolAllocator[1]()) + : pages (new PoolAllocator[1]()) { } @@ -555,7 +553,7 @@ class PagedPoolAllocator } private: - int numPages; + int numPages{1}; PoolAllocator *pages; }; diff --git a/codemp/Ratl/vector_vs.h b/codemp/Ratl/vector_vs.h index 31883d18cc..772e445b17 100644 --- a/codemp/Ratl/vector_vs.h +++ b/codemp/Ratl/vector_vs.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -467,13 +467,13 @@ class vector_base : public ratl_base friend class const_iterator; // Data //------ - int mLoc; - vector_base* mOwner; + int mLoc{0}; + vector_base* mOwner{0}; public: // Constructors //-------------- - iterator() : mOwner(0), mLoc(0) + iterator() {} iterator(vector_base* p, int t) : mOwner(p), mLoc(t) {} @@ -552,13 +552,13 @@ class vector_base : public ratl_base { friend class vector_base; - int mLoc; - const vector_base* mOwner; + int mLoc{0}; + const vector_base* mOwner{0}; public: // Constructors //-------------- - const_iterator() : mOwner(0), mLoc(0) + const_iterator() {} const_iterator(const vector_base* p, int t) : mOwner(p), mLoc(t) {} diff --git a/codemp/client/FxPrimitives.cpp b/codemp/client/FxPrimitives.cpp index 1497924f6a..930b825530 100644 --- a/codemp/client/FxPrimitives.cpp +++ b/codemp/client/FxPrimitives.cpp @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -31,12 +31,7 @@ extern int drawnFx; // Base Effect Class // //-------------------------- -CEffect::CEffect(void) : - mFlags(0), - mMatImpactFX(MATIMPACTFX_NONE), - mMatImpactParm(-1), - mSoundRadius(-1), - mSoundVolume(-1) +CEffect::CEffect(void) { memset( &mRefEnt, 0, sizeof( mRefEnt )); } diff --git a/codemp/client/FxPrimitives.h b/codemp/client/FxPrimitives.h index b04ccf5a59..4533652747 100644 --- a/codemp/client/FxPrimitives.h +++ b/codemp/client/FxPrimitives.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -132,10 +132,10 @@ class CEffect int mTimeStart; int mTimeEnd; - unsigned int mFlags; + unsigned int mFlags{0}; - EMatImpactEffect mMatImpactFX; - int mMatImpactParm; + EMatImpactEffect mMatImpactFX{MATIMPACTFX_NONE}; + int mMatImpactParm{-1}; // Size of our object, useful for things that have physics vec3_t mMin; @@ -146,8 +146,8 @@ class CEffect miniRefEntity_t mRefEnt; - int mSoundRadius; - int mSoundVolume; + int mSoundRadius{-1}; + int mSoundVolume{-1}; public: @@ -364,10 +364,7 @@ class CFlash : public CParticle { public: - CFlash(): - mScreenX(0), - mScreenY(0), - mRadiusModifier(1) + CFlash() {} virtual ~CFlash() {} @@ -380,9 +377,9 @@ class CFlash : public CParticle protected: // kef -- mScreenX and mScreenY are used for flashes that are FX_LOCALIZED_FLASH - float mScreenX; - float mScreenY; - float mRadiusModifier; + float mScreenX{0}; + float mScreenY{0}; + float mRadiusModifier{1}; }; //------------------------------ diff --git a/codemp/client/FxScheduler.h b/codemp/client/FxScheduler.h index 73b23e828a..5c91c49820 100644 --- a/codemp/client/FxScheduler.h +++ b/codemp/client/FxScheduler.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -378,7 +378,6 @@ class PoolAllocator : pool (new T[N]) , freeAndAllocated (new int[N]) , numFree (N) - , highWatermark (0) { for ( int i = 0; i < N; i++ ) { @@ -468,7 +467,7 @@ class PoolAllocator int *freeAndAllocated; int numFree; - int highWatermark; + int highWatermark{0}; }; template @@ -476,8 +475,7 @@ class PagedPoolAllocator { public: PagedPoolAllocator () - : numPages (1) - , pages (new PoolAllocator[1]()) + : pages (new PoolAllocator[1]()) { } @@ -541,7 +539,7 @@ class PagedPoolAllocator } private: - int numPages; + int numPages{1}; PoolAllocator *pages; }; @@ -596,21 +594,16 @@ class CFxScheduler class CScheduled2DEffect { public: - CScheduled2DEffect(): - mScreenX(0), - mScreenY(0), - mWidth(0), - mHeight(0), - mShaderHandle(0) + CScheduled2DEffect() {mColor[0]=mColor[1]=mColor[2]=mColor[3]=1.0f;} public: - float mScreenX; - float mScreenY; - float mWidth; - float mHeight; + float mScreenX{0}; + float mScreenY{0}; + float mWidth{0}; + float mHeight{0}; vec4_t mColor; // bytes A, G, B, R -- see class paletteRGBA_c - qhandle_t mShaderHandle; + qhandle_t mShaderHandle{0}; }; // this makes looking up the index based on the string name much easier diff --git a/codemp/client/FxSystem.cpp b/codemp/client/FxSystem.cpp index f54d9915f2..d5fdccb362 100644 --- a/codemp/client/FxSystem.cpp +++ b/codemp/client/FxSystem.cpp @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -36,12 +36,7 @@ cvar_t *fx_nearCull; // Stuff for the FxHelper //------------------------------------------------------ -SFxHelper::SFxHelper() : - mTime(0), - mOldTime(0), - mFrameTime(0), - mTimeFrozen(false), - refdef(0) +SFxHelper::SFxHelper() { } diff --git a/codemp/client/FxSystem.h b/codemp/client/FxSystem.h index d42750ffa9..a39ef96085 100644 --- a/codemp/client/FxSystem.h +++ b/codemp/client/FxSystem.h @@ -37,12 +37,12 @@ extern cvar_t *fx_nearCull; class SFxHelper { public: - int mTime; - int mOldTime; - int mFrameTime; - bool mTimeFrozen; + int mTime{0}; + int mOldTime{0}; + int mFrameTime{0}; + bool mTimeFrozen{false}; float mRealTime; - refdef_t* refdef; + refdef_t* refdef{0}; #ifdef _DEBUG int mMainRefs; int mMiniRefs; diff --git a/codemp/ghoul2/ghoul2_shared.h b/codemp/ghoul2/ghoul2_shared.h index f20fa75c54..be904b5304 100644 --- a/codemp/ghoul2/ghoul2_shared.h +++ b/codemp/ghoul2/ghoul2_shared.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -47,20 +47,14 @@ struct model_s; // we save the whole surfaceInfo_t struct struct surfaceInfo_t { - int offFlags; // what the flags are for this model - int surface; // index into array held inside the model definition of pointers to the actual surface data loaded in - used by both client and game - float genBarycentricJ; // point 0 barycentric coors - float genBarycentricI; // point 1 barycentric coors - point 2 is 1 - point0 - point1 - int genPolySurfaceIndex; // used to point back to the original surface and poly if this is a generated surface - int genLod; // used to determine original lod of original surface and poly hit location - -surfaceInfo_t(): - offFlags(0), - surface(0), - genBarycentricJ(0), - genBarycentricI(0), - genPolySurfaceIndex(0), - genLod(0) + int offFlags{0}; // what the flags are for this model + int surface{0}; // index into array held inside the model definition of pointers to the actual surface data loaded in - used by both client and game + float genBarycentricJ{0}; // point 0 barycentric coors + float genBarycentricI{0}; // point 1 barycentric coors - point 2 is 1 - point0 - point1 + int genPolySurfaceIndex{0}; // used to point back to the original surface and poly if this is a generated surface + int genLod{0}; // used to determine original lod of original surface and poly hit location + +surfaceInfo_t() {} }; @@ -72,21 +66,21 @@ surfaceInfo_t(): // we save the whole structure here. struct boneInfo_t { - int boneNumber; // what bone are we overriding? + int boneNumber{-1}; // what bone are we overriding? mdxaBone_t matrix; // details of bone angle overrides - some are pre-done on the server, some in ghoul2 - int flags; // flags for override - int startFrame; // start frame for animation - int endFrame; // end frame for animation NOTE anim actually ends on endFrame+1 - int startTime; // time we started this animation - int pauseTime; // time we paused this animation - 0 if not paused - float animSpeed; // speed at which this anim runs. 1.0f means full speed of animation incoming - ie if anim is 20hrtz, we run at 20hrts. If 5hrts, we run at 5 hrts - float blendFrame; // frame PLUS LERP value to blend from - int blendLerpFrame; // frame to lerp the blend frame with. - int blendTime; // Duration time for blending - used to calc amount each frame of new anim is blended with last frame of the last anim - int blendStart; // Time when blending starts - not necessarily the same as startTime since we might start half way through an anim - int boneBlendTime; // time for duration of bone angle blend with normal animation - int boneBlendStart; // time bone angle blend with normal animation began - int lastTime; // this does not go across the network + int flags{0}; // flags for override + int startFrame{0}; // start frame for animation + int endFrame{0}; // end frame for animation NOTE anim actually ends on endFrame+1 + int startTime{0}; // time we started this animation + int pauseTime{0}; // time we paused this animation - 0 if not paused + float animSpeed{0}; // speed at which this anim runs. 1.0f means full speed of animation incoming - ie if anim is 20hrtz, we run at 20hrts. If 5hrts, we run at 5 hrts + float blendFrame{0}; // frame PLUS LERP value to blend from + int blendLerpFrame{0}; // frame to lerp the blend frame with. + int blendTime{0}; // Duration time for blending - used to calc amount each frame of new anim is blended with last frame of the last anim + int blendStart{0}; // Time when blending starts - not necessarily the same as startTime since we might start half way through an anim + int boneBlendTime{0}; // time for duration of bone angle blend with normal animation + int boneBlendStart{0}; // time bone angle blend with normal animation began + int lastTime{0}; // this does not go across the network mdxaBone_t newMatrix; // This is the lerped matrix that Ghoul2 uses on the client side - does not go across the network //rww - RAGDOLL_BEGIN @@ -108,7 +102,7 @@ struct boneInfo_t int firstTime; int firstCollisionTime; int restTime; - int RagFlags; + int RagFlags{0}; int DependentRagIndexMask; mdxaBone_t originalTrueBoneMatrix; mdxaBone_t parentTrueBoneMatrix; // figure I will need this sooner or later @@ -153,22 +147,7 @@ struct boneInfo_t int airTime; //base is in air, be more quick and sensitive about collisions //rww - RAGDOLL_END -boneInfo_t(): - boneNumber(-1), - flags(0), - startFrame(0), - endFrame(0), - startTime(0), - pauseTime(0), - animSpeed(0), - blendFrame(0), - blendLerpFrame(0), - blendTime(0), - blendStart(0), - boneBlendTime(0), - boneBlendStart(0), - lastTime(0), - RagFlags(0) +boneInfo_t() { matrix.matrix[0][0] = matrix.matrix[0][1] = matrix.matrix[0][2] = matrix.matrix[0][3] = matrix.matrix[1][0] = matrix.matrix[1][1] = matrix.matrix[1][2] = matrix.matrix[1][3] = @@ -178,16 +157,12 @@ boneInfo_t(): }; //we save from top to boltUsed here. Don't bother saving the position, it gets rebuilt every frame anyway struct boltInfo_t{ - int boneNumber; // bone number bolt attaches to - int surfaceNumber; // surface number bolt attaches to - int surfaceType; // if we attach to a surface, this tells us if it is an original surface or a generated one - doesn't go across the network - int boltUsed; // nor does this + int boneNumber{-1}; // bone number bolt attaches to + int surfaceNumber{-1}; // surface number bolt attaches to + int surfaceType{0}; // if we attach to a surface, this tells us if it is an original surface or a generated one - doesn't go across the network + int boltUsed{0}; // nor does this mdxaBone_t position; // this does not go across the network - boltInfo_t(): - boneNumber(-1), - surfaceNumber(-1), - surfaceType(0), - boltUsed(0) + boltInfo_t() {} }; @@ -254,68 +229,41 @@ class CGhoul2Info boltInfo_v mBltlist; boneInfo_v mBlist; // save from here - int mModelindex; - qhandle_t mCustomShader; - qhandle_t mCustomSkin; - int mModelBoltLink; - int mSurfaceRoot; - int mLodBias; - int mNewOrigin; // this contains the bolt index of the new origin for this model + int mModelindex{-1}; + qhandle_t mCustomShader{0}; + qhandle_t mCustomSkin{0}; + int mModelBoltLink{0}; + int mSurfaceRoot{0}; + int mLodBias{0}; + int mNewOrigin{-1}; // this contains the bolt index of the new origin for this model #ifdef _G2_GORE - int mGoreSetTag; + int mGoreSetTag{0}; #endif - qhandle_t mModel; // this and the next entries do NOT go across the network. They are for gameside access ONLY + qhandle_t mModel{0}; // this and the next entries do NOT go across the network. They are for gameside access ONLY char mFileName[MAX_QPATH]; - int mAnimFrameDefault; - int mSkelFrameNum; - int mMeshFrameNum; - int mFlags; // used for determining whether to do full collision detection against this object + int mAnimFrameDefault{0}; + int mSkelFrameNum{-1}; + int mMeshFrameNum{-1}; + int mFlags{0}; // used for determining whether to do full collision detection against this object // to here - size_t *mTransformedVertsArray; // used to create an array of pointers to transformed verts per surface for collision detection - CBoneCache *mBoneCache; - int mSkin; + size_t *mTransformedVertsArray{0}; // used to create an array of pointers to transformed verts per surface for collision detection + CBoneCache *mBoneCache{0}; + int mSkin{0}; // these occasionally are not valid (like after a vid_restart) // call the questionably efficient G2_SetupModelPointers(this) to insure validity - bool mValid; // all the below are proper and valid - const model_s *currentModel; - int currentModelSize; - const model_s *animModel; - int currentAnimModelSize; - const mdxaHeader_t *aHeader; + bool mValid{false}; // all the below are proper and valid + const model_s *currentModel{0}; + int currentModelSize{0}; + const model_s *animModel{0}; + int currentAnimModelSize{0}; + const mdxaHeader_t *aHeader{0}; #ifdef _G2_LISTEN_SERVER_OPT - int entityNum; + int entityNum{ENTITYNUM_NONE}; #endif - CGhoul2Info(): - mModelindex(-1), - mCustomShader(0), - mCustomSkin(0), - mModelBoltLink(0), - mSurfaceRoot(0), - mLodBias(0), - mNewOrigin(-1), -#ifdef _G2_GORE - mGoreSetTag(0), -#endif - mModel(0), - mAnimFrameDefault(0), - mSkelFrameNum(-1), - mMeshFrameNum(-1), - mFlags(0), - mTransformedVertsArray(0), - mBoneCache(0), - mSkin(0), - mValid(false), - currentModel(0), - currentModelSize(0), - animModel(0), - currentAnimModelSize(0), - aHeader(0) -#ifdef _G2_LISTEN_SERVER_OPT - , entityNum(ENTITYNUM_NONE) -#endif + CGhoul2Info() { mFileName[0] = 0; } diff --git a/codemp/qcommon/GenericParser2.cpp b/codemp/qcommon/GenericParser2.cpp index 37f7916bf4..de73cdccc0 100644 --- a/codemp/qcommon/GenericParser2.cpp +++ b/codemp/qcommon/GenericParser2.cpp @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -177,9 +177,7 @@ static char *GetToken(char **text, bool allowLineBreaks, bool readUntilEOL = fal } CTextPool::CTextPool(int initSize) : - mNext(0), - mSize(initSize), - mUsed(0) + mSize(initSize) { // mPool = (char *)Z_Malloc(mSize, TAG_GP2); mPool = (char *)Z_Malloc(mSize, TAG_TEXTPOOL, qtrue); @@ -462,14 +460,7 @@ bool CGPValue::Write(CTextPool **textPool, int depth) CGPGroup::CGPGroup(const char *initName, CGPGroup *initParent) : CGPObject(initName), - mPairs(0), - mInOrderPairs(0), - mCurrentPair(0), - mSubGroups(0), - mInOrderSubGroups(0), - mCurrentSubGroup(0), - mParent(initParent), - mWriteable(false) + mParent(initParent) { } @@ -862,9 +853,7 @@ const char *CGPGroup::FindPairValue(const char *key, const char *defaultVal) -CGenericParser2::CGenericParser2(void) : - mTextPool(0), - mWriteable(false) +CGenericParser2::CGenericParser2(void) { } @@ -908,14 +897,6 @@ bool CGenericParser2::Write(CTextPool *textPool) return mTopLevel.Write(&textPool, -1); } - - - - - - - - // The following groups of routines are used for a C interface into GP2. // C++ users should just use the objects as normally and not call these routines below // diff --git a/codemp/qcommon/GenericParser2.h b/codemp/qcommon/GenericParser2.h index 250f866eeb..acbe27aceb 100644 --- a/codemp/qcommon/GenericParser2.h +++ b/codemp/qcommon/GenericParser2.h @@ -45,8 +45,8 @@ class CTextPool { private: char *mPool; - CTextPool *mNext; - int mSize, mUsed; + CTextPool *mNext{0}; + int mSize, mUsed{0}; public: CTextPool(int initSize = 10240); @@ -114,12 +114,12 @@ class CGPValue : public CGPObject class CGPGroup : public CGPObject { private: - CGPValue *mPairs, *mInOrderPairs; - CGPValue *mCurrentPair; - CGPGroup *mSubGroups, *mInOrderSubGroups; - CGPGroup *mCurrentSubGroup; + CGPValue *mPairs{0}, *mInOrderPairs{0}; + CGPValue *mCurrentPair{0}; + CGPGroup *mSubGroups{0}, *mInOrderSubGroups{0}; + CGPGroup *mCurrentSubGroup{0}; CGPGroup *mParent; - bool mWriteable; + bool mWriteable{false}; void SortObject(CGPObject *object, CGPObject **unsortedList, CGPObject **sortedList, CGPObject **lastObject); @@ -158,8 +158,8 @@ class CGenericParser2 { private: CGPGroup mTopLevel; - CTextPool *mTextPool; - bool mWriteable; + CTextPool *mTextPool{0}; + bool mWriteable{false}; public: CGenericParser2(void); diff --git a/codemp/rd-dedicated/tr_local.h b/codemp/rd-dedicated/tr_local.h index 2207419839..df41d6a9f9 100644 --- a/codemp/rd-dedicated/tr_local.h +++ b/codemp/rd-dedicated/tr_local.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 1999 - 2005, Id Software, Inc. Copyright (C) 2000 - 2013, Raven Software, Inc. @@ -1598,15 +1598,15 @@ class CRenderableSurface { public: #ifdef _G2_GORE - int ident; + int ident{SF_MDX}; #else - const int ident; // ident of this surface - required so the materials renderer knows what sort of surface this refers to + const int ident{SF_MDX}; // ident of this surface - required so the materials renderer knows what sort of surface this refers to #endif - CBoneCache *boneCache; - mdxmSurface_t *surfaceData; // pointer to surface data loaded into file - only used by client renderer DO NOT USE IN GAME SIDE - if there is a vid restart this will be out of wack on the game + CBoneCache *boneCache{0}; + mdxmSurface_t *surfaceData{0}; // pointer to surface data loaded into file - only used by client renderer DO NOT USE IN GAME SIDE - if there is a vid restart this will be out of wack on the game #ifdef _G2_GORE - float *alternateTex; // alternate texture coordinates. - void *goreChain; + float *alternateTex{0}; // alternate texture coordinates. + void *goreChain{0}; float scale; float fade; @@ -1626,16 +1626,7 @@ class CRenderableSurface } #endif -CRenderableSurface(): - ident(SF_MDX), - boneCache(0), -#ifdef _G2_GORE - surfaceData(0), - alternateTex(0), - goreChain(0) -#else - surfaceData(0) -#endif +CRenderableSurface() {} #ifdef _G2_GORE diff --git a/codemp/rd-vanilla/tr_local.h b/codemp/rd-vanilla/tr_local.h index 5c7930ecdb..a0268ec452 100644 --- a/codemp/rd-vanilla/tr_local.h +++ b/codemp/rd-vanilla/tr_local.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 1999 - 2005, Id Software, Inc. Copyright (C) 2000 - 2013, Raven Software, Inc. @@ -1621,15 +1621,15 @@ class CRenderableSurface { public: #ifdef _G2_GORE - int ident; + int ident{SF_MDX}; #else - const int ident; // ident of this surface - required so the materials renderer knows what sort of surface this refers to + const int ident{SF_MDX}; // ident of this surface - required so the materials renderer knows what sort of surface this refers to #endif - CBoneCache *boneCache; - mdxmSurface_t *surfaceData; // pointer to surface data loaded into file - only used by client renderer DO NOT USE IN GAME SIDE - if there is a vid restart this will be out of wack on the game + CBoneCache *boneCache{0}; + mdxmSurface_t *surfaceData{0}; // pointer to surface data loaded into file - only used by client renderer DO NOT USE IN GAME SIDE - if there is a vid restart this will be out of wack on the game #ifdef _G2_GORE - float *alternateTex; // alternate texture coordinates. - void *goreChain; + float *alternateTex{0}; // alternate texture coordinates. + void *goreChain{0}; float scale; float fade; @@ -1649,16 +1649,7 @@ class CRenderableSurface } #endif -CRenderableSurface(): - ident(SF_MDX), - boneCache(0), -#ifdef _G2_GORE - surfaceData(0), - alternateTex(0), - goreChain(0) -#else - surfaceData(0) -#endif +CRenderableSurface() {} #ifdef _G2_GORE diff --git a/codemp/rd-vanilla/tr_quicksprite.cpp b/codemp/rd-vanilla/tr_quicksprite.cpp index add8d2d2cb..70c7f10380 100644 --- a/codemp/rd-vanilla/tr_quicksprite.cpp +++ b/codemp/rd-vanilla/tr_quicksprite.cpp @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -40,12 +40,7 @@ CQuickSpriteSystem SQuickSprite; // Construction/Destruction ////////////////////////////////////////////////////////////////////// -CQuickSpriteSystem::CQuickSpriteSystem() : - mTexBundle(NULL), - mGLStateBits(0), - mFogIndex(-1), - mUseFog(qfalse), - mNextVert(0) +CQuickSpriteSystem::CQuickSpriteSystem() { int i; diff --git a/codemp/rd-vanilla/tr_quicksprite.h b/codemp/rd-vanilla/tr_quicksprite.h index d27b8239e4..db1293a33c 100644 --- a/codemp/rd-vanilla/tr_quicksprite.h +++ b/codemp/rd-vanilla/tr_quicksprite.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -29,15 +29,15 @@ along with this program; if not, see . class CQuickSpriteSystem { private: - textureBundle_t *mTexBundle; - uint32_t mGLStateBits; - int mFogIndex; - qboolean mUseFog; + textureBundle_t *mTexBundle = nullptr; + uint32_t mGLStateBits{0}; + int mFogIndex{-1}; + qboolean mUseFog{qfalse}; vec4_t mVerts[SHADER_MAX_VERTEXES]; vec2_t mTextureCoords[SHADER_MAX_VERTEXES]; // Ideally this would be static, cause it never changes vec2_t mFogTextureCoords[SHADER_MAX_VERTEXES]; uint32_t mColors[SHADER_MAX_VERTEXES]; - int mNextVert; + int mNextVert{0}; void Flush(void); diff --git a/codemp/server/NPCNav/navigator.h b/codemp/server/NPCNav/navigator.h index d026322e12..a734413758 100644 --- a/codemp/server/NPCNav/navigator.h +++ b/codemp/server/NPCNav/navigator.h @@ -1,4 +1,4 @@ -/* +/* =========================================================================== Copyright (C) 2000 - 2013, Raven Software, Inc. Copyright (C) 2001 - 2013, Activision, Inc. @@ -63,13 +63,13 @@ class CEdge public: - CEdge( void ) : m_first(-1), m_second(-1), m_cost(-1) {} + CEdge( void ) {} CEdge( int first, int second, int cost ); ~CEdge( void ); - int m_first; - int m_second; - int m_cost; + int m_first{-1}; + int m_second{-1}; + int m_cost{-1}; }; /*