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(); }
CElementGen::CElementGen(const TToken<CGenDescription>& gen, EModelOrientationType orientType,
EOptionalSystemFlags flags)
: x1c_genDesc(gen), x2c_orientType(orientType), x27c_randState(x94_randomSeed) {
CElementGen::CElementGen(TToken<CGenDescription> gen, EModelOrientationType orientType, EOptionalSystemFlags flags)
: x1c_genDesc(std::move(gen)), x2c_orientType(orientType), x27c_randState(x94_randomSeed) {
CGenDescription* desc = x1c_genDesc.GetObj();
x28_loadedGenDesc = desc;

View File

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