mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-02 09:41:13 -06:00
Fixes ColormapAttrData not always syncing + ColormapEnabled-script being executed
This commit is contained in:
@@ -68,12 +68,15 @@ void SyncableFloatDataStorage::encode(SyncBuffer* syncBuffer) {
|
||||
for (auto val : storageEntry.data) {
|
||||
syncBuffer->encode(val);
|
||||
}
|
||||
|
||||
// TODO: Maybe combine solution with syncDirty?
|
||||
storageEntry.hasEncoded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SyncableFloatDataStorage::decode(SyncBuffer* syncBuffer) {
|
||||
ZoneScopedN("SyncableFloatDataStorage::encode")
|
||||
ZoneScopedN("SyncableFloatDataStorage::decode")
|
||||
|
||||
std::lock_guard guard(_mutex);
|
||||
|
||||
@@ -121,8 +124,9 @@ void SyncableFloatDataStorage::postSync(bool isMaster) {
|
||||
std::lock_guard guard(_mutex);
|
||||
for (auto& sgnStorage : _storage) {
|
||||
for (auto& storageEntry : sgnStorage.second) {
|
||||
if (storageEntry.second.syncDirty) {
|
||||
if (storageEntry.second.syncDirty && storageEntry.second.hasEncoded) {
|
||||
storageEntry.second.syncDirty = false;
|
||||
storageEntry.second.hasEncoded = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -221,6 +225,20 @@ size_t SyncableFloatDataStorage::count(const Identifier& identifier, const stora
|
||||
return sceneIt->second.count(key);
|
||||
}
|
||||
|
||||
// Helper function for debugging
|
||||
std::string SyncableFloatDataStorage::getStringOfAllKeysInStorage() {
|
||||
std::string keysString;
|
||||
|
||||
for (auto [id, sceneStorage]: _storage) {
|
||||
keysString += '(' + id + ')' + ": ";
|
||||
for(auto [key, val]: sceneStorage) {
|
||||
keysString += storage::getStorageKeyString(key) + " ";
|
||||
}
|
||||
keysString += '\n';
|
||||
}
|
||||
return keysString;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
Reference in New Issue
Block a user