Added 'hasLoaded' bool in the syncable storage so that enabling properties in the renderable occurs at the correct time

This commit is contained in:
Victor Lindquist
2022-06-15 19:14:49 -06:00
parent dfe97d348c
commit c011986794
6 changed files with 39 additions and 11 deletions

View File

@@ -173,14 +173,24 @@ bool SyncableFloatDataStorage::isDirty(
return _storage.find(identifier)->second.find(key)->second.dirty;
}
bool SyncableFloatDataStorage::isSyncDirty(
const Identifier& identifier, const storage::Key key
) {
void SyncableFloatDataStorage::setLoaded(const Identifier& identifier, const storage::Key key) {
if (!count(identifier, key)) {
return true;
LERROR(fmt::format(
"SceneGraphNode {} has no data with key '{}' in the centralized data storage",
identifier,
storage::getStorageKeyString(key)
));
return;
}
_storage.find(identifier)->second.find(key)->second.hasLoaded = true;
}
bool SyncableFloatDataStorage::hasLoaded(const Identifier& identifier, const storage::Key key) {
if (!count(identifier, key)) {
return false;
}
return _storage.find(identifier)->second.find(key)->second.syncDirty;
return _storage.find(identifier)->second.find(key)->second.hasLoaded;
}
void SyncableFloatDataStorage::store(