CElementGen: std::move TToken instance in constructor

Allows the parameter to be moved into via calling code.
This commit is contained in:
Lioncash 2020-03-09 13:07:51 -04:00
parent af2a82b5a7
commit 15dce1683e
2 changed files with 4 additions and 5 deletions

View File

@ -53,9 +53,8 @@ void CElementGen::Initialize() {
void CElementGen::Shutdown() { CElementGenShaders::Shutdown(); } void CElementGen::Shutdown() { CElementGenShaders::Shutdown(); }
CElementGen::CElementGen(const TToken<CGenDescription>& gen, EModelOrientationType orientType, CElementGen::CElementGen(TToken<CGenDescription> gen, EModelOrientationType orientType, EOptionalSystemFlags flags)
EOptionalSystemFlags flags) : x1c_genDesc(std::move(gen)), x2c_orientType(orientType), x27c_randState(x94_randomSeed) {
: x1c_genDesc(gen), x2c_orientType(orientType), x27c_randState(x94_randomSeed) {
CGenDescription* desc = x1c_genDesc.GetObj(); CGenDescription* desc = x1c_genDesc.GetObj();
x28_loadedGenDesc = desc; x28_loadedGenDesc = desc;

View File

@ -144,8 +144,8 @@ private:
void AccumulateBounds(const zeus::CVector3f& pos, float size); void AccumulateBounds(const zeus::CVector3f& pos, float size);
public: public:
CElementGen(const TToken<CGenDescription>& gen, EModelOrientationType orientType = EModelOrientationType::Normal, explicit CElementGen(TToken<CGenDescription> gen, EModelOrientationType orientType = EModelOrientationType::Normal,
EOptionalSystemFlags flags = EOptionalSystemFlags::One); EOptionalSystemFlags flags = EOptionalSystemFlags::One);
~CElementGen() override; ~CElementGen() override;
std::array<boo::ObjToken<boo::IShaderDataBinding>, 2> m_normalDataBind; std::array<boo::ObjToken<boo::IShaderDataBinding>, 2> m_normalDataBind;