2016-04-16 03:24:25 +00:00
|
|
|
#ifndef __URDE_CADDITIVEANIMPLAYBACK_HPP__
|
|
|
|
#define __URDE_CADDITIVEANIMPLAYBACK_HPP__
|
|
|
|
|
|
|
|
#include "RetroTypes.hpp"
|
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
class CAnimTreeNode;
|
|
|
|
class CAdditiveAnimationInfo;
|
|
|
|
class CSegIdList;
|
|
|
|
class CCharLayoutInfo;
|
|
|
|
class CSegStatementSet;
|
|
|
|
|
|
|
|
class CAdditiveAnimationInfo
|
|
|
|
{
|
2016-04-16 21:49:47 +00:00
|
|
|
float x0_fadeInDur = 0.f;
|
|
|
|
float x4_fadeOutDur = 0.f;
|
2016-04-16 03:24:25 +00:00
|
|
|
public:
|
|
|
|
void read(CInputStream& in)
|
|
|
|
{
|
2016-04-16 21:49:47 +00:00
|
|
|
x0_fadeInDur = in.readFloatBig();
|
|
|
|
x4_fadeOutDur = in.readFloatBig();
|
2016-04-16 03:24:25 +00:00
|
|
|
}
|
|
|
|
CAdditiveAnimationInfo() = default;
|
|
|
|
CAdditiveAnimationInfo(CInputStream& in) {read(in);}
|
2016-04-16 21:49:47 +00:00
|
|
|
float GetFadeInDuration() const {return x0_fadeInDur;}
|
|
|
|
float GetFadeOutDuration() const {return x4_fadeOutDur;}
|
2016-04-16 03:24:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CAdditiveAnimPlayback
|
|
|
|
{
|
|
|
|
public:
|
2016-04-16 21:49:47 +00:00
|
|
|
enum class EAdditivePlaybackPhase
|
2016-04-16 03:24:25 +00:00
|
|
|
{
|
2016-04-16 21:49:47 +00:00
|
|
|
None,
|
|
|
|
FadingIn,
|
|
|
|
FadingOut,
|
|
|
|
FadedIn,
|
|
|
|
FadedOut
|
2016-04-16 03:24:25 +00:00
|
|
|
};
|
|
|
|
private:
|
|
|
|
CAdditiveAnimationInfo x0_info;
|
2016-04-16 21:49:47 +00:00
|
|
|
std::shared_ptr<CAnimTreeNode> x8_anim;
|
|
|
|
float xc_targetWeight;
|
|
|
|
float x10_curWeight = 0.f;
|
2016-04-16 03:24:25 +00:00
|
|
|
bool x14_a;
|
2016-04-16 21:49:47 +00:00
|
|
|
float x18_weightTimer = 0.f;
|
|
|
|
EAdditivePlaybackPhase x1c_phase = EAdditivePlaybackPhase::FadingIn;
|
2016-04-16 03:24:25 +00:00
|
|
|
bool x20_ = false;
|
|
|
|
public:
|
|
|
|
CAdditiveAnimPlayback(const std::weak_ptr<CAnimTreeNode>& anim, float weight, bool a,
|
|
|
|
const CAdditiveAnimationInfo& info, bool b);
|
|
|
|
|
|
|
|
void AddToSegStatementSet(const CSegIdList& list, const CCharLayoutInfo&, CSegStatementSet&) const;
|
|
|
|
void Update(float dt);
|
|
|
|
void FadeOut();
|
|
|
|
void SetWeight(float w);
|
2016-04-16 21:49:47 +00:00
|
|
|
float GetTargetWeight() const {return xc_targetWeight;}
|
|
|
|
bool GetA() const {return x14_a;}
|
|
|
|
const std::shared_ptr<CAnimTreeNode>& GetAnim() const {return x8_anim;}
|
2016-04-16 03:24:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __URDE_CADDITIVEANIMPLAYBACK_HPP__
|