CSequenceHelper: std::move constructor parameters where applicable

Same behavior, but allows for calling code to move into the interface.
This commit is contained in:
Lioncash 2020-03-09 11:45:53 -04:00
parent cff12f0986
commit 815f492e0f
2 changed files with 18 additions and 20 deletions

View File

@ -10,30 +10,29 @@
namespace urde { namespace urde {
CSequenceFundamentals::CSequenceFundamentals(const CSteadyStateAnimInfo& ssInfo, CSequenceFundamentals::CSequenceFundamentals(const CSteadyStateAnimInfo& ssInfo, std::vector<CBoolPOINode> boolNodes,
const std::vector<CBoolPOINode>& boolNodes, std::vector<CInt32POINode> int32Nodes,
const std::vector<CInt32POINode>& int32Nodes, std::vector<CParticlePOINode> particleNodes,
const std::vector<CParticlePOINode>& particleNodes, std::vector<CSoundPOINode> soundNodes)
const std::vector<CSoundPOINode>& soundNodes)
: x0_ssInfo(ssInfo) : x0_ssInfo(ssInfo)
, x18_boolNodes(boolNodes) , x18_boolNodes(std::move(boolNodes))
, x28_int32Nodes(int32Nodes) , x28_int32Nodes(std::move(int32Nodes))
, x38_particleNodes(particleNodes) , x38_particleNodes(std::move(particleNodes))
, x48_soundNodes(soundNodes) {} , x48_soundNodes(std::move(soundNodes)) {}
CSequenceHelper::CSequenceHelper(const std::shared_ptr<CAnimTreeNode>& a, const std::shared_ptr<CAnimTreeNode>& b, CSequenceHelper::CSequenceHelper(const std::shared_ptr<CAnimTreeNode>& a, const std::shared_ptr<CAnimTreeNode>& b,
const CAnimSysContext& animCtx) CAnimSysContext animCtx)
: x0_animCtx(animCtx) { : x0_animCtx(std::move(animCtx)) {
x10_treeNodes.reserve(2); x10_treeNodes.reserve(2);
x10_treeNodes.push_back(a); x10_treeNodes.push_back(a);
x10_treeNodes.push_back(b); x10_treeNodes.push_back(b);
} }
CSequenceHelper::CSequenceHelper(const std::vector<std::shared_ptr<IMetaAnim>>& nodes, const CAnimSysContext& animCtx) CSequenceHelper::CSequenceHelper(const std::vector<std::shared_ptr<IMetaAnim>>& nodes, CAnimSysContext animCtx)
: x0_animCtx(animCtx) { : x0_animCtx(std::move(animCtx)) {
x10_treeNodes.reserve(nodes.size()); x10_treeNodes.reserve(nodes.size());
for (const std::shared_ptr<IMetaAnim>& meta : nodes) for (const std::shared_ptr<IMetaAnim>& meta : nodes)
x10_treeNodes.push_back(meta->GetAnimationTree(animCtx, CMetaAnimTreeBuildOrders::NoSpecialOrders())); x10_treeNodes.push_back(meta->GetAnimationTree(x0_animCtx, CMetaAnimTreeBuildOrders::NoSpecialOrders()));
} }
CSequenceFundamentals CSequenceHelper::ComputeSequenceFundamentals() { CSequenceFundamentals CSequenceHelper::ComputeSequenceFundamentals() {

View File

@ -22,10 +22,9 @@ class CSequenceFundamentals {
std::vector<CSoundPOINode> x48_soundNodes; std::vector<CSoundPOINode> x48_soundNodes;
public: public:
CSequenceFundamentals(const CSteadyStateAnimInfo& ssInfo, const std::vector<CBoolPOINode>& boolNodes, CSequenceFundamentals(const CSteadyStateAnimInfo& ssInfo, std::vector<CBoolPOINode> boolNodes,
const std::vector<CInt32POINode>& int32Nodes, std::vector<CInt32POINode> int32Nodes, std::vector<CParticlePOINode> particleNodes,
const std::vector<CParticlePOINode>& particleNodes, std::vector<CSoundPOINode> soundNodes);
const std::vector<CSoundPOINode>& soundNodes);
const CSteadyStateAnimInfo& GetSteadyStateAnimInfo() const { return x0_ssInfo; } const CSteadyStateAnimInfo& GetSteadyStateAnimInfo() const { return x0_ssInfo; }
const std::vector<CBoolPOINode>& GetBoolPointsOfInterest() const { return x18_boolNodes; } const std::vector<CBoolPOINode>& GetBoolPointsOfInterest() const { return x18_boolNodes; }
@ -41,8 +40,8 @@ class CSequenceHelper {
public: public:
CSequenceHelper(const std::shared_ptr<CAnimTreeNode>& a, const std::shared_ptr<CAnimTreeNode>& b, CSequenceHelper(const std::shared_ptr<CAnimTreeNode>& a, const std::shared_ptr<CAnimTreeNode>& b,
const CAnimSysContext& animCtx); CAnimSysContext animCtx);
CSequenceHelper(const std::vector<std::shared_ptr<IMetaAnim>>& nodes, const CAnimSysContext& animCtx); CSequenceHelper(const std::vector<std::shared_ptr<IMetaAnim>>& nodes, CAnimSysContext animCtx);
CSequenceFundamentals ComputeSequenceFundamentals(); CSequenceFundamentals ComputeSequenceFundamentals();
}; };