/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/EditorPlugins/Assets/EditorPluginAssets/RenderPipelineAsset/RenderPipelineAssetManager.cpp
60 строк
2 KB
Jan Krassnigg
Fixed #1144: Resource file extension cleanup (#1374)
20 авг 2024, 21:47
Не верифицирован
20 авг 2024, 21:47
c453d11
Код
Авторство
О чём код?
#include <EditorPluginAssets/EditorPluginAssetsPCH.h> #include <EditorPluginAssets/RenderPipelineAsset/RenderPipelineAsset.h> #include <EditorPluginAssets/RenderPipelineAsset/RenderPipelineAssetManager.h> #include <EditorPluginAssets/RenderPipelineAsset/RenderPipelineAssetWindow.moc.h> EZ_BEGIN_DYNAMIC_REFLECTED_TYPE(ezRenderPipelineAssetManager, 1, ezRTTIDefaultAllocator<ezRenderPipelineAssetManager>) EZ_END_DYNAMIC_REFLECTED_TYPE; ezRenderPipelineAssetManager::ezRenderPipelineAssetManager() { ezDocumentManager::s_Events.AddEventHandler(ezMakeDelegate(&ezRenderPipelineAssetManager::OnDocumentManagerEvent, this)); m_DocTypeDesc.m_sDocumentTypeName = "RenderPipeline"; m_DocTypeDesc.m_sFileExtension = "ezRenderPipelineAsset"; m_DocTypeDesc.m_sIcon = ":/AssetIcons/RenderPipeline.svg"; m_DocTypeDesc.m_sAssetCategory = "Rendering"; m_DocTypeDesc.m_pDocumentType = ezGetStaticRTTI<ezRenderPipelineAssetDocument>(); m_DocTypeDesc.m_pManager = this; m_DocTypeDesc.m_CompatibleTypes.PushBack("CompatibleAsset_RenderPipeline"); m_DocTypeDesc.m_sResourceFileExtension = "ezBinRenderPipeline"; m_DocTypeDesc.m_AssetDocumentFlags = ezAssetDocumentFlags::AutoTransformOnSave; ezQtImageCache::GetSingleton()->RegisterTypeImage("RenderPipeline", QPixmap(":/AssetIcons/RenderPipeline.svg")); } ezRenderPipelineAssetManager::~ezRenderPipelineAssetManager() { ezDocumentManager::s_Events.RemoveEventHandler(ezMakeDelegate(&ezRenderPipelineAssetManager::OnDocumentManagerEvent, this)); } void ezRenderPipelineAssetManager::OnDocumentManagerEvent(const ezDocumentManager::Event& e) { switch (e.m_Type) { case ezDocumentManager::Event::Type::DocumentWindowRequested: { if (e.m_pDocument->GetDynamicRTTI() == ezGetStaticRTTI<ezRenderPipelineAssetDocument>()) { new ezQtRenderPipelineAssetDocumentWindow(e.m_pDocument); // NOLINT: Not a memory leak } } break; default: break; } } void ezRenderPipelineAssetManager::InternalCreateDocument( ezStringView sDocumentTypeName, ezStringView sPath, bool bCreateNewDocument, ezDocument*& out_pDocument, const ezDocumentObject* pOpenContext) { out_pDocument = new ezRenderPipelineAssetDocument(sPath); } void ezRenderPipelineAssetManager::InternalGetSupportedDocumentTypes(ezDynamicArray<const ezDocumentTypeDescriptor*>& inout_DocumentTypes) const { inout_DocumentTypes.PushBack(&m_DocTypeDesc); }