mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 06:57:37 +02:00
more correct needsToCallUpdate() implementations
This commit is contained in:
parent
b515fd50fc
commit
353afb47b3
3 changed files with 30 additions and 43 deletions
|
@ -25,7 +25,7 @@ public:
|
|||
ALLOW_INSTANTIATION // This class can be instantiated
|
||||
|
||||
void update(const quint64& now) override;
|
||||
bool needsToCallUpdate() const override { return true; }
|
||||
bool needsToCallUpdate() const override { return _retryApply; }
|
||||
|
||||
// methods for getting/setting all properties of an entity
|
||||
virtual EntityItemProperties getProperties(EntityPropertyFlags desiredProperties = EntityPropertyFlags()) const override;
|
||||
|
|
|
@ -195,10 +195,7 @@ void ModelEntityItem::appendSubclassData(OctreePacketData* packetData, EncodeBit
|
|||
|
||||
// added update function back for property fix
|
||||
void ModelEntityItem::update(const quint64& now) {
|
||||
|
||||
{
|
||||
auto currentAnimationProperties = this->getAnimationProperties();
|
||||
|
||||
if (_previousAnimationProperties != currentAnimationProperties) {
|
||||
withWriteLock([&] {
|
||||
// if we hit start animation or change the first or last frame then restart the animation
|
||||
|
@ -226,22 +223,15 @@ void ModelEntityItem::update(const quint64& now) {
|
|||
|
||||
});
|
||||
_previousAnimationProperties = this->getAnimationProperties();
|
||||
|
||||
}
|
||||
|
||||
if (isAnimatingSomething()) {
|
||||
if (!(getAnimationFirstFrame() < 0) && !(getAnimationFirstFrame() > getAnimationLastFrame())) {
|
||||
updateFrameCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EntityItem::update(now);
|
||||
}
|
||||
|
||||
bool ModelEntityItem::needsToCallUpdate() const {
|
||||
|
||||
return true;
|
||||
return isAnimatingSomething();
|
||||
}
|
||||
|
||||
void ModelEntityItem::updateFrameCount() {
|
||||
|
@ -714,7 +704,6 @@ float ModelEntityItem::getAnimationFPS() const {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
bool ModelEntityItem::isAnimatingSomething() const {
|
||||
return resultWithReadLock<bool>([&] {
|
||||
return !_animationProperties.getURL().isEmpty() &&
|
||||
|
|
|
@ -78,8 +78,6 @@ class PolyLineEntityItem : public EntityItem {
|
|||
QString getTextures() const;
|
||||
void setTextures(const QString& textures);
|
||||
|
||||
virtual bool needsToCallUpdate() const override { return true; }
|
||||
|
||||
virtual ShapeType getShapeType() const override { return SHAPE_TYPE_NONE; }
|
||||
|
||||
bool pointsChanged() const { return _pointsChanged; }
|
||||
|
|
Loading…
Reference in a new issue