mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-16 08:27:01 +00:00
General: Remove unnecessary inline specifiers and add overrides
This commit is contained in:
@@ -45,18 +45,18 @@ public:
|
||||
static IDependencyNode* ArchiveConstructor(EDependencyNodeType Type);
|
||||
|
||||
// Accessors
|
||||
inline uint NumChildren() const { return mChildren.size(); }
|
||||
inline IDependencyNode* ChildByIndex(uint Index) const { return mChildren[Index]; }
|
||||
uint NumChildren() const { return mChildren.size(); }
|
||||
IDependencyNode* ChildByIndex(uint Index) const { return mChildren[Index]; }
|
||||
};
|
||||
|
||||
// Basic dependency tree; this class is sufficient for most resource types.
|
||||
class CDependencyTree : public IDependencyNode
|
||||
{
|
||||
public:
|
||||
CDependencyTree() {}
|
||||
CDependencyTree() = default;
|
||||
|
||||
virtual EDependencyNodeType Type() const;
|
||||
virtual void Serialize(IArchive& rArc);
|
||||
EDependencyNodeType Type() const override;
|
||||
void Serialize(IArchive& rArc) override;
|
||||
|
||||
void AddChild(IDependencyNode *pNode);
|
||||
void AddDependency(const CAssetID& rkID, bool AvoidDuplicates = true);
|
||||
@@ -71,17 +71,17 @@ protected:
|
||||
CAssetID mID;
|
||||
|
||||
public:
|
||||
CResourceDependency() {}
|
||||
CResourceDependency() = default;
|
||||
CResourceDependency(const CAssetID& rkID) : mID(rkID) {}
|
||||
|
||||
virtual EDependencyNodeType Type() const;
|
||||
virtual void Serialize(IArchive& rArc);
|
||||
virtual void GetAllResourceReferences(std::set<CAssetID>& rOutSet) const;
|
||||
virtual bool HasDependency(const CAssetID& rkID) const;
|
||||
EDependencyNodeType Type() const override;
|
||||
void Serialize(IArchive& rArc) override;
|
||||
void GetAllResourceReferences(std::set<CAssetID>& rOutSet) const override;
|
||||
bool HasDependency(const CAssetID& rkID) const override;
|
||||
|
||||
// Accessors
|
||||
inline CAssetID ID() const { return mID; }
|
||||
inline void SetID(const CAssetID& rkID) { mID = rkID; }
|
||||
CAssetID ID() const { return mID; }
|
||||
void SetID(const CAssetID& rkID) { mID = rkID; }
|
||||
};
|
||||
|
||||
// Node representing a single resource dependency referenced by a script property.
|
||||
@@ -90,58 +90,53 @@ class CPropertyDependency : public CResourceDependency
|
||||
TString mIDString;
|
||||
|
||||
public:
|
||||
CPropertyDependency()
|
||||
: CResourceDependency()
|
||||
{}
|
||||
CPropertyDependency() = default;
|
||||
|
||||
CPropertyDependency(const TString& rkPropID, const CAssetID& rkAssetID)
|
||||
: CResourceDependency(rkAssetID)
|
||||
, mIDString(rkPropID)
|
||||
{}
|
||||
|
||||
virtual EDependencyNodeType Type() const;
|
||||
virtual void Serialize(IArchive& rArc);
|
||||
EDependencyNodeType Type() const override;
|
||||
void Serialize(IArchive& rArc) override;
|
||||
|
||||
// Accessors
|
||||
inline TString PropertyID() const { return mIDString; }
|
||||
TString PropertyID() const { return mIDString; }
|
||||
};
|
||||
|
||||
// Node representing a single animset dependency referenced by a script property. Indicates which character is being used.
|
||||
class CCharPropertyDependency : public CPropertyDependency
|
||||
{
|
||||
protected:
|
||||
int mUsedChar;
|
||||
int mUsedChar = -1;
|
||||
|
||||
public:
|
||||
CCharPropertyDependency()
|
||||
: CPropertyDependency()
|
||||
, mUsedChar(-1)
|
||||
{}
|
||||
CCharPropertyDependency() = default;
|
||||
|
||||
CCharPropertyDependency(const TString& rkPropID, const CAssetID& rkAssetID, int UsedChar)
|
||||
: CPropertyDependency(rkPropID, rkAssetID)
|
||||
, mUsedChar(UsedChar)
|
||||
{}
|
||||
|
||||
virtual EDependencyNodeType Type() const;
|
||||
virtual void Serialize(IArchive& rArc);
|
||||
EDependencyNodeType Type() const override;
|
||||
void Serialize(IArchive& rArc) override;
|
||||
|
||||
// Accessors
|
||||
inline int UsedChar() const { return mUsedChar; }
|
||||
int UsedChar() const { return mUsedChar; }
|
||||
};
|
||||
|
||||
// Node representing a script object. Indicates the type of object.
|
||||
class CScriptInstanceDependency : public IDependencyNode
|
||||
{
|
||||
protected:
|
||||
uint mObjectType;
|
||||
uint mObjectType = 0;
|
||||
|
||||
public:
|
||||
virtual EDependencyNodeType Type() const;
|
||||
virtual void Serialize(IArchive& rArc);
|
||||
EDependencyNodeType Type() const override;
|
||||
void Serialize(IArchive& rArc) override;
|
||||
|
||||
// Accessors
|
||||
inline uint ObjectType() const { return mObjectType; }
|
||||
uint ObjectType() const { return mObjectType; }
|
||||
|
||||
// Static
|
||||
static CScriptInstanceDependency* BuildTree(CScriptObject *pInstance);
|
||||
@@ -151,17 +146,17 @@ public:
|
||||
class CSetCharacterDependency : public CDependencyTree
|
||||
{
|
||||
protected:
|
||||
uint32 mCharSetIndex;
|
||||
uint32 mCharSetIndex = 0;
|
||||
|
||||
public:
|
||||
CSetCharacterDependency() : CDependencyTree() {}
|
||||
CSetCharacterDependency(uint32 SetIndex) : CDependencyTree(), mCharSetIndex(SetIndex) {}
|
||||
CSetCharacterDependency() = default;
|
||||
CSetCharacterDependency(uint32 SetIndex) : mCharSetIndex(SetIndex) {}
|
||||
|
||||
virtual EDependencyNodeType Type() const;
|
||||
virtual void Serialize(IArchive& rArc);
|
||||
EDependencyNodeType Type() const override;
|
||||
void Serialize(IArchive& rArc) override;
|
||||
|
||||
// Accessors
|
||||
inline uint32 CharSetIndex() const { return mCharSetIndex; }
|
||||
uint32 CharSetIndex() const { return mCharSetIndex; }
|
||||
|
||||
// Static
|
||||
static CSetCharacterDependency* BuildTree(const SSetCharacter& rkChar);
|
||||
@@ -174,14 +169,14 @@ protected:
|
||||
std::set<uint32> mCharacterIndices;
|
||||
|
||||
public:
|
||||
CSetAnimationDependency() : CDependencyTree() {}
|
||||
CSetAnimationDependency() = default;
|
||||
|
||||
virtual EDependencyNodeType Type() const;
|
||||
virtual void Serialize(IArchive& rArc);
|
||||
EDependencyNodeType Type() const override;
|
||||
void Serialize(IArchive& rArc) override;
|
||||
|
||||
// Accessors
|
||||
inline bool IsUsedByCharacter(uint32 CharIdx) const { return mCharacterIndices.find(CharIdx) != mCharacterIndices.end(); }
|
||||
inline bool IsUsedByAnyCharacter() const { return !mCharacterIndices.empty(); }
|
||||
bool IsUsedByCharacter(uint32 CharIdx) const { return mCharacterIndices.find(CharIdx) != mCharacterIndices.end(); }
|
||||
bool IsUsedByAnyCharacter() const { return !mCharacterIndices.empty(); }
|
||||
|
||||
// Static
|
||||
static CSetAnimationDependency* BuildTree(const CAnimSet *pkOwnerSet, uint32 AnimIndex);
|
||||
@@ -191,18 +186,18 @@ public:
|
||||
class CAnimEventDependency : public CResourceDependency
|
||||
{
|
||||
protected:
|
||||
uint32 mCharIndex;
|
||||
uint32 mCharIndex = 0;
|
||||
|
||||
public:
|
||||
CAnimEventDependency() : CResourceDependency() {}
|
||||
CAnimEventDependency() = default;
|
||||
CAnimEventDependency(const CAssetID& rkID, uint32 CharIndex)
|
||||
: CResourceDependency(rkID), mCharIndex(CharIndex) {}
|
||||
|
||||
virtual EDependencyNodeType Type() const;
|
||||
virtual void Serialize(IArchive& rArc);
|
||||
EDependencyNodeType Type() const override;
|
||||
void Serialize(IArchive& rArc) override;
|
||||
|
||||
// Accessors
|
||||
inline uint32 CharIndex() const { return mCharIndex; }
|
||||
uint32 CharIndex() const { return mCharIndex; }
|
||||
};
|
||||
|
||||
// Node representing an area. Tracks dependencies on a per-instance basis and can separate dependencies of different script layers.
|
||||
@@ -212,17 +207,17 @@ protected:
|
||||
std::vector<uint32> mLayerOffsets;
|
||||
|
||||
public:
|
||||
CAreaDependencyTree() : CDependencyTree() {}
|
||||
CAreaDependencyTree() = default;
|
||||
|
||||
virtual EDependencyNodeType Type() const;
|
||||
virtual void Serialize(IArchive& rArc);
|
||||
EDependencyNodeType Type() const override;
|
||||
void Serialize(IArchive& rArc) override;
|
||||
|
||||
void AddScriptLayer(CScriptLayer *pLayer, const std::vector<CAssetID>& rkExtraDeps);
|
||||
void GetModuleDependencies(EGame Game, std::vector<TString>& rModuleDepsOut, std::vector<uint32>& rModuleLayerOffsetsOut) const;
|
||||
|
||||
// Accessors
|
||||
inline uint32 NumScriptLayers() const { return mLayerOffsets.size(); }
|
||||
inline uint32 ScriptLayerOffset(uint32 LayerIdx) const { return mLayerOffsets[LayerIdx]; }
|
||||
uint32 NumScriptLayers() const { return mLayerOffsets.size(); }
|
||||
uint32 ScriptLayerOffset(uint32 LayerIdx) const { return mLayerOffsets[LayerIdx]; }
|
||||
};
|
||||
|
||||
#endif // CDEPENDENCYTREE
|
||||
|
||||
@@ -78,7 +78,7 @@ public:
|
||||
void LoadResource(const CAssetID& rkID, std::vector<uint8>& rBuffer);
|
||||
bool ShouldExportDiscNode(const nod::Node *pkNode, bool IsInRoot);
|
||||
|
||||
inline TString ProjectPath() const { return mProjectPath; }
|
||||
TString ProjectPath() const { return mProjectPath; }
|
||||
|
||||
protected:
|
||||
bool ExtractDiscData();
|
||||
@@ -91,7 +91,7 @@ protected:
|
||||
TString MakeWorldName(CAssetID WorldID);
|
||||
|
||||
// Convenience Functions
|
||||
inline SResourceInstance* FindResourceInstance(const CAssetID& rkID)
|
||||
SResourceInstance* FindResourceInstance(const CAssetID& rkID)
|
||||
{
|
||||
uint64 IntegralID = rkID.ToLongLong();
|
||||
auto Found = mResourceMap.find(IntegralID);
|
||||
|
||||
@@ -82,34 +82,34 @@ public:
|
||||
static CGameProject* LoadProject(const TString& rkProjPath, IProgressNotifier *pProgress);
|
||||
|
||||
// Directory Handling
|
||||
inline TString ProjectRoot() const { return mProjectRoot; }
|
||||
inline TString ProjectPath() const { return mProjectRoot + FileUtil::SanitizeName(mProjectName, false) + ".prj"; }
|
||||
inline TString HiddenFilesDir() const { return mProjectRoot + ".project/"; }
|
||||
inline TString DiscDir(bool Relative) const { return Relative ? "Disc/" : mProjectRoot + "Disc/"; }
|
||||
inline TString PackagesDir(bool Relative) const { return Relative ? "Packages/" : mProjectRoot + "Packages/"; }
|
||||
inline TString ResourcesDir(bool Relative) const { return Relative ? "Resources/" : mProjectRoot + "Resources/"; }
|
||||
TString ProjectRoot() const { return mProjectRoot; }
|
||||
TString ProjectPath() const { return mProjectRoot + FileUtil::SanitizeName(mProjectName, false) + ".prj"; }
|
||||
TString HiddenFilesDir() const { return mProjectRoot + ".project/"; }
|
||||
TString DiscDir(bool Relative) const { return Relative ? "Disc/" : mProjectRoot + "Disc/"; }
|
||||
TString PackagesDir(bool Relative) const { return Relative ? "Packages/" : mProjectRoot + "Packages/"; }
|
||||
TString ResourcesDir(bool Relative) const { return Relative ? "Resources/" : mProjectRoot + "Resources/"; }
|
||||
|
||||
// Disc Filesystem Management
|
||||
inline TString DiscFilesystemRoot(bool Relative) const { return DiscDir(Relative) + (IsWiiBuild() ? "DATA/" : "") + "files/"; }
|
||||
TString DiscFilesystemRoot(bool Relative) const { return DiscDir(Relative) + (IsWiiBuild() ? "DATA/" : "") + "files/"; }
|
||||
|
||||
// Accessors
|
||||
inline void SetProjectName(const TString& rkName) { mProjectName = rkName; }
|
||||
void SetProjectName(const TString& rkName) { mProjectName = rkName; }
|
||||
|
||||
inline TString Name() const { return mProjectName; }
|
||||
inline uint32 NumPackages() const { return mPackages.size(); }
|
||||
inline CPackage* PackageByIndex(uint32 Index) const { return mPackages[Index]; }
|
||||
inline void AddPackage(CPackage *pPackage) { mPackages.push_back(pPackage); }
|
||||
inline CResourceStore* ResourceStore() const { return mpResourceStore.get(); }
|
||||
inline CGameInfo* GameInfo() const { return mpGameInfo.get(); }
|
||||
inline CAudioManager* AudioManager() const { return mpAudioManager.get(); }
|
||||
inline CTweakManager* TweakManager() const { return mpTweakManager.get(); }
|
||||
inline EGame Game() const { return mGame; }
|
||||
inline ERegion Region() const { return mRegion; }
|
||||
inline TString GameID() const { return mGameID; }
|
||||
inline float BuildVersion() const { return mBuildVersion; }
|
||||
inline bool IsWiiBuild() const { return mBuildVersion >= 3.f; }
|
||||
inline bool IsTrilogy() const { return mGame <= EGame::Corruption && mBuildVersion >= 3.593f; }
|
||||
inline bool IsWiiDeAsobu() const { return mGame <= EGame::Corruption && mBuildVersion >= 3.570f && mBuildVersion < 3.593f; }
|
||||
TString Name() const { return mProjectName; }
|
||||
uint32 NumPackages() const { return mPackages.size(); }
|
||||
CPackage* PackageByIndex(uint32 Index) const { return mPackages[Index]; }
|
||||
void AddPackage(CPackage *pPackage) { mPackages.push_back(pPackage); }
|
||||
CResourceStore* ResourceStore() const { return mpResourceStore.get(); }
|
||||
CGameInfo* GameInfo() const { return mpGameInfo.get(); }
|
||||
CAudioManager* AudioManager() const { return mpAudioManager.get(); }
|
||||
CTweakManager* TweakManager() const { return mpTweakManager.get(); }
|
||||
EGame Game() const { return mGame; }
|
||||
ERegion Region() const { return mRegion; }
|
||||
TString GameID() const { return mGameID; }
|
||||
float BuildVersion() const { return mBuildVersion; }
|
||||
bool IsWiiBuild() const { return mBuildVersion >= 3.f; }
|
||||
bool IsTrilogy() const { return mGame <= EGame::Corruption && mBuildVersion >= 3.593f; }
|
||||
bool IsWiiDeAsobu() const { return mGame <= EGame::Corruption && mBuildVersion >= 3.570f && mBuildVersion < 3.593f; }
|
||||
};
|
||||
|
||||
#endif // CGAMEPROJECT_H
|
||||
|
||||
@@ -13,7 +13,7 @@ class COpeningBanner
|
||||
bool mWii;
|
||||
|
||||
public:
|
||||
COpeningBanner(CGameProject *pProj);
|
||||
explicit COpeningBanner(CGameProject *pProj);
|
||||
TString EnglishGameName() const;
|
||||
void SetEnglishGameName(const TString& rkName);
|
||||
void Save();
|
||||
|
||||
@@ -34,24 +34,22 @@ struct SNamedResource
|
||||
|
||||
class CPackage
|
||||
{
|
||||
CGameProject *mpProject;
|
||||
CGameProject *mpProject = nullptr;
|
||||
TString mPakName;
|
||||
TString mPakPath;
|
||||
std::vector<SNamedResource> mResources;
|
||||
bool mNeedsRecook;
|
||||
bool mNeedsRecook = false;
|
||||
|
||||
// Cached dependency list; used to figure out if a given resource is in this package
|
||||
mutable bool mCacheDirty;
|
||||
mutable bool mCacheDirty = false;
|
||||
mutable std::set<CAssetID> mCachedDependencies;
|
||||
|
||||
public:
|
||||
CPackage() {}
|
||||
|
||||
CPackage() = default;
|
||||
CPackage(CGameProject *pProj, const TString& rkName, const TString& rkPath)
|
||||
: mpProject(pProj)
|
||||
, mPakName(rkName)
|
||||
, mPakPath(rkPath)
|
||||
, mNeedsRecook(false)
|
||||
, mCacheDirty(true)
|
||||
{}
|
||||
|
||||
@@ -70,14 +68,14 @@ public:
|
||||
TString CookedPackagePath(bool Relative) const;
|
||||
|
||||
// Accessors
|
||||
inline TString Name() const { return mPakName; }
|
||||
inline TString Path() const { return mPakPath; }
|
||||
inline CGameProject* Project() const { return mpProject; }
|
||||
inline uint32 NumNamedResources() const { return mResources.size(); }
|
||||
inline const SNamedResource& NamedResourceByIndex(uint32 Idx) const { return mResources[Idx]; }
|
||||
inline bool NeedsRecook() const { return mNeedsRecook; }
|
||||
TString Name() const { return mPakName; }
|
||||
TString Path() const { return mPakPath; }
|
||||
CGameProject* Project() const { return mpProject; }
|
||||
uint32 NumNamedResources() const { return mResources.size(); }
|
||||
const SNamedResource& NamedResourceByIndex(uint32 Idx) const { return mResources[Idx]; }
|
||||
bool NeedsRecook() const { return mNeedsRecook; }
|
||||
|
||||
inline void SetPakName(TString NewName) { mPakName = NewName; }
|
||||
void SetPakName(TString NewName) { mPakName = std::move(NewName); }
|
||||
};
|
||||
|
||||
#endif // CPACKAGE
|
||||
|
||||
@@ -41,7 +41,7 @@ class CResourceEntry
|
||||
mutable TString mCachedUppercaseName; // This is used to speed up case-insensitive sorting and filtering.
|
||||
|
||||
// Private constructor
|
||||
CResourceEntry(CResourceStore *pStore);
|
||||
explicit CResourceEntry(CResourceStore *pStore);
|
||||
|
||||
public:
|
||||
static CResourceEntry* CreateNewResource(CResourceStore *pStore, const CAssetID& rkID,
|
||||
@@ -86,27 +86,27 @@ public:
|
||||
void ClearFlag(EResEntryFlag Flag);
|
||||
|
||||
// Accessors
|
||||
inline void SetFlagEnabled(EResEntryFlag Flag, bool Enabled) { Enabled ? SetFlag(Flag) : ClearFlag(Flag); }
|
||||
void SetFlagEnabled(EResEntryFlag Flag, bool Enabled) { Enabled ? SetFlag(Flag) : ClearFlag(Flag); }
|
||||
|
||||
inline void SetDirty() { SetFlag(EResEntryFlag::NeedsRecook); }
|
||||
inline void SetHidden(bool Hidden) { SetFlagEnabled(EResEntryFlag::Hidden, Hidden); }
|
||||
inline bool HasFlag(EResEntryFlag Flag) const { return mFlags.HasFlag(Flag); }
|
||||
inline bool IsHidden() const { return HasFlag(EResEntryFlag::Hidden); }
|
||||
inline bool IsMarkedForDeletion() const { return HasFlag(EResEntryFlag::MarkedForDeletion); }
|
||||
void SetDirty() { SetFlag(EResEntryFlag::NeedsRecook); }
|
||||
void SetHidden(bool Hidden) { SetFlagEnabled(EResEntryFlag::Hidden, Hidden); }
|
||||
bool HasFlag(EResEntryFlag Flag) const { return mFlags.HasFlag(Flag); }
|
||||
bool IsHidden() const { return HasFlag(EResEntryFlag::Hidden); }
|
||||
bool IsMarkedForDeletion() const { return HasFlag(EResEntryFlag::MarkedForDeletion); }
|
||||
|
||||
inline bool IsLoaded() const { return mpResource != nullptr; }
|
||||
inline bool IsCategorized() const { return mpDirectory && !mpDirectory->FullPath().CaseInsensitiveCompare( mpStore->DefaultResourceDirPath() ); }
|
||||
inline bool IsNamed() const { return mName != mID.ToString(); }
|
||||
inline CResource* Resource() const { return mpResource; }
|
||||
inline CResTypeInfo* TypeInfo() const { return mpTypeInfo; }
|
||||
inline CResourceStore* ResourceStore() const { return mpStore; }
|
||||
inline CDependencyTree* Dependencies() const { return mpDependencies; }
|
||||
inline CAssetID ID() const { return mID; }
|
||||
inline CVirtualDirectory* Directory() const { return mpDirectory; }
|
||||
inline TString DirectoryPath() const { return mpDirectory->FullPath(); }
|
||||
inline TString Name() const { return mName; }
|
||||
inline const TString& UppercaseName() const { return mCachedUppercaseName; }
|
||||
inline EResourceType ResourceType() const { return mpTypeInfo->Type(); }
|
||||
bool IsLoaded() const { return mpResource != nullptr; }
|
||||
bool IsCategorized() const { return mpDirectory && !mpDirectory->FullPath().CaseInsensitiveCompare( mpStore->DefaultResourceDirPath() ); }
|
||||
bool IsNamed() const { return mName != mID.ToString(); }
|
||||
CResource* Resource() const { return mpResource; }
|
||||
CResTypeInfo* TypeInfo() const { return mpTypeInfo; }
|
||||
CResourceStore* ResourceStore() const { return mpStore; }
|
||||
CDependencyTree* Dependencies() const { return mpDependencies; }
|
||||
CAssetID ID() const { return mID; }
|
||||
CVirtualDirectory* Directory() const { return mpDirectory; }
|
||||
TString DirectoryPath() const { return mpDirectory->FullPath(); }
|
||||
TString Name() const { return mName; }
|
||||
const TString& UppercaseName() const { return mCachedUppercaseName; }
|
||||
EResourceType ResourceType() const { return mpTypeInfo->Type(); }
|
||||
|
||||
protected:
|
||||
CResource* InternalLoad(IInputStream& rInput);
|
||||
|
||||
@@ -20,7 +20,7 @@ enum class EDatabaseVersion
|
||||
// Add new versions before this line
|
||||
|
||||
Max,
|
||||
Current = EDatabaseVersion::Max - 1
|
||||
Current = Max - 1
|
||||
};
|
||||
|
||||
class CResourceStore
|
||||
@@ -39,8 +39,8 @@ class CResourceStore
|
||||
bool mDatabasePathExists;
|
||||
|
||||
public:
|
||||
CResourceStore(const TString& rkDatabasePath);
|
||||
CResourceStore(CGameProject *pProject);
|
||||
explicit CResourceStore(const TString& rkDatabasePath);
|
||||
explicit CResourceStore(CGameProject *pProject);
|
||||
~CResourceStore();
|
||||
bool SerializeDatabaseCache(IArchive& rArc);
|
||||
bool LoadDatabaseCache();
|
||||
@@ -78,19 +78,19 @@ public:
|
||||
static TString StaticDefaultResourceDirPath(EGame Game);
|
||||
|
||||
// Accessors
|
||||
inline CGameProject* Project() const { return mpProj; }
|
||||
inline EGame Game() const { return mGame; }
|
||||
inline TString DatabaseRootPath() const { return mDatabasePath; }
|
||||
inline bool DatabasePathExists() const { return mDatabasePathExists; }
|
||||
inline TString ResourcesDir() const { return IsEditorStore() ? DatabaseRootPath() : DatabaseRootPath() + "Resources/"; }
|
||||
inline TString DatabasePath() const { return DatabaseRootPath() + "ResourceDatabaseCache.bin"; }
|
||||
inline CVirtualDirectory* RootDirectory() const { return mpDatabaseRoot; }
|
||||
inline uint32 NumTotalResources() const { return mResourceEntries.size(); }
|
||||
inline uint32 NumLoadedResources() const { return mLoadedResources.size(); }
|
||||
inline bool IsCacheDirty() const { return mDatabaseCacheDirty; }
|
||||
CGameProject* Project() const { return mpProj; }
|
||||
EGame Game() const { return mGame; }
|
||||
TString DatabaseRootPath() const { return mDatabasePath; }
|
||||
bool DatabasePathExists() const { return mDatabasePathExists; }
|
||||
TString ResourcesDir() const { return IsEditorStore() ? DatabaseRootPath() : DatabaseRootPath() + "Resources/"; }
|
||||
TString DatabasePath() const { return DatabaseRootPath() + "ResourceDatabaseCache.bin"; }
|
||||
CVirtualDirectory* RootDirectory() const { return mpDatabaseRoot; }
|
||||
uint32 NumTotalResources() const { return mResourceEntries.size(); }
|
||||
uint32 NumLoadedResources() const { return mLoadedResources.size(); }
|
||||
bool IsCacheDirty() const { return mDatabaseCacheDirty; }
|
||||
|
||||
inline void SetCacheDirty() { mDatabaseCacheDirty = true; }
|
||||
inline bool IsEditorStore() const { return mpProj == nullptr; }
|
||||
void SetCacheDirty() { mDatabaseCacheDirty = true; }
|
||||
bool IsEditorStore() const { return mpProj == nullptr; }
|
||||
};
|
||||
|
||||
extern TString gDataDir;
|
||||
|
||||
@@ -19,7 +19,7 @@ class CVirtualDirectory
|
||||
std::vector<CResourceEntry*> mResources;
|
||||
|
||||
public:
|
||||
CVirtualDirectory(CResourceStore *pStore);
|
||||
explicit CVirtualDirectory(CResourceStore *pStore);
|
||||
CVirtualDirectory(const TString& rkName, CResourceStore *pStore);
|
||||
CVirtualDirectory(CVirtualDirectory *pParent, const TString& rkName, CResourceStore *pStore);
|
||||
~CVirtualDirectory();
|
||||
@@ -48,14 +48,14 @@ public:
|
||||
static bool IsValidDirectoryPath(TString Path);
|
||||
|
||||
// Accessors
|
||||
inline CVirtualDirectory* Parent() const { return mpParent; }
|
||||
inline bool IsRoot() const { return !mpParent; }
|
||||
inline TString Name() const { return mName; }
|
||||
CVirtualDirectory* Parent() const { return mpParent; }
|
||||
bool IsRoot() const { return !mpParent; }
|
||||
TString Name() const { return mName; }
|
||||
|
||||
inline uint32 NumSubdirectories() const { return mSubdirectories.size(); }
|
||||
inline CVirtualDirectory* SubdirectoryByIndex(uint32 Index) { return mSubdirectories[Index]; }
|
||||
inline uint32 NumResources() const { return mResources.size(); }
|
||||
inline CResourceEntry* ResourceByIndex(uint32 Index) { return mResources[Index]; }
|
||||
uint32 NumSubdirectories() const { return mSubdirectories.size(); }
|
||||
CVirtualDirectory* SubdirectoryByIndex(uint32 Index) { return mSubdirectories[Index]; }
|
||||
uint32 NumResources() const { return mResources.size(); }
|
||||
CResourceEntry* ResourceByIndex(uint32 Index) { return mResources[Index]; }
|
||||
};
|
||||
|
||||
#endif // CVIRTUALDIRECTORY
|
||||
|
||||
@@ -12,14 +12,14 @@ class CCharacterUsageMap
|
||||
{
|
||||
std::map<CAssetID, std::vector<bool>> mUsageMap;
|
||||
std::set<CAssetID> mStillLookingIDs;
|
||||
CResourceStore *mpStore;
|
||||
uint32 mLayerIndex;
|
||||
bool mIsInitialArea;
|
||||
bool mCurrentAreaAllowsDupes;
|
||||
CResourceStore *mpStore = nullptr;
|
||||
uint32 mLayerIndex = UINT32_MAX;
|
||||
bool mIsInitialArea = true;
|
||||
bool mCurrentAreaAllowsDupes = false;
|
||||
|
||||
public:
|
||||
CCharacterUsageMap(CResourceStore *pStore)
|
||||
: mpStore(pStore), mLayerIndex(-1), mIsInitialArea(true), mCurrentAreaAllowsDupes(false)
|
||||
explicit CCharacterUsageMap(CResourceStore *pStore)
|
||||
: mpStore(pStore)
|
||||
{}
|
||||
|
||||
bool IsCharacterUsed(const CAssetID& rkID, uint32 CharacterIndex) const;
|
||||
@@ -47,19 +47,17 @@ class CPackageDependencyListBuilder
|
||||
std::set<CAssetID> mPackageUsedAssets;
|
||||
std::set<CAssetID> mAreaUsedAssets;
|
||||
std::set<CAssetID> mUniversalAreaAssets;
|
||||
bool mEnableDuplicates;
|
||||
bool mCurrentAreaHasDuplicates;
|
||||
bool mIsUniversalAreaAsset;
|
||||
bool mIsPlayerActor;
|
||||
bool mEnableDuplicates = false;
|
||||
bool mCurrentAreaHasDuplicates = false;
|
||||
bool mIsUniversalAreaAsset = false;
|
||||
bool mIsPlayerActor = false;
|
||||
|
||||
public:
|
||||
CPackageDependencyListBuilder(const CPackage *pkPackage)
|
||||
explicit CPackageDependencyListBuilder(const CPackage *pkPackage)
|
||||
: mpkPackage(pkPackage)
|
||||
, mGame(pkPackage->Project()->Game())
|
||||
, mpStore(pkPackage->Project()->ResourceStore())
|
||||
, mGame(pkPackage->Project()->Game())
|
||||
, mCharacterUsageMap(pkPackage->Project()->ResourceStore())
|
||||
, mCurrentAreaHasDuplicates(false)
|
||||
, mIsPlayerActor(false)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -79,10 +77,10 @@ class CAreaDependencyListBuilder
|
||||
CCharacterUsageMap mCharacterUsageMap;
|
||||
std::set<CAssetID> mBaseUsedAssets;
|
||||
std::set<CAssetID> mLayerUsedAssets;
|
||||
bool mIsPlayerActor;
|
||||
bool mIsPlayerActor = false;
|
||||
|
||||
public:
|
||||
CAreaDependencyListBuilder(CResourceEntry *pAreaEntry)
|
||||
explicit CAreaDependencyListBuilder(CResourceEntry *pAreaEntry)
|
||||
: mpAreaEntry(pAreaEntry)
|
||||
, mpStore(pAreaEntry->ResourceStore())
|
||||
, mGame(pAreaEntry->Game())
|
||||
@@ -106,7 +104,7 @@ class CAssetDependencyListBuilder
|
||||
CAssetID mCurrentAnimSetID;
|
||||
|
||||
public:
|
||||
CAssetDependencyListBuilder(CResourceEntry* pEntry)
|
||||
explicit CAssetDependencyListBuilder(CResourceEntry* pEntry)
|
||||
: mpResourceEntry(pEntry)
|
||||
, mCharacterUsageMap(pEntry->ResourceStore())
|
||||
{}
|
||||
|
||||
Reference in New Issue
Block a user