Feature/assets (#1784)

General overhaul of the Asset loading system
This commit is contained in:
Alexander Bock
2021-12-19 21:04:01 +04:00
committed by GitHub
parent f8b5d4b662
commit debcb43ade
167 changed files with 3251 additions and 4441 deletions

View File

@@ -32,23 +32,20 @@ int syncResource(lua_State* L) {
auto [identifier, version] = ghoul::lua::values<std::string, double>(L);
ghoul::Dictionary dict;
dict.setValue("Type", std::string("HttpSynchronization"));
dict.setValue("Identifier", identifier);
dict.setValue("Version", version);
const SyncModule* module = global::moduleEngine->module<SyncModule>();
HttpSynchronization sync(
dict,
module->synchronizationRoot(),
module->httpSynchronizationRepositories()
);
std::unique_ptr<ResourceSynchronization> sync =
ResourceSynchronization::createFromDictionary(dict);
sync.start();
sync->start();
while (sync.isSyncing()) {
while (sync->isSyncing()) {
std::this_thread::sleep_for(std::chrono::milliseconds(20));
}
ghoul::lua::push(L, sync.isResolved());
ghoul::lua::push(L, sync->isResolved());
return 1;
}