Merge pull request #156 from lioncash/moving

CSkinnedModel: std::move constructor arguments where applicable
This commit is contained in:
Luke S 2020-02-24 03:00:59 -05:00 committed by GitHub
commit 1d9224f55c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -10,14 +10,17 @@ static logvisor::Module Log("urde::CSkinnedModel");
CSkinnedModel::CSkinnedModel(TLockedToken<CModel> model, TLockedToken<CSkinRules> skinRules, CSkinnedModel::CSkinnedModel(TLockedToken<CModel> model, TLockedToken<CSkinRules> skinRules,
TLockedToken<CCharLayoutInfo> layoutInfo, int shaderIdx, int drawInsts) TLockedToken<CCharLayoutInfo> layoutInfo, int shaderIdx, int drawInsts)
: x4_model(model), x10_skinRules(skinRules), x1c_layoutInfo(layoutInfo) { : x4_model(std::move(model)), x10_skinRules(std::move(skinRules)), x1c_layoutInfo(std::move(layoutInfo)) {
if (!model) if (!x4_model) {
Log.report(logvisor::Fatal, fmt("bad model token provided to CSkinnedModel")); Log.report(logvisor::Fatal, fmt("bad model token provided to CSkinnedModel"));
if (!skinRules) }
if (!x10_skinRules) {
Log.report(logvisor::Fatal, fmt("bad skin token provided to CSkinnedModel")); Log.report(logvisor::Fatal, fmt("bad skin token provided to CSkinnedModel"));
if (!layoutInfo) }
if (!x1c_layoutInfo) {
Log.report(logvisor::Fatal, fmt("bad character layout token provided to CSkinnedModel")); Log.report(logvisor::Fatal, fmt("bad character layout token provided to CSkinnedModel"));
m_modelInst = model->MakeNewInstance(shaderIdx, drawInsts); }
m_modelInst = x4_model->MakeNewInstance(shaderIdx, drawInsts);
} }
CSkinnedModel::CSkinnedModel(IObjectStore& store, CAssetId model, CAssetId skinRules, CAssetId layoutInfo, CSkinnedModel::CSkinnedModel(IObjectStore& store, CAssetId model, CAssetId skinRules, CAssetId layoutInfo,