mirror of
https://github.com/lubosz/overte.git
synced 2025-04-10 04:52:17 +02:00
CR feedback
This commit is contained in:
parent
59e8a98412
commit
8755e2d42e
4 changed files with 25 additions and 16 deletions
|
@ -1701,6 +1701,13 @@ AnimationHandle::AnimationHandle(Model* model) :
|
|||
_running(false) {
|
||||
}
|
||||
|
||||
AnimationDetails AnimationHandle::getAnimationDetails() const {
|
||||
AnimationDetails details(_role, _url, _fps, _priority, _loop, _hold,
|
||||
_startAutomatically, _firstFrame, _lastFrame, _running, _frameIndex);
|
||||
return details;
|
||||
}
|
||||
|
||||
|
||||
void AnimationHandle::simulate(float deltaTime) {
|
||||
_frameIndex += deltaTime * _fps;
|
||||
|
||||
|
|
|
@ -357,11 +357,7 @@ public:
|
|||
void setFrameIndex(float frameIndex) { _frameIndex = glm::clamp(_frameIndex, _firstFrame, _lastFrame); }
|
||||
float getFrameIndex() const { return _frameIndex; }
|
||||
|
||||
AnimationDetails getAnimationDetails() const {
|
||||
AnimationDetails details(_role, _url, _fps, _priority, _loop, _hold,
|
||||
_startAutomatically, _firstFrame, _lastFrame, _running, _frameIndex);
|
||||
return details;
|
||||
}
|
||||
AnimationDetails getAnimationDetails() const;
|
||||
|
||||
signals:
|
||||
|
||||
|
|
|
@ -103,6 +103,21 @@ void Animation::downloadFinished(QNetworkReply* reply) {
|
|||
}
|
||||
|
||||
|
||||
AnimationDetails::AnimationDetails() :
|
||||
role(), url(), fps(0.0f), priority(0.0f), loop(false), hold(false),
|
||||
startAutomatically(false), firstFrame(0.0f), lastFrame(0.0f), running(false), frameIndex(0.0f)
|
||||
{
|
||||
}
|
||||
|
||||
AnimationDetails::AnimationDetails(QString role, QUrl url, float fps, float priority, bool loop,
|
||||
bool hold, bool startAutomatically, float firstFrame, float lastFrame, bool running, float frameIndex) :
|
||||
role(role), url(url), fps(fps), priority(priority), loop(loop), hold(hold),
|
||||
startAutomatically(startAutomatically), firstFrame(firstFrame), lastFrame(lastFrame),
|
||||
running(running), frameIndex(frameIndex)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
QScriptValue animationDetailsToScriptValue(QScriptEngine* engine, const AnimationDetails& details) {
|
||||
QScriptValue obj = engine->newObject();
|
||||
obj.setProperty("role", details.role);
|
||||
|
@ -116,9 +131,6 @@ QScriptValue animationDetailsToScriptValue(QScriptEngine* engine, const Animatio
|
|||
obj.setProperty("lastFrame", details.lastFrame);
|
||||
obj.setProperty("running", details.running);
|
||||
obj.setProperty("frameIndex", details.frameIndex);
|
||||
|
||||
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,15 +74,9 @@ private:
|
|||
|
||||
class AnimationDetails {
|
||||
public:
|
||||
AnimationDetails() :
|
||||
role(), url(), fps(0.0f), priority(0.0f), loop(false), hold(false),
|
||||
startAutomatically(false), firstFrame(0.0f), lastFrame(0.0f), running(false), frameIndex(0.0f) { }
|
||||
|
||||
AnimationDetails();
|
||||
AnimationDetails(QString role, QUrl url, float fps, float priority, bool loop,
|
||||
bool hold, bool startAutomatically, float firstFrame, float lastFrame, bool running, float frameIndex) :
|
||||
role(role), url(url), fps(fps), priority(priority), loop(loop), hold(hold),
|
||||
startAutomatically(startAutomatically), firstFrame(firstFrame), lastFrame(lastFrame),
|
||||
running(running), frameIndex(frameIndex) { }
|
||||
bool hold, bool startAutomatically, float firstFrame, float lastFrame, bool running, float frameIndex);
|
||||
|
||||
QString role;
|
||||
QUrl url;
|
||||
|
|
Loading…
Reference in a new issue