Added null progress notifier, optimized CResourceStore::BuildFromDirectory a little
This commit is contained in:
parent
a813c4c61c
commit
bfe541a35d
|
@ -339,4 +339,5 @@ SOURCES += \
|
|||
Resource/CResTypeInfo.cpp \
|
||||
CompressionUtil.cpp \
|
||||
IUIRelay.cpp \
|
||||
GameProject\COpeningBanner.cpp
|
||||
GameProject\COpeningBanner.cpp \
|
||||
IProgressNotifier.cpp
|
||||
|
|
|
@ -303,9 +303,9 @@ bool CResourceStore::BuildFromDirectory(bool ShouldGenerateCacheFile)
|
|||
for (auto Iter = ResourceList.begin(); Iter != ResourceList.end(); Iter++)
|
||||
{
|
||||
TString Path = *Iter;
|
||||
TString RelPath = FileUtil::MakeRelative(Path, ResDir);
|
||||
TString RelPath = Path.ChopFront( ResDir.Size() );
|
||||
|
||||
if (FileUtil::IsFile(Path) && Path.GetFileExtension() == "rsmeta")
|
||||
if (FileUtil::IsFile(Path) && Path.EndsWith(".rsmeta"))
|
||||
{
|
||||
// Determine resource name
|
||||
TString DirPath = RelPath.GetFileDirectory();
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
#include "IProgressNotifier.h"
|
||||
|
||||
CNullProgressNotifier *gpNullProgress = new CNullProgressNotifier();
|
|
@ -63,4 +63,14 @@ protected:
|
|||
virtual void UpdateProgress(const TString& rkTaskName, const TString& rkStepDesc, float ProgressPercent) = 0;
|
||||
};
|
||||
|
||||
// Null progress notifier can be passed to functions that require a progress notifier if you don't want to use one.
|
||||
class CNullProgressNotifier : public IProgressNotifier
|
||||
{
|
||||
public:
|
||||
bool ShouldCancel() const { return false; }
|
||||
protected:
|
||||
void UpdateProgress(const TString&, const TString&, float) {}
|
||||
};
|
||||
extern CNullProgressNotifier *gpNullProgress;
|
||||
|
||||
#endif // IPROGRESSNOTIFIER_H
|
||||
|
|
Loading…
Reference in New Issue