CWallCrawlerSwarm: Make use of size_t where applicable

Avoids unnecessary upper register clearing.
This commit is contained in:
Lioncash 2020-03-30 18:21:02 -04:00
parent e1273faa68
commit e5a0959ef0
1 changed files with 10 additions and 7 deletions

View File

@ -93,13 +93,15 @@ CWallCrawlerSwarm::CWallCrawlerSwarm(TUniqueId uid, bool active, std::string_vie
x4b0_modelDatas.emplace_back(std::make_unique<CModelData>(launchAnimRes)); x4b0_modelDatas.emplace_back(std::make_unique<CModelData>(launchAnimRes));
x4b0_modelDatas.emplace_back(std::make_unique<CModelData>(animRes)); x4b0_modelDatas.emplace_back(std::make_unique<CModelData>(animRes));
if (aParams.GetXRayAssets().first.IsValid()) { if (aParams.GetXRayAssets().first.IsValid()) {
for (int i = 0; i < 9; ++i) for (size_t i = 0; i < 9; ++i) {
x4b0_modelDatas[i]->SetXRayModel(aParams.GetXRayAssets()); x4b0_modelDatas[i]->SetXRayModel(aParams.GetXRayAssets());
}
x560_26_modelAssetDirty = true; x560_26_modelAssetDirty = true;
} }
if (aParams.GetThermalAssets().first.IsValid()) { if (aParams.GetThermalAssets().first.IsValid()) {
for (int i = 0; i < 9; ++i) for (size_t i = 0; i < 9; ++i) {
x4b0_modelDatas[i]->SetInfraModel(aParams.GetThermalAssets()); x4b0_modelDatas[i]->SetInfraModel(aParams.GetThermalAssets());
}
x560_26_modelAssetDirty = true; x560_26_modelAssetDirty = true;
} }
if (part1.IsValid()) if (part1.IsValid())
@ -120,12 +122,12 @@ void CWallCrawlerSwarm::Accept(IVisitor& visitor) { visitor.Visit(this); }
void CWallCrawlerSwarm::AllocateSkinnedModels(CStateManager& mgr, CModelData::EWhichModel which) { void CWallCrawlerSwarm::AllocateSkinnedModels(CStateManager& mgr, CModelData::EWhichModel which) {
//x430_.clear(); //x430_.clear();
for (int i = 0; i < 9; ++i) { for (size_t i = 0; i < 9; ++i) {
//x430_.push_back(x4b0_[i]->PickAnimatedModel(which).Clone()); //x430_.push_back(x4b0_[i]->PickAnimatedModel(which).Clone());
x4b0_modelDatas[i]->EnableLooping(true); x4b0_modelDatas[i]->EnableLooping(true);
x4b0_modelDatas[i]->AdvanceAnimation( x4b0_modelDatas[i]->AdvanceAnimation(x4b0_modelDatas[i]->GetAnimationData()->GetAnimTimeRemaining("Whole Body"sv) *
x4b0_modelDatas[i]->GetAnimationData()->GetAnimTimeRemaining("Whole Body"sv) * (i * 0.0625f), (float(i) * 0.0625f),
mgr, x4_areaId, true); mgr, x4_areaId, true);
} }
//x430_.push_back(x4b0_.back()->PickAnimatedModel(which).Clone()); //x430_.push_back(x4b0_.back()->PickAnimatedModel(which).Clone());
x4dc_whichModel = which; x4dc_whichModel = which;
@ -891,8 +893,9 @@ void CWallCrawlerSwarm::Think(float dt, CStateManager& mgr) {
} }
void CWallCrawlerSwarm::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) { void CWallCrawlerSwarm::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) {
for (int i = 0; i < 5; ++i) for (size_t i = 0; i < 5; ++i) {
x4b0_modelDatas[i]->GetAnimationData()->PreRender(); x4b0_modelDatas[i]->GetAnimationData()->PreRender();
}
bool activeBoid = false; bool activeBoid = false;
for (auto& b : x108_boids) { for (auto& b : x108_boids) {
if (b.GetActive()) { if (b.GetActive()) {