CResourceStore: Use in-class initializers where applicable

This commit is contained in:
Lioncash 2020-06-12 14:11:39 -04:00
parent 7da16efe9d
commit 137b2395c9
2 changed files with 6 additions and 12 deletions

View File

@ -20,9 +20,6 @@ CResourceStore *gpEditorStore = nullptr;
// Constructor for editor store
CResourceStore::CResourceStore(const TString& rkDatabasePath)
: mpProj(nullptr)
, mGame(EGame::Prime)
, mDatabaseCacheDirty(false)
{
mpDatabaseRoot = new CVirtualDirectory(this);
mDatabasePath = FileUtil::MakeAbsolute(rkDatabasePath.GetFileDirectory());
@ -32,10 +29,7 @@ CResourceStore::CResourceStore(const TString& rkDatabasePath)
// Main constructor for game projects and game exporter
CResourceStore::CResourceStore(CGameProject *pProject)
: mpProj(nullptr)
, mGame(EGame::Invalid)
, mpDatabaseRoot(nullptr)
, mDatabaseCacheDirty(false)
: mGame(EGame::Invalid)
{
SetProject(pProject);
}

View File

@ -27,16 +27,16 @@ class CResourceStore
{
friend class CResourceIterator;
CGameProject *mpProj;
EGame mGame;
CVirtualDirectory *mpDatabaseRoot;
CGameProject *mpProj = nullptr;
EGame mGame{EGame::Prime};
CVirtualDirectory *mpDatabaseRoot = nullptr;
std::map<CAssetID, CResourceEntry*> mResourceEntries;
std::map<CAssetID, CResourceEntry*> mLoadedResources;
bool mDatabaseCacheDirty;
bool mDatabaseCacheDirty = false;
// Directory paths
TString mDatabasePath;
bool mDatabasePathExists;
bool mDatabasePathExists = false;
public:
explicit CResourceStore(const TString& rkDatabasePath);