Merge branch 'master' into feature/profiles

# Conflicts:
#	include/openspace/scene/assetloader.h
#	src/scene/assetloader.cpp
This commit is contained in:
Alexander Bock
2020-06-14 17:54:25 +02:00
117 changed files with 3952 additions and 2105 deletions

View File

@@ -324,17 +324,9 @@ void OpenSpaceEngine::initialize() {
}
// Set up asset loader
std::unique_ptr<SynchronizationWatcher> w =
std::make_unique<SynchronizationWatcher>();
SynchronizationWatcher* rawWatcher = w.get();
global::openSpaceEngine._assetManager = std::make_unique<AssetManager>(
std::make_unique<AssetLoader>(
global::scriptEngine.luaState(),
rawWatcher,
FileSys.absPath("${ASSETS}")
),
std::move(w)
global::scriptEngine.luaState(),
FileSys.absPath("${ASSETS}")
);
global::scriptEngine.addLibrary(global::openSpaceEngine._assetManager->luaLibrary());
@@ -737,15 +729,13 @@ void OpenSpaceEngine::loadSingleAsset(const std::string& assetPath) {
_loadingScreen->setPhase(LoadingScreen::Phase::Synchronization);
_loadingScreen->postMessage("Synchronizing assets");
std::vector<std::shared_ptr<const Asset>> allAssets =
_assetManager->rootAsset()->subTreeAssets();
std::vector<const Asset*> allAssets = _assetManager->rootAsset().subTreeAssets();
std::unordered_set<std::shared_ptr<ResourceSynchronization>> resourceSyncs;
for (const std::shared_ptr<const Asset>& a : allAssets) {
std::vector<std::shared_ptr<ResourceSynchronization>> syncs =
a->ownSynchronizations();
std::unordered_set<ResourceSynchronization*> resourceSyncs;
for (const Asset* a : allAssets) {
std::vector<ResourceSynchronization*> syncs = a->ownSynchronizations();
for (const std::shared_ptr<ResourceSynchronization>& s : syncs) {
for (ResourceSynchronization* s : syncs) {
ZoneScopedN("Update resource synchronization")
if (s->state() == ResourceSynchronization::State::Syncing) {
@@ -1013,7 +1003,7 @@ void OpenSpaceEngine::writeSceneDocumentation() {
_documentationJson += "{\"name\":\"Scene License Information\",";
_documentationJson += "\"identifier\":\"sceneLicense";
_documentationJson += "\",\"data\":";
_documentationJson += _scene->generateSceneLicenseDocumentationJson();
_documentationJson += SceneLicenseWriter().generateJson();
_documentationJson += "},";
_documentationJson += "{\"name\":\"Scene Properties\",";
_documentationJson += "\"identifier\":\"propertylist";// + _scene->jsonName();
@@ -1028,8 +1018,7 @@ void OpenSpaceEngine::writeSceneDocumentation() {
DocEng.addHandlebarTemplates(global::keybindingManager.templatesToRegister());
//TODO this is in efficaiant, here i am just instaning the class to get
//at a member variable which is staticly defined. How do i just get that
const std::vector<SceneLicense> licenses;
SceneLicenseWriter writer(licenses);
SceneLicenseWriter writer;
DocEng.addHandlebarTemplates(writer.templatesToRegister());
DocEng.addHandlebarTemplates(global::rootPropertyOwner.templatesToRegister());