Asset loading and synchronization

This commit is contained in:
Emil Axelsson
2017-11-16 19:29:45 +01:00
parent 7c80384d12
commit 436062381e
9 changed files with 339 additions and 304 deletions
+4 -10
View File
@@ -45,20 +45,14 @@ void GuiAssetComponent::render() {
AssetManager& assetManager = OsEng.assetManager();
std::unordered_set<std::shared_ptr<Asset>> allAssets;
std::vector<std::shared_ptr<Asset>> loadedAssets = assetManager.loadedAssets();
for (const std::shared_ptr<Asset>& ancestor : loadedAssets) {
const std::vector<std::shared_ptr<Asset>> all = ancestor->allAssets();
std::copy(all.begin(), all.end(), std::inserter(allAssets, allAssets.end()));
}
std::vector<std::shared_ptr<Asset>> allAssets =
assetManager.rootAsset()->subTreeAssets();
for (const auto& a : allAssets) {
ImGui::Text("%s", a->assetFilePath().c_str());
ImGui::NextColumn();
assetManager.currentAssetState(a.get());
ImGui::NextColumn();
ImGui::Separator();
/*