3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-26 17:15:37 +02:00

clear garbage out of avatar-entity settings array before writing it to disk. when changing domains, re-rez avatar-entities after octree is cleared

This commit is contained in:
Seth Alves 2017-11-15 20:10:05 -08:00
parent 3f5b21ec22
commit 93fd2a6a6b
5 changed files with 11 additions and 6 deletions
interface/src
libraries
avatars-renderer/src/avatars-renderer
avatars/src

View file

@ -5495,6 +5495,8 @@ void Application::clearDomainOctreeDetails() {
DependencyManager::get<ModelCache>()->clearUnusedResources();
DependencyManager::get<SoundCache>()->clearUnusedResources();
DependencyManager::get<TextureCache>()->clearUnusedResources();
getMyAvatar()->setAvatarEntityDataChanged(true);
}
void Application::clearDomainAvatars() {

View file

@ -951,11 +951,7 @@ void MyAvatar::saveData() {
}
settings.endArray();
if (_avatarEntityData.size() == 0) {
// HACK: manually remove empty 'avatarEntityData' else deleted avatarEntityData may show up in settings file
settings.remove("avatarEntityData");
}
settings.remove("avatarEntityData");
settings.beginWriteArray("avatarEntityData");
int avatarEntityIndex = 0;
auto hmdInterface = DependencyManager::get<HMDScriptingInterface>();

View file

@ -198,6 +198,11 @@ void Avatar::setTargetScale(float targetScale) {
}
}
void Avatar::setAvatarEntityDataChanged(bool value) {
AvatarData::setAvatarEntityDataChanged(value);
_avatarEntityDataHashes.clear();
}
void Avatar::updateAvatarEntities() {
PerformanceTimer perfTimer("attachments");
// - if queueEditEntityMessage sees clientOnly flag it does _myAvatar->updateAvatarEntity()

View file

@ -265,6 +265,8 @@ public:
virtual float getModelScale() const { return _modelScale; }
virtual void setModelScale(float scale) { _modelScale = scale; }
virtual void setAvatarEntityDataChanged(bool value) override;
public slots:
// FIXME - these should be migrated to use Pose data instead

View file

@ -603,7 +603,7 @@ public:
Q_INVOKABLE AvatarEntityMap getAvatarEntityData() const;
Q_INVOKABLE void setAvatarEntityData(const AvatarEntityMap& avatarEntityData);
void setAvatarEntityDataChanged(bool value) { _avatarEntityDataChanged = value; }
virtual void setAvatarEntityDataChanged(bool value) { _avatarEntityDataChanged = value; }
void insertDetachedEntityID(const QUuid entityID);
AvatarEntityIDs getAndClearRecentlyDetachedIDs();