46 lines
1.4 KiB
C++
46 lines
1.4 KiB
C++
|
|
#include "Application.h"
|
||
|
|
|
||
|
|
#include <XCEngine/Core/Asset/ResourceManager.h>
|
||
|
|
#ifdef XCENGINE_ENABLE_MONO_SCRIPTING
|
||
|
|
#include <XCEngine/Scripting/Mono/MonoScriptRuntime.h>
|
||
|
|
#endif
|
||
|
|
|
||
|
|
namespace XCEngine::Editor {
|
||
|
|
|
||
|
|
Application& Application::Get() {
|
||
|
|
alignas(Application) static unsigned char storage[sizeof(Application)] = {};
|
||
|
|
return *reinterpret_cast<Application*>(storage);
|
||
|
|
}
|
||
|
|
|
||
|
|
bool Application::CanReimportProjectAsset(const std::string& assetPath) const {
|
||
|
|
if (assetPath.empty()) {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
return ::XCEngine::Resources::ResourceManager::Get().CanReimportProjectAsset(assetPath.c_str());
|
||
|
|
}
|
||
|
|
|
||
|
|
bool Application::ReimportProjectAsset(const std::string& assetPath) {
|
||
|
|
if (assetPath.empty()) {
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
auto& resourceManager = ::XCEngine::Resources::ResourceManager::Get();
|
||
|
|
resourceManager.Initialize();
|
||
|
|
return resourceManager.ReimportProjectAsset(assetPath.c_str());
|
||
|
|
}
|
||
|
|
|
||
|
|
bool Application::ReimportAllProjectAssets() {
|
||
|
|
auto& resourceManager = ::XCEngine::Resources::ResourceManager::Get();
|
||
|
|
resourceManager.Initialize();
|
||
|
|
return resourceManager.RebuildProjectAssetCache();
|
||
|
|
}
|
||
|
|
|
||
|
|
bool Application::ClearProjectLibrary() {
|
||
|
|
auto& resourceManager = ::XCEngine::Resources::ResourceManager::Get();
|
||
|
|
resourceManager.Initialize();
|
||
|
|
return resourceManager.ClearProjectLibraryCache();
|
||
|
|
}
|
||
|
|
|
||
|
|
} // namespace XCEngine::Editor
|