MCPcopy Create free account
hub / github.com/Illation/ETEngine / Init

Method Init

Engine/source/EtEditor/Content/FileResourceManager.cpp:32–53  ·  view source on GitHub ↗

--------------------------------- FileResourceManager::Init Load the asset database from the engine and project files and link them together

Source from the content-addressed store, hash-verified

30// Load the asset database from the engine and project files and link them together
31//
32void FileResourceManager::Init()
33{
34 // init databases and file directories unlinked
35 InitDb(m_ProjectDb, m_ProjectDir, EditorConfig::GetInstance()->GetProjectPath());
36 InitDb(m_EngineDb, m_EngineDir, EditorConfig::GetInstance()->GetEnginePath());
37
38 // link databases
39 auto assetGetter = [this](core::HashString const assetId)
40 {
41 core::I_Asset* ret = m_ProjectDb.GetAsset(assetId, false);
42
43 if (ret == nullptr)
44 {
45 return m_EngineDb.GetAsset(assetId); // we only need to log if the first search fails
46 }
47
48 return ret;
49 };
50
51 SetAssetReferences(m_ProjectDb, assetGetter);
52 SetAssetReferences(m_EngineDb, assetGetter);
53}
54
55//---------------------------------
56// FileResourceManager::Deinit

Callers

nothing calls this directly

Calls 1

GetAssetMethod · 0.45

Tested by

no test coverage detected