mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-07-29 08:25:42 +00:00
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 \
|
Resource/CResTypeInfo.cpp \
|
||||||
CompressionUtil.cpp \
|
CompressionUtil.cpp \
|
||||||
IUIRelay.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++)
|
for (auto Iter = ResourceList.begin(); Iter != ResourceList.end(); Iter++)
|
||||||
{
|
{
|
||||||
TString Path = *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
|
// Determine resource name
|
||||||
TString DirPath = RelPath.GetFileDirectory();
|
TString DirPath = RelPath.GetFileDirectory();
|
||||||
|
3
src/Core/IProgressNotifier.cpp
Normal file
3
src/Core/IProgressNotifier.cpp
Normal file
@ -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;
|
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
|
#endif // IPROGRESSNOTIFIER_H
|
||||||
|
Loading…
x
Reference in New Issue
Block a user