class LOTPlayerPrivate {
private:
- bool setPos(float pos);
- bool update(float pos);
+ void setPos(float pos);
+ bool update();
public:
LOTPlayerPrivate();
const std::vector<LOTNode *> &LOTPlayerPrivate::renderList(float pos)
{
- if (!mCompItem || !this->update(pos)) {
+ this->setPos(pos);
+
+ if (!mCompItem || !this->update()) {
static std::vector<LOTNode *> empty;
return empty;
}
return float(mModel->frameDuration()) / float(mModel->frameRate());
}
-bool LOTPlayerPrivate::setPos(float pos)
+void LOTPlayerPrivate::setPos(float pos)
{
if (pos > 1.0) pos = 1.0;
if (pos < 0) pos = 0;
if (!vCompare(pos, mPos)) mChanged = true;
mPos = pos;
-
- return true;
}
float LOTPlayerPrivate::pos()
return mPos;
}
-bool LOTPlayerPrivate::update(float pos)
+bool LOTPlayerPrivate::update()
{
//Nothing updated, skip it.
if (!mChanged) return true;
mCompItem->resize(mSize);
- this->setPos(pos);
int frameNumber;
if (mModel->isStatic()) frameNumber = 0;
bool result = false;
- if (this->update(pos)) {
+ this->setPos(pos);
+
+ if (this->update()) {
mRenderInProgress.store(true);