mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Don't call Settings::set when you don't need too.
This commit is contained in:
parent
e1725d1eee
commit
850f92eae3
3 changed files with 15 additions and 7 deletions
|
@ -25,8 +25,10 @@ OctreeQuery::OctreeQuery() {
|
|||
}
|
||||
|
||||
void OctreeQuery::setMaxOctreePacketsPerSecond(int maxOctreePPS) {
|
||||
_maxOctreePPS = maxOctreePPS;
|
||||
SettingHandles::maxOctreePacketsPerSecond.set(_maxOctreePPS);
|
||||
if (maxOctreePPS != _maxOctreePPS) {
|
||||
_maxOctreePPS = maxOctreePPS;
|
||||
SettingHandles::maxOctreePacketsPerSecond.set(_maxOctreePPS);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -44,12 +44,16 @@ void ViewFrustum::setOrientation(const glm::quat& orientationAsQuaternion) {
|
|||
}
|
||||
|
||||
void ViewFrustum::setFieldOfView(float f) {
|
||||
_fieldOfView = f;
|
||||
SettingHandles::fieldOfView.set(f);
|
||||
if (f != _fieldOfView) {
|
||||
_fieldOfView = f;
|
||||
SettingHandles::fieldOfView.set(f);
|
||||
}
|
||||
}
|
||||
void ViewFrustum::setRealWorldFieldOfView(float realWorldFieldOfView) {
|
||||
_realWorldFieldOfView = realWorldFieldOfView;
|
||||
SettingHandles::realWorldFieldOfView.set(realWorldFieldOfView);
|
||||
if (realWorldFieldOfView != _realWorldFieldOfView) {
|
||||
_realWorldFieldOfView = realWorldFieldOfView;
|
||||
SettingHandles::realWorldFieldOfView.set(realWorldFieldOfView);
|
||||
}
|
||||
}
|
||||
|
||||
// ViewFrustum::calculateViewFrustum()
|
||||
|
|
|
@ -101,7 +101,9 @@ T SettingHandle<T>::getDefault() const {
|
|||
|
||||
template <typename T> inline
|
||||
void SettingHandle<T>::set(const T& value) const {
|
||||
SettingsBridge::setInSettings(_key, QVariant(value));
|
||||
if (value != get()) {
|
||||
SettingsBridge::setInSettings(_key, QVariant(value));
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T> inline
|
||||
|
|
Loading…
Reference in a new issue