CGameArea: Make use of in-class initializers where applicable

Same behavior, less code.
This commit is contained in:
Lioncash 2020-06-14 19:27:52 -04:00
parent 2c274897c9
commit 903f6dfe7e
2 changed files with 8 additions and 16 deletions

View File

@ -2,16 +2,8 @@
#include "Core/Resource/Script/CScriptLayer.h" #include "Core/Resource/Script/CScriptLayer.h"
#include "Core/Render/CRenderer.h" #include "Core/Render/CRenderer.h"
CGameArea::CGameArea(CResourceEntry *pEntry /*= 0*/) CGameArea::CGameArea(CResourceEntry *pEntry)
: CResource(pEntry) : CResource(pEntry)
, mWorldIndex(-1)
, mVertexCount(0)
, mTriangleCount(0)
, mTerrainMerged(false)
, mOriginalWorldMeshCount(0)
, mUsesCompression(false)
, mpMaterialSet(nullptr)
, mpCollision(nullptr)
{ {
} }

View File

@ -26,17 +26,17 @@ class CGameArea : public CResource
friend class CAreaLoader; friend class CAreaLoader;
friend class CAreaCooker; friend class CAreaCooker;
uint32 mWorldIndex; uint32 mWorldIndex = UINT32_MAX;
uint32 mVertexCount; uint32 mVertexCount = 0;
uint32 mTriangleCount; uint32 mTriangleCount = 0;
bool mTerrainMerged; bool mTerrainMerged = false;
CTransform4f mTransform; CTransform4f mTransform;
CAABox mAABox; CAABox mAABox;
// Data saved from the original file to help on recook // Data saved from the original file to help on recook
std::vector<std::vector<uint8>> mSectionDataBuffers; std::vector<std::vector<uint8>> mSectionDataBuffers;
uint32 mOriginalWorldMeshCount; uint32 mOriginalWorldMeshCount = 0;
bool mUsesCompression; bool mUsesCompression = false;
struct SSectionNumber struct SSectionNumber
{ {
@ -46,7 +46,7 @@ class CGameArea : public CResource
std::vector<SSectionNumber> mSectionNumbers; std::vector<SSectionNumber> mSectionNumbers;
// Geometry // Geometry
CMaterialSet *mpMaterialSet; CMaterialSet *mpMaterialSet = nullptr;
std::vector<std::unique_ptr<CModel>> mWorldModels; // TerrainModels is the original version of each model; this is currently mainly used in the POI map editor std::vector<std::unique_ptr<CModel>> mWorldModels; // TerrainModels is the original version of each model; this is currently mainly used in the POI map editor
std::vector<std::unique_ptr<CStaticModel>> mStaticWorldModels; // StaticTerrainModels is the merged terrain for faster rendering in the world editor std::vector<std::unique_ptr<CStaticModel>> mStaticWorldModels; // StaticTerrainModels is the merged terrain for faster rendering in the world editor
// Script // Script